/* AccessDocs UI — WCAG 2.1 AA; type/colour kinship with Nightstand Labs (light theme) */
:root {
  --ink: #0f172a;
  --muted: #475569;
  --bg: #f4f7fb;
  --bg-deep: #e4ebf5;
  --panel: #ffffff;
  --line: #c9d3e2;
  --link: #1554c0;
  --accent: #1e5aef;
  --accent-ink: #ffffff;
  --accent-soft: #e8effe;
  --mark: #3d4f6f;
  --ok: #157a3c;
  --warn: #8a5a00;
  --bad: #a12626;
  --focus: #ffbf47;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Sora, "Segoe UI", system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.06);
  --max: 1100px;
}
* { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 5.5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
}
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* —— Header —— */
header.site {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(12px);
}
header.site .bar {
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  padding: .85rem 1.25rem;
}
header.site .brand {
  font-family: var(--serif);
  font-weight: 600; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
header.site .brand:hover { color: var(--accent); }
header.site nav { flex: 1; }
header.site nav ul {
  list-style: none; display: flex; gap: .15rem .85rem;
  margin: 0; padding: 0; flex-wrap: wrap; align-items: center;
  justify-content: flex-end;
}
header.site nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .35rem .2rem;
}
header.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current="page"] {
  color: var(--ink); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}
header.site nav a.nav-cta {
  display: inline-block;
  margin-left: .35rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  background: transparent;
}
header.site nav a.nav-cta:hover {
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none;
}
header.site .user-bar {
  margin-left: auto; display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
}

/* —— Main / footer —— */
main { max-width: var(--max); margin: 0 auto; padding: 1.75rem 1.25rem 3.5rem; width: 100%; flex: 1; }
footer.site {
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem;
  padding: 1.5rem 1.25rem 2rem;
  background: var(--panel);
}
footer.site .foot-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  justify-content: space-between; align-items: baseline;
}
footer.site nav ul {
  list-style: none; display: flex; flex-wrap: wrap; gap: .75rem 1.1rem;
  margin: 0; padding: 0;
}
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--ink); text-decoration: underline; }

/* —— Type —— */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); margin: 0 0 .85rem; }
h2 { font-size: clamp(1.45rem, 2.5vw, 1.85rem); margin: 0 0 .65rem; }
h3 { font-size: 1.2rem; margin: 0 0 .4rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
p.lede { font-size: 1.1rem; max-width: 42rem; color: var(--muted); margin: 0 0 1.25rem; }
.muted { color: var(--muted); }
.eyebrow {
  font-family: var(--sans);
  font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--mark); margin: 0 0 .75rem;
}

