/* VVDex Agent — private portal. Design system: "Daylight".
   Light, premium, quiet. Depth comes from layered shadow and a soft mesh wash,
   not from drawing a box around everything.
   Constraint: portal CSP is default-src 'none'; style-src 'self'; img-src 'self'.
   No JavaScript, no webfonts, no data: URIs, no inline style attributes.
   Everything here is plain CSS; all graphics are inline SVG. */

:root {
  color-scheme: light;

  /* Surface ladder — warm near-white canvas, pure white for things that float. */
  --paper: #fbfbf9;
  --surface: #ffffff;
  --sunk: #f5f6f3;
  --wash: #f0f2ec;

  /* Ink ladder */
  --ink: #14161a;
  --ink-2: #3f454c;
  --muted: #6d7480;
  --faint: #9aa1aa;

  /* Hairlines — never heavier than they need to be. */
  --line: rgba(20, 22, 26, .08);
  --line-2: rgba(20, 22, 26, .14);

  /* Accent: deep forest, the olive heritage taken to full depth.
     Lime survives only as a live-state dot. */
  --accent: #2f4a33;
  --accent-soft: #eef3ea;
  --accent-line: rgba(47, 74, 51, .22);
  --live: #5fbd54;

  --danger: #a8352a;
  --danger-soft: #fdf1ef;

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;

  /* Three shadow steps. Everything picks one; nothing invents its own. */
  --sh-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --sh-2: 0 2px 4px -2px rgba(16, 24, 40, .05), 0 10px 26px -6px rgba(16, 24, 40, .09);
  --sh-3: 0 10px 20px -8px rgba(16, 24, 40, .1), 0 30px 60px -18px rgba(16, 24, 40, .18);
  --ring: 0 0 0 3.5px rgba(47, 74, 51, .12);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { position: relative; margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--paper); }

/* Mesh wash: three wide, pale blooms. This is the only colour on most pages. */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(251, 251, 249, 0) 38%, var(--paper) 86%);
}
.aurora i { position: absolute; display: block; border-radius: 50%; filter: blur(80px); }
.aurora i:nth-child(1) {
  top: -26vh; left: 42%; width: 66vw; height: 52vw; max-width: 980px; max-height: 760px;
  background: radial-gradient(circle, rgba(129, 176, 122, .3), transparent 68%);
  animation: drift-a 40s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  top: -20vh; left: -16vw; width: 54vw; height: 46vw; max-width: 820px; max-height: 700px;
  background: radial-gradient(circle, rgba(168, 184, 208, .26), transparent 68%);
  animation: drift-b 52s ease-in-out infinite alternate;
}
@keyframes drift-a { from { transform: translate3d(-6%, 0, 0) scale(1); } to { transform: translate3d(8%, 5%, 0) scale(1.12); } }
@keyframes drift-b { from { transform: translate3d(0, 0, 0) scale(1.06); } to { transform: translate3d(12%, 8%, 0) scale(.94); } }

.shell { position: relative; z-index: 1; width: min(1140px, calc(100% - 44px)); margin: 0 auto; }

