/* Closeout — 2026 pivot
   Night-band hero, live-set Bricolage headline, organic marketing grid, real dark theme.
   Type: Bricolage Grotesque (display) · Hanken Grotesk (body) · JetBrains Mono (data). */

@font-face {
  font-family: "Bricolage Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 103%;
  ascent-override: 93%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Hanken Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 97%;
  ascent-override: 100%;
  descent-override: 26%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "JetBrains Fallback";
  src: local("Courier New"), local("Menlo");
  size-adjust: 101%;
  ascent-override: 102%;
  descent-override: 30%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light dark;

  --bg: #f2f3f1;
  --surface: #ffffff;
  --surface-2: #f7f8f7;
  --ink: #171f26;
  --muted: #52606b;
  --border: #d9ddd8;
  --border-strong: #bfc7c2;
  --heading: #2f4658;
  --brand: #2f4658;
  --brand-2: #5c8199;
  --brand-soft: #e7edf1;
  --link: #2f5f7e;
  --link-hover: #171f26;
  --accent: #e2781c;
  --accent-text: #a14e0b;

  --btn-bg: #2f4658;
  --btn-fg: #f7f9fa;
  --btn-hover: #233747;
  --on-status: #ffffff;
  --btn-danger: #b42318;
  --btn-warn: #8a5a00;
  --btn-ok: #1f7a52;

  --ok: #1c6b48;   --ok-bg: #e6f4ec;   --ok-bd: #b5dcc6;
  --warn: #7a4f00; --warn-bg: #fdf4dc; --warn-bd: #efd8a0;
  --danger: #a4271c; --danger-bg: #fdecea; --danger-bd: #f3c1bb;
  --info: #1f5a85; --info-bg: #e7f1f9; --info-bd: #b9d4ea;
  --neutral: #4d5a64; --neutral-bg: #eef0ee; --neutral-bd: #d5dad6;

  --ring: #2f5f7e;
  --ring-halo: rgba(47, 95, 126, 0.22);
  --field-bg: #fbfcfb;
  --drop-bg: #f5f7f8;
  --drop-bd: #a9b4bb;
  --strip-bg: #1b2a36;
  --strip-fg: #e8eef2;
  --arch: #2f4658;
  --backdrop: rgba(18, 25, 31, 0.5);

  --night-a: #1b2a36;
  --night-b: #12191f;
  --night-ink: #e8eef2;
  --night-link: #9ec0d6;
  --night-accent: #f0964a;
  --night-muted: #b9c6cf;
  --night-card: #1b242b;
  --night-line: rgba(232, 238, 242, 0.12);
  --grid-line: rgba(232, 238, 242, 0.06);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shoulder: 30px 12px 12px 12px;
  --shadow: 0 1px 2px rgba(23, 31, 38, 0.05), 0 4px 14px rgba(23, 31, 38, 0.05);
  --shadow-md: 0 1px 2px rgba(23, 31, 38, 0.06), 0 6px 16px rgba(23, 31, 38, 0.06), 0 18px 40px rgba(23, 31, 38, 0.08);
  --shadow-lift: 0 2px 4px rgba(8, 12, 16, 0.18), 0 16px 32px rgba(8, 12, 16, 0.28), 0 40px 80px rgba(8, 12, 16, 0.3);

  --touch: 44px;
  --font: "Hanken Grotesk", "Hanken Fallback", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "Bricolage Fallback", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "JetBrains Fallback", ui-monospace, monospace;
  --max: 1160px;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --seam: 64px;
}

@media (min-width: 760px) {
  :root { --gutter: 24px; }
}
@media (max-width: 759px) {
  :root { --seam: 40px; }
}

