/* GapStorm local page, styled with the IDEAT design system (Design system v0.1, light theme only).
   Tokens first: colour, radius and type are the IDEAT values. Components below are built from them.
   Two weights only (400 and 700). Smallest text is 12px. Phone first. */

/* Funnel Sans (SIL Open Font License), self-hosted: card text and quotes. */
@font-face {
  font-family: "Funnel Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/funnel-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Funnel Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/funnel-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --page: #e3e3ff;
  --card: #ffffff;
  --subtle: #d2d2ff;
  --ink: #0e0b1a;
  --muted: #5b5878;
  --deep: #3c199b;
  --primary: #8336ff;
  --primary-hover: #6f1fee;
  --accent: #ff008c;
  --accent-hover: #e0007d;
  --soft: #a19fff;
  --line: #c3c1f5;
  --danger: #d00036;
  --danger-soft: #ffe0e8;
  --warning: #fff600;
  --warning-soft: #fffbb0;
  --good: #0b7a0b;
  --good-soft: #d9f7d9;
  --level-1: #a19fff;
  --level-2: #03db03;
  --level-3: #a5f900;
  --level-4: #fff600;
  --level-5: #ff00ff;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 999px;

  /* Cy comes from Adobe Fonts when a kit is configured (config/app.ts); Lexend and the system font stand in. */
  --font-ui: "cy", "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-idea: "Funnel Sans", var(--font-ui);
  --measure: 46rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
}
h1, h2, h3, h4, p, ul, ol, dl, dd, blockquote, figure, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
b, strong, h1, h2, h3, h4 { font-weight: 700; }
a { color: var(--deep); text-underline-offset: 0.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; border-radius: var(--r-sm); z-index: 60; }