a { color: var(--ink); text-decoration-color: rgba(20, 22, 26, .24); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
button, input, select, textarea { font: inherit; }
::selection { background: rgba(47, 74, 51, .14); }

/* ── Chrome ─────────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin: 0 -22px; padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 249, .78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: .96rem; letter-spacing: -.022em;
}
.mark {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px;
  color: #fff; background: var(--accent);
  box-shadow: var(--sh-1), 0 0 0 1px rgba(20, 22, 26, .06);
  font: 700 .8rem/1 var(--mono);
}
.nav { display: flex; align-items: center; gap: 2px; font-size: .875rem; }
.nav a {
  padding: 7px 11px; border-radius: var(--r-xs);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav .email {
  margin-left: 8px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font: .72rem/1.5 var(--mono);
}
.nav form { margin: 0; }
.link-button {
  border: 0; background: transparent; padding: 0;
  color: var(--muted); font-size: .875rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(20,22,26,.2);
  transition: color .15s ease;
}
.link-button:hover { color: var(--ink); }
.link-button.danger { color: var(--danger); text-decoration-color: rgba(168, 53, 42, .3); }

/* Label: a small capsule, not a shouting caps line. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font: 600 .705rem/1.5 var(--mono); letter-spacing: .07em; text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 3px rgba(95, 189, 84, .18);
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero { padding: clamp(52px, 8vw, 96px) 0 clamp(40px, 6vw, 68px); }
.hero-copy { max-width: 780px; margin: 0 auto; text-align: center; }
.hero h1 {
  margin: 22px 0 20px;
  font: 600 clamp(2.7rem, 6.2vw, 4.7rem)/1.04 var(--sans);
  letter-spacing: -.047em; color: var(--ink);
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  max-width: 560px; margin: 0 auto;
  color: var(--muted); font-size: clamp(1.03rem, 1.5vw, 1.16rem); line-height: 1.6;
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.page .actions, .auth .actions { justify-content: flex-start; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 19px;
  border: 1px solid var(--ink); border-radius: var(--r-sm);
  color: #fff; background: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, var(--sh-2);
  font-weight: 560; font-size: .92rem; letter-spacing: -.008em;
  text-decoration: none; cursor: pointer;
  transition: transform .14s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { background: #22262c; transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, var(--sh-3); }
.button:active { transform: translateY(0); box-shadow: var(--sh-1); }
.button.secondary {
  color: var(--ink); background: var(--surface); border-color: var(--line-2);
  box-shadow: var(--sh-1);
}
.button.secondary:hover { background: var(--surface); border-color: var(--accent-line); box-shadow: var(--sh-2); }
.button.small { min-height: 34px; padding: 0 13px; border-radius: var(--r-xs); font-size: .855rem; }

/* Hero artwork: the real overlay, floating over a light desktop. */
.hero-art {
  position: relative;
  margin: clamp(38px, 6vw, 62px) auto 0;
  max-width: 1000px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.hero-art svg { display: block; width: 100%; height: auto; }
.hero-art figcaption {
  display: flex; flex-wrap: wrap; gap: 6px 26px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted); font-size: .82rem;
}
.hero-art figcaption b { color: var(--ink); font-weight: 560; }

@keyframes pulse-dot { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes caret { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes sweep { from { transform: translateX(-26%); } to { transform: translateX(128%); } }
.art-dot { animation: pulse-dot 2.4s ease-in-out infinite; transform-origin: center; }
.art-caret { animation: caret 1.1s step-end infinite; }
.art-sweep { animation: sweep 8s cubic-bezier(.4, 0, .2, 1) infinite; }

/* ── Surfaces ───────────────────────────────────────────────────────── */

.principles, .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.principles { margin-bottom: 22px; }

.card {
  position: relative; min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: box-shadow .22s ease, border-color .22s ease, transform .22s ease;
}
.principles .card:hover, .grid .card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.card h2, .card h3 {
  margin: 12px 0 8px;
  font: 600 1.16rem/1.32 var(--sans); letter-spacing: -.024em; color: var(--ink);
}
.card h2 small { color: var(--muted); font: .82rem/1 var(--mono); font-weight: 400; }
.card p { margin: 0; color: var(--muted); font-size: .935rem; }
.number {
  display: inline-grid; place-items: center; width: 27px; height: 27px;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  background: var(--sunk); color: var(--accent);
  font: 600 .715rem/1 var(--mono);
}

/* ── Page frame ─────────────────────────────────────────────────────── */

.page { padding: clamp(36px, 5vw, 58px) 0 96px; }
.page-head { max-width: 720px; margin-bottom: 34px; }
.page h1 {
  margin: 18px 0 13px;
  font: 600 clamp(2rem, 4.2vw, 3.05rem)/1.08 var(--sans); letter-spacing: -.042em;
}
.page-head p { color: var(--muted); font-size: 1.03rem; }
.stack { display: grid; gap: 16px; }

.release { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.release-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font: .82rem/1.6 var(--mono); }
.hash {
  display: block; margin-top: 16px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--sunk); color: var(--ink-2);
  font: .755rem/1.6 var(--mono); overflow-wrap: anywhere;
}
.token-value { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); user-select: all; }

.status { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: .83rem; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(95, 189, 84, .16); }
.status.bad { color: var(--danger); }
.status.bad::before { background: var(--danger); box-shadow: 0 0 0 3px rgba(168, 53, 42, .12); }

.guide { counter-reset: steps; }
.guide article { position: relative; padding-left: 74px; }
.guide article::before {
  counter-increment: steps; content: counter(steps, decimal-leading-zero);
  position: absolute; left: 26px; top: 28px;
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--accent-line); border-radius: var(--r-xs);
  background: var(--accent-soft); color: var(--accent);
  font: 600 .72rem/1 var(--mono);
}
.guide code, .card code {
  padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--sunk); color: var(--accent); font: .845em/1.5 var(--mono);
}

