/* Brio web app. Plain CSS. The one font file is vendored (vendor/inter-variable.woff2, OFL; licence in
 * vendor/INTER-LICENSE.txt). Nothing loads from outside the site.
 *
 * Spacing is a 4px scale and type is a fixed set: both come only from the tokens on :root. A test
 * (test_app.py, WebScreensTests) fails on any other margin, padding, gap or font size. Sizes are rem, so
 * text grows to 200%. The look follows the modern app designs in the UI research (section 4.9 is
 * superseded for its visual tokens): soft white cards with no outline, pill buttons, one gradient accent.
 */

@font-face {
  font-family: "Inter";
  src: url("vendor/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  --t-micro: .75rem;
  --t-small: .875rem;
  --t-label: .875rem;
  --t-body: 1rem;
  --t-h3: 1.125rem;
  --t-h2: 1.25rem;
  --t-h1: 2rem;
  --t-brand: 1.25rem;

  --nav-space: 104px;

  --bg: #f4f5f8;
  --glow-a: rgba(167, 139, 250, .42);
  --glow-b: rgba(125, 211, 252, .38);
  --glow-c: rgba(253, 186, 140, .28);
  --surface: #ffffff;
  --edge: transparent;
  --divider: rgba(14, 15, 19, .07);
  --shadow: 0 10px 30px rgba(17, 17, 40, .06);
  --shadow-float: 0 12px 32px rgba(17, 17, 40, .12);
  --text: #0e0f13;
  --muted: #5b6070;
  --soft: #eef0f4;
  --soft-hover: #e3e6ed;
  --tint: #f4f5f8;
  --field: #eef0f4;
  --ink: #0e0f13;
  --ink-on: #ffffff;
  --ink-hover: #2a2c35;
  --accent-a: #7c5cff;
  --accent-b: #3b82f6;
  --focus: #7c5cff;
  --link: #4f3cc9;
  --bar: #0e0f13;
  --bar-ink: #ffffff;
  --bar-btn: #ffffff;
  --bar-btn-ink: #0e0f13;
  --nav-bg: rgba(255, 255, 255, .8);
  --ok: #15803d;
  --wait: #7c5cff;
  --applied: #2563eb;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --pdf-bg: #fde9e7; --pdf-fg: #b42318;
  --doc-bg: #e6eeff; --doc-fg: #1d4ed8;
  --txt-bg: #e5f6ec; --txt-fg: #15803d;

  --r-card: 24px;
  --r-tile: 20px;
  --r-small: 16px;
  --r-field: 14px;
  --r-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c10;
    --glow-a: rgba(124, 92, 255, .22);
    --glow-b: rgba(59, 130, 246, .18);
    --glow-c: rgba(251, 146, 60, .12);
    --surface: #15171c;
    --edge: rgba(255, 255, 255, .06);
    --divider: rgba(255, 255, 255, .08);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-float: 0 12px 32px rgba(0, 0, 0, .5);
    --text: #f2f3f6;
    --muted: #a3a8b4;
    --soft: #22252d;
    --soft-hover: #2c303a;
    --tint: #1d2028;
    --field: #1d2028;
    --ink: #f5f6f8;
    --ink-on: #0b0c10;
    --ink-hover: #dfe2e8;
    --focus: #a78bfa;
    --link: #b9adff;
    --bar: #f2f3f6;
    --bar-ink: #0b0c10;
    --bar-btn: #0b0c10;
    --bar-btn-ink: #ffffff;
    --nav-bg: rgba(21, 23, 28, .8);
    --ok: #86efac;
    --wait: #a78bfa;
    --applied: #93c5fd;
    --bad: #ffb4ab;
    --bad-bg: #3a1a1c;
    --pdf-bg: #3a1d20; --pdf-fg: #ffb4ab;
    --doc-bg: #172443; --doc-fg: #93c5fd;
    --txt-bg: #14291e; --txt-fg: #86efac;
  }
}

@media (min-width: 900px) {
  :root { --t-h1: 2.5rem; --nav-space: 0px; }
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* The soft glow behind the top of the page. Fixed, so it stays put while the page scrolls. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vmax 30vmax at 10% 4%, var(--glow-a), transparent 70%),
    radial-gradient(40vmax 28vmax at 94% 0%, var(--glow-b), transparent 70%),
    radial-gradient(34vmax 24vmax at 56% 0%, var(--glow-c), transparent 72%);
  filter: blur(28px);
}

