/* Portal styles, matching the SimplePlainAI company site (www.simpleplainai.com):
   warm cream canvas, off-black ink, Space Grotesk + JetBrains Mono, sharp black buttons,
   uppercase mono labels, blue accent used sparingly. Fonts are self-hosted (strict CSP,
   SIL Open Font License, see /static/fonts/OFL-*.txt). No JavaScript anywhere. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.87c506d88b9f.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.b636a65da4f0.woff2") format("woff2");
}

:root {
  --ink: #111111;
  --ink-80: #313130;
  --ink-60: #626260;          /* muted text: 6:1 on cream */
  --ink-50: #7b7b78;          /* form borders: 4:1 on white */
  --white: #ffffff;
  --cream: #faf9f6;           /* the canvas */
  --oat: #dedbd6;             /* hairlines */
  --sand: #d3cec6;
  --blue: #2563ff;            /* brand accent: focus, admin tag, sparingly */
  --blue-bg: #eef3ff;
  --blue-ink: #1d4ed8;
  --green: #2c6415;
  --green-bg: #edf5e8;
  --orange-ink: #a63a00;
  --orange-bg: #fff2eb;
  --orange: #fe4c02;
  --danger: #b42318;
  --danger-bg: #fef3f2;

  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-button: 4px;
  --radius-nav: 6px;
  --radius-card: 8px;
  --topbar-h: 64px;
  --measure: 44rem;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }

h1, h2, h3 { font-weight: 400; color: var(--ink); margin: 0 0 0.75rem; }
h1 { font-size: clamp(30px, 2.4rem + 0.6vw, 44px); line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; margin-top: 2.5rem; }
h3 { font-size: 19px; line-height: 1.2; letter-spacing: -0.01em; margin-top: 1.75rem; font-weight: 500; }
p, ul, ol, dl, table { margin: 0 0 1rem; }
strong { font-weight: 600; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--sand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

code, pre, .mono { font-family: var(--font-mono); font-size: 0.875em; }
code { background: var(--white); border: 1px solid var(--oat); border-radius: 4px; padding: 1px 5px; word-break: break-all; }

.lead { font-size: 18px; font-weight: 300; line-height: 1.45; color: var(--ink-80); max-width: var(--measure); }
.meta { color: var(--ink-60); font-size: 14px; }
.eyebrow, .crumbs, .facts dt, th, .nav-group-title, .stat-label, .footer-col-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
}
.eyebrow { color: var(--ink-60); margin: 0 0 1rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--white); padding: 0.5rem 0.75rem; border-radius: var(--radius-button);
}
.skip-link:focus { top: 0.75rem; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 640px) { .container { padding: 0 32px; } }
@media (min-width: 900px) { .container { padding: 0 40px; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--oat);
}
.topbar-inner { display: flex; align-items: center; gap: 12px 24px; min-height: var(--topbar-h); }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.brand img { display: block; height: 28px; width: auto; }
@media (min-width: 640px) { .brand img { height: 32px; } }
.context { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink-80); font-size: 15px; }
.context::before { content: ""; width: 1px; height: 22px; background: var(--oat); }
.context-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.tag {
  font: 500 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue-ink); background: var(--blue-bg); border: 1px solid #c9d8ff; border-radius: 999px; padding: 5px 8px;
}
.spacer { flex: 1; }

.topnav { display: none; }
.topnav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.topnav a { display: block; padding: 8px 12px; border-radius: var(--radius-nav); text-decoration: none; color: var(--ink); }
.topnav a:hover { background: var(--cream); }
.topnav a[aria-current="page"] { font-weight: 600; }
@media (min-width: 900px) { .topnav { display: block; } }

/* Dropdowns without JavaScript: <details class="menu"> */
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 10px; border: 1px solid var(--oat); border-radius: var(--radius-nav);
  background: var(--white); color: var(--ink); font-size: 15px;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.menu[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.menu > summary:hover { border-color: var(--ink-50); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 15rem; max-width: calc(100vw - 32px);
  background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.12); padding: 8px;
}
.menu-panel a, .menu-panel button {
  display: flex; width: 100%; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-nav);
  color: var(--ink); text-decoration: none; font: 400 15px/1.3 var(--font-sans); background: none; border: 0; text-align: left; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--cream); }