/* ── Auth ───────────────────────────────────────────────────────────── */

.auth {
  max-width: 436px; margin: clamp(40px, 8vh, 84px) auto;
  padding: 34px 32px 30px;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-3);
}
.auth h1 { font-size: 1.95rem; margin: 16px 0 8px; }
.auth > p { color: var(--muted); font-size: .94rem; }
.auth form { margin-top: 4px; }
.auth .button { width: 100%; margin-top: 6px; }

.field { display: grid; gap: 6px; margin: 15px 0; min-width: 0; }
.field label { color: var(--ink-2); font-weight: 550; font-size: .855rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  outline: none; box-shadow: var(--sh-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; line-height: 1.6; font-family: var(--mono); font-size: .875rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
.field select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }

.notice {
  margin: 18px 0; padding: 14px 16px;
  border: 1px solid var(--accent-line); border-left-width: 3px; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--ink-2);
}
.notice strong { display: block; color: var(--ink); }
.notice p { margin: 4px 0 0; font-size: .9rem; }
.notice.error { border-color: rgba(168, 53, 42, .3); background: var(--danger-soft); color: #7e2a21; }
.muted { color: var(--muted); font-size: .865rem; }
.danger { color: var(--danger); }
.spaced { margin-top: 20px; }
.auth-alt { margin-top: 22px; font-size: .9rem; }

/* ── Tables & records ───────────────────────────────────────────────── */

.access-create { display: grid; grid-template-columns: minmax(0, .85fr) minmax(320px, 1.15fr); gap: 36px; margin-bottom: 16px; }
.access-create form { display: grid; grid-template-columns: 1.5fr .7fr; gap: 0 12px; align-content: start; }
.access-create form .field:last-of-type { grid-column: 1 / -1; }
.access-create form .button { justify-self: start; grid-column: 1 / -1; margin-top: 6px; }
.access-table { margin-top: 16px; }
.table-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: var(--sunk); }
th { color: var(--faint); font: 600 .675rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
td small { display: block; color: var(--muted); font-size: .805rem; }
td strong { font-weight: 560; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--sunk); color: var(--ink-2);
  font: 600 .705rem/1.45 var(--mono); letter-spacing: .04em; text-transform: uppercase;
}
.pill.active, .pill.accepted { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pill.revoked, .pill.superseded { color: var(--danger); border-color: rgba(168, 53, 42, .26); background: var(--danger-soft); }

.footer {
  position: relative; z-index: 1;
  margin-top: 78px; padding: 26px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: .8rem;
}

/* ── Workspace: the instrument ──────────────────────────────────────── */

.workspace { display: grid; gap: 22px; }
.workspace .page-head { margin-bottom: 0; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; }
.section-head h2 {
  margin: 11px 0 0; max-width: 620px;
  font: 600 clamp(1.34rem, 2.2vw, 1.78rem)/1.18 var(--sans); letter-spacing: -.034em;
}
.section-head p { margin: 8px 0 0; }

.folder-grid, .setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.folder-card, .setup-card { min-width: 0; padding: 22px; }
.folder-head, .setup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.folder-head h2, .setup-head h2 { margin: 11px 0 0; font-size: 1.08rem; }
.setup-head p { margin: 5px 0 0; color: var(--muted); font-size: .865rem; }
.count {
  display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  background: var(--sunk); color: var(--ink-2);
  font: 600 .79rem/1 var(--mono);
}

.records { display: grid; gap: 6px; margin-top: 18px; }
.record {
  min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.record:hover { border-color: var(--line-2); box-shadow: var(--sh-1); }
.record[open] { border-color: var(--accent-line); box-shadow: var(--sh-1); }

.record summary, .add-panel > summary, .setup-card > details > summary, .create-panel > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px;
  color: var(--ink); font-weight: 550; font-size: .915rem;
  cursor: pointer; list-style: none;
  transition: color .15s ease;
}
summary::-webkit-details-marker { display: none; }
.record summary:hover, .add-panel > summary:hover, .setup-card > details > summary:hover, .create-panel > summary:hover { color: var(--accent); }
.record summary small { display: block; margin-top: 2px; color: var(--muted); font: .76rem/1.5 var(--mono); font-weight: 400; }
.record summary > span:last-child { color: var(--muted); font-size: .84rem; }
.add-panel > summary::after, .setup-card > details > summary::after, .create-panel > summary::after {
  content: "+"; margin-left: auto;
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--surface); color: var(--muted); font: 400 1rem/1 var(--mono);
  transition: transform .2s ease, color .15s ease, border-color .15s ease;
}
details[open] > summary::after { transform: rotate(45deg); color: var(--accent); border-color: var(--accent-line); }

