* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rubik", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg, #f8c135);
}

main {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.page-nav-shell {
  margin-bottom: 16px;
}

.page-nav-summary {
  display: none;
}

.page-nav-summary-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.page-nav-summary-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.page-nav {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.page-nav a,
.page-nav span {
  color: var(--ink);
  text-decoration: none;
}

.page-nav a,
.page-nav .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.page-nav a:hover,
.page-nav a:focus {
  text-decoration: underline;
}

.page-nav .is-active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.page-nav .is-active span,
.page-nav .is-active .icon-svg {
  color: var(--accent);
}

.page-nav-sep {
  color: rgba(59, 68, 140, 0.6);
}

.app {
  background: var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.site-footer {
  padding: 18px 6px 0;
  text-align: center;
  font-size: 0.92rem;
  color: rgba(59, 68, 140, 0.9);
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
  text-decoration: underline;
}

.icon-svg {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  vertical-align: -0.125em;
  fill: currentColor;
  stroke: currentColor;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 18, 42, 0.6);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 24px;
  border-radius: 24px;
  background: #fff9ec;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-top h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.04em;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-meta {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}

.modal-grid {
  display: grid;
  gap: 14px;
}

.modal-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.modal-label {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(29, 42, 87, 0.7);
}

.modal-value {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  word-break: break-word;
}

.modal-value a {
  color: var(--accent);
}

.picker-modal-card {
  width: min(520px, 100%);
}

.picker-options {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.picker-clear {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(59, 68, 140, 0.16);
  border-radius: 999px;
  background: rgba(59, 68, 140, 0.08);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(59, 68, 140, 0.05);
  font-weight: 700;
  line-height: 1.3;
}

.picker-option input {
  margin: 0;
  accent-color: var(--accent);
}

@media (max-width: 720px) {
  main {
    width: min(100vw - 12px, 1320px);
    padding: 14px 0 28px;
  }

  .page-nav-shell {
    margin-bottom: 0;
    padding: 0;
    width: auto;
    display: block;
  }

  .page-nav-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0 14px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    width: fit-content;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 30;
  }

  .page-nav-summary::-webkit-details-marker {
    display: none;
  }

  .page-nav {
    position: fixed;
    top: 60px;
    right: 12px;
    width: min(280px, calc(100vw - 24px));
    z-index: 29;
    display: flex;
    margin-top: 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--accent);
    box-shadow: 0 12px 28px rgba(29, 42, 87, 0.12);
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    transition:
      max-height 300ms ease,
      opacity 300ms ease,
      transform 300ms ease,
      padding 300ms ease,
      border-width 300ms ease;
  }

  .page-nav-shell[open] .page-nav {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 320px;
    padding-top: 14px;
    padding-bottom: 14px;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.18);
  }

  .page-nav-sep {
    display: none;
  }

  .page-nav a,
  .page-nav .nav-item {
    width: 100%;
    min-height: 44px;
    padding: 10px 0;
    color: #fff;
  }

  .page-nav a span,
  .page-nav .nav-item span {
    color: inherit;
  }

  .page-nav a:hover,
  .page-nav a:focus {
    color: #fff;
  }

  .page-nav .is-active,
  .page-nav .is-active span,
  .page-nav .is-active .icon-svg {
    color: #f8c135;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    padding: 18px;
    border-radius: 18px;
  }

  .modal-top {
    gap: 10px;
  }

  .modal-top h2 {
    font-size: clamp(1.35rem, 7vw, 2rem);
  }

  .modal-actions {
    gap: 6px;
  }

  .modal-close {
    min-width: 40px;
    min-height: 40px;
  }
}