[data-theme="dark"] {
  --bg: #12191f;
  --surface: #1b242b;
  --surface-2: #20272c;
  --ink: #e8eef2;
  --muted: #a7b4bd;
  --border: rgba(232, 238, 242, 0.1);
  --border-strong: rgba(232, 238, 242, 0.22);
  --heading: #e8eef2;
  --brand: #9ec0d6;
  --brand-2: #9ec0d6;
  --brand-soft: rgba(158, 192, 214, 0.1);
  --link: #9ec0d6;
  --link-hover: #e8eef2;
  --accent-text: #f0964a;

  --btn-bg: #9ec0d6;
  --btn-fg: #171f26;
  --btn-hover: #b8d3e4;
  --on-status: #171f26;
  --btn-danger: #f08a80;
  --btn-warn: #f0c060;
  --btn-ok: #7ed3b2;

  --ok: #7ed3b2;   --ok-bg: rgba(126, 211, 178, 0.1);  --ok-bd: rgba(126, 211, 178, 0.38);
  --warn: #f0c060; --warn-bg: rgba(240, 192, 96, 0.1); --warn-bd: rgba(240, 192, 96, 0.38);
  --danger: #f08a80; --danger-bg: rgba(240, 138, 128, 0.1); --danger-bd: rgba(240, 138, 128, 0.38);
  --info: #8fd0ff; --info-bg: rgba(143, 208, 255, 0.1); --info-bd: rgba(143, 208, 255, 0.38);
  --neutral: #a7b4bd; --neutral-bg: rgba(232, 238, 242, 0.05); --neutral-bd: rgba(232, 238, 242, 0.2);

  --ring: #9ec0d6;
  --ring-halo: rgba(158, 192, 214, 0.28);
  --field-bg: #20272c;
  --drop-bg: #20272c;
  --drop-bd: rgba(232, 238, 242, 0.25);
  --strip-bg: #1b242b;
  --strip-fg: #e8eef2;
  --arch: #e8eef2;
  --backdrop: rgba(5, 8, 10, 0.66);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.28), 0 20px 44px rgba(0, 0, 0, 0.26);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100dvh;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--heading);
  text-wrap: balance;
}
p, li { text-wrap: pretty; }

a { color: var(--link); font-weight: 600; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
img, svg { max-width: 100%; }

/* ——— Focus: ring grows in 120ms ——— */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
  animation: ring-grow 120ms var(--ease);
}
@keyframes ring-grow {
  from { outline-offset: 0; outline-color: transparent; }
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 1rem;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 12px; color: var(--btn-fg); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ——— Brand mark ——— */
.mark { display: block; flex: 0 0 auto; overflow: visible; }
.mark .mark-arch { fill: var(--arch); }
.mark .mark-key { fill: #e2781c; transform-box: fill-box; }
.on-night .mark .mark-arch { fill: #e8eef2; }
.mark.is-dropping .mark-key { animation: key-drop 420ms cubic-bezier(0.3, 1.35, 0.55, 1) both; }
@keyframes key-drop {
  from { transform: translateY(-18px); opacity: 0; }
  40% { opacity: 1; }
  to { transform: translateY(0); }
}

/* ——— Theme toggle ——— */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  flex: 0 0 auto;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.theme-toggle:hover { background: var(--brand-soft); }
.theme-toggle svg { transition: transform 260ms var(--ease); }
.theme-toggle[aria-pressed="true"] svg { transform: rotate(180deg); }
.on-night .theme-toggle { color: var(--night-ink); border-color: rgba(232, 238, 242, 0.3); }
.on-night .theme-toggle:hover { background: rgba(232, 238, 242, 0.08); }

/* ——— Status strips (app + auth + upload) ——— */
.sample-banner {
  background: var(--strip-bg);
  color: var(--strip-fg);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.55rem var(--gutter);
  border-bottom: 1px solid var(--border);
}
.sample-banner span { font-weight: 400; opacity: 0.92; }

.compliance-banner {
  background: var(--warn-bg);
  color: var(--warn);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem var(--gutter);
  border-bottom: 1px solid var(--warn-bd);
}

.top-links {
  margin: 0;
  padding: 0.25rem var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  align-items: center;
}
.top-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.25rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--link);
}
.top-links a:hover { text-decoration: underline; }
.top-links .theme-toggle { margin-left: 0.25rem; }

.coming-soon-chip {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: var(--brand-soft);
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ——— App header ——— */
.app-header {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.85rem;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem var(--gutter) 0.9rem;
}
.app-header > .mark { grid-row: span 2; width: 40px; height: 40px; }
.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 32;
}
.app-header .sub { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.94rem; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.5rem var(--gutter);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--touch);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.nav-link:hover { background: var(--brand-soft); color: var(--ink); }
.nav-link.active { background: var(--btn-bg); color: var(--btn-fg); }
.nav-link .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #171f26;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}
.nav-link .badge[hidden] { display: none; }
.nav-link.active .badge { background: var(--btn-fg); color: var(--btn-bg); }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 3rem;
}

/* ——— Views + motion on functional moments only ——— */
.view[hidden] { display: none !important; }
.view:not([hidden]),
.upload-shell > [id^="panel-"]:not([hidden]) { animation: rise-in 200ms var(--ease) both; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(6px); }
}