.editor-form, .setup-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding: 2px 14px 16px; }
.full, .editor-form .full, .setup-form .full { grid-column: 1 / -1; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.row-actions form { margin: 0; }
.inline-danger { padding: 0 14px 14px; }

.add-panel { margin-top: 15px; border-top: 1px solid var(--line); }
.add-panel > summary { padding-left: 0; padding-right: 0; }
.folder-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 15px 0 0; }
.folder-tools form, .compact-form { display: flex; align-items: center; gap: 8px; }
.folder-tools input, .compact-form input {
  min-width: 0; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); outline: none; box-shadow: var(--sh-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.folder-tools input:focus, .compact-form input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.folder-tools input::placeholder, .compact-form input::placeholder { color: var(--faint); }

.setup-card { position: relative; overflow: hidden; }
.setup-card.selected {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 46%);
  box-shadow: var(--sh-2);
}
.setup-card.selected::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.setup-card > details { margin-top: 13px; border-top: 1px solid var(--line); }
.setup-card > details > summary { padding-left: 0; padding-right: 0; }
.setup-form fieldset {
  min-width: 0; margin: 14px 0; padding: 15px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--sunk);
}
.setup-form legend { padding: 0 8px; color: var(--accent); font: 600 .69rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }

.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .875rem; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.check:hover { border-color: var(--line-2); box-shadow: var(--sh-1); }
.check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.check input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--muted); font: .745rem/1.5 var(--mono); }
.check strong { font-weight: 550; }

.create-panel { margin-top: 2px; padding: 4px 12px; }
.create-panel > summary { font-size: .94rem; }

/* Accent is reserved for STATE, not for labels. A folder's kind and an inactive setup
   are structural labels — if every capsule glows, "active in agent" means nothing. */
.folder-head .eyebrow,
.setup-card:not(.selected) .setup-head .eyebrow {
  border-color: var(--line); background: var(--sunk); color: var(--muted);
}
.folder-head .eyebrow::before,
.setup-card:not(.selected) .setup-head .eyebrow::before { background: var(--faint); box-shadow: none; }
.setup-card.selected .setup-head .eyebrow::before { animation: pulse-dot 2.6s ease-in-out infinite; }