.menu-panel a[aria-current="page"] { font-weight: 600; background: var(--cream); }
.menu-panel form { margin: 0; }
.menu-panel hr { border: 0; border-top: 1px solid var(--oat); margin: 6px 0; }
.menu-identity { padding: 8px 12px 10px; font-size: 13px; color: var(--ink-60); overflow-wrap: anywhere; }
.menu-identity strong { display: block; color: var(--ink); font-size: 15px; font-weight: 500; }
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--white); font-size: 13px; font-weight: 600; text-transform: uppercase;
}
.account-label { display: none; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { .account-label { display: inline; } }

.mobile-menu { display: block; }
.mobile-menu > summary { padding: 0 12px; }
.mobile-menu > summary::after { display: none; }
.mobile-menu .menu-panel { min-width: 17rem; }
@media (min-width: 900px) { .mobile-menu { display: none; } }

/* ---------- Portal tabs ---------- */
.tabs { background: var(--white); border-bottom: 1px solid var(--oat); }
.tabs ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: thin; }
.tabs a {
  display: block; padding: 14px 12px 12px; white-space: nowrap; text-decoration: none; color: var(--ink-60);
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

/* ---------- Page shell ---------- */
.page { padding-block: 32px 72px; }
@media (min-width: 900px) { .page { padding-block: 40px 96px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: 12px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; color: var(--ink-60); }
.crumbs a { color: var(--ink-60); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs a::after { content: "/"; margin-left: 6px; color: var(--sand); }
.narrow { max-width: 34rem; }

/* Admin console: sidebar + content */
.console { display: grid; gap: 0 40px; }
@media (min-width: 1000px) { .console { grid-template-columns: 220px minmax(0, 1fr); } }
.sidenav { display: none; }
@media (min-width: 1000px) {
  .sidenav { display: block; position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; padding-top: 40px; }
}

@media (min-width: 1000px) { .console-mobile-nav { display: none; } }
.console-mobile-nav .menu-panel { left: 0; right: auto; }
.nav-group { margin-bottom: 20px; }
.nav-group-title { color: var(--ink-60); padding: 0 12px; margin: 0 0 6px; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a, .menu-panel .nav-group a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 38px; padding: 6px 12px; border-radius: var(--radius-nav); text-decoration: none; color: var(--ink-80);
}
.nav-group a:hover { background: var(--white); color: var(--ink); }
.nav-group a[aria-current="page"] { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--oat); }
.count { font: 500 12px/1 var(--font-mono); background: var(--ink); color: var(--white); border-radius: 999px; padding: 4px 7px; }
.console .page { min-width: 0; }

/* ---------- Buttons ---------- */
.button, button, input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-button); border: 1px solid var(--ink);
  background: var(--ink); color: var(--white); font: 400 16px/1.2 var(--font-sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.button:hover, button:hover, input[type="submit"]:hover { background: var(--white); color: var(--ink); }
.button-secondary, button.button-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.button-secondary:hover, button.button-secondary:hover { background: var(--ink); color: var(--white); }
.button-danger, button.button-danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.button-danger:hover, button.button-danger:hover { background: var(--white); color: var(--danger); }
.button-small, button.button-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.button-wide { width: 100%; }
.link-button, button.link-button {
  display: inline; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink);
  font: inherit; text-decoration: underline; text-decoration-color: var(--sand); text-underline-offset: 3px; cursor: pointer;
}
.link-button:hover, button.link-button:hover { background: none; color: var(--ink); text-decoration-color: var(--ink); }
.danger-link, button.danger-link { color: var(--danger); text-decoration-color: #f1b8b2; }
.danger-link:hover { text-decoration-color: var(--danger); }
.cancel { margin-left: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Cards, panels, facts ---------- */
.card, .panel { background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); }
.card { padding: 24px; }
.panel { margin: 0 0 24px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 20px; border-bottom: 1px solid var(--oat); }
.panel-head h2 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 15px; }
.panel-body { padding: 16px 20px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel > .table-scroll { border: 0; border-radius: 0 0 var(--radius-card) var(--radius-card); margin: 0; }
.panel .empty { padding: 16px 20px; margin: 0; color: var(--ink-60); }
.two-col { display: grid; gap: 0 24px; }
@media (min-width: 1100px) { .two-col { grid-template-columns: 1fr 1fr; } }

.facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); margin: 0 0 28px; }
.facts > div { background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 14px 16px; min-width: 0; }
.facts dt { color: var(--ink-60); margin-bottom: 8px; }
.facts dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin: 0 0 32px; }
.stat { display: block; background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 16px; text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: var(--ink-50); }
.stat-label { color: var(--ink-60); }
.stat-value { display: block; font-size: 36px; line-height: 1.1; letter-spacing: -0.03em; margin-top: 10px; }
.stat-note { display: block; font-size: 14px; color: var(--ink-60); margin-top: 4px; }