.view-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.35rem;
}
h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-variation-settings: "opsz" 32;
}
h3 { font-weight: 700; letter-spacing: -0.015em; font-variation-settings: "opsz" 24; }
.lead { color: var(--muted); margin: 0 0 1rem; font-size: 1.02rem; line-height: 1.6; }
.muted { color: var(--muted); }
.stat {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin: 0.65rem 0;
}
.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ——— Buttons ——— */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch);
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(23, 31, 38, 0.14), 0 4px 12px rgba(23, 31, 38, 0.1);
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 90ms var(--ease);
}
.btn:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:focus-visible { box-shadow: 0 0 0 5px var(--ring-halo); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.btn-danger, .btn-danger:hover { background: var(--btn-danger); color: var(--on-status); box-shadow: none; }
.btn-warn, .btn-warn:hover { background: var(--btn-warn); color: var(--on-status); box-shadow: none; }
.btn-ok, .btn-ok:hover { background: var(--btn-ok); color: var(--on-status); box-shadow: none; }
.btn-danger:hover, .btn-warn:hover, .btn-ok:hover { filter: brightness(1.06); }
.btn-sm { min-height: 36px; padding: 0.35rem 0.8rem; font-size: 0.875rem; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.85rem 0;
}

/* In-button busy ring while the upload submits */
#btn-submit:disabled { opacity: 1; background: var(--btn-hover); }
#btn-submit:disabled::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Drawn success checkmark (inserted by dp.js) */
.dp-check { display: block; width: 52px; height: 52px; margin: 0 0 0.75rem; }
.dp-check circle { fill: var(--ok-bg); stroke: var(--ok); stroke-width: 2; }
.dp-check path {
  fill: none;
  stroke: var(--ok);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 420ms 120ms var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ——— Pills ——— */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--neutral-bd);
  background: var(--neutral-bg);
  color: var(--neutral);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill-missing, .pill-incomplete { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.pill-submitted { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }
.pill-revision_requested { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.pill-accepted, .pill-complete { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.pill-archived { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-bd); }
.pill-active { background: var(--brand-soft); color: var(--heading); border-color: var(--border-strong); }

.progress {
  height: 8px;
  background: var(--brand-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.45rem 0;
}
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ——— Tables ——— */
table.data { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
table.data th,
table.data td {
  padding: 0.75rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 600;
}
table.data tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ——— Toast / modal ——— */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 600;
  z-index: 200;
  max-width: calc(100vw - 2 * var(--gutter));
  box-shadow: var(--shadow-md);
  animation: toast-in 200ms var(--ease) both;
}
.toast[hidden] { display: none !important; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: var(--gutter);
  animation: fade-in 200ms var(--ease) both;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  animation: rise-in 200ms var(--ease) both;
}
@keyframes fade-in { from { opacity: 0; } }
.modal h3 { margin: 0 0 0.75rem; font-size: 1.2rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.preview-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ——— Fields ——— */
.field {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0.85rem 0 0.35rem;
  color: var(--ink);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  background: var(--field-bg);
  color: var(--ink);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 4px var(--ring-halo);
  outline-offset: 1px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 96px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); cursor: not-allowed; }

.dropzone {
  border: 2px dashed var(--drop-bd);
  border-radius: var(--radius);
  padding: 1.6rem 1rem;
  text-align: center;
  background: var(--drop-bg);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), transform 150ms var(--ease);
}
.dropzone .muted { font-weight: 400; font-size: 0.875rem; }
.dropzone:hover { border-color: var(--brand-2); }
.dropzone.dragover { border-color: var(--accent); transform: scale(1.01); }

.upload-shell {
  max-width: 540px;
  margin: 1.5rem auto 3rem;
  padding: 0 var(--gutter);
}
.upload-shell .app-header {
  grid-template-columns: 1fr;
  row-gap: 0.65rem;
  justify-items: start;
  padding: 1.35rem 1.25rem 1.1rem;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.upload-shell .app-header > .mark { grid-row: auto; width: 48px; height: 48px; }

/* ——— App footer ——— */
.footer-demo {
  margin-top: 2rem;
  padding: 1.25rem var(--gutter) 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.6;
}
.footer-demo > .mark { display: inline-block; vertical-align: -5px; margin-right: 0.4rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.85rem 0; }
.chip {
  min-height: 36px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease), transform 90ms var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--ink); }
.chip:active { transform: scale(0.985); }
.chip.active { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }

.missing-list { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--warn); font-size: 0.9rem; }
.revision-form textarea { margin-top: 0.35rem; }

.card ul { margin: 0; padding-left: 1.15rem; }
.card ul li { margin: 0.35rem 0; }

/* ——— Marketing nav (auth pages on ground, marketing on night band) ——— */
.mkt-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  padding: 0.5rem var(--gutter);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.mkt-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
}
.mkt-nav a:hover,
.mkt-nav a[aria-current="page"] { color: var(--ink); background: var(--brand-soft); }
.mkt-nav .brand {
  margin-right: auto;
  gap: 0.5rem;
  padding-left: 0.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.035em;
  color: var(--heading);
  font-variation-settings: "opsz" 32;
}
.mkt-nav .brand:hover { background: transparent; color: var(--heading); }
.mkt-nav .coming-soon-chip { margin-left: 0.25rem; }