/* ── Motion & responsive ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .aurora i, .art-dot, .art-caret, .art-sweep,
  .setup-card.selected .setup-head .eyebrow::before { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

@media (max-width: 980px) {
  .principles, .grid { grid-template-columns: 1fr 1fr; }
  .folder-grid, .setup-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 30px, 1140px); }
  /* The brand plus four nav items cannot share one row at 390px — measured 417px of
     content against a 390px viewport. Give the nav its own scrollable row. */
  .topbar { margin: 0 -15px; padding: 11px 15px; flex-wrap: wrap; row-gap: 2px; }
  .brand { flex: none; }
  .nav {
    width: 100%; min-width: 0; margin: 0 -15px; padding: 2px 15px 4px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    font-size: .82rem;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a, .nav form, .nav .link-button { flex: none; white-space: nowrap; }
  .nav a { padding: 6px 9px; }
  .nav .email { display: none; }
  .principles, .grid { grid-template-columns: 1fr; }
  .release { grid-template-columns: 1fr; gap: 18px; }
  .access-create { grid-template-columns: 1fr; gap: 20px; }
  .access-create form { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; gap: 14px; }
  .editor-form, .setup-form, .check-grid { grid-template-columns: 1fr; }
  .folder-tools, .compact-form { align-items: stretch; flex-direction: column; }
  .guide article { padding-left: 26px; }
  .guide article::before { position: static; margin-bottom: 12px; }
  .hero { padding-top: 44px; }
  .hero h1 { font-size: clamp(2.35rem, 10.5vw, 3.2rem); }
  .hero-art figcaption { padding: 13px 17px; font-size: .78rem; }
  .card { padding: 21px; }
  .auth { padding: 27px 23px 25px; }
}

/* ── Landing: how-it-works flow ─────────────────────────────────────── */

.flow { padding: clamp(46px, 7vw, 82px) 0 clamp(18px, 3vw, 30px); }
.flow-head { max-width: 640px; margin: 0 auto clamp(30px, 4vw, 46px); text-align: center; }
.flow-head h2 {
  margin: 18px 0 0;
  font: 600 clamp(1.7rem, 3.4vw, 2.5rem)/1.14 var(--sans); letter-spacing: -.038em;
}
.steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 0 14px; }
.step {
  display: flex; flex-direction: column;
  padding: 26px 24px 28px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--sh-1);
  transition: box-shadow .22s ease, transform .22s ease;
}
.step:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.step-art {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 18px;
  border: 1px solid var(--accent-line); border-radius: var(--r-md);
  background: var(--accent-soft);
}
.step-art svg { width: 30px; height: 30px; }
.step-n { color: var(--accent); font: 600 .69rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.step h3 { margin: 10px 0 8px; font: 600 1.14rem/1.32 var(--sans); letter-spacing: -.024em; }
.step p { margin: 0; color: var(--muted); font-size: .925rem; }
.step-link { display: grid; place-items: center; }
.step-link svg { width: 24px; height: 10px; }

.closer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 26px;
  margin-top: clamp(40px, 6vw, 72px); padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: linear-gradient(140deg, var(--accent-soft), var(--surface) 62%);
  box-shadow: var(--sh-1);
}
.closer h2 { margin: 16px 0 6px; font: 600 clamp(1.5rem, 2.8vw, 2.05rem)/1.16 var(--sans); letter-spacing: -.036em; }
.closer p { margin: 0; color: var(--muted); }
.closer .actions { margin-top: 0; }

/* ── Workspace: two-pane app shell ──────────────────────────────────── */

.ws-head { max-width: 700px; margin-bottom: 4px; }
.ws-shell { display: grid; grid-template-columns: 254px minmax(0, 1fr); gap: 30px; align-items: start; }
.ws-side { position: sticky; top: 78px; display: grid; gap: 12px; }

