:root {
  color-scheme: light dark;
  --ink: #202124;
  --muted: #5f646a;
  --paper: #f2efe8;
  --panel: #ffffff;
  --line: #c9d7df;
  --accent: #0069b4;
  --accent-strong: #00528d;
  --gold: #b7822e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 239, 232, 0.98)),
    var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.protected-page:not(.is-unlocked) .site-menu,
.protected-page:not(.is-unlocked) main {
  visibility: hidden;
}

.page-gate {
  align-items: center;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 100;
}

.page-gate-dialog {
  background: var(--panel);
  border: 1px solid rgba(32, 33, 36, 0.16);
  box-shadow: 0 22px 70px rgba(32, 33, 36, 0.22);
  display: grid;
  gap: 14px;
  max-width: 430px;
  padding: 28px;
  width: min(100%, 430px);
}

.page-gate-title {
  font-weight: 700;
}

.page-gate-dialog label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.page-gate-input {
  border: 1px solid rgba(32, 33, 36, 0.24);
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  padding: 12px 13px;
}

.page-gate-feedback {
  color: #c62828;
  min-height: 1.4em;
}

.page-gate-dialog button {
  min-height: 46px;
  border: 1px solid var(--accent-strong);
  border-radius: 4px;
  background: var(--accent-strong);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 11px 18px;
}

.page-gate-dialog button:hover,
.page-gate-dialog button:focus-visible {
  background: var(--accent);
  outline: none;
}

.legal-shell {
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: 36px 0 64px;
}

.legal-header {
  text-align: center;
}

.legal-logo {
  display: block;
  width: min(48vw, 180px);
  height: auto;
  margin: 0 auto 20px;
}

.legal-logo-fallback {
  margin: 0 auto 20px;
  color: var(--accent-strong);
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 700;
}

.legal-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1.08;
}

.legal-intro {
  max-width: 650px;
  margin: 18px auto 30px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.legal-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  margin: 0 auto 22px;
}

.legal-nav a {
  border: 1px solid rgba(0, 82, 141, 0.24);
  border-radius: 4px;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 10px;
  text-decoration: none;
}

.legal-nav a:hover,
.legal-nav a:focus-visible {
  background: rgba(0, 105, 180, 0.10);
  text-decoration: none;
}

.site-menu {
  left: 14px;
  pointer-events: none;
  position: fixed;
  top: 14px;
  z-index: 40;
}

.site-menu-toggle {
  align-items: center;
  background: var(--panel);
  border: 1px solid rgba(0, 82, 141, 0.28);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  height: 42px;
  justify-content: center;
  list-style: none;
  pointer-events: auto;
  width: 42px;
}

.site-menu-toggle::-webkit-details-marker {
  display: none;
}

.site-menu-toggle span {
  background: var(--accent-strong);
  display: block;
  height: 2px;
  width: 20px;
}

.site-menu-panel {
  background: var(--panel);
  border: 1px solid rgba(32, 33, 36, 0.14);
  box-shadow: 0 16px 40px rgba(32, 33, 36, 0.18);
  display: grid;
  gap: 2px;
  margin-top: 8px;
  min-width: 230px;
  padding: 8px;
  pointer-events: auto;
}

.site-menu-panel a {
  color: var(--ink);
  font-weight: 700;
  padding: 10px 12px;
  text-decoration: none;
}

.site-menu-disabled {
  color: var(--muted);
  cursor: not-allowed;
  font-weight: 700;
  opacity: 0.68;
  padding: 10px 12px;
}

.site-menu-panel a:hover,
.site-menu-panel a:focus-visible {
  background: rgba(0, 105, 180, 0.10);
  color: var(--accent-strong);
  outline: none;
  text-decoration: none;
}

.legal-content {
  border: 1px solid rgba(32, 33, 36, 0.14);
  background: #ffffff;
  padding: clamp(22px, 5vw, 42px);
}

.legal-content section + section {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid rgba(32, 33, 36, 0.12);
}

h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
}

h3 {
  margin: 20px 0 8px;
  color: var(--accent-strong);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

h2 + h3 {
  margin-top: 0;
}

p,
li {
  font-size: 1rem;
  line-height: 1.68;
}

.legal-content section > p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

p {
  margin: 0;
}

p + p {
  margin-top: 12px;
}

ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

li + li {
  margin-top: 8px;
}

a {
  color: var(--accent-strong);
  font-weight: 700;
}

a:focus-visible {
  outline: 3px solid rgba(0, 105, 180, 0.28);
  outline-offset: 3px;
}

.legal-warning {
  border-left: 4px solid var(--gold);
  background: rgba(183, 130, 46, 0.10);
  color: var(--ink);
  margin-bottom: 28px;
  padding: 14px 16px;
  text-align: left;
}

.faq-nav-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  text-align: center;
  text-transform: uppercase;
}

.faq-nav {
  margin-top: 0;
}

.faq-content h2 {
  color: var(--ink);
}

.faq-content section,
.faq-item {
  scroll-margin-top: 74px;
}

.faq-item {
  border-top: 1px solid rgba(32, 33, 36, 0.12);
}