/* ——— Night band ——— */
.night {
  position: relative;
  color: var(--night-ink);
  background: linear-gradient(160deg, var(--night-a) 0%, var(--night-b) 100%);
  overflow: clip;
}
.night a:not(.btn) { color: var(--night-link); }
.night a:not(.btn):hover { color: var(--night-ink); }
.night h1, .night h2, .night h3 { color: var(--night-ink); }

.night-hero {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(160deg, var(--night-a) 0%, var(--night-b) 100%);
  padding-bottom: calc(var(--seam) + 2.5rem);
  -webkit-mask:
    linear-gradient(#000, #000) top / 100% calc(100% - var(--seam) + 1px) no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 64' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1000V10C860 10 760 64 620 64C440 64 200 22 0 18Z'/%3E%3C/svg%3E") bottom / 100% var(--seam) no-repeat;
  mask:
    linear-gradient(#000, #000) top / 100% calc(100% - var(--seam) + 1px) no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 64' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1000V10C860 10 760 64 620 64C440 64 200 22 0 18Z'/%3E%3C/svg%3E") bottom / 100% var(--seam) no-repeat;
}

.seam-top {
  padding-top: calc(var(--seam) + 2.5rem);
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 64' preserveAspectRatio='none'%3E%3Cpath d='M0 18C200 22 440 64 620 64C760 64 860 10 1000 10V64H0Z'/%3E%3C/svg%3E") top / 100% var(--seam) no-repeat,
    linear-gradient(#000, #000) bottom / 100% calc(100% - var(--seam) + 1px) no-repeat;
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 64' preserveAspectRatio='none'%3E%3Cpath d='M0 18C200 22 440 64 620 64C760 64 860 10 1000 10V64H0Z'/%3E%3C/svg%3E") top / 100% var(--seam) no-repeat,
    linear-gradient(#000, #000) bottom / 100% calc(100% - var(--seam) + 1px) no-repeat;
}

.notice-rail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  padding: 0.55rem var(--gutter);
  border-bottom: 1px solid var(--night-line);
  font-size: 0.8rem;
  color: var(--night-muted);
  text-align: center;
}
.notice-rail p { margin: 0; }
.notice-rail .notice-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--night-accent);
  letter-spacing: 0.02em;
}
.notice-rail .notice-compliance { color: var(--night-ink); font-weight: 600; }

.night .mkt-nav {
  max-width: var(--max);
  margin: 0 auto;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  padding: 0.75rem var(--gutter);
}
.night .mkt-nav a { color: var(--night-ink); }
.night .mkt-nav a:hover,
.night .mkt-nav a[aria-current="page"] { background: rgba(232, 238, 242, 0.08); color: var(--night-ink); }
.night .mkt-nav .brand { color: var(--night-ink); }
.night .mkt-nav .brand:hover { background: transparent; }
.night .coming-soon-chip {
  background: rgba(232, 238, 242, 0.06);
  border-color: rgba(232, 238, 242, 0.28);
  color: var(--night-ink);
}

.hero-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 0;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 1000px) {
  .hero-wrap { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; padding-top: 2.5rem; }
  .hero-visual { margin-right: -64px; }
}

.hero-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  animation: mark-in 320ms var(--ease) both;
}
@media (min-width: 760px) { .hero-mark { width: 96px; height: 96px; } }
@keyframes mark-in { from { opacity: 0; transform: scale(1.04); } }

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--night-accent);
  border: 1px solid rgba(240, 150, 74, 0.4);
  background: rgba(240, 150, 74, 0.08);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