.danger-zone { border-color: #f1c4bf; }
.danger-zone .panel-head { border-bottom-color: #f1c4bf; }
.danger-zone .panel-head h2 { color: var(--danger); }
.danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 14px 20px; border-top: 1px solid var(--oat); }
.danger-row:first-of-type { border-top: 0; }
.danger-row p { margin: 0; max-width: 36rem; }
.danger-row form { margin: 0; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); margin: 0 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--oat); }
th { color: var(--ink-60); background: var(--cream); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover td { background: #fdfcfa; }
td.empty-row { color: var(--ink-60); text-align: center; padding: 28px 16px; }
table.compact { font-size: 14px; }
table.compact td, table.compact th { padding: 8px 14px; }
th[scope="row"] { background: transparent; width: 40%; }
td.actions { white-space: nowrap; }
td.actions a + a { margin-left: 14px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font: 500 12px/1.3 var(--font-mono);
  letter-spacing: 0.02em; white-space: nowrap; border: 1px solid var(--oat); background: var(--cream); color: var(--ink-80);
}
.badge-connected, .badge-active, .badge-completed, .badge-published { background: var(--green-bg); border-color: #cfe3c3; color: var(--green); }
.badge-pending, .badge-received, .badge-in-progress, .badge-draft { background: var(--blue-bg); border-color: #c9d8ff; color: var(--blue-ink); }
.badge-error, .badge-suspended, .badge-rejected, .badge-overdue { background: var(--orange-bg); border-color: #ffd2bd; color: var(--orange-ink); }
.badge-disconnected, .badge-archived, .badge-retired, .badge-soon { color: var(--ink-60); }

/* ---------- Forms ---------- */
main form { max-width: 36rem; }
main form.inline-form, main form.filters, .button-row form, td form, .danger-row form { max-width: none; }
.form-card { background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 24px; max-width: 40rem; }
.form-card form { max-width: none; }
label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="number"], input[type="tel"], input[type="url"],
input[type="search"], input[type="date"], input[type="datetime-local"], select, textarea {
  display: block; width: 100%; min-height: 44px; margin-bottom: 18px; padding: 9px 12px;
  font: 400 16px/1.4 var(--font-sans); color: var(--ink); background: var(--white);
  border: 1px solid var(--ink-50); border-radius: var(--radius-button);
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--ink); }
input[readonly] { background: var(--cream); }
.helptext, .help-text { display: block; color: var(--ink-60); font-size: 14px; margin: -12px 0 18px; }
label + .helptext { margin: -2px 0 8px; }
.errorlist { list-style: none; margin: 0 0 10px; padding: 8px 12px; background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-button); font-size: 15px; }
.errorlist.nonfield { margin-bottom: 18px; }
/* Django radio / checkbox groups */
main form div[id^="id_"] { display: grid; gap: 8px; margin-bottom: 18px; }
main form div[id^="id_"] > div > label {
  display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0;
  background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-button); padding: 10px 12px; cursor: pointer;
}
main form div[id^="id_"] > div > label:hover { border-color: var(--ink-50); }
input[type="radio"], input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex-shrink: 0; }
main form div:has(> input[type="checkbox"]) { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
main form div:has(> input[type="checkbox"]) > label { order: 2; flex: 1; font-weight: 400; margin: 0; }
main form div:has(> input[type="checkbox"]) > .errorlist { order: 3; flex-basis: 100%; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 8px; }
.form-actions .cancel { margin: 0; }
.copy-field { font-family: var(--font-mono); font-size: 14px; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; margin-bottom: 20px; }
.filters > div { flex: 1 1 12rem; max-width: 18rem; }
.filters input, .filters select { margin-bottom: 0; min-height: 40px; }
.filters label { font-size: 13px; color: var(--ink-60); }
.filters .choice { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; min-height: 40px; }
.filters .choice label { margin: 0; color: var(--ink); font-size: 15px; }
.filters button { min-height: 40px; }
.filter-note { margin: -8px 0 16px; }

.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-form select { width: auto; min-height: 36px; margin: 0; padding: 4px 8px; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 24px; }
.button-row form { margin: 0; }

/* ---------- Messages and notices ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.message, .notice {
  border: 1px solid var(--oat); border-left-width: 4px; background: var(--white); border-radius: var(--radius-button);
  padding: 12px 16px; max-width: var(--measure);
}
.message > :last-child, .notice > :last-child { margin-bottom: 0; }
.message-success { border-left-color: var(--green); }
.message-info { border-left-color: var(--blue); }
.message-warning, .message-error { border-left-color: var(--orange); background: var(--orange-bg); }
.notice { border-left-color: var(--orange); background: var(--orange-bg); color: var(--ink); margin-bottom: 24px; }
.notice-info { border-left-color: var(--blue); background: var(--blue-bg); }
.review-note { border: 1px dashed var(--orange); background: var(--orange-bg); padding: 10px 14px; border-radius: var(--radius-button); font-size: 14px; margin: 0 0 1rem; max-width: var(--measure); }
.review-note::before { content: "For legal review: "; font-weight: 600; }
.missing { background: var(--orange-bg); color: var(--orange-ink); border: 1px dashed var(--orange); padding: 0 0.3em; border-radius: 4px; font-family: var(--font-mono); font-size: 0.85em; }

/* ---------- Lists ---------- */
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 12px 20px; border-bottom: 1px solid var(--oat); }
.plain li:last-child { border-bottom: 0; }
.panel-body .plain li { padding-inline: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--oat); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--ink-50);
}
.checklist li.done::before { border-color: var(--green); background: var(--green) url("../icons/check.d282aa6a7fe5.svg") center/16px no-repeat; }
.checklist li.done { color: var(--ink-60); }
.checklist .step-body { flex: 1; }
.checklist .step-body .meta { display: block; margin-top: 2px; }
.contact-list { list-style: none; padding: 0; max-width: var(--measure); }
.contact-list li { padding: 16px 0; border-bottom: 1px solid var(--oat); }
.contact-list strong { display: block; font-weight: 500; }