.faq-item:first-of-type {
  border-top: 0;
}

.faq-item[open] {
  padding-bottom: 18px;
}

.faq-question {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  min-height: 56px;
  padding: 12px 0;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  color: var(--accent-strong);
  content: "⌄";
  flex: 0 0 24px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transition: transform 0.16s ease;
}

.faq-item[open] > .faq-question::after {
  transform: rotate(180deg);
}

.faq-question h3 {
  margin: 0;
}

.faq-item > p,
.faq-item > ol,
.faq-item > ul,
.faq-item > .faq-helper-open {
  margin-left: 0;
}

.faq-warning-line {
  padding-left: 1.45em;
  position: relative;
  text-align: left;
}

.faq-warning-symbol {
  color: #c62828;
  font-weight: 700;
  left: 0;
  line-height: inherit;
  position: absolute;
  top: 0;
}

.faq-helper-open,
.faq-helper-button {
  min-height: 46px;
  border: 1px solid var(--accent-strong);
  border-radius: 4px;
  background: var(--accent-strong);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 11px 18px;
}

.faq-helper-open {
  margin-top: 14px;
}

.faq-helper-open:hover,
.faq-helper-open:focus-visible,
.faq-helper-button:hover,
.faq-helper-button:focus-visible {
  background: var(--accent);
  outline: none;
}

.faq-helper-button.secondary {
  background: #ffffff;
  color: var(--accent-strong);
}

.faq-helper {
  align-items: center;
  background: rgba(32, 33, 36, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 20;
}

.faq-helper[hidden] {
  display: none;
}

.faq-helper-dialog {
  background: #ffffff;
  border: 1px solid rgba(32, 33, 36, 0.16);
  box-shadow: 0 22px 70px rgba(32, 33, 36, 0.22);
  max-width: 520px;
  padding: 28px;
  position: relative;
  width: min(100%, 520px);
}

.faq-helper-dialog h2 {
  margin-bottom: 12px;
}

.faq-helper-kicker {
  font-family: Arial, Helvetica, sans-serif;
}

.faq-helper-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 1.6rem;
  height: 40px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 40px;
}

.faq-helper-content {
  margin-top: 12px;
}

.faq-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.legal-update {
  margin-top: 34px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.legal-return {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid rgba(32, 33, 36, 0.12);
}

.legal-return[hidden] {
  display: none !important;
}

.legal-return button {
  min-height: 48px;
  border: 1px solid var(--accent-strong);
  border-radius: 4px;
  background: var(--accent-strong);
  color: #ffffff;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.legal-return button:hover {
  background: var(--accent);
}

.legal-return button:focus-visible {
  outline: 3px solid rgba(0, 105, 180, 0.28);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .legal-shell {
    width: min(100% - 20px, 820px);
    padding-top: 22px;
  }

  .legal-logo {
    width: min(48vw, 170px);
  }

  .legal-content {
    padding: 20px;
  }

  .legal-return button {
    width: 100%;
  }

  .faq-helper-dialog {
    padding: 24px 18px 20px;
  }

  .faq-helper-actions,
  .faq-helper-button,
  .faq-helper-open {
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f7fb;
    --muted: #c8d0d9;
    --paper: #101418;
    --panel: #171d22;
    --line: #324453;
    --accent: #78c7ff;
    --accent-strong: #a8dbff;
    --gold: #e2bd6f;
  }

  body {
    background:
      linear-gradient(180deg, rgba(16, 20, 24, 0.98), rgba(23, 29, 34, 0.98)),
      var(--paper);
  }

  .legal-content,
  .faq-helper-dialog {
    border-color: rgba(200, 208, 217, 0.2);
    background: var(--panel);
  }

  .legal-content section + section,
  .faq-item,
  .legal-return {
    border-color: rgba(200, 208, 217, 0.16);
  }

  .legal-nav a {
    border-color: rgba(168, 219, 255, 0.35);
  }

  .legal-nav a:hover,
  .legal-nav a:focus-visible,
  .site-menu-panel a:hover,
  .site-menu-panel a:focus-visible {
    background: rgba(120, 199, 255, 0.16);
  }

  .faq-helper {
    background: rgba(0, 0, 0, 0.58);
  }

  .faq-helper-open,
  .faq-helper-button,
  .legal-return button,
  .page-gate-dialog button {
    border-color: var(--accent-strong);
    background: #12384f;
    color: #f5f7fb;
  }

  .faq-helper-open:hover,
  .faq-helper-open:focus-visible,
  .faq-helper-button:hover,
  .faq-helper-button:focus-visible,
  .legal-return button:hover,
  .legal-return button:focus-visible,
  .page-gate-dialog button:hover,
  .page-gate-dialog button:focus-visible {
    background: #1b5475;
    color: #ffffff;
  }

  .faq-helper-button.secondary {
    background: var(--panel);
    border-color: rgba(168, 219, 255, 0.55);
    color: var(--accent-strong);
  }

  .page-gate-input {
    border-color: rgba(200, 208, 217, 0.26);
    background: #101418;
  }
}