h1, h2, h3 { margin: 0 0 var(--space-4); font-weight: 650; letter-spacing: -.02em; color: var(--text); }
h1 { margin-bottom: var(--space-6); font-size: var(--t-h1); line-height: 1.1; outline: none; }
h2 { font-size: var(--t-h2); line-height: 1.3; font-weight: 600; }
h3 { font-size: var(--t-h3); line-height: 1.3; font-weight: 600; }
p, ul, ol, dl { margin: 0 0 var(--space-4); }
ul, ol { padding-left: var(--space-6); }

a { color: var(--link); text-underline-offset: .15em; }
/* Inside the app, links read as plain ink, with no underline. Prose pages keep normal links. */
.app main a, .app .foot a { color: var(--text); font-weight: 600; text-decoration: none; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

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

.skip {
  position: absolute;
  left: var(--space-4);
  top: -64px;
  z-index: 10;
  background: var(--surface);
  color: var(--text);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-float);
}
.skip:focus { top: var(--space-4); }

.ico {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The top bar: the brand, the demo notice, and Account (a round button) on a phone */

.side { display: contents; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-3);
}
.brand { margin: 0; font-size: var(--t-brand); font-weight: 750; letter-spacing: -.02em; color: var(--text); }
.top-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  margin-left: auto;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.top-account[aria-current="page"] { background: var(--ink); color: var(--ink-on); }
.demo-banner {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-small);
  background: var(--soft);
  color: var(--muted);
  font-size: var(--t-small);
  text-align: center;
}

/* Navigation: a floating bar of three on a phone; a column of rows in a side card on a wide screen */

nav {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 5;
  padding: var(--space-2);
  background: var(--nav-bg);
  border: 1px solid var(--edge);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-float);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1); }
nav li { min-width: 0; }
nav li.nav-account { display: none; }
nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 56px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--r-pill);
  text-align: center;
  text-decoration: none;
  font-size: var(--t-micro);
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}
nav a[aria-current="page"] { background: var(--ink); color: var(--ink-on); }
nav .ico { width: 22px; height: 22px; }

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-7);
}

@media (min-width: 900px) {
  body.app {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }
  body.app.signed-out { grid-template-columns: minmax(0, 1fr); }
  .app .side {
    display: flex;
    flex-direction: column;
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    top: var(--space-5);
    align-self: start;
    height: calc(100dvh - 40px);
    margin: var(--space-5);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--edge);
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
  }
  .app.signed-out .side { display: block; position: static; height: auto; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  .app .top { padding: var(--space-4) var(--space-3) var(--space-6); }
  .app .top-account { display: none; }
  .app .top { flex-direction: column; align-items: flex-start; justify-content: flex-start; }
  .app .demo-banner { flex: none; width: auto; max-width: 100%; padding: var(--space-1) var(--space-3); border-radius: var(--r-pill); text-align: left; }
  .app nav {
    position: static;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .app nav ul { display: flex; flex-direction: column; flex: 1 1 auto; gap: var(--space-1); padding: 0; }
  .app nav li.nav-account { display: block; margin-top: auto; }
  .app nav a {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-3);
    min-height: 52px;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--r-small);
    font-size: var(--t-body);
    color: var(--text);
  }
  .app nav a:hover { background: var(--soft); }
  .app nav a[aria-current="page"], .app nav a[aria-current="page"]:hover { background: var(--ink); color: var(--ink-on); }
  .app nav .ico { width: 20px; height: 20px; }
  .app main { grid-column: 2; grid-row: 1; margin: 0; padding: var(--space-9) var(--space-8) var(--space-8); }
  .app.signed-out main { grid-column: 1; margin: 0 auto; }
  .app .foot { grid-column: 2; grid-row: 2; }
  .app.signed-out .foot { grid-column: 1; }
  .app.signed-out .side { grid-row: 1; }
}

/* Page blocks */

.page > :last-child { margin-bottom: 0; }
.block { margin: 0 0 var(--space-7); }
.block > :last-child { margin-bottom: 0; }
.stack > * + * { margin-top: var(--space-3); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.gap-top { margin-top: var(--space-5); }
.gap-y { margin: var(--space-5) 0; }
.meta { margin: 0 0 var(--space-1); font-size: var(--t-small); color: var(--muted); overflow-wrap: anywhere; }
.meta .k { font-weight: 600; }
.hint { margin: 0 0 var(--space-3); color: var(--muted); font-size: var(--t-small); }
.loading { color: var(--muted); }

/* Buttons: pills. One ink (near black) button per screen; soft grey for the rest; quiet text for the least */

.btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--soft);
  color: var(--text);
  font-family: inherit;
  font-size: var(--t-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--soft-hover); }