/* Live-set headline */
.kinetic {
  margin: 0.9rem 0 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.4vw, 4.9rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-optical-sizing: none;
  font-variation-settings: "opsz" 96, "wdth" 100, "wght" 800;
  color: var(--night-ink);
  max-width: 14ch;
  min-height: 3.92em;
  text-wrap: balance;
}
@media (min-width: 760px) { .kinetic { min-height: 2.94em; } }
.kinetic.kinetic-short { min-height: 1.96em; max-width: 12ch; }
@media (min-width: 1000px) { .kinetic.kinetic-short { min-height: 0.98em; max-width: none; } }
.kinetic .w { display: inline-grid; vertical-align: top; }
.kinetic .w > span { grid-area: 1 / 1; }
.kinetic .w-ghost { visibility: hidden; }
.kinetic .em { color: var(--night-link); }
@media (prefers-reduced-motion: no-preference) {
  .kinetic .w-live {
    opacity: 0;
    transform: translateY(14px);
    font-variation-settings: "opsz" 96, "wdth" 88, "wght" 500;
    animation: word-set 700ms var(--ease) forwards;
    animation-delay: calc(var(--i) * 45ms);
  }
}
@keyframes word-set {
  to {
    opacity: 1;
    transform: translateY(0);
    font-variation-settings: "opsz" 96, "wdth" 100, "wght" 800;
  }
}

.night .lead { color: var(--night-muted); font-size: 1.1rem; max-width: 36rem; }
.night .lead strong { color: var(--night-ink); }

