/* Dashboard X static site — shared stylesheet (lead/NEXT-M9c §1).
   Light theme from docs/redesign/web/tpl-legal-*.png with the app's green
   accent: white page, near-black headings, dark-grey body, one column,
   mobile-first (works at 320 px), content column ≤ 720 px on desktop.
   Link text uses a darker green (#16804A, 4.98:1 on white) so it meets
   WCAG AA; the bright accent/primary (#2FE07E) carries underlines, the
   tab indicator and filled buttons (dark text on green = 10.9:1). */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f5f5;
  --heading: #0d0e0e;
  --body: #4a4f4d;
  --muted: #6e7472;
  --rule: #e3e6e5;
  --accent: #2fe07e;
  --accent-text: #16804a;
  --accent-soft: #e6fbef;
  --on-accent: #07130c;
  --danger: #c8413e;
  --danger-soft: #fdecea;
  --warning: #8a5a12;
  --warning-soft: #fff4e3;
  --focus: #16804a;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1:focus { outline: none; } /* focused programmatically on state changes */

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--heading); color: #fff; padding: 10px 14px; border-radius: 8px;
  text-decoration: none; z-index: 10;
}
.skip:focus { top: 12px; }

/* ── Header: close ✕, mark + wordmark, tab row ───────────────────── */
.site-header {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px 0;
}
.header-top {
  display: flex;
  justify-content: flex-end;
  min-height: 44px;
}
.close {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--heading);
  cursor: pointer; border-radius: 8px; margin-right: -8px;
}
.close svg { width: 24px; height: 24px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--heading); text-decoration: none;
  margin: 12px 0 8px;
}
.mark {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-auto-rows: 10px;
  gap: 3px;
  flex: none;
}
.mark i { display: block; background: var(--accent); border-radius: 3px; }
.wordmark { font-size: 28px; font-weight: 700; font-style: italic; letter-spacing: -0.02em; line-height: 1.2; }

.tabs {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--rule);
  margin: 4px -20px 0;
  padding: 0 20px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none;
  padding: 10px 0 12px;
  color: var(--body);
  text-decoration: none;
  font-size: 17px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--accent); font-weight: 500; }
.tabs a:hover { color: var(--heading); }
/* Under 480 px the four labels don't fit on one line (NEXT-M9d §2): a
   2 × 2 grid instead of a clipped scroller, every tab visible. */
@media (max-width: 479px) {
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; overflow: visible; border-bottom: 0; }
  .tabs a { border-bottom: 2px solid var(--rule); margin-bottom: 0; white-space: normal; }
  .tabs a[aria-current="page"] { border-bottom-color: var(--accent); }
}

/* ── Content column ──────────────────────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}
main.narrow { max-width: 520px; }
h1 {
  color: var(--heading);
  font-size: 36px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 20px;
}
h2 {
  color: var(--heading);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  margin: 36px 0 12px;
}
h3 { color: var(--heading); font-size: 17px; font-weight: 600; margin: 24px 0 8px; }
p { margin: 0 0 18px; }
.lede { font-size: 18px; margin-bottom: 24px; }
.updated { color: var(--muted); font-size: 15px; margin: -8px 0 28px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }
ul, ol { padding-left: 24px; margin: 0 0 18px; }
li { margin: 6px 0; }
li::marker { color: var(--muted); }
strong { color: var(--heading); font-weight: 600; }
.note {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 0 10px 10px 0;
  margin: 0 0 20px;
}
.todo { background: #fff4e3; color: #8a5a12; padding: 1px 6px; border-radius: 4px; font-size: 14px; }
table.plain { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 16px; }
table.plain th, table.plain td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
table.plain th { color: var(--heading); font-weight: 600; }

/* Overview */
.ref { white-space: nowrap; }
/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 52px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 17px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(.96); }
.btn-secondary { background: #fff; color: var(--heading); border-color: #cfd3d1; }
.btn-secondary:hover { border-color: var(--heading); }
.btn + .btn { margin-top: 12px; }
.btn.inline { width: auto; }
.btn .spinner {
  width: 18px; height: 18px; margin-right: 10px;
  border: 2px solid rgba(7,19,12,.25); border-top-color: var(--on-accent);
  border-radius: 50%; animation: spin .8s linear infinite; display: none;
}
.btn.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forms (reset page; 52 dp inputs like the app) ───────────────── */
label { display: block; color: var(--heading); font-size: 15px; font-weight: 500; margin: 0 0 6px; }
.field { position: relative; margin-bottom: 16px; }
.field input {
  width: 100%; height: 52px; padding: 0 48px 0 16px;
  border-radius: 14px; border: 1px solid #cfd3d1; background: #fff;
  color: var(--heading); font: inherit; font-size: 16px;
}
.field input::placeholder { color: #9aa09d; }
.field input:focus { border-color: var(--accent-text); outline: 3px solid rgba(47, 224, 126, .35); outline-offset: 0; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field .reveal {
  position: absolute; right: 6px; top: 6px; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.field .reveal:hover { color: var(--heading); }
.field .reveal svg { width: 20px; height: 20px; }
.field .reveal .off { display: none; }
.field .reveal[aria-pressed="true"] .on { display: none; }
.field .reveal[aria-pressed="true"] .off { display: block; }
.field-error { color: var(--danger); font-size: 14px; margin: -10px 0 14px; }
.rules { list-style: none; padding: 0; margin: 4px 0 20px; }
.rules li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); margin: 6px 0; }
.rules li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c4c9c7; flex: none; margin: 0 4px; }
.rules li.met { color: var(--heading); }
.rules li.met::before {
  width: 16px; height: 16px; margin: 0; background: var(--accent-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.6-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.6-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.actions { margin-top: 8px; }
.banner { border-radius: 12px; padding: 12px 14px; font-size: 15px; margin: 0 0 16px; }
.banner-error { background: var(--danger-soft); color: var(--danger); }
.banner-warning { background: var(--warning-soft); color: var(--warning); }
.state-icon {
  width: 84px; height: 84px; margin: 8px auto 20px; border-radius: 50%;
  border: 3px solid var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
}
.state-icon.bad { border-color: var(--danger); color: var(--danger); }
.state-icon svg { width: 40px; height: 40px; }
[hidden] { display: none !important; }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  font-size: 16px;
}
.footer-links { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-contact { color: var(--body); margin-bottom: 20px; }
.footer-rule { border: 0; border-top: 1px solid var(--rule); margin: 0 0 18px; }
.footer-copy { color: var(--muted); font-size: 15px; text-align: center; margin: 0; }

@media (min-width: 640px) {
  .site-header { padding-top: 20px; }
  main { padding: 36px 24px 64px; }
  h1 { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn .spinner { animation-duration: 2s; }
}