.btn.primary { background: var(--ink); color: var(--ink-on); }
.btn.primary:hover { background: var(--ink-hover); }
.btn.quiet { min-height: 44px; padding: 0 var(--space-3); background: transparent; }
.btn.quiet:hover { background: var(--soft); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); filter: brightness(.97); }
.btn.quiet.danger { background: transparent; color: var(--bad); }
.btn.small { min-height: 44px; padding: 0 var(--space-5); font-size: var(--t-small); }
.btn.quiet.small { padding: 0 var(--space-3); }
.btn.big { min-height: 52px; }
.btn.block { width: 100%; }
.btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { background: var(--soft-hover); }
.icon-btn .ico { width: 20px; height: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn { transition: background-color .15s, color .15s, transform .15s, box-shadow .15s; }
  .btn:active, .icon-btn:active { transform: scale(.97); }
}

/* Forms: soft fields with no outline until they are focused, then a 2px accent ring */

.field { margin: 0 0 var(--space-5); }
.field > label, .label { display: block; margin: 0 0 var(--space-2); font-size: var(--t-label); font-weight: 600; }
input[type="text"], input[type="email"], input[type="date"], input[type="search"], select, textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-5);
  font-family: inherit;
  font-size: var(--t-body);
  color: var(--text);
  background: var(--field);
  border: 0;
  border-radius: var(--r-field);
  transition: box-shadow .15s;
}
input[type="text"], input[type="email"], input[type="date"], input[type="search"], select { line-height: 28px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--focus); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { min-height: 120px; resize: vertical; }
input[type="checkbox"] { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--accent-a); }
.check-row { display: flex; gap: var(--space-3); align-items: flex-start; min-height: 44px; margin: 0 0 var(--space-5); }
.check-row > span { padding-top: var(--space-1); }
/* The sign-in code: six boxes, with the real input lying over them, see-through */
.field.center { text-align: center; }
.code-wrap { position: relative; width: max-content; max-width: 100%; margin: 0 auto; }
.code-slots { display: flex; gap: var(--space-2); }
.code-slot {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 3rem;
  max-width: calc((100vw - 2 * var(--space-5) - 5 * var(--space-2)) / 6);
  height: 3.25rem;
  font-size: var(--t-h2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: var(--r-field);
  transition: box-shadow .15s;
}
.code-slot.active { box-shadow: 0 0 0 2px var(--focus); }
.code-slot.active.blank::after { content: ""; width: 2px; height: 1.5rem; border-radius: 1px; background: var(--text); }
.code-digit, .code-digit-out { position: absolute; inset: 0; display: grid; place-items: center; }
.code-wrap.error .code-slot { outline: 2px solid var(--bad); outline-offset: -1px; }
.code-wrap .code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  opacity: 0;
  cursor: text;
}
.row.center { justify-content: center; }
@media (prefers-reduced-motion: no-preference) {
  .code-slot.active.blank::after { animation: code-caret 1.1s steps(1) infinite; }
  .code-wrap.error .code-slots { animation: code-shake .3s; }
}
@keyframes code-caret { 50% { opacity: 0; } }
@keyframes code-shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }
.counter { margin: 0 0 var(--space-3); color: var(--muted); font-size: var(--t-small); }

/* Messages: text and a colour, and an icon for errors; never colour alone */

.msg {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-small);
  font-weight: 500;
}
.msg.error { background: var(--bad-bg); color: var(--bad); }
.msg.error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
  color: var(--bad-bg);
  font-size: var(--t-micro);
  font-weight: 700;
  line-height: 1;
}
.msg.ok { background: var(--soft); color: var(--ok); }
.msg.info { background: var(--soft); color: var(--text); }

/* Cards: white, no outline, one soft shadow. Related rows sit together in one card. */

.cards { display: grid; gap: var(--space-3); margin: 0 0 var(--space-7); padding: 0; list-style: none; }
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--space-6);
}
.card > :last-child, .panel > :last-child { margin-bottom: 0; }
.panel.block { margin-bottom: var(--space-7); }
.panel.tinted {
  background: linear-gradient(135deg, rgba(124, 92, 255, .12), rgba(59, 130, 246, .12)), var(--surface);
}
.card h3, .card h2 { overflow-wrap: anywhere; }
.card.picked {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--accent-a), var(--accent-b)) border-box;
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .15s, box-shadow .15s; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(17, 17, 40, .09); }
}