.night .btn { background: #9ec0d6; color: #171f26; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 22px rgba(0, 0, 0, 0.28); }
.night .btn:hover { background: #b8d3e4; color: #171f26; }
.night .btn-ghost,
.night .btn-ghost:hover {
  background: transparent;
  color: var(--night-ink);
  border: 1px solid var(--night-ink);
  box-shadow: none;
}
.night .btn-ghost:hover { background: rgba(232, 238, 242, 0.08); }
.night .btn:focus-visible { outline-color: var(--night-ink); box-shadow: 0 0 0 5px rgba(232, 238, 242, 0.2); }
.night :focus-visible { outline-color: var(--night-ink); }

.trust-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
}
.trust-rail li {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--night-ink);
  background: rgba(232, 238, 242, 0.06);
  border: 1px solid rgba(232, 238, 242, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

/* Binder mock (keeps its tilt) */
.hero-visual { margin: 0; }
.binder-mock {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  transform: rotate(-1.6deg);
}
.binder-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 18px;
  background:
    repeating-linear-gradient(180deg, #171f26 0 10px, #2f4658 10px 14px, transparent 14px 28px),
    #2f4658;
}
.binder-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.75rem 0.75rem 0 1.6rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.binder-tab {
  padding: 0.45rem 0.7rem;
  border-radius: 8px 8px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.binder-tab.on {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-color: var(--surface);
  margin-bottom: -1px;
}
.binder-body { padding: 0.85rem 1.1rem 1rem 1.75rem; }
.binder-row {
  display: grid;
  grid-template-columns: 1.3fr auto 0.8fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.binder-row:last-child { border-bottom: 0; }
.binder-row strong { color: var(--ink); }
.binder-row .muted { font-size: 0.85rem; }
.binder-caption {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--night-muted);
}

/* ——— Organic marketing sections ——— */
.mkt-section {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem var(--gutter);
}
.mkt-section > * { position: relative; z-index: 1; }
.mkt-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 0.4rem;
}
.night .mkt-kicker { color: var(--night-accent); }
.section-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variation-settings: "opsz" 64;
  max-width: 22ch;
}

.org-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .org-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (min-width: 1000px) {
  .org-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
  .org-grid > .s7 { grid-column: span 7; }
  .org-grid > .s5 { grid-column: span 5; }
  .org-grid > :first-child { margin-top: 28px; }
}

.o-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--shoulder);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.o-card h3 { margin: 0 0 0.6rem; font-size: 1.25rem; }
.o-card p { margin: 0; color: var(--muted); }
.o-card ul { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.o-card li { margin: 0.4rem 0; }
.o-card li::marker { color: var(--accent); }
.o-card-quiet { background: var(--surface-2); box-shadow: none; }

.band { padding-bottom: 3.5rem; }
.band .mkt-section { padding-top: 0; padding-bottom: 0; }
.band .o-card {
  background: var(--night-card);
  border-color: var(--night-line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 28px rgba(0, 0, 0, 0.22);
}
.band .o-card h3 { color: var(--night-ink); }
.band .o-card p { color: var(--night-muted); }
.band .o-card .stage {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--night-link);
}

.closing { overflow: clip; }
.closing::before {
  content: "";
  position: absolute;
  z-index: 0;
  right: -6%;
  top: 50%;
  width: min(560px, 80vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: #2f4658;
  opacity: 0.05;
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M6 54L6 36A26 26 0 0 1 19.254 13.339L23.153 27.892A12 12 0 0 0 20 36L20 54ZM44.746 13.339A26 26 0 0 1 58 36L58 54L44 54L44 36A12 12 0 0 0 40.847 27.892Z'/%3E%3Cpath d='M22.937 11.631A26 26 0 0 1 41.063 11.631L37.404 25.286A12 12 0 0 0 26.596 25.286Z'/%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 64 64'%3E%3Cpath d='M6 54L6 36A26 26 0 0 1 19.254 13.339L23.153 27.892A12 12 0 0 0 20 36L20 54ZM44.746 13.339A26 26 0 0 1 58 36L58 54L44 54L44 36A12 12 0 0 0 40.847 27.892Z'/%3E%3Cpath d='M22.937 11.631A26 26 0 0 1 41.063 11.631L37.404 25.286A12 12 0 0 0 26.596 25.286Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ladder-inline {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.text-link-row { margin: 1rem 0 0; }

.soft-offer {
  padding: 1rem 1.2rem;
  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.94rem;
}
.soft-offer strong { font-weight: 750; }

/* ——— Site footer (marketing) ——— */
.site-footer { margin-top: 1rem; padding-bottom: 2rem; }
.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.035em;
  color: var(--night-ink);
  font-variation-settings: "opsz" 32;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0 0.5rem; margin: 0; padding: 0; list-style: none; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.5rem;
  margin-left: -0.5rem;
  margin-right: 0.5rem;
}
.footer-legal {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--night-line);
  color: var(--night-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ——— Pricing ladder: straight, gridded ——— */
.pricing-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pricing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: var(--shadow);
}
.price-card.featured { border-color: var(--brand); box-shadow: var(--shadow-md), 0 0 0 1px var(--brand); }
.price-card .tier-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.price-card .amount {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0.45rem 0 0.1rem;
  color: var(--heading);
  font-variation-settings: "opsz" 48;
  font-variant-numeric: tabular-nums;
}
.price-card .rec-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.price-card ul { margin: 0.9rem 0 0; padding: 0.9rem 0 0; list-style: none; flex: 1; border-top: 1px solid var(--border); }
.price-card li { position: relative; padding: 0.3rem 0 0.3rem 1.1rem; color: var(--muted); font-size: 0.94rem; }
.price-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8rem;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

/* ——— Auth pages ——— */
.auth-shell { max-width: 460px; margin: 2.5rem auto 4rem; padding: 0 var(--gutter); }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--shoulder);
  box-shadow: var(--shadow-md);
  padding: 1.75rem 1.5rem;
}
.auth-card > .mark { width: 48px; height: 48px; margin-bottom: 1rem; }
.auth-card h1 {
  margin: 0.2rem 0 0.75rem;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-variation-settings: "opsz" 48;
}
.preview-banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  margin: 0 0 1.2rem;
}
.auth-field { margin: 0 0 1rem; }
.auth-field label { display: block; font-size: 0.875rem; font-weight: 700; margin-bottom: 0.35rem; }
.auth-note { margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }
.auth-note a { display: inline-flex; align-items: center; min-height: var(--touch); }
.auth-error,
.auth-card [role="alert"] {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-bd);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  animation: shake 320ms var(--ease);
}
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.plan-grid { display: grid; gap: 0.65rem; margin-top: 1rem; }
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--surface-2);
}

@media (max-width: 640px) {
  .binder-row { grid-template-columns: 1fr auto; }
  .binder-row > span.muted { grid-column: 1 / -1; margin-top: -0.4rem; }
  .card-row { flex-direction: column; }
}
@media (max-width: 759px) {
  .org-grid > * { margin-top: 0 !important; }
  .binder-mock { transform: rotate(-1deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  #btn-submit:disabled::before { animation: none; border-right-color: currentColor; opacity: 0.6; }
}