/* —— Components —— */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.2rem; background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.card .big { font-size: 1.75rem; font-weight: 600; display: block; font-variant-numeric: tabular-nums; }
table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; }
th, td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; }
th { background: var(--bg-deep); font-weight: 600; }
caption { text-align: left; font-weight: 600; margin-bottom: .4rem; color: var(--muted); font-size: .95rem; }
form.stack { display: grid; gap: 1rem; max-width: 34rem; }
label { font-weight: 600; display: block; margin-bottom: .3rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], select, textarea {
  font: inherit; width: 100%; padding: .65rem .75rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
}
input[type="file"] { font: inherit; }
.hint { color: var(--muted); font-size: .92rem; margin: .25rem 0 0; }
button, .btn {
  font: inherit; font-weight: 600;
  padding: .65rem 1.15rem; border-radius: var(--radius);
  border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
button:hover, .btn:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
  text-decoration: none; color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary {
  background: transparent; color: var(--ink); border-color: var(--line);
}
button.secondary:hover, .btn.secondary:hover {
  background: var(--panel); color: var(--ink); border-color: var(--muted);
}
button.danger { background: var(--bad); border-color: var(--bad); }
button.small, .btn.small { padding: .35rem .7rem; font-size: .92rem; border-radius: var(--radius-sm); }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.alert { border: 1.5px solid; border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; }
.alert.ok { border-color: var(--ok); background: #eef8f1; }
.alert.error { border-color: var(--bad); background: #fbeeee; }
.alert.info { border-color: var(--accent); background: var(--accent-soft); }
.status { font-weight: 600; white-space: nowrap; }
.status::before { display: inline-block; width: 1.1em; text-align: center; margin-right: .25em; }
.status.complete { color: var(--ok); } .status.complete::before { content: "\2713"; }
.status.needs_review { color: var(--warn); } .status.needs_review::before { content: "\26A0"; }
.status.failed, .status.expired { color: var(--bad); } .status.failed::before { content: "\2717"; }
.status.queued, .status.running, .status.uploaded { color: var(--muted); }
.status.running::before, .status.queued::before { content: "\21BB"; }
.score { font-variant-numeric: tabular-nums; }
.review-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
  display: grid; gap: .75rem; grid-template-columns: minmax(160px, 260px) 1fr;
  background: var(--panel);
}
.review-item img { max-width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); }
.review-item .ctx { background: var(--bg); padding: .5rem .75rem; border-radius: var(--radius-sm); font-size: .95rem; }
@media (max-width: 700px) { .review-item { grid-template-columns: 1fr; } }
.outline { list-style: none; padding-left: 0; }
.outline li { padding: .2rem 0; }
.outline .lvl-2 { padding-left: 1.25rem; } .outline .lvl-3 { padding-left: 2.5rem; }
.outline .lvl-4, .outline .lvl-5, .outline .lvl-6 { padding-left: 3.75rem; }
.timeline { list-style: none; padding: 0; }
.timeline li { padding: .25rem 0; border-left: 3px solid var(--line); padding-left: .75rem; margin-left: .25rem; }
.deadline td:first-child { font-weight: 600; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details summary { cursor: pointer; font-weight: 600; }
pre { background: var(--bg-deep); padding: .75rem; overflow: auto; border-radius: var(--radius-sm); }

/* Screen reader preview */
.preview-columns {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start; margin-top: 1rem;
}
.transcript-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; background: var(--panel); box-shadow: var(--shadow-sm);
}
.transcript-panel h2 { margin-top: 0; }
.speech-controls select { width: auto; padding: .3rem .5rem; }
.doc-facts { margin: 0 0 .75rem; display: grid; gap: .25rem; }
.doc-facts div { display: flex; gap: .5rem; flex-wrap: wrap; }
.doc-facts dt { font-weight: 600; min-width: 5.5rem; }
.doc-facts dd { margin: 0; }
.transcript {
  list-style: none; margin: .75rem 0 0; padding: 0;
  max-height: 70vh; overflow: auto; border-top: 1px solid var(--line);
}
.transcript li {
  padding: .45rem .5rem; border-bottom: 1px solid var(--line);
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline;
}
.transcript li .cue {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .02em; color: #fff; background: var(--accent);
  border-radius: 3px; padding: .05rem .4rem; white-space: nowrap;
}
.transcript li.note { color: var(--muted); font-style: italic; background: var(--bg); }
.transcript li[aria-current="true"] { background: #fff7e0; outline: 3px solid var(--focus); outline-offset: -3px; }

/* ============================================================
   Landing page
   ============================================================ */
body.page-landing {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(30, 90, 239, 0.12), transparent 55%),
    radial-gradient(900px 500px at -5% 20%, rgba(61, 79, 111, 0.08), transparent 50%),
    linear-gradient(180deg, #eef3f9 0%, var(--bg) 28%, var(--bg) 100%);
  background-attachment: fixed;
}
body.page-landing main {
  max-width: none; padding: 0; width: 100%;
}
body.page-landing main > .alert {
  max-width: var(--max); margin: 1rem auto 0; width: calc(100% - 2.5rem);
}
body.page-landing header.site {
  background: color-mix(in srgb, #eef3f9 80%, transparent);
}

.hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; gap: 2.5rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
}
.hero-brand {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  font-weight: 600; line-height: 1.05;
  letter-spacing: -0.03em; margin: 0 0 .35rem;
  color: var(--ink);
  animation: rise .7s ease both;
}
.hero .eyebrow { animation: rise .7s ease .05s both; }
.hero h1 {
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  font-weight: 600; max-width: 22ch;
  margin: 0 0 1rem;
  animation: rise .7s ease .1s both;
}
.hero .lede { animation: rise .7s ease .15s both; }
.hero-cta {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  margin-top: .25rem;
  animation: rise .7s ease .2s both;
}
.hero-cta .btn { padding: .75rem 1.25rem; }
.hero-note {
  margin: 1rem 0 0; font-size: .92rem; color: var(--muted);
  animation: rise .7s ease .25s both;
}
.hero-note a { font-weight: 500; }

.hero-visual {
  position: relative;
  animation: rise .8s ease .18s both;
}
.hero-visual::before {
  content: "";
  position: absolute; inset: 12% -8% -8% 18%;
  background: radial-gradient(circle at 40% 40%, rgba(30, 90, 239, 0.18), transparent 65%);
  z-index: 0; pointer-events: none;
}
.doc-stage {
  position: relative; z-index: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.25rem;
  transform: rotate(0.6deg);
}
.doc-stage-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .9rem;
}
.doc-stage-top .pill {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ok);
  background: #e8f6ec; border-radius: 999px; padding: .25rem .65rem;
}
.doc-stage-top .meta { font-size: .82rem; color: var(--muted); }
.doc-lines { display: grid; gap: .55rem; }
.doc-line {
  height: .55rem; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-deep), #dfe7f2);
}
.doc-line.short { width: 42%; }
.doc-line.mid { width: 68%; }
.doc-line.tag {
  display: flex; align-items: center; gap: .5rem;
  height: auto; background: transparent;
}
.doc-line.tag span {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: .2rem .45rem; border-radius: 4px;
}
.doc-line.tag i {
  flex: 1; height: .45rem; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-deep), #dfe7f2);
  font-style: normal;
}
.doc-score {
  margin-top: 1rem; padding-top: .9rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
.doc-score strong {
  font-family: var(--serif); font-size: 1.75rem; font-weight: 600;
  color: var(--ok);
}
.doc-score span { font-size: .88rem; color: var(--muted); }

.band {
  padding: clamp(2.5rem, 5vw, 4rem) 1.25rem;
}
.band-inner { max-width: var(--max); margin: 0 auto; }
.band.alt {
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  border-block: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.band-head { max-width: 40rem; margin-bottom: 1.5rem; }
.band-head p { color: var(--muted); margin: .35rem 0 0; }

.scan-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 36rem;
}
.scan-panel form.stack { max-width: none; }
.scan-row {
  display: grid; gap: .75rem;
  grid-template-columns: 1fr auto;
  align-items: end;
}
@media (max-width: 560px) {
  .scan-row { grid-template-columns: 1fr; }
}

.deadline-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.deadline-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow-sm);
}
.deadline-card .when {
  font-family: var(--serif);
  font-size: 1.65rem; font-weight: 600;
  color: var(--accent); margin: .35rem 0 .5rem;
}
.deadline-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.deadline-note { margin: 1.15rem 0 0; font-size: .92rem; max-width: 60ch; }

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
  counter-reset: step;
}
.steps li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem 1.3rem;
  box-shadow: var(--shadow-sm);
  counter-increment: step;
  position: relative;
}
.steps li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.85rem; height: 1.85rem;
  border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: .9rem;
  margin-bottom: .75rem;
}
.steps strong { display: block; font-size: 1.05rem; margin-bottom: .35rem; color: var(--ink); }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; }
}

