:root {
  color-scheme: dark light;
  --bg: #061012;
  --bg-2: #091719;
  --surface: rgba(12, 24, 28, 0.82);
  --surface-2: rgba(14, 30, 34, 0.88);
  --surface-3: rgba(17, 39, 43, 0.92);
  --text: #f3fbf8;
  --muted: #b7c8c5;
  --quiet: #8ca4a1;
  --line: rgba(177, 221, 214, 0.18);
  --line-strong: rgba(177, 221, 214, 0.34);
  --blue: #6bbce7;
  --green: #79dfb1;
  --amber: #e8cb71;
  --danger: #ee9292;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  --glow: 0 0 0 1px rgba(121, 223, 177, 0.08), 0 0 38px rgba(107, 188, 231, 0.08);
  --focus: #9fe8ff;
  --focus-ring: 0 0 0 3px rgba(115, 189, 231, 0.34);
  --control-bg: rgba(5, 13, 15, 0.9);
  --nav-bg: rgba(6, 16, 18, 0.91);
  --page-bg:
    linear-gradient(180deg, rgba(7, 19, 22, 0.94) 0%, rgba(6, 16, 18, 1) 56%, #050d0f 100%),
    radial-gradient(circle at 15% -10%, rgba(121, 223, 177, 0.14), transparent 32%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.18em; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface-3);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
.wrap { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }
.topbar .wrap { width: min(1240px, calc(100% - 32px)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(130%);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 820; letter-spacing: 0; text-decoration: none; white-space: nowrap; }
.brand-logo {
  display: block;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: var(--glow);
  object-fit: contain;
  padding: 3px;
}
.links { display: flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.035);
}
.theme-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 5px 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 780;
  cursor: pointer;
}
.theme-toggle button[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: var(--glow);
}
.theme-toggle button:hover {
  color: var(--text);
}
.links a, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 720;
  font-size: 0.86rem;
  line-height: 1.15;
}
.links a:hover, .button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.068); text-decoration: none; }
.button.primary { background: rgba(37, 87, 77, 0.82); border-color: rgba(121, 223, 177, 0.5); color: #f2fff8; }
.button.warn { border-color: rgba(232, 203, 113, 0.45); color: #fff1b8; }

.hero {
  padding: 44px 0 26px;
  border-bottom: 1px solid rgba(177, 221, 214, 0.1);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 860;
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: 0;
  max-width: 820px;
}
h2 { margin: 0 0 12px; font-size: clamp(1.16rem, 2vw, 1.55rem); line-height: 1.18; letter-spacing: 0; }
h3 { margin: 0 0 6px; font-size: 0.98rem; letter-spacing: 0; }
p { color: var(--muted); margin: 0 0 10px; }
.lede { font-size: clamp(1rem, 1.35vw, 1.14rem); max-width: 760px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.band { padding: 20px 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .notice, .form-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow), var(--glow);
  backdrop-filter: blur(14px) saturate(116%);
}
.card {
  min-height: 104px;
  padding: 14px;
}
.card h3 { color: #ffffff; }
.card p { font-size: 0.93rem; }
.notice {
  padding: 14px;
  border-color: rgba(232, 203, 113, 0.36);
  background: rgba(25, 25, 18, 0.78);
}
.notice strong { color: var(--amber); }
.form-panel {
  padding: 18px;
  background: var(--surface-2);
}

label {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 0.91rem;
  font-weight: 720;
}
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  background: var(--control-bg);
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(107, 188, 231, 0.28);
  outline-offset: 1px;
  border-color: rgba(107, 188, 231, 0.66);
}
textarea { min-height: 108px; resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.full { grid-column: 1 / -1; }
.check { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.check input { width: auto; min-height: 0; margin-top: 4px; }
.status { padding: 12px; border-radius: 6px; background: rgba(121, 223, 177, 0.1); border: 1px solid rgba(121, 223, 177, 0.26); }
.private { border-color: rgba(238, 146, 146, 0.35); }
.private strong { color: var(--danger); }
.table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 6px; font-size: 0.92rem; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px 9px; text-align: left; vertical-align: top; }
.table th { color: var(--green); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }
.table tr:hover td { background: rgba(255, 255, 255, 0.035); }
.table-wrap { overflow-x: auto; }
.admin-table td { min-width: 160px; }
.admin-review-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
  min-width: min(520px, 68vw);
}
.admin-review-form label { font-size: 0.82rem; }
.admin-review-form textarea { min-height: 72px; }
.admin-review-form .button, .admin-review-form label:nth-of-type(4) { grid-column: 1 / -1; }
.footer {
  padding: 24px 0;
  color: var(--quiet);
  border-top: 1px solid var(--line);
  margin-top: 24px;
  background: rgba(0, 0, 0, 0.14);
  font-size: 0.9rem;
}
.small { font-size: 0.88rem; color: var(--muted); }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5fbf8;
    --bg-2: #eaf5f1;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-2: rgba(255, 255, 255, 0.94);
    --surface-3: rgba(236, 248, 244, 0.98);
    --text: #132225;
    --muted: #425b5d;
    --quiet: #667b7d;
    --line: rgba(31, 76, 80, 0.18);
    --line-strong: rgba(31, 76, 80, 0.34);
    --blue: #126c92;
    --green: #147a5d;
    --amber: #7a5c00;
    --danger: #9b2f35;
    --shadow: 0 14px 34px rgba(16, 43, 46, 0.12);
    --glow: 0 0 0 1px rgba(20, 122, 93, 0.08);
    --focus: #005f83;
    --focus-ring: 0 0 0 3px rgba(18, 108, 146, 0.22);
    --control-bg: rgba(255, 255, 255, 0.96);
    --nav-bg: rgba(245, 251, 248, 0.92);
    --page-bg:
      linear-gradient(180deg, #f5fbf8 0%, #eef8f4 58%, #e7f2ef 100%),
      radial-gradient(circle at 12% -12%, rgba(20, 122, 93, 0.11), transparent 30%);
  }

  .brand-logo,
  .links a,
  .button {
    background: rgba(255, 255, 255, 0.68);
  }

  .links a:hover,
  .button:hover,
  .table tr:hover td {
    background: rgba(20, 122, 93, 0.07);
  }

  .button.primary {
    background: #166b56;
    color: #ffffff;
  }

  .button.warn {
    color: #684f00;
    background: rgba(255, 247, 214, 0.86);
  }

  .card h3 {
    color: #132225;
  }

  .notice {
    background: rgba(255, 250, 229, 0.9);
  }
}

html[data-theme="light"] {
  --bg: #f5fbf8;
  --bg-2: #eaf5f1;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-2: rgba(255, 255, 255, 0.94);
  --surface-3: rgba(236, 248, 244, 0.98);
  --text: #132225;
  --muted: #425b5d;
  --quiet: #667b7d;
  --line: rgba(31, 76, 80, 0.18);
  --line-strong: rgba(31, 76, 80, 0.34);
  --blue: #126c92;
  --green: #147a5d;
  --amber: #7a5c00;
  --danger: #9b2f35;
  --shadow: 0 14px 34px rgba(16, 43, 46, 0.12);
  --glow: 0 0 0 1px rgba(20, 122, 93, 0.08);
  --focus: #005f83;
  --focus-ring: 0 0 0 3px rgba(18, 108, 146, 0.22);
  --control-bg: rgba(255, 255, 255, 0.96);
  --nav-bg: rgba(245, 251, 248, 0.92);
  --page-bg:
    linear-gradient(180deg, #f5fbf8 0%, #eef8f4 58%, #e7f2ef 100%),
    radial-gradient(circle at 12% -12%, rgba(20, 122, 93, 0.11), transparent 30%);
}

html[data-theme="dark"] {
  --bg: #061012;
  --bg-2: #091719;
  --surface: rgba(12, 24, 28, 0.82);
  --surface-2: rgba(14, 30, 34, 0.88);
  --surface-3: rgba(17, 39, 43, 0.92);
  --text: #f3fbf8;
  --muted: #b7c8c5;
  --quiet: #8ca4a1;
  --line: rgba(177, 221, 214, 0.18);
  --line-strong: rgba(177, 221, 214, 0.34);
  --blue: #6bbce7;
  --green: #79dfb1;
  --amber: #e8cb71;
  --danger: #ee9292;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  --glow: 0 0 0 1px rgba(121, 223, 177, 0.08), 0 0 38px rgba(107, 188, 231, 0.08);
  --focus: #9fe8ff;
  --focus-ring: 0 0 0 3px rgba(115, 189, 231, 0.34);
  --control-bg: rgba(5, 13, 15, 0.9);
  --nav-bg: rgba(6, 16, 18, 0.91);
  --page-bg:
    linear-gradient(180deg, rgba(7, 19, 22, 0.94) 0%, rgba(6, 16, 18, 1) 56%, #050d0f 100%),
    radial-gradient(circle at 15% -10%, rgba(121, 223, 177, 0.14), transparent 32%);
}

html[data-theme="dark"] .brand-logo,
html[data-theme="dark"] .links a,
html[data-theme="dark"] .button {
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .links a:hover,
html[data-theme="dark"] .button:hover,
html[data-theme="dark"] .table tr:hover td {
  background: rgba(255, 255, 255, 0.068);
}

html[data-theme="dark"] .button.primary {
  background: rgba(37, 87, 77, 0.82);
  color: #f2fff8;
}

html[data-theme="dark"] .button.warn {
  color: #fff1b8;
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .card h3 {
  color: #ffffff;
}

html[data-theme="dark"] .notice {
  background: rgba(25, 25, 18, 0.78);
}

html[data-theme="light"] .brand-logo,
html[data-theme="light"] .links a,
html[data-theme="light"] .button {
  background: rgba(255, 255, 255, 0.68);
}

html[data-theme="light"] .links a:hover,
html[data-theme="light"] .button:hover,
html[data-theme="light"] .table tr:hover td {
  background: rgba(20, 122, 93, 0.07);
}

html[data-theme="light"] .button.primary {
  background: #166b56;
  color: #ffffff;
}

html[data-theme="light"] .button.warn {
  color: #684f00;
  background: rgba(255, 247, 214, 0.86);
}

html[data-theme="light"] .card h3 {
  color: #132225;
}

html[data-theme="light"] .notice {
  background: rgba(255, 250, 229, 0.9);
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(159, 232, 255, 0.55);
    --line-strong: rgba(159, 232, 255, 0.82);
  }

  .card,
  .notice,
  .form-panel,
  .links a,
  .button,
  input,
  select,
  textarea {
    border-width: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 900px) {
  .nav { align-items: flex-start; flex-direction: column; }
  .links { flex-wrap: wrap; justify-content: flex-start; }
  .links a, .button { font-size: 0.84rem; }
  .grid, .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .wrap { width: min(100% - 24px, 1040px); }
  .hero { padding-top: 34px; }
  .grid, .grid.two, .fields { grid-template-columns: 1fr; }
  .links a, .button { width: 100%; }
  .theme-toggle { width: 100%; }
  .theme-toggle button { flex: 1 1 0; }
  .form-panel { padding: 14px; }
}