.ws-live {
  padding: 16px 17px;
  border: 1px solid var(--accent-line); border-radius: var(--r-lg);
  background: linear-gradient(170deg, var(--accent-soft), var(--surface) 78%);
  box-shadow: var(--sh-1);
}
.ws-live-k {
  display: flex; align-items: center; gap: 7px;
  color: var(--accent); font: 600 .675rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.ws-live-k::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 3px rgba(95, 189, 84, .18);
  animation: pulse-dot 2.6s ease-in-out infinite;
}
.ws-live-v { margin-top: 9px; font-weight: 600; font-size: .97rem; letter-spacing: -.02em; line-height: 1.3; }
.ws-live-m { margin-top: 5px; color: var(--muted); font: .74rem/1.5 var(--mono); }

.ws-nav {
  display: grid; gap: 2px; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--sh-1);
}
.ws-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-xs);
  color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .9rem;
  transition: background .15s ease, color .15s ease;
}
.ws-nav a:hover { background: var(--sunk); color: var(--ink); }
.ws-nav b {
  min-width: 22px; padding: 2px 6px; border-radius: 6px;
  background: var(--sunk); color: var(--muted);
  font: 600 .72rem/1.5 var(--mono); text-align: center;
}
/* Active pane marker. :has lets one hash drive both the pane and the rail with no script. */
body:not(:has(.ws-pane:target)) .ws-nav a[href="#setups"],
body:has(#setups:target) .ws-nav a[href="#setups"],
body:has(#knowledge:target) .ws-nav a[href="#knowledge"],
body:has(#sync:target) .ws-nav a[href="#sync"] {
  background: var(--ink); color: #fff;
}
body:not(:has(.ws-pane:target)) .ws-nav a[href="#setups"] b,
body:has(#setups:target) .ws-nav a[href="#setups"] b,
body:has(#knowledge:target) .ws-nav a[href="#knowledge"] b,
body:has(#sync:target) .ws-nav a[href="#sync"] b {
  background: rgba(255, 255, 255, .16); color: #fff;
}

.ws-meter {
  padding: 15px 17px 13px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--sh-1);
}
.ws-meter-h { color: var(--faint); font: 600 .655rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.ws-meter dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 12px 0 0; }
.ws-meter dt { color: var(--muted); font-size: .84rem; }
.ws-meter dd { margin: 0; font: 600 .84rem/1.5 var(--mono); text-align: right; }
.ws-rev {
  display: flex; align-items: center; gap: 7px;
  margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line);
  color: var(--faint); font: .7rem/1.5 var(--mono);
}
.ws-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(95, 189, 84, .16); }

.ws-main { min-width: 0; }
/* One pane at a time. Without :has the panes simply stack, which is the old behaviour. */
.ws-pane { display: none; gap: 16px; }
#setups { display: grid; }
body:has(.ws-pane:target) #setups { display: none; }
.ws-pane:target { display: grid; }

/* ── Density: chips and reach ───────────────────────────────────────── */

.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--sunk); color: var(--muted);
  font: 500 .735rem/1.55 var(--mono); white-space: nowrap;
}
.chip.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.reach { display: grid; gap: 8px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.reach-line { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: start; }
.reach-k { color: var(--faint); font: 600 .655rem/1.9 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.reach-v { display: flex; flex-wrap: wrap; gap: 5px; }

.empty {
  margin: 0; padding: 15px 16px;
  border: 1px dashed var(--line-2); border-radius: var(--r-md);
  background: var(--sunk); color: var(--muted); font-size: .89rem;
}
td.empty { border-style: solid; border-width: 0; background: transparent; padding: 15px 10px; }

@media (max-width: 980px) {
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .step-link { transform: rotate(90deg); padding: 2px 0; }
}

@media (max-width: 860px) {
  .ws-shell { grid-template-columns: 1fr; gap: 20px; }
  .ws-side {
    position: sticky; top: 0; z-index: 30;
    grid-template-columns: 1fr; gap: 10px;
    padding: 10px 0; background: var(--paper);
  }
  .ws-nav { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
  .ws-nav a { justify-content: center; gap: 6px; padding: 9px 6px; font-size: .82rem; white-space: nowrap; }
  .ws-nav b { min-width: 19px; padding: 2px 5px; font-size: .69rem; }
  .ws-meter { display: none; }
  .closer { flex-direction: column; align-items: flex-start; }
}
