:root {
  color-scheme: dark;
  --bg: #070a11;
  --surface: #101521;
  --surface-strong: #151b28;
  --text: #e8edf6;
  --text-dim: #b6c0d1;
  --text-muted: #8691a5;
  --border: rgba(200, 214, 240, 0.2);
  --border-strong: rgba(232, 237, 246, 0.42);
  --accent: #e8edf6;
  --accent-text: #070a11;
  --ok: #79c99e;
  --error: #ef9a9a;
  --focus: #b8caee;
  --max-width: 1080px;
  --font-ui: "Jost", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.legal-wrap {
  width: min(100% - 40px, var(--max-width));
  margin: 0 auto;
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 17, 0.94);
  backdrop-filter: blur(14px);
}

.legal-header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.legal-brand img { width: 30px; height: 30px; filter: grayscale(1) brightness(1.3); }
.legal-brand b { font-size: 14px; font-weight: 600; }

.legal-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.legal-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.legal-nav a:hover { color: var(--text); border-color: var(--border); }
.legal-nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent); }

.legal-hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}

.legal-kicker {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.legal-hero h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0;
}

.legal-lead {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--text-dim);
  font-size: 17px;
}

.legal-meta { margin: 14px 0 0; color: var(--text-muted); font-size: 13px; }

.legal-layout {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 52px;
  padding: 42px 0 72px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 4px;
}

.legal-toc strong {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.legal-toc a {
  padding: 7px 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.legal-toc a:hover { color: var(--text); }

.legal-copy { min-width: 0; }

.legal-section {
  padding: 0 0 42px;
  margin: 0 0 42px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 88px;
}

.legal-section:last-child { margin-bottom: 0; border-bottom: 0; }

.legal-section h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}

.legal-section h3 { margin: 28px 0 10px; font-size: 18px; letter-spacing: 0; }
.legal-section p { margin: 0 0 14px; color: var(--text-dim); }
.legal-section strong { color: var(--text); }
.legal-section ul, .legal-section ol { margin: 10px 0 18px; padding-left: 24px; color: var(--text-dim); }
.legal-section li { margin: 7px 0; }

.legal-callout {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-dim);
}

.legal-callout code {
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.96em;
}

.inline-link { color: var(--text); text-decoration-color: var(--text-muted); text-underline-offset: 3px; }
.inline-link:hover { text-decoration-color: var(--text); }

.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 44px;
  padding: 42px 0 72px;
  align-items: start;
}

.support-form {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field-wide { grid-column: 1 / -1; }
.field label, .field-label { color: var(--text); font-size: 14px; font-weight: 600; }
.field-hint { color: var(--text-muted); font-size: 12px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #090d15;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.field input, .field select { min-height: 46px; padding: 10px 12px; }
.field textarea { min-height: 170px; padding: 12px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); opacity: 1; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 3px 0 20px;
  color: var(--text-dim);
  font-size: 13px;
}

.consent-row input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }

.support-submit {
  min-height: 46px;
  min-width: 190px;
  border: 0;
  border-radius: 7px;
  padding: 11px 18px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.support-submit:hover { filter: brightness(0.92); }
.support-submit:disabled { cursor: wait; opacity: 0.62; }

.support-status {
  min-height: 0;
  margin-top: 18px;
  padding: 0;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 14px;
}

.support-status:not(:empty) { min-height: 48px; padding: 12px 14px; border: 1px solid var(--border); }
.support-status[data-state="pending"] { color: var(--text); }
.support-status[data-state="success"] { border-color: rgba(121, 201, 158, 0.5); color: var(--ok); }
.support-status[data-state="error"] { border-color: rgba(239, 154, 154, 0.5); color: var(--error); }

.support-aside h2 {
  margin: 0 0 15px;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0;
}

.support-aside p, .support-aside li { color: var(--text-dim); }
.support-aside ul { padding-left: 20px; }
.support-aside .legal-callout { margin-top: 26px; }

.legal-footer { border-top: 1px solid var(--border); padding: 28px 0 36px; }
.legal-footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.legal-footer p { margin: 0; color: var(--text-muted); font-size: 12px; }
.legal-footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.legal-footer a { color: var(--text-dim); font-size: 12px; }

@media (max-width: 780px) {
  .legal-layout, .support-layout { grid-template-columns: 1fr; gap: 30px; }
  .legal-toc { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-toc strong { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
  .legal-wrap { width: min(100% - 24px, var(--max-width)); }
  .legal-header-inner { gap: 8px; }
  .legal-brand b { font-size: 12px; }
  .legal-nav { gap: 5px; }
  .legal-nav a { min-height: 32px; padding: 5px 7px; font-size: 11px; }
  .legal-nav .nav-secondary { display: none; }
  .legal-hero { padding: 45px 0 30px; }
  .legal-lead { font-size: 15px; }
  .legal-layout, .support-layout { padding: 30px 0 52px; }
  .legal-toc { grid-template-columns: 1fr; }
  .legal-section h2 { font-size: 29px; }
  .support-form { padding: 18px 14px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .support-submit { width: 100%; }
}

@media (max-width: 340px) {
  .legal-brand b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