.reason {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--tint);
  border-radius: var(--r-small);
}
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--r-pill);
  background: var(--soft);
  color: var(--text);
  font-size: var(--t-small);
  font-weight: 600;
}
.job-head { display: flex; gap: var(--space-3); align-items: flex-start; margin: 0 0 var(--space-2); }
.job-head h3 { flex: 1; min-width: 0; margin: 0; padding-top: var(--space-1); overflow-wrap: anywhere; }

/* The pick toggle: a 44px hit area around a 28px round control. A real checkbox sits under it. */

.pick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  margin: 0;
  border-radius: 50%;
  cursor: pointer;
}
.pick-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.pick-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  color: #ffffff;
  background: transparent;
}
.pick-dot .ico { width: 16px; height: 16px; opacity: 0; stroke-width: 2.25; }
.pick-input:checked + .pick-dot { border-color: transparent; background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); }
.pick-input:checked + .pick-dot .ico { opacity: 1; }
.pick-input:focus-visible + .pick-dot { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .pick-dot { transition: background-color .15s, border-color .15s; }
  .pick-dot .ico { transition: opacity .15s; }
}

.status { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-4) 0 0; }
.status-text {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 28px;
  margin: 0;
  padding: 0;
  font-size: var(--t-small);
  font-weight: 600;
}
.status-text::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-text.waiting::before { background: var(--wait); }
.status-text.ready::before { background: var(--ok); }
.status-text.applied::before { background: var(--applied); }

.seg-group { margin: 0 0 var(--space-4); }
.seg-group > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--t-h3);
  font-weight: 600;
  cursor: pointer;
}
.seg-group[open] > summary { margin-bottom: var(--space-2); }
.seg-group > p { margin: 0 0 var(--space-4); }

/* The picked bar: a dark rounded bar that floats above the phone navigation */

.picked-bar {
  position: sticky;
  bottom: calc(100px + env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-7) 0 0;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  background: var(--bar);
  color: var(--bar-ink);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
}
.picked-bar p { margin: 0; font-weight: 600; }
.picked-bar .btn.primary { background: var(--bar-btn); color: var(--bar-btn-ink); }
.picked-bar .btn.primary:hover { background: var(--soft-hover); color: var(--bar-btn-ink); }
@media (min-width: 900px) {
  .picked-bar { bottom: var(--space-6); }
}

/* Upload screen: the step line, the drop card, the rows being added, and the list */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 600;
}
.steps li { display: flex; align-items: center; gap: var(--space-2); }
.steps .num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text);
  font-size: var(--t-micro);
}
.steps [aria-current="step"] { color: var(--text); }
.steps [aria-current="step"] .num { background: var(--ink); color: var(--ink-on); }
.steps li.done { color: var(--text); }
.steps li.done .num { background: var(--soft-hover); }
.steps .num .ico { width: 14px; height: 14px; stroke-width: 2.25; }

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6) var(--space-7);
  text-align: center;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.drop.over {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--accent-a), var(--accent-b)) border-box;
}
.drop-tile {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 0 var(--space-2);
  border-radius: var(--r-tile);
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #ffffff;
}
.drop-tile .ico { width: 28px; height: 28px; }
.drop-title { margin: 0; font-size: var(--t-h2); font-weight: 600; line-height: 1.3; }
.drop .hint { margin: 0; }
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.file-input:focus-visible + .btn { outline: 2px solid var(--focus); outline-offset: 2px; }
.progress { width: 100%; height: var(--space-2); accent-color: var(--accent-a); }

.doc-list {
  margin: 0 0 var(--space-7);
  padding: var(--space-2) var(--space-6);
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.doc-item { padding: var(--space-4) 0; }
.doc-item + .doc-item { border-top: 1px solid var(--divider); }
.file-row { display: flex; align-items: center; gap: var(--space-3); }
.file-row .doc-main { flex: 1 1 auto; min-width: 0; }
.file-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-small);
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: .02em;
}
.file-tile.pdf { background: var(--pdf-bg); color: var(--pdf-fg); }
.file-tile.doc { background: var(--doc-bg); color: var(--doc-fg); }
.file-tile.txt { background: var(--txt-bg); color: var(--txt-fg); }
.doc-row-title { margin: 0 0 var(--space-1); font-weight: 600; overflow-wrap: anywhere; }
.doc-row-actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; margin: var(--space-3) 0 0; }
.doc-row-actions .field { flex: 1 1 14em; margin: 0; }
.doc-row-actions .field > label { font-size: var(--t-small); }
.doc-row-actions select { min-width: 0; }
.confirm { margin: var(--space-3) 0 0; font-weight: 600; }

/* My profile, once documents are added: the next step first, the list, then adding more folded away.
   On a wide screen the next step sits to the right of the list. */