/* ---------- Documents ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.25rem; }
.prose li { margin-bottom: 0.4rem; }
.document { max-width: var(--measure); background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 8px 28px 16px; margin-bottom: 24px; }
.document h2:first-child { margin-top: 1.25rem; }
pre.json { background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 14px 16px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; max-width: var(--measure); }
.pagination { display: flex; gap: 16px; align-items: center; margin: 0 0 24px; font-size: 15px; }

/* ---------- Public pages ---------- */
.hero { padding: 24px 0 8px; }
@media (min-width: 900px) { .hero { padding: 48px 0 24px; } }
.hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1; letter-spacing: -0.035em; max-width: 16ch; margin-bottom: 24px; }
.hero .lead { font-size: clamp(17px, 1.1rem + 0.3vw, 21px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.section { padding-top: 24px; }
.steps { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); counter-reset: step; }
.steps li { background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 24px; counter-increment: step; }
.steps li::before { content: "0" counter(step); display: block; font: 500 12px/1 var(--font-mono); letter-spacing: 0.08em; color: var(--blue); margin-bottom: 18px; }
.steps h3 { margin: 0 0 8px; font-size: 21px; font-weight: 400; letter-spacing: -0.02em; }
.steps p { margin: 0; color: var(--ink-80); }

/* Sign-in and other single-purpose pages */
.auth { padding-block: 48px 72px; }
@media (min-width: 640px) { .auth { padding-block: 80px 96px; } }
.auth-card { max-width: 30rem; margin: 0 auto; background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 32px 28px; }
@media (min-width: 640px) { .auth-card { padding: 40px; } }
.auth-card h1 { font-size: 32px; margin-bottom: 12px; }
.auth-card .lead { font-size: 17px; }
.auth-card form { max-width: none; }
.stack { display: grid; gap: 10px; margin: 24px 0 16px; }
.stack form { margin: 0; }

/* ---------- Footers ---------- */
.site-footer { background: var(--ink); color: #9c9fa5; padding: 56px 0 32px; margin-top: 48px; }
@media (min-width: 900px) { .site-footer { padding: 72px 0 40px; } }
.site-footer a { color: #d3cec6; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; } }
.footer-brand img { height: 28px; width: auto; filter: invert(1) brightness(2); }
.footer-brand p { color: var(--white); font-size: 18px; line-height: 1.35; letter-spacing: -0.01em; max-width: 22rem; margin: 16px 0 0; }
.footer-col-title { color: #7ea2ff; margin: 0 0 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-bottom { border-top: 1px solid var(--ink-80); margin-top: 40px; padding-top: 20px; font-size: 13px; font-weight: 300; line-height: 1.5; }
.site-footer .missing { background: transparent; color: #ffb48f; border-color: #8a3a14; }
.app-footer { border-top: 1px solid var(--oat); padding: 20px 0; font-size: 13px; color: var(--ink-60); }
.app-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.app-footer ul { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0; padding: 0; }
.app-footer a { color: var(--ink-60); }
.button-danger-outline, button.button-danger-outline { background: transparent; color: var(--danger); border-color: var(--danger); }
.button-danger-outline:hover, button.button-danger-outline:hover { background: var(--danger); color: var(--white); }
.empty { color: var(--ink-60); }
.console-mobile-nav { margin: 0 0 24px; }
.spaced { margin-top: 32px; }
.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0 0 8px; background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-button); padding: 12px 14px; cursor: pointer; }
.choice:hover { border-color: var(--ink-50); }
.auth-card .eyebrow { margin-bottom: 12px; }
.auth-card .notice, .auth-card .message { max-width: none; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }

/* Fixes after visual review */
.table-scroll { position: relative; }   /* keeps visually-hidden header text inside the scroller */
.menu-panel button { justify-content: flex-start; }
.brand img { height: 19px; }   /* trimmed wordmark; same visual size as www.simpleplainai.com */
@media (min-width: 640px) { .brand img { height: 22px; } }
.footer-brand img { height: 20px; }
.tag { white-space: nowrap; }
.topbar-inner { gap: 12px; }
@media (min-width: 640px) { .topbar-inner { gap: 12px 24px; } }
@media (max-width: 479px) { .topbar-cta { display: none; } }

/* Client dashboard: one card per service (customer/modules.py) */
.section-tight { margin: 0 0 28px; }
.section-title { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 12px; }
.service-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.service-card { display: flex; flex-direction: column; gap: 10px; background: var(--white); border: 1px solid var(--oat); border-radius: var(--radius-card); padding: 20px; min-width: 0; }
.service-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.service-card h3 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.service-card p { margin: 0; color: var(--ink-80); }
.service-card .plain { margin: 0; overflow-wrap: anywhere; }
.service-card-link { margin-top: auto; font-weight: 500; }
.service-card.is-soon { background: transparent; border-style: dashed; }
.service-card.is-soon h3, .service-card.is-soon p { color: var(--ink-60); }
.service-card .plain li { padding: 8px 0; }