.pricing-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
}
.plan {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem 1.2rem 1.4rem;
  display: flex; flex-direction: column; gap: .35rem;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.plan:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.plan.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, #f7f9ff 0%, var(--panel) 55%);
}
.plan .plan-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 .15rem;
}
.plan h3 { margin: 0; font-size: 1.15rem; }
.plan .big { margin: .15rem 0 .35rem; color: var(--ink); }
.plan .plan-blurb { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.pricing-note { margin: 1.25rem 0 0; font-size: .92rem; max-width: 70ch; }
@media (max-width: 960px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

.trust-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .85rem;
  grid-template-columns: repeat(2, 1fr);
}
.trust-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}
.trust-list li strong { color: var(--ink); }
@media (max-width: 700px) {
  .trust-list { grid-template-columns: 1fr; }
}

.company-band .band-inner {
  display: grid; gap: 1rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
}
.company-band p { margin: 0; color: var(--muted); max-width: 42rem; }
.company-mark {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 600;
  color: var(--ink); text-decoration: none;
}
.company-mark:hover { color: var(--accent); }
@media (max-width: 700px) {
  .company-band .band-inner { grid-template-columns: 1fr; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; }
  .doc-stage { transform: none; }
}

/* —— Auth pages —— */
body.page-auth {
  background:
    radial-gradient(900px 480px at 90% -20%, rgba(30, 90, 239, 0.1), transparent 55%),
    linear-gradient(180deg, #eef3f9 0%, var(--bg) 40%);
}
body.page-auth main {
  display: flex; flex-direction: column; align-items: center;
  padding-top: clamp(2rem, 6vw, 3.5rem);
}
.auth-panel {
  width: min(100%, 28rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}
.auth-panel h1 { font-size: clamp(1.5rem, 3vw, 1.85rem); }
.auth-panel form.stack { max-width: none; }

/* —— Admin deploy —— */
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 52rem;
}
.admin-card h2 { margin-top: 0; }
.admin-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 1rem 0;
}
.admin-meta dt { font-size: 0.8rem; color: var(--muted); margin: 0; }
.admin-meta dd { margin: 0.15rem 0 0; word-break: break-word; }
.admin-progress { margin: 1rem 0; }
.admin-progress-track {
  height: 0.55rem;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
}
.admin-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}
.admin-log {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0.75rem;
  max-height: 18rem;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}
.admin-log li { margin: 0.15rem 0; white-space: pre-wrap; word-break: break-word; }
.admin-log li.ok { color: #86efac; }
.admin-log li.warn { color: #fde68a; }
.admin-log li.error { color: #fca5a5; }
.admin-status { min-height: 1.4em; }
.admin-status.is-ok { color: var(--ok); }
.admin-status.is-error { color: var(--bad); }