/* ---------- type ---------- */
.display { font-weight: 700; letter-spacing: -0.02em; line-height: 1.02; }
h1.display { font-size: 44px; overflow-wrap: anywhere; }
h2 { font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
h3 { font-size: 18px; line-height: 1.3; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small-text { font-size: 14px; }
.meta { color: var(--muted); font-size: 12px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ---------- shell: sidebar on desktop, top bar on a phone ---------- */
.shell { min-height: 100dvh; }
.side { display: none; }
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--card);
}
.bar .brand { margin-right: auto; }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); }
/* Logo slot: fixed size, so the final logo drops in without moving anything. */
.logo-slot { display: inline-flex; align-items: center; height: 32px; max-width: 168px; }
.logo-slot img { height: 32px; width: auto; max-width: 168px; object-fit: contain; display: block; }
.wordmark { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 32px; white-space: nowrap; }
.spend-pill { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: var(--r-full); background: var(--subtle); color: var(--deep); white-space: nowrap; }
.icon-button {
  appearance: none; border: 0; background: var(--subtle); color: var(--deep); cursor: pointer;
  width: 44px; height: 44px; border-radius: var(--r-full); display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.icon { width: 20px; height: 20px; flex: none; }
.menu {
  position: absolute; top: 100%; left: 0; right: 0; display: grid; gap: 4px;
  padding: 8px 16px 16px; background: var(--card); border-bottom-left-radius: var(--r-xl); border-bottom-right-radius: var(--r-xl);
  box-shadow: 0 16px 24px rgb(14 11 26 / 0.12);
}
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px; border-radius: var(--r-full);
  color: var(--ink); font-weight: 700; text-decoration: none; background: transparent; border: 0; cursor: pointer; width: 100%; text-align: left;
}
.nav-link:hover { background: var(--page); }
.nav-link[aria-current="page"] { background: var(--subtle); color: var(--deep); }
.side-nav { display: grid; gap: 4px; }
.side-recent { display: grid; gap: 8px; min-height: 0; }
.side-recent .eyebrow { padding: 0 16px; }
.recent-link { display: block; padding: 6px 16px; border-radius: var(--r-full); color: var(--ink); font-size: 14px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-link:hover { background: var(--page); }
.recent-link[aria-current="page"] { background: var(--subtle); color: var(--deep); font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.spend-card { background: var(--page); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 4px; }
.spend-card .figure { font-size: 32px; }

main { max-width: var(--measure); margin: 0 auto; padding: 24px 16px 48px; padding-bottom: calc(48px + env(safe-area-inset-bottom)); display: grid; gap: 24px; align-content: start; }
main:focus { outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head > div { display: grid; gap: 8px; min-width: 0; }
.page-head h1:focus { outline: none; }

/* ---------- buttons: pills, 52px ---------- */
.button {
  appearance: none; border: 2px solid transparent; border-radius: var(--r-full);
  background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
  height: 52px; padding: 0 28px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.button:hover { background: var(--primary-hover); }
.button.accent { background: var(--accent); }
.button.accent:hover { background: var(--accent-hover); }
.button.outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.button.outline:hover { background: var(--ink); color: #fff; }
.button.soft { background: var(--subtle); color: var(--deep); }
.button.soft:hover { background: var(--line); }
.button.sm { height: 44px; padding: 0 20px; font-size: 14px; }
.button.block { width: 100%; }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }
.text-button { appearance: none; border: 0; background: none; padding: 8px 0; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--deep); cursor: pointer; text-underline-offset: 4px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.text-button:hover { text-decoration: underline; }
.text-button[disabled] { opacity: 0.5; cursor: not-allowed; text-decoration: none; }

/* ---------- cards, alerts, pills ---------- */
.panel { background: var(--card); border-radius: var(--r-xl); padding: 20px; }
.alert { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-lg); padding: 14px 16px; background: var(--subtle); color: var(--deep); }
.alert-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; line-height: 1; background: var(--deep); color: #fff; }
.alert-body { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-error .alert-icon { background: var(--danger); }
.alert-good { background: var(--good-soft); color: var(--good); }
.alert-good .alert-icon { background: var(--good); }
.alert-warning { background: var(--warning-soft); color: var(--ink); }
.alert-warning .alert-icon { background: var(--ink); color: var(--warning); }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: var(--r-full); background: var(--subtle); color: var(--deep); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warning { background: var(--warning-soft); color: var(--ink); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.plain { background: var(--page); color: var(--muted); }

details > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; border-radius: var(--r-sm); }
details.panel > summary { margin: -8px 0; }
details.panel[open] > summary { margin-bottom: 8px; }

/* ---------- home ---------- */
.runs { display: grid; gap: 12px; }
.run-link { display: grid; gap: 10px; padding: 20px; background: var(--card); border-radius: var(--r-xl); color: var(--ink); text-decoration: none; border: 2px solid transparent; }
.run-link:hover { border-color: var(--primary); }
.run-link .title { font-family: var(--font-idea); font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.budget { display: grid; gap: 4px; }
.budget .figure { font-size: 32px; }

/* ---------- forms ---------- */
form.brief { display: grid; gap: 24px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 14px; font-weight: 700; }
.field .hint, .hint { color: var(--muted); font-size: 12px; }
.problem { color: var(--danger); font-size: 14px; font-weight: 700; }
.problem:empty { display: none; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0 16px; width: 100%; height: 52px;
}
textarea { height: auto; min-height: 104px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--primary); }
[aria-invalid="true"] { border-color: var(--danger); }
.grid-2 { display: grid; gap: 16px; }
.group { background: var(--card); border-radius: var(--r-xl); padding: 20px; display: grid; gap: 16px; }
.group > legend { float: left; width: 100%; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.group > legend + * { clear: both; }
.group.inner { background: var(--page); border-radius: var(--r-lg); padding: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- stepper ---------- */
.stepper-wrap { display: grid; gap: 8px; }
.stepper { display: flex; gap: 6px; }
.stepper li { flex: 1; height: 6px; border-radius: var(--r-full); background: var(--line); }
.stepper li[data-state="done"] { background: var(--primary); }
.stepper li[data-state="now"] { background: var(--accent); }
.stepper .step-dot, .stepper .step-label { display: none; }
.stepper-text { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------- team ---------- */
.team-layout { display: grid; gap: 24px; }
.team-main { display: grid; gap: 24px; min-width: 0; }
.team-section { display: grid; gap: 12px; }
.team-section > header { display: grid; gap: 4px; }
.members { display: grid; gap: 12px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span, .choice-button {
  appearance: none; display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: var(--r-full);
  border: 2px solid var(--primary); background: transparent; color: var(--deep); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.choice input:checked + span, .choice-button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.saved-chip { display: inline-flex; align-items: center; gap: 2px; }
.saved-chip .choice-button { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 12px; border-right-width: 1px; }
.chip-x { appearance: none; height: 44px; width: 40px; border: 2px solid var(--primary); border-left-width: 1px; border-radius: 0 var(--r-full) var(--r-full) 0; background: transparent; color: var(--deep); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chip-x:hover { background: var(--subtle); }
.chip-x .icon { width: 16px; height: 16px; }
.save-form { display: grid; gap: 8px; }
.save-form .row > input { flex: 1 1 12rem; width: auto; }

.member { background: var(--card); border-radius: var(--r-xl); padding: 16px; display: grid; gap: 16px; border: 2px solid transparent; align-content: start; }
.member[data-open="true"] { border-color: var(--primary); }
.member[data-problem="true"] { border-color: var(--danger); }
.member-head { display: flex; align-items: flex-start; gap: 12px; }
.member-toggle { appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; text-align: left; display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; border-radius: var(--r-md); }
.member-toggle[disabled] { cursor: default; }
.member-face { flex: none; line-height: 0; }
.member-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.member-name { font-size: 18px; font-weight: 700; line-height: 1.25; }
.member-desc { font-size: 12px; color: var(--muted); }
.member-set { font-size: 12px; font-weight: 700; color: var(--deep); margin-top: 4px; }
.member[data-off="true"] .member-set { color: var(--muted); }
.member-toggle .icon { margin-top: 12px; color: var(--muted); transition: transform 0.15s; }
.member-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.member-toggle[disabled] .icon { display: none; }
.member-body, .member-fields { display: grid; gap: 16px; }
.member-fields[disabled] { opacity: 0.5; }
.member select { height: 44px; background: var(--subtle); border-color: transparent; font-weight: 700; }
.note-row { display: flex; justify-content: space-between; gap: 12px; }

.face { display: block; color: var(--ink); }
/* The head takes the colour of the level. Shapes that set a stroke width get rounded corners in the same colour. */
.face { --face: var(--line); }
.face-l1 { --face: var(--level-1); }
.face-l2 { --face: var(--level-2); }
.face-l3 { --face: var(--level-3); }
.face-l4 { --face: var(--level-4); }
.face-l5 { --face: var(--level-5); }
.face-bg { fill: var(--face); stroke: var(--face); stroke-width: 0; }

/* On/off switch */
.switch { position: relative; display: inline-flex; align-items: center; width: 52px; height: 44px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { position: relative; width: 52px; height: 32px; border-radius: var(--r-full); background: var(--muted); transition: background-color 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Face slider: five steps, the knob is a face. A real range input sits on top, invisible. */
.fs { display: grid; gap: 6px; }
.fs-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.fs-label { font-size: 14px; font-weight: 700; }
.fs-value, .fs-ends { font-size: 12px; color: var(--muted); }
.fs-ends { display: flex; justify-content: space-between; gap: 12px; }
.fs-track { position: relative; height: 44px; border-radius: var(--r-full); background: var(--subtle); }
.fs-track:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.fs-dot { position: absolute; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--soft); transform: translate(-50%, -50%); }
.fs-knob { position: absolute; top: 50%; transform: translate(-50%, -50%); transition: left 0.15s; pointer-events: none; line-height: 0; }
.fs-dot:nth-child(1), .fs-track[data-level="1"] .fs-knob { left: 22px; }
.fs-dot:nth-child(2), .fs-track[data-level="2"] .fs-knob { left: calc(22px + (100% - 44px) * 0.25); }
.fs-dot:nth-child(3), .fs-track[data-level="3"] .fs-knob { left: calc(22px + (100% - 44px) * 0.5); }
.fs-dot:nth-child(4), .fs-track[data-level="4"] .fs-knob { left: calc(22px + (100% - 44px) * 0.75); }
.fs-dot:nth-child(5), .fs-track[data-level="5"] .fs-knob { left: calc(100% - 22px); }
.fs-track input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fs-track input:disabled { cursor: not-allowed; }

/* Cost and start: a bar fixed to the bottom on a phone, a sticky card on desktop. */
.team-aside {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--card); box-shadow: 0 -8px 24px rgb(14 11 26 / 0.12);
}
.team-aside .aside-detail { display: none; }
.team-aside .aside-cost { display: grid; gap: 2px; min-width: 0; }
.team-aside .figure { font-size: 24px; }
main:has(.team-aside) { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
.aside-detail { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }

/* ---------- a run in progress ---------- */
.stages { display: grid; gap: 4px; background: var(--card); border-radius: var(--r-xl); padding: 12px 20px; }
.stage { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 10px 0; }
.stage + .stage { border-top: 1px solid var(--page); }
.stage .marker { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.stage .marker .icon { width: 16px; height: 16px; display: none; }
.stage .marker .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: none; }
.stage[data-state="done"] .marker { background: var(--primary); border-color: var(--primary); }
.stage[data-state="done"] .marker .icon { display: block; }
.stage[data-state="running"] .marker { border-color: var(--accent); }
.stage[data-state="running"] .marker .dot { display: block; animation: pulse 1.2s ease-in-out infinite; }
.stage[data-state="waiting"] .name { color: var(--muted); font-weight: 400; }
.stage .name { font-weight: 700; }
.stage .text { display: grid; gap: 2px; min-width: 0; }
@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.7); } }
.notes { font-size: 12px; color: var(--muted); display: grid; gap: 4px; max-height: 14rem; overflow: auto; overflow-wrap: anywhere; }

/* ---------- insight cards ---------- */
.cards { display: grid; gap: 16px; }
.card { background: var(--card); border-radius: var(--r-xl); padding: 20px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); overflow-wrap: anywhere; }
.card .head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.card .rank { width: 32px; height: 32px; border-radius: 50%; background: var(--subtle); color: var(--deep); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.card h3 { font-family: var(--font-idea); font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.card .idea { font-family: var(--font-idea); font-size: 18px; line-height: 1.45; }
.card .why { background: var(--page); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 6px; font-family: var(--font-idea); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
/* Idea validation: the outcome panel above the cards */
.verdict .idea { font-family: var(--font-idea); font-size: 18px; line-height: 1.45; border-left: 3px solid var(--soft); padding-left: 12px; margin-top: 6px; overflow-wrap: anywhere; }
.verdict-line .pill { font-size: 16px; padding: 8px 16px; white-space: normal; }
.verdict[data-outcome="inconclusive"] .verdict-line .pill { background: var(--page); color: var(--ink); }
.tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tally > div { background: var(--page); border-radius: var(--r-lg); padding: 12px 14px; display: grid; gap: 2px; }
.tally dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.tally dd { font-size: 14px; font-weight: 700; }
@media (max-width: 560px) { .tally { grid-template-columns: 1fr; } }
.card h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.sources { display: grid; gap: 12px; }
.source { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--page); }
.source a { font-weight: 700; overflow-wrap: anywhere; }
.source blockquote { font-family: var(--font-idea); border-left: 3px solid var(--soft); padding-left: 12px; }
.source details ul { list-style: disc; padding-left: 20px; color: var(--muted); font-size: 12px; }
.source details > summary { font-size: 12px; font-weight: 700; color: var(--deep); min-height: 32px; }
.skeptic { font-size: 14px; color: var(--deep); background: var(--subtle); border-radius: var(--r-md); padding: 10px 14px; }
.rejected { display: grid; gap: 16px; }
.rejected li { display: grid; gap: 4px; overflow-wrap: anywhere; }
.team-used { display: grid; gap: 12px; }
.team-used li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.team-used .who { font-weight: 700; }
.team-used q { font-family: var(--font-idea); quotes: "“" "”"; }

/* ---------- sign-in, dialog, entry screen ---------- */
.auth { min-height: calc(100dvh - 120px); display: grid; align-content: center; justify-items: center; gap: 24px; }
.auth .panel { width: min(100%, 26rem); padding: 24px; display: grid; gap: 20px; }
.auth h1.display { font-size: 36px; }

dialog { border: 0; border-radius: var(--r-xl); background: var(--card); color: var(--ink); padding: 24px; max-width: min(30rem, calc(100vw - 2rem)); }
dialog::backdrop { background: rgb(14 11 26 / 0.55); }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 8px; }

.splash {
  position: fixed; inset: 0; z-index: 50; display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
  background: var(--soft); cursor: pointer; overflow: hidden; opacity: 1; transition: opacity 0.7s ease-in-out;
}
.splash.leaving { opacity: 0; }
.splash:focus-visible { outline: 4px solid rgb(255 255 255 / 0.7); outline-offset: -4px; }
/* The picture is 78% of the screen height and starts 10% from the top, as in IDEAT. On a narrow phone the sides crop. */
.splash img { position: absolute; left: 50%; top: 10%; height: 78%; width: auto; max-width: none; transform: translateX(-50%); pointer-events: none; user-select: none; }

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

/* ---------- wider screens ---------- */
@media (min-width: 40rem) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .panel, .group, .card { padding: 24px; }
  .group.inner { padding: 16px; }
}

@media (min-width: 64rem) {
  .shell:not(.signed-out) { display: grid; grid-template-columns: 256px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
  .bar { display: none; }
  .side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100dvh; padding: 24px 16px; background: var(--card); overflow-y: auto; }
  .side .brand { padding: 0 16px; align-self: flex-start; }
  main { max-width: none; margin: 0; padding: 40px 40px 64px; }
  main > * { max-width: var(--measure); }
  main > .wide { max-width: 72rem; }
  .shell.signed-out main { max-width: var(--measure); margin: 0 auto; }
  h1.display { font-size: 56px; }
  .button.sm { height: 40px; }
  .hide-desktop { display: none !important; }

  .stepper { gap: 0; align-items: center; }
  .stepper li { flex: none; height: auto; background: none; display: flex; align-items: center; gap: 10px; }
  .stepper li[data-state] { background: none; }
  .stepper li + li::before { content: ""; width: 40px; height: 2px; background: var(--line); margin: 0 12px; }
  .stepper .step-dot { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); font-size: 14px; font-weight: 700; color: var(--muted); }
  .stepper .step-dot .icon { width: 16px; height: 16px; }
  .stepper .step-label { display: inline; font-size: 14px; font-weight: 700; color: var(--muted); }
  .stepper li[data-state="done"] .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
  .stepper li[data-state="now"] .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
  .stepper li[data-state="now"] .step-label, .stepper li[data-state="done"] .step-label { color: var(--ink); }
  .stepper-text { display: none; }

  .team-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .team-aside {
    position: sticky; top: 24px; left: auto; right: auto; bottom: auto; z-index: auto;
    display: grid; gap: 16px; padding: 24px; border-radius: var(--r-xl); box-shadow: none;
  }
  .team-aside .aside-detail { display: grid; }
  .team-aside .figure { font-size: 40px; }
  .team-aside .button { width: 100%; }
  main:has(.team-aside) { padding-bottom: 64px; }
}

@media (min-width: 84rem) {
  .members { grid-template-columns: 1fr 1fr; }
}