.docs-layout:not(.has-docs) .docs-next { display: none; }
.docs-layout:not(.has-docs) .add-more > summary { display: none; }
.add-more[open] > summary { margin: 0 0 var(--space-5); }
@media (min-width: 1200px) {
  main:has(.docs-layout.has-docs) { max-width: 1080px; }
  .docs-layout.has-docs { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-7); align-items: start; }
  .docs-layout.has-docs .docs-main { grid-column: 1; grid-row: 1; }
  .docs-layout.has-docs .docs-next { grid-column: 2; grid-row: 1; position: sticky; top: var(--space-6); }
}

details.paste > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--r-pill);
  background: var(--soft);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
details.paste > summary::-webkit-details-marker { display: none; }
details.paste > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: var(--space-1);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
details.paste[open] > summary::after { transform: rotate(-135deg); }
details.paste > summary:hover { background: var(--soft-hover); }
@media (prefers-reduced-motion: no-preference) {
  details.paste > summary::after { transition: transform .15s; }
}
details.paste > form { margin-top: var(--space-3); }

.links { margin: 0 0 var(--space-7); padding: var(--space-2) var(--space-6); list-style: none; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow); }
.links li + li { border-top: 1px solid var(--divider); }
.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.links a::after { content: "\203A"; color: var(--muted); font-size: var(--t-h2); line-height: 1; }

/* Profile review: each section is a row in one card, with a chevron */

.summary-list { margin: 0 0 var(--space-7); padding: var(--space-2) var(--space-6); list-style: none; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow); }
.summary-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 64px;
  padding: var(--space-3) 0;
}
.summary-list li + li { border-top: 1px solid var(--divider); }
.summary-list li > div { min-width: 0; flex: 1 1 auto; }
.summary-list li > a { flex: none; }
.summary-list .name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.summary-list .value { margin: 0; color: var(--muted); font-size: var(--t-small); overflow-wrap: anywhere; }

/* Profile sections (edit), entries */

.entry { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--space-6); }
.entry + .entry { margin-top: var(--space-3); }
.entry-actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0 0; }
.entry h3 { margin: 0 0 var(--space-1); }
.entry ul { margin: var(--space-1) 0 0; }

.facts dt { margin-top: var(--space-3); font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.plain { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.plain li + li { margin-top: var(--space-1); }

/* Documents */

.paper {
  max-width: 70ch;
  margin: 0 0 var(--space-7);
  padding: var(--space-7) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.paper h2 { margin: 0 0 var(--space-1); font-size: var(--t-h2); }
.paper h3 { margin: var(--space-7) 0 var(--space-3); font-size: var(--t-small); font-weight: 600; color: var(--muted); }
.paper h4 { margin: var(--space-4) 0 var(--space-1); font-size: var(--t-body); }
.paper p { margin: 0 0 var(--space-2); font-size: var(--t-body); line-height: 1.5; }
.paper .lines p { margin: 0; }
.paper .contact { color: var(--muted); font-size: var(--t-small); }
.paper .signoff { margin-top: var(--space-5); }

.week-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-5); }
.week-bar .week-label { flex: 1 1 12em; margin: 0; font-weight: 600; text-align: center; }

.app-grid { display: grid; gap: 0 var(--space-3); }
@media (min-width: 560px) {
  .app-grid { grid-template-columns: 1fr 1fr; }
  .app-grid .wide { grid-column: 1 / -1; }
}

fieldset { min-width: 0; margin: var(--space-7) 0 0; padding: var(--space-6); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow); }
legend { padding: 0 var(--space-2); font-size: var(--t-h3); font-weight: 600; }

/* Sign-in and the setup steps (name, notice): one centred card on the glow */

body.signed-out main { max-width: 440px; padding-top: var(--space-9); }
body.signed-out main h1 { text-align: left; }
body.signed-out main .page, body.setup main .page {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
body.setup main { max-width: 520px; }

/* Footer on the app and the legal pages */

.foot { margin: var(--space-8) var(--space-5) var(--space-7); font-size: var(--t-small); color: var(--muted); }
.foot::after { content: ""; display: block; height: var(--nav-space); }
.foot p { margin: 0 0 var(--space-2); }
.foot p.small { font-size: var(--t-micro); }

/* The Claude button shows only where a desktop app can open it */
.open-claude { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .open-claude { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; transform: none !important; }
}

@media (forced-colors: active) {
  .btn, .card, .panel, .drop, .picked-bar, .pick-dot { border: 2px solid ButtonText; }
  .btn.primary, nav a[aria-current="page"] { border-color: Highlight; }
}
