/* Orbit components for Hiredevil.
   docs/design/README.md and the reference screens in docs/design/reference/ are
   binding (spec 4.8, AT-71). Sizes, gaps, radii, borders, and type sizes below are
   the references' own values; colors, fonts, radii, and durations are tokens from
   tokens.css, which every page links first. AT-56 lints this file. */

/* ---------------------------------------------------------------- fonts (self-hosted, OFL) */
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }

/* ---------------------------------------------------------------- page */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--space); }
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  background: var(--space);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .display { font-family: var(--font-display); }
code { font-family: var(--font-body); }
.num { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); font-size: var(--text-sm); }
.small { color: var(--ink2); font-size: var(--text-xs); }
.strong { font-weight: 600; }
.ember { color: var(--ember); font-weight: 600; }
.signal { color: var(--signal); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- atmosphere (R1, the redesign)
   Flat grounds. Day has no stars and no glow. Night keeps sparse stars at 35% and
   one faint heat at the very bottom edge. The aurora and the travelling band are gone. */
.stars, .flare { position: fixed; pointer-events: none; z-index: -1; }
.stars {
  display: none;
  left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent;
  box-shadow: 663px 308px var(--star), 808px 1333px var(--star), 98px 148px var(--star), 1681px 1097px var(--star),
    192px 748px var(--star), 1193px 118px var(--star), 1039px 439px var(--star), 76px 176px var(--star),
    888px 856px var(--star), 143px 492px var(--star), 185px 1128px var(--star), 869px 121px var(--star),
    253px 457px var(--star), 1291px 1284px var(--star), 812px 101px var(--star), 452px 95px var(--star),
    1140px 272px var(--star), 593px 858px var(--star), 295px 1107px var(--star), 370px 211px var(--star),
    1308px 384px var(--star), 762px 199px var(--star), 128px 1155px var(--star), 421px 1016px var(--star),
    875px 643px var(--star), 928px 740px var(--star), 613px 508px var(--star), 1626px 368px var(--star);
  animation: twinkle calc(var(--dur-beat) / 2) ease-in-out infinite, glide calc(var(--dur-drift) * 3) linear infinite alternate;
}
.stars.far {
  width: 1px; height: 1px;
  box-shadow: 167px 1176px var(--star), 614px 1075px var(--star), 1013px 703px var(--star), 1493px 919px var(--star),
    149px 241px var(--star), 1048px 856px var(--star), 337px 700px var(--star), 863px 80px var(--star),
    1368px 158px var(--star), 1173px 642px var(--star), 717px 1217px var(--star), 140px 191px var(--star),
    552px 970px var(--star), 133px 124px var(--star), 1183px 1395px var(--star), 710px 46px var(--star),
    945px 727px var(--star), 120px 446px var(--star), 1573px 588px var(--star), 264px 507px var(--star),
    814px 800px var(--star), 165px 340px var(--star), 1125px 569px var(--star), 280px 881px var(--star);
  animation: twinkle var(--dur-beat) ease-in-out infinite reverse, glide calc(var(--dur-drift) * 5) linear infinite alternate;
}
[data-theme="night"] .stars { display: block; opacity: 0.35; }
[data-theme="night"] body {
  background: radial-gradient(120% 60% at 50% 120%, color-mix(in oklab, var(--glow) 35%, transparent), transparent 60%), var(--space);
}
[data-motion="off"] .stars, [data-motion="off"] .arrive,
[data-motion="off"] .scan::before, [data-motion="off"] .wedge { animation: none; }
[data-motion="off"] * { transition: none; }

/* Screen morph and theme change, through the View Transitions API (CSS only). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: var(--dur-settle);
  animation-timing-function: var(--ease-glide);
}
[data-motion="off"]::view-transition-old(root), [data-motion="off"]::view-transition-new(root) { animation: none; }

/* ---------------------------------------------------------------- cascade */
.arrive { animation: arrive var(--dur-arrive) var(--ease-glide) both; }
.arrive.d1 { animation-delay: var(--cascade-step); }
.arrive.d2 { animation-delay: calc(var(--cascade-step) * 2); }
.arrive.d3 { animation-delay: calc(var(--cascade-step) * 3); }
.arrive.d4 { animation-delay: calc(var(--cascade-step) * 4); }
.arrive.d5 { animation-delay: calc(var(--cascade-step) * 5); }

/* ---------------------------------------------------------------- the rail shell (reference: Main) */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.rail {
  flex: 1 1 220px; max-width: 260px;
  padding: 28px 20px; display: flex; flex-direction: column; gap: 28px;
  border-right: 1px solid var(--line);
}
/* The wordmark takes the line the Main reference gives the product name, at the
   rail's inner width (design guide, Wordmark). */
.rail .hiredevil-logo { align-self: flex-start; }
.pilot { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--deck); }
.pilot-flame { flex: none; margin: 0 2px; overflow: visible; }
.pilot-flame .heart { fill: var(--on-ember); opacity: 0.85; }
.pilot:not(.active) .pilot-flame { opacity: 0.45; transform: scale(0.8); transform-origin: 50% 90%; }
.pilot:not(.active) .pilot-flame .heart { opacity: 0.4; }
.pilot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rail .dest { display: flex; flex-direction: column; gap: 4px; }
.navlink {
  display: block; padding: 11px 14px; border-radius: var(--radius-control);
  text-decoration: none; color: var(--ink2);
  transition: background var(--dur-hover) ease, color var(--dur-hover) ease;
}
.navlink:hover { background: var(--deck2); color: var(--ink); }
.navlink[aria-current="page"] { background: var(--deck2); color: var(--ink); font-weight: 600; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.spend { display: flex; flex-direction: column; gap: 8px; }
.spend .line { display: flex; justify-content: space-between; gap: 0; white-space: nowrap; font-size: var(--text-xs); color: var(--ink2); }
.spend .value { color: var(--ink); font-variant-numeric: tabular-nums; }
progress.spendbar { appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: var(--radius-pill); background: var(--deck2); overflow: hidden; }
progress.spendbar::-webkit-progress-bar { background: var(--deck2); }
progress.spendbar::-webkit-progress-value { background: var(--signal); }
progress.spendbar::-moz-progress-bar { background: var(--signal); }
.pause {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 0; min-height: 44px; padding: 0 14px;
  white-space: nowrap;
  border-radius: var(--radius-control); border: 1px solid var(--line); background: transparent; color: var(--ink2);
  font-family: var(--font-body); font-size: var(--text-md); cursor: pointer;
  transition: border-color var(--dur-hover) ease, color var(--dur-hover) ease;
}
.pause:hover { border-color: var(--ink2); color: var(--ink); }
.switch { position: relative; width: 34px; height: 20px; border-radius: var(--radius-pill); background: var(--deck2); flex: none; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--deck);
  transition: transform var(--dur-toggle) var(--ease-glide);
}
.pause[aria-pressed="true"] .switch { background: var(--ember); }
.pause[aria-pressed="true"] .switch::after { transform: translateX(14px); }
.rail-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.textlink {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: transparent;
  color: var(--ink2); font-family: var(--font-body); font-size: var(--text-sm); text-decoration: none; cursor: pointer;
}
.textlink:hover { color: var(--ink); }
.content {
  flex: 999 1 560px; min-width: 0;
  padding: 40px clamp(20px, 4vw, 56px) 56px; display: flex; flex-direction: column; gap: 36px;
}

/* At phone width the rail is one row: the wordmark and a closed Menu (approved in the M1a review). */
details.menu { display: none; }
details.menu > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; max-width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-control); cursor: pointer; font-weight: 600; white-space: nowrap;
}
details.menu > summary .here { color: var(--ink2); font-weight: 400; }
details.menu[open] > .menu-body { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
@media (max-width: 719px) {
  /* A short page must not stretch the bar to fill the screen. */
  .app { align-content: flex-start; }
  .rail {
    flex: 1 1 100%; max-width: none; padding: 12px 16px; gap: 12px;
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  /* 150 px wide (M1c review D5: room for the full screen name). Ruling 41: equal
     space above and below makes the wordmark exactly as tall as the bar's 44 px
     row, so it sits level with the Menu, stays where it is when the Menu opens
     onto a second row, and has 22 px above it for the flame, which rises 14 px.
     The bar's height does not change. */
  .rail .hiredevil-logo--rail {
    flex: none; width: 150px; align-self: center;
    margin-block: calc((44px - 150px * 312 / 1990) / 2);
  }
  .rail-wide { display: none; }
  /* The Menu takes what the wordmark leaves and shortens the screen name, so the
     bar stays one row whatever the screen is called (M1a review). */
  details.menu { display: block; flex: 1 1 auto; min-width: 0; text-align: right; }
  details.menu > .menu-body { text-align: left; }
  details.menu[open] { flex-basis: 100%; }
  .content { padding: 28px 20px 40px; gap: 28px; }
}
@media (min-width: 720px) { .rail-wide { display: contents; } }

/* ---------------------------------------------------------------- the focused shell (references: Intake, Preview) */
.focused {
  min-height: 100vh; padding: 40px clamp(20px, 4vw, 56px) 56px;
  display: flex; flex-direction: column; gap: 32px;
}
.focused > * { max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-direction: column; gap: 10px; }
.back {
  align-self: flex-start; text-decoration: none; color: var(--ink2); font-size: var(--text-sm);
  min-height: 44px; display: inline-flex; align-items: center;
}
.back:hover { color: var(--ink); }
.focused h1 { font-weight: 500; font-size: var(--text-hero-evidence); line-height: 1.1; max-width: 18ch; }
.lede { color: var(--ink2); font-size: var(--text-lg); max-width: 60ch; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.tab {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: transparent; color: var(--ink2); font-weight: 600; text-decoration: none;
  transition: background var(--dur-toggle) ease, color var(--dur-toggle) ease;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--space); }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 20px; align-items: start; }
.column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------------------------------------------------------------- signed-out pages (approved design of record) */
.solo { max-width: 560px; margin: 0 auto; padding: 40px 20px 56px; display: flex; flex-direction: column; gap: 20px; }
.wide { max-width: 1240px; margin: 0 auto; padding: 40px clamp(20px, 4vw, 56px) 56px; display: flex; flex-direction: column; gap: 20px; }
.solo h1, .wide h1 { font-weight: 500; font-size: var(--text-hero-today); line-height: 1.1; }
/* The wordmark (design guide, Wordmark): the owner's hiredevil.css, with the
   width set by a class per place instead of a custom property. No ground behind
   it in either theme. The theme shows the white or the ink image through two
   tokens. The canvas is the flame, registered against the lettering in the
   owner's design coordinates (wordmark 1990 by 312, canvas 2172 by 724); it
   overflows the wordmark's box without taking space, and never takes a click. */
.hiredevil-logo {
  position: relative;
  display: inline-block;
  max-width: 100%;
  aspect-ratio: 1990 / 312;
  vertical-align: middle;
  overflow: visible;
  isolation: isolate;
  text-decoration: none;
  background: transparent;
}
.hiredevil-logo--rail { width: 190px; }
/* 8 px under it on top of the page's 20 px gap: 28 px, a little over half the
   wordmark's 50 px height (design guide, Wordmark: clear space). */
.hiredevil-logo--hero { display: block; width: 320px; margin: 0 auto 8px; }
.hiredevil-logo__wordmark {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  background: transparent;
}
.hiredevil-logo__wordmark--white { display: var(--wordmark-white); }
.hiredevil-logo__wordmark--ink { display: var(--wordmark-ink); }
.hiredevil-logo__fire {
  position: absolute;
  left: -4.6231155779%;
  top: -60.8974358974%;
  width: 109.1457286432%;
  height: 232.0512820513%;
  display: block;
  z-index: 1;
  pointer-events: none;
  background: transparent;
}

/* ---------------------------------------------------------------- Today (reference: Main) */
.greeting { display: flex; flex-direction: column; gap: 6px; }
.greeting h1 { font-weight: 500; font-size: var(--text-hero-today); line-height: 1.1; letter-spacing: 0.01em; }
.greeting p { font-size: var(--text-lg); color: var(--ink2); }
/* The full flame, 2 of 3: the 2 px underline of "N decisions need you" (.decisions-line), whose text is solid
   ember (ruling 56). The third is the score dial's stroke, in its SVG gradient. */
.decisions-line { color: var(--ember); font-weight: 600; background: var(--flame) left bottom / 100% 2px no-repeat; padding-bottom: 3px; }
.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; align-items: stretch; }
.queued {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--deck);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.queued .label { font-size: var(--text-sm); color: var(--ember); font-weight: 600; }
.queued .title { font-weight: 600; }
.queued .helper { color: var(--ink2); font-size: var(--text-sm); }
.queued .act { margin-top: auto; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 20px; }
.radar-panel {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--deck);
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
}
/* The ring of fire (R1): server-drawn SVG; only the wedge moves, and only while a poll runs. */
.ring-box { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-of-fire { display: block; overflow: visible; }
.ring-of-fire .rl { fill: none; stroke: var(--line); }
.ring-of-fire .crescent { fill: none; stroke: var(--ink2); stroke-opacity: 0.45; stroke-width: 1.2; stroke-linejoin: round; }
.ring-of-fire .wedge { animation: sweep var(--dur-sweep) linear infinite; }
.ring-of-fire .wedge-edge { fill: none; stroke: var(--signal); stroke-width: 3; stroke-linecap: round; }
.ring-of-fire .mark rect { fill: var(--deck2); stroke: var(--ink2); stroke-opacity: 0.5; }
.ring-of-fire .mark.checked rect { fill: var(--signal); }
.ring-of-fire .mark.new rect { fill: var(--aurora); }
.ring-of-fire .mark text { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.04em; fill: var(--ink2); }
.ring-of-fire .fire { stroke: var(--ember); stroke-width: 2.5; stroke-linecap: round; }
.ring-of-fire:not(.sweeping) .core { opacity: 0.55; }
.ring-more { font-size: var(--text-xs); color: var(--ink2); }
.radar-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.radar-text h2, .panel-head h2, .panel h2 { font-weight: 600; font-size: var(--text-xl); }
.event { display: flex; gap: 10px; align-items: baseline; }
.event .mark { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); flex: none; }
.event .mark.new { background: var(--ember); }
.event.seen { color: var(--ink2); }
.event strong { font-weight: 600; color: var(--ink); }

/* ---------------------------------------------------------------- panels (reference: Intake) */
.panel {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--deck);
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.panel.files { gap: 4px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel.files .panel-head { padding-bottom: 10px; }
.panel-head .count { font-family: var(--font-display); font-weight: 600; font-size: var(--text-display); font-variant-numeric: tabular-nums; color: var(--signal); }
.group-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.group-head .who { display: flex; flex-direction: column; gap: 2px; }
.group-head .who span { font-size: var(--text-sm); color: var(--ink2); }
.drop {
  position: relative; min-height: 190px; padding: 28px; border-radius: var(--radius-panel); border: 1.5px dashed var(--line);
  background: var(--deck); color: var(--ink); display: flex; flex-direction: column; gap: 8px; align-items: center;
  justify-content: center; text-align: center; cursor: pointer;
  transition: border-color var(--dur-hover) ease, background var(--dur-hover) ease;
}
.drop:hover, .drop:focus-within { border-color: var(--signal); background: var(--deck2); }
.drop .big { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); }
.drop .sub { color: var(--ink2); font-size: var(--text-sm); max-width: 44ch; }
.drop svg { stroke: var(--signal); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.upload-row .chosen { color: var(--ink2); font-size: var(--text-xs); }
.file-row { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 12px; padding: 12px 10px; border-radius: var(--radius-control); }
.file-row .name { position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .result { position: relative; color: var(--ink2); font-size: var(--text-sm); flex: none; }
.file-row.reading { background: var(--deck2); }
.file-row.reading .result { color: var(--signal); }
/* R1, the burn line: while intake reads a file, a line of heat moves down its row. */
.scan::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--ember) 20%, var(--signal) 60%, transparent);
  box-shadow: 0 0 8px 1px var(--glow);
  animation: burn var(--dur-scan) ease-in-out infinite;
}
@keyframes burn { from { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { top: calc(100% - 2px); opacity: 0; } }
.files .note { margin-top: 8px; font-size: var(--text-xs); color: var(--ink2); }
progress.meter { appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: var(--radius-pill); background: var(--deck2); overflow: hidden; }
progress.meter::-webkit-progress-bar { background: var(--deck2); }
progress.meter::-webkit-progress-value { background: linear-gradient(90deg, var(--aurora), var(--signal)); }
progress.meter::-moz-progress-bar { background: linear-gradient(90deg, var(--aurora), var(--signal)); }
.helper { font-size: var(--text-sm); color: var(--ink2); }
.helper a { color: var(--ink); }
.fact {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px;
  border-radius: var(--radius-row); border: 1px solid var(--line);
  transition: border-color var(--dur-toggle) ease, opacity var(--dur-toggle) ease;
}
.fact.approved { border-color: var(--signal); }
.fact .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ink2); flex: none; }
.fact.approved .dot { background: var(--signal); border-color: var(--signal); }
.fact .text { flex: 999 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fact .text .what { font-weight: 500; }
.fact .text .from { font-size: var(--text-xs); color: var(--ink2); }
.fact .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.conflict { padding: 14px; border-radius: var(--radius-row); border: 1px solid var(--ember); display: flex; flex-direction: column; gap: 4px; }
.conflict .title { font-weight: 600; color: var(--ember); }
.conflict .choices { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
details.edit > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink2); cursor: pointer; font-size: var(--text-sm); }
/* Edit beside Approve and Reject: a quiet summary in the row; the form opens under the row. */
.fact { position: relative; }
details.inline-edit > summary { padding: 0 14px; border-radius: var(--radius-control); font-size: var(--text-md); list-style: none; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
details.inline-edit[open] { flex-basis: 100%; }
details.inline-edit[open] > summary { color: var(--ink); }
.helper.next-step a { text-decoration: none; font-weight: 600; }

/* ---------------------------------------------------------------- buttons */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: var(--radius-control); border: 1px solid var(--line); background: transparent; color: var(--ink);
  font-family: var(--font-body); font-size: var(--text-md); text-decoration: none; cursor: pointer;
  transition: border-color var(--dur-hover) ease, color var(--dur-hover) ease, transform var(--dur-press) ease;
}
button:hover, .button:hover { border-color: var(--ink2); color: var(--ink); }
/* Primary buttons (ruling 56): --flame-button carries white text at 5.2 to 1 or more
   at every point; the gold is in the glow and the bottom edge, never under the label. */
.primary {
  min-height: 46px; padding: 0 20px; border: 0; background: var(--flame-button); color: var(--on-ember); font-weight: 600;
  box-shadow: 0 8px 22px -8px var(--glow), inset 0 1px 0 color-mix(in oklab, var(--on-ember) 18%, transparent),
    inset 0 -2px 0 color-mix(in oklab, var(--aurora) 55%, transparent);
  transition: transform var(--dur-press) ease, box-shadow var(--dur-toggle) ease;
}
.primary:hover {
  color: var(--on-ember); transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px var(--glow), inset 0 1px 0 color-mix(in oklab, var(--on-ember) 22%, transparent),
    inset 0 -2px 0 color-mix(in oklab, var(--aurora) 55%, transparent);
}
.primary:active { transform: translateY(0); }
.ghost { border-color: transparent; color: var(--ink2); }
.ghost:hover { border-color: transparent; color: var(--ink); }
button[aria-pressed="true"] { border-color: var(--signal); }
form.inline { display: inline-flex; }

/* ---------------------------------------------------------------- forms */
form.stack, .stack { display: flex; flex-direction: column; gap: 10px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-row); padding: 14px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
legend { padding: 0 4px; font-weight: 600; }
label { font-size: var(--text-sm); color: var(--ink2); }
.choice { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); font-size: var(--text-md); }
input[type="text"], input[type="password"], input[type="url"], input:not([type]), textarea, select {
  width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-row);
  background: var(--space); color: var(--ink); font-family: var(--font-body); font-size: var(--text-md);
}
textarea { min-height: 120px; padding: 12px 14px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--signal); }
input[type="file"]::file-selector-button {
  min-height: var(--hit); margin-right: 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-control);
  background: transparent; color: var(--ink); font-family: var(--font-body); font-size: var(--text-md); cursor: pointer;
  transition: border-color var(--dur-hover) ease;
}
input[type="file"]::file-selector-button:hover { border-color: var(--ink2); }

/* ---------------------------------------------------------------- messages and tables */
.notice { font-size: var(--text-sm); color: var(--ink2); }
.error { color: var(--ember); font-weight: 600; }
.disclosure { padding: 22px; border: 1px solid var(--ember); border-radius: var(--radius-panel); background: var(--deck); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink2); font-weight: 500; }
.scroll { overflow-x: auto; }
.theme-switch { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- job boards and jobs (M1b; no reference) */
.board-row {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border-radius: var(--radius-control); background: var(--deck2); overflow-wrap: anywhere;
}
.board-row .board-meta { font-size: var(--text-sm); color: var(--ink2); }
.board-row.closed .board-name { color: var(--ink2); }
.board-row a { color: var(--ink); }
button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------- Today: focused card, dial, shortlist (M1c; design: Main) */
.needs:has(> .focus-card) { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.focus-card {
  grid-column: span 2; min-width: 0; padding: 1px; background: var(--line);
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%); border-radius: var(--radius-panel);
}
/* The full flame (ruling 56: only where no text sits on it), 1 of 3: the decision card's edge. */
.ring { position: relative; overflow: hidden; background: var(--flame); }
[data-theme="day"] .ring, :root:not([data-theme]) .ring {
  box-shadow: 0 1px 2px color-mix(in oklab, var(--ink) 5%, transparent), 0 12px 32px -18px color-mix(in oklab, var(--ink) 18%, transparent);
}
.focus-inner {
  position: relative; height: 100%; box-sizing: border-box; padding: 28px; background: var(--deck);
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%); border-radius: var(--radius-panel);
  display: flex; flex-wrap: wrap; gap: 28px; align-items: center; align-content: center;
}
.focus-main { flex: 999 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.focus-main .label { font-size: var(--text-sm); color: var(--ember); font-weight: 600; }
.focus-main .head { display: flex; flex-direction: column; gap: 4px; }
.focus-main h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-2xl); line-height: 1.2; }
.focus-main .muted { font-size: var(--text-md); }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bullets li { display: flex; gap: 10px; align-items: baseline; }
.bullets .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); flex: none; transform: translateY(-2px); }
.bullets .dot.open { background: transparent; border: 1px solid var(--ink2); box-sizing: border-box; }
.bullets .unstated { color: var(--ink2); }
.acts { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; align-items: center; }
.quiet {
  display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 18px; border: 1px solid var(--line);
  border-radius: var(--radius-control); text-decoration: none; color: var(--ink2);
}
.quiet:hover { color: var(--ink); border-color: var(--ink2); }
.quiet.bare { border-color: transparent; }
.dial-box { flex: 1 1 140px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dial-wrap { position: relative; width: 132px; height: 132px; }
.dial-wrap svg { display: block; }
.dial { animation: dial var(--dur-dial) var(--ease-glide) calc(var(--cascade-step) * 4) both; }
.dial-label { font-size: var(--text-xs); color: var(--ink2); }
@property --score { syntax: "<integer>"; inherits: false; initial-value: 0; }
@keyframes countup { from { --score: 0; } }
.countup { counter-reset: score var(--score); animation: countup var(--dur-dial) var(--ease-glide) calc(var(--cascade-step) * 4) both; }
.countup::after { content: counter(score); }
.figure {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-figure); font-variant-numeric: tabular-nums;
}
[data-motion="off"] .dial, [data-motion="off"] .countup { animation: none; }
.queue { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.queue .queued { flex: 1; }
.radar-text .health { font-size: var(--text-sm); }
.shortlist-panel {
  box-sizing: border-box; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-panel);
  background: var(--deck); display: flex; flex-direction: column; gap: 6px;
}
.shortlist-panel .panel-head { padding-bottom: 8px; }
.row {
  display: flex; gap: 16px; align-items: center; min-height: 64px; padding: 8px 10px;
  border-radius: var(--radius-row); text-decoration: none; color: var(--ink);
}
.row:hover { background: var(--deck2); }
.row .fit {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-title); width: 40px; flex: none;
  font-variant-numeric: tabular-nums; color: var(--signal);
}
.row.miss .fit { color: var(--ink2); }
.row .text { display: flex; flex-direction: column; min-width: 0; }
.row .title { font-weight: 600; }
.row .muted { font-size: var(--text-sm); }

/* ---------------------------------------------------------------- Shortlist and the job page (M1c; no design) */
.match-card { gap: 14px; }
.match-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.match-head .who { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.match-head h2 a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
/* One line at any width; the title takes what is left (second M1c review S4). */
.fit-figure { font-family: var(--font-display); font-weight: 600; font-size: var(--text-display); color: var(--signal); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.constraints { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: var(--text-xs); padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--ink2); }
.pill.pass { color: var(--ink); }
.pill.fail, .helper.fails { color: var(--ember); }
.reason { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-row); background: var(--deck2); }
.reason .evidence { margin: 0; padding-left: 18px; color: var(--ink2); font-size: var(--text-sm); }
.result.gap, .result.fail { color: var(--ember); }
.greeting .back { align-self: flex-start; }
.countup.n0 { --score: 0; }
.countup.n1 { --score: 1; }
.countup.n2 { --score: 2; }
.countup.n3 { --score: 3; }
.countup.n4 { --score: 4; }
.countup.n5 { --score: 5; }
.countup.n6 { --score: 6; }
.countup.n7 { --score: 7; }
.countup.n8 { --score: 8; }
.countup.n9 { --score: 9; }
.countup.n10 { --score: 10; }
.countup.n11 { --score: 11; }
.countup.n12 { --score: 12; }
.countup.n13 { --score: 13; }
.countup.n14 { --score: 14; }
.countup.n15 { --score: 15; }
.countup.n16 { --score: 16; }
.countup.n17 { --score: 17; }
.countup.n18 { --score: 18; }
.countup.n19 { --score: 19; }
.countup.n20 { --score: 20; }
.countup.n21 { --score: 21; }
.countup.n22 { --score: 22; }
.countup.n23 { --score: 23; }
.countup.n24 { --score: 24; }
.countup.n25 { --score: 25; }
.countup.n26 { --score: 26; }
.countup.n27 { --score: 27; }
.countup.n28 { --score: 28; }
.countup.n29 { --score: 29; }
.countup.n30 { --score: 30; }
.countup.n31 { --score: 31; }
.countup.n32 { --score: 32; }
.countup.n33 { --score: 33; }
.countup.n34 { --score: 34; }
.countup.n35 { --score: 35; }
.countup.n36 { --score: 36; }
.countup.n37 { --score: 37; }
.countup.n38 { --score: 38; }
.countup.n39 { --score: 39; }
.countup.n40 { --score: 40; }
.countup.n41 { --score: 41; }
.countup.n42 { --score: 42; }
.countup.n43 { --score: 43; }
.countup.n44 { --score: 44; }
.countup.n45 { --score: 45; }
.countup.n46 { --score: 46; }
.countup.n47 { --score: 47; }
.countup.n48 { --score: 48; }
.countup.n49 { --score: 49; }
.countup.n50 { --score: 50; }
.countup.n51 { --score: 51; }
.countup.n52 { --score: 52; }
.countup.n53 { --score: 53; }
.countup.n54 { --score: 54; }
.countup.n55 { --score: 55; }
.countup.n56 { --score: 56; }
.countup.n57 { --score: 57; }
.countup.n58 { --score: 58; }
.countup.n59 { --score: 59; }
.countup.n60 { --score: 60; }
.countup.n61 { --score: 61; }
.countup.n62 { --score: 62; }
.countup.n63 { --score: 63; }
.countup.n64 { --score: 64; }
.countup.n65 { --score: 65; }
.countup.n66 { --score: 66; }
.countup.n67 { --score: 67; }
.countup.n68 { --score: 68; }
.countup.n69 { --score: 69; }
.countup.n70 { --score: 70; }
.countup.n71 { --score: 71; }
.countup.n72 { --score: 72; }
.countup.n73 { --score: 73; }
.countup.n74 { --score: 74; }
.countup.n75 { --score: 75; }
.countup.n76 { --score: 76; }
.countup.n77 { --score: 77; }
.countup.n78 { --score: 78; }
.countup.n79 { --score: 79; }
.countup.n80 { --score: 80; }
.countup.n81 { --score: 81; }
.countup.n82 { --score: 82; }
.countup.n83 { --score: 83; }
.countup.n84 { --score: 84; }
.countup.n85 { --score: 85; }
.countup.n86 { --score: 86; }
.countup.n87 { --score: 87; }
.countup.n88 { --score: 88; }
.countup.n89 { --score: 89; }
.countup.n90 { --score: 90; }
.countup.n91 { --score: 91; }
.countup.n92 { --score: 92; }
.countup.n93 { --score: 93; }
.countup.n94 { --score: 94; }
.countup.n95 { --score: 95; }
.countup.n96 { --score: 96; }
.countup.n97 { --score: 97; }
.countup.n98 { --score: 98; }
.countup.n99 { --score: 99; }
.countup.n100 { --score: 100; }

/* ---------------------------------------------------------------- M1c fix round */
.dial-box.small { flex: none; align-self: center; }
.dial-box.small .dial-wrap { width: 96px; height: 96px; }
.dial-box.small .figure { font-size: var(--text-display); }
.req-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 2px 12px; padding: 10px; border-radius: var(--radius-row);
}
.req-row .name { min-width: 0; overflow-wrap: anywhere; }
.req-row .result { font-size: var(--text-sm); color: var(--ink2); }
details.ranking > summary { font-weight: 600; }
details.ranking[open] > summary { margin-bottom: 10px; }
.more-waiting { align-self: flex-start; font-size: var(--text-sm); color: var(--ink2); }
.more-waiting:hover { color: var(--ink); }

/* ---------------------------------------------------------------- R1: the pipeline counts (Main)
   At the top of the decision card, above "Ready to submit", under a hairline; with
   nothing waiting, in a plain card in the same place. Two columns on a phone. */
.counts {
  flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr));
  gap: 14px 12px; padding-bottom: 18px; margin-bottom: -6px; border-bottom: 1px solid var(--line);
}
.counts .count { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.counts .n { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.counts .ready .n { color: var(--ember); }
.counts .what { font-size: var(--text-xs); color: var(--ink2); }
.counts-card { grid-column: 1 / -1; padding: 22px 28px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--deck); }
.counts-card .counts { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
@media (max-width: 719px) { .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- M1d: application preview (Preview) */
.focused.preview { padding-top: 32px; padding-bottom: 0; gap: 24px; }
.preview .page-head { gap: 10px; }
.preview-h { font-weight: 500; font-size: var(--text-hero-preview); line-height: 1.15; max-width: none; }
.focused h1.preview-h { max-width: none; font-size: var(--text-hero-preview); line-height: 1.15; }
.lede-plain { color: var(--ink2); }
/* R1, signed in fire: the person's name, written in flame stroke by stroke, then
   cooled to burnt copper. Drawn cooled unless the script starts the writing. */
.signed { display: flex; flex-direction: column; gap: 2px; color: var(--ink2); }
.sig { display: block; height: 56px; width: auto; max-width: 100%; overflow: visible; }
.sig path { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sig .ink path { stroke: color-mix(in oklab, var(--ember) 70%, var(--ink2)); }
.sig .fire { display: none; }
.sig.go .fire { display: inline; filter: drop-shadow(0 0 3px var(--glow)); animation: sig-cool var(--dur-flare) ease var(--sig-total) forwards; }
.sig.go path { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: sig-write var(--sig-dur) cubic-bezier(0.45, 0.05, 0.4, 1) var(--sig-delay) forwards; }
.sig-plain { font-family: var(--font-display); font-size: var(--text-xl); font-style: italic; color: var(--ember); }
@keyframes sig-write { to { stroke-dashoffset: 0; } }
@keyframes sig-cool { to { opacity: 0; } }
.needs-you { display: flex; flex-direction: column; gap: 14px; }
.answer-form {
  padding: 20px 22px; border: 1px solid var(--ember); border-radius: var(--radius-card); background: var(--deck);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: end;
}
.answer-form.changes { border-color: var(--line); margin-top: 14px; }
.answer-body { flex: 999 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.answer-body label { font-weight: 600; }
.answer-body input { min-height: 46px; padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--space); color: var(--ink); }
.answer-body .helper { font-size: var(--text-xs); }
.claim-item {
  padding: 20px 22px; border: 1px solid var(--ember); border-radius: var(--radius-card); background: var(--deck);
  display: flex; flex-direction: column; gap: 10px;
}
.claim-item p { font-weight: 600; }
.claim-item p.helper { font-weight: 400; font-size: var(--text-xs); }
.all-clear {
  padding: 16px 22px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--deck);
  display: flex; gap: 12px; align-items: center;
}
.beacon { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 14px var(--glow); flex: none; }
.settle { animation: settle var(--dur-settle) var(--ease-glide) both; }
@keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.preview .panel { padding: 24px; gap: 14px; }
.preview .panel h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); }
.form-panel { gap: 18px; }
.preview .tabs { padding-top: 0; }
.fields { display: flex; flex-direction: column; gap: 6px; }
.field {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius-row);
  border: 1px solid transparent; background: transparent; color: var(--ink); text-decoration: none;
  transition: background var(--dur-hover) ease, border-color var(--dur-hover) ease;
}
a.field:hover { background: var(--deck2); }
.field.picked { border-color: var(--signal); }
.f-label { font-size: var(--text-xs); color: var(--ink2); }
.f-value { font-weight: 500; overflow-wrap: anywhere; }
.f-value.waiting { color: var(--ink2); font-weight: 400; }
.f-source { font-size: var(--text-xs); color: var(--signal); }
.f-source.open { color: var(--ember); }
.field.static { position: relative; padding-right: 96px; }
.f-act { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
/* Handoff on a phone: Copy goes under the value, so the value has the whole line (M1d review, D4). */
@media (max-width: 480px) {
  .field.static { padding-right: 16px; }
  .f-act { position: static; transform: none; align-self: flex-start; margin-top: 4px; }
}
.passage { padding: 16px; border-radius: var(--radius-row); background: var(--space); border: 1px solid var(--line); overflow-wrap: anywhere; }
.passage .mark {
  color: var(--ink);
  background: linear-gradient(var(--glow), var(--glow)) no-repeat left / 100% 100%;
  animation: mark var(--dur-settle) var(--ease-glide) both;
  border-radius: var(--radius-mark);
}
@keyframes mark { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
/* R1: the passage a fact came from, faintly singed. */
.passage .mark.singe {
  background:
    linear-gradient(color-mix(in oklab, var(--ember) 55%, transparent), color-mix(in oklab, var(--ember) 55%, transparent)) no-repeat left bottom / 100% 1px,
    linear-gradient(color-mix(in oklab, var(--signal) 12%, transparent), color-mix(in oklab, var(--ember) 8%, transparent)) no-repeat left / 100% 100%;
}
.quiet.ink { color: var(--ink); }
.compare { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius-row); background: var(--space); border: 1px solid var(--line); }
.preview-foot {
  position: sticky; bottom: 0; margin: 12px calc(-1 * var(--page-pad)) 0; padding: 16px var(--page-pad);
  border-top: 1px solid var(--line); background: color-mix(in oklab, var(--space) 86%, transparent);
  backdrop-filter: blur(14px); display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  max-width: none; width: auto;
}
.foot-note { margin-left: auto; font-size: var(--text-sm); color: var(--ink2); }
.preview-foot button[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.submitted-form { display: flex; flex-wrap: wrap; gap: 12px; flex: 1 1 420px; }
.submitted-form input { flex: 1 1 260px; min-height: 46px; }
li.yours .small { margin-left: 6px; }

/* ---------------------------------------------------------------- M1d: applications list */
.app-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-state { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-state .state { font-weight: 600; }
@media (max-width: 640px) { .app-row { grid-template-columns: 1fr; gap: 6px; } }
/* ---------------------------------------------------------------- the Connect step (reference: Connect, binding) */
.connect { padding: 36px clamp(20px, 4vw, 56px) 56px; display: flex; flex-direction: column; gap: 32px; }
.connect > * { box-sizing: border-box; width: 100%; max-width: 1080px; margin-left: auto; margin-right: auto; }
.connect-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.setup-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--text-sm); }
/* Review F6: the reference's boxes are content-box, so a 1 px border adds 2 px:
   36 px pills are 38 here, 26 px circles 28, the 36 px tick 38. */
.setup-steps li { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--ink2); }
.setup-steps li .step-n { font-variant-numeric: tabular-nums; }
.setup-steps li[aria-current="step"] { border-color: var(--signal); color: var(--ink); background: var(--deck2); }
.setup-steps li[aria-current="step"] .step-n { color: var(--signal); font-weight: 600; }
.connect-head { display: flex; flex-direction: column; gap: 12px; }
.connect-head h1 { font-weight: 500; font-size: var(--text-hero-evidence); line-height: 1.1; max-width: 20ch; }
.connect-head > p:not(.notice):not(.error) { color: var(--ink2); font-size: var(--text-lg); max-width: 62ch; }
/* R1: one panel, OpenRouter, centred as the reference draws it. */
.connect-panels { width: 100%; }
.connect-panels > .connect-panel { max-width: 600px; margin: 0 auto; padding: 30px; gap: 18px; }
.connect-panel { box-sizing: border-box; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--deck); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.connect-panel.lit { box-shadow: 0 24px 70px -40px var(--glow); }
.connect-panel h2 { font-weight: 600; font-size: var(--text-xl); line-height: 1.2; }
.connect-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.connect-panel .badge { font-size: var(--text-xs); padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--signal); color: var(--signal); }
.connect-panel .panel-lede { color: var(--ink2); font-size: var(--text-md); }
.connect-panel .small, .connect-done .small { font-size: var(--text-xs); color: var(--ink2); }
.numbered { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.numbered li { display: flex; gap: 12px; align-items: flex-start; }
.numbered .n { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-xs); font-variant-numeric: tabular-nums; color: var(--ink2); }
.numbered li > span:last-child { padding-top: 2px; }
.connect-panel .primary.wide-button { width: 100%; min-height: 50px; padding: 0 22px; border-radius: var(--radius-control); font-size: var(--text-body-lg); margin-top: 4px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick form { display: contents; }
.pick-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: transparent; color: var(--ink2); text-decoration: none; }
.pick-button:hover { border-color: var(--ink2); color: var(--ink); }
.pick-button[aria-pressed="true"] { border-color: var(--signal); background: var(--deck2); color: var(--ink); }
.quiet-button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-control); background: transparent; color: var(--ink); flex: 1 0 auto; }
.quiet-button.dim { color: var(--ink2); flex: 0 0 auto; }
.connect-foot { color: var(--ink2); font-size: var(--text-sm); }
.connect > .connect-done { max-width: 720px; gap: 22px; }
.done-head { display: flex; gap: 14px; align-items: flex-start; }
.done-head > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.done-head .tick { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--signal); color: var(--signal); display: inline-flex; align-items: center; justify-content: center; }
/* Review F2: the hollow amber ring of "Almost connected". */
.done-head .tick.pending { border-color: var(--ember); color: var(--ember); }
.done-acts form { display: contents; }
.connect-done .strong { font-weight: 600; color: var(--ink); font-size: var(--text-md); }
.model-choice { display: flex; flex-direction: column; gap: 10px; }
.stop-form { display: flex; flex-direction: column; gap: 6px; }
.limit-row { display: flex; align-items: center; gap: 10px; }
.limit-row .dollar { color: var(--ink2); font-size: var(--text-lg); }
.limit-row input { width: 110px; min-height: 44px; box-sizing: border-box; padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--deck2); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.done-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.done-acts .primary { min-height: 48px; padding: 0 22px; border-radius: var(--radius-control); font-size: var(--text-body-lg); }

/* ---------------------------------------------------------------- R1: two intensities
   Quiet, night only: up to 12 slow embers and the bottom heat (on body, above).
   Turned up: 24 more embers while a run is in progress; the decision card's flame
   edge circles and its primary button smoulders while that decision waits; the
   dial flickers on the top match. With reduced motion nothing moves and the
   embers are not drawn. */
.embers { display: none; position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
[data-theme="night"] .embers { display: block; }
.embers i {
  position: absolute; bottom: -12px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, var(--aurora) 0, var(--signal) 40%, var(--ember) 70%, transparent 72%);
  box-shadow: 0 0 8px 2px var(--glow);
  animation: rise-a var(--dur-beat) linear infinite;
}
.embers i:nth-child(3n+2) { animation-name: rise-b; }
.embers i:nth-child(3n) { animation-name: rise-c; }
.embers i:nth-child(1) { left: 66.3%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 0.73); animation-delay: calc(var(--dur-beat) * -0.17); }
.embers i:nth-child(2) { left: 32.1%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.76); animation-delay: calc(var(--dur-beat) * -0.73); }
.embers i:nth-child(3) { left: 96.8%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.89); animation-delay: calc(var(--dur-beat) * -0.68); }
.embers i:nth-child(4) { left: 58.9%; width: 4px; height: 4px; animation-duration: calc(var(--dur-beat) * 0.76); animation-delay: calc(var(--dur-beat) * -1.04); }
.embers i:nth-child(5) { left: 76.2%; width: 5px; height: 5px; animation-duration: calc(var(--dur-beat) * 0.96); animation-delay: calc(var(--dur-beat) * -1.06); }
.embers i:nth-child(6) { left: 56.5%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 1.02); animation-delay: calc(var(--dur-beat) * -0.21); }
.embers i:nth-child(7) { left: 11.4%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 0.67); animation-delay: calc(var(--dur-beat) * -0.17); }
.embers i:nth-child(8) { left: 80.7%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 1.14); animation-delay: calc(var(--dur-beat) * -0.42); }
.embers i:nth-child(9) { left: 58.9%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.75); animation-delay: calc(var(--dur-beat) * -0.42); }
.embers i:nth-child(10) { left: 21.1%; width: 4px; height: 4px; animation-duration: calc(var(--dur-beat) * 0.98); animation-delay: calc(var(--dur-beat) * -0.67); }
.embers i:nth-child(11) { left: 97.4%; width: 5px; height: 5px; animation-duration: calc(var(--dur-beat) * 0.65); animation-delay: calc(var(--dur-beat) * -0.65); }
.embers i:nth-child(12) { left: 51.1%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 0.86); animation-delay: calc(var(--dur-beat) * -0.44); }
.embers i:nth-child(13) { left: 94.7%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 1.11); animation-delay: calc(var(--dur-beat) * -0.39); }
.embers i:nth-child(14) { left: 65.5%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.82); animation-delay: calc(var(--dur-beat) * -0.73); }
.embers i:nth-child(15) { left: 14.7%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.66); animation-delay: calc(var(--dur-beat) * -0.01); }
.embers i:nth-child(16) { left: 29.8%; width: 4px; height: 4px; animation-duration: calc(var(--dur-beat) * 0.93); animation-delay: calc(var(--dur-beat) * -0.51); }
.embers i:nth-child(17) { left: 3.5%; width: 5px; height: 5px; animation-duration: calc(var(--dur-beat) * 0.87); animation-delay: calc(var(--dur-beat) * -0.00); }
.embers i:nth-child(18) { left: 52.5%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 1.11); animation-delay: calc(var(--dur-beat) * -0.21); }
.embers i:nth-child(19) { left: 88.7%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 0.89); animation-delay: calc(var(--dur-beat) * -0.88); }
.embers i:nth-child(20) { left: 57.1%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.61); animation-delay: calc(var(--dur-beat) * -0.15); }
.embers i:nth-child(21) { left: 93.7%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.80); animation-delay: calc(var(--dur-beat) * -0.18); }
.embers i:nth-child(22) { left: 29.8%; width: 4px; height: 4px; animation-duration: calc(var(--dur-beat) * 0.65); animation-delay: calc(var(--dur-beat) * -0.66); }
.embers i:nth-child(23) { left: 32.8%; width: 5px; height: 5px; animation-duration: calc(var(--dur-beat) * 0.88); animation-delay: calc(var(--dur-beat) * -0.24); }
.embers i:nth-child(24) { left: 67.8%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 0.88); animation-delay: calc(var(--dur-beat) * -0.56); }
.embers i:nth-child(25) { left: 3.8%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 0.86); animation-delay: calc(var(--dur-beat) * -0.94); }
.embers i:nth-child(26) { left: 61.6%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.90); animation-delay: calc(var(--dur-beat) * -1.05); }
.embers i:nth-child(27) { left: 2.9%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.87); animation-delay: calc(var(--dur-beat) * -1.13); }
.embers i:nth-child(28) { left: 36.2%; width: 4px; height: 4px; animation-duration: calc(var(--dur-beat) * 0.68); animation-delay: calc(var(--dur-beat) * -0.28); }
.embers i:nth-child(29) { left: 42.9%; width: 5px; height: 5px; animation-duration: calc(var(--dur-beat) * 0.93); animation-delay: calc(var(--dur-beat) * -1.10); }
.embers i:nth-child(30) { left: 12.0%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 1.12); animation-delay: calc(var(--dur-beat) * -0.75); }
.embers i:nth-child(31) { left: 49.3%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 0.82); animation-delay: calc(var(--dur-beat) * -0.70); }
.embers i:nth-child(32) { left: 11.7%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.77); animation-delay: calc(var(--dur-beat) * -0.46); }
.embers i:nth-child(33) { left: 37.8%; width: 3px; height: 3px; animation-duration: calc(var(--dur-beat) * 0.71); animation-delay: calc(var(--dur-beat) * -0.51); }
.embers i:nth-child(34) { left: 57.6%; width: 4px; height: 4px; animation-duration: calc(var(--dur-beat) * 0.90); animation-delay: calc(var(--dur-beat) * -1.14); }
.embers i:nth-child(35) { left: 9.7%; width: 5px; height: 5px; animation-duration: calc(var(--dur-beat) * 1.09); animation-delay: calc(var(--dur-beat) * -0.52); }
.embers i:nth-child(36) { left: 28.6%; width: 2px; height: 2px; animation-duration: calc(var(--dur-beat) * 1.03); animation-delay: calc(var(--dur-beat) * -1.02); }
@keyframes rise-a { 0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; } 10% { opacity: 0.9; } 70% { opacity: 0.5; } 100% { transform: translate3d(-60px, -100vh, 0) scale(0.3); opacity: 0; } }
@keyframes rise-b { 0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; } 10% { opacity: 0.9; } 70% { opacity: 0.5; } 100% { transform: translate3d(25px, -100vh, 0) scale(0.3); opacity: 0; } }
@keyframes rise-c { 0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; } 10% { opacity: 0.9; } 70% { opacity: 0.5; } 100% { transform: translate3d(75px, -100vh, 0) scale(0.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .embers { display: none !important; } }
[data-motion="off"] .embers { display: none !important; }

/* The circling edge: the angle is registered so it can turn (ruling 30's list holds --edge). */
@property --edge { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes edge { to { --edge: 360deg; } }
.ring.waiting {
  background: conic-gradient(from var(--edge), var(--f1), var(--f2) 20%, var(--f3) 40%, var(--f2) 60%, var(--f1) 80%, var(--f1));
  animation: edge calc(var(--dur-arrive) * 10) linear infinite;
}
@keyframes smoulder { to { background-position: 100% 50%; } }
.ring.waiting .primary { background-size: 220% 100%; background-position: 0% 50%; animation: smoulder var(--dur-breathe) ease-in-out infinite alternate; }
@keyframes flicker-glow {
  0%, 100% { filter: drop-shadow(0 0 4px var(--glow)); }
  35% { filter: drop-shadow(0 0 10px var(--glow)); }
  60% { filter: drop-shadow(0 0 6px var(--glow)); }
  80% { filter: drop-shadow(0 0 12px var(--glow)); }
}
.dial-wrap svg.flicker { overflow: visible; animation: flicker-glow calc(var(--dur-dial) * 2.4) ease-in-out var(--dur-flare) infinite; }

/* The pilot light: a flickering flame while a run is active, a dim ember otherwise. */
@keyframes flicker { 0%, 100% { transform: scale(1, 1) skewX(0); } 20% { transform: scale(0.96, 1.05) skewX(-2deg); } 45% { transform: scale(1.03, 0.95) skewX(1.5deg); } 70% { transform: scale(0.98, 1.08) skewX(-1deg); } }
@keyframes ember-glow { 50% { opacity: 0.25; } }
.pilot.active .pilot-flame { transform-origin: 50% 92%; animation: flicker calc(var(--dur-settle) * 4) ease-in-out infinite; }
.pilot:not(.active) .pilot-flame { animation: ember-glow calc(var(--dur-breathe) * 1.06) ease-in-out infinite; }

/* Cards catch: on arrival each card's top edge ignites in turn, a cascade step
   (80 ms) apart, then cools. Once per page load. */
:is(.panel, .queued, .counts-card, .radar-panel, .shortlist-panel, .pilot) { position: relative; }
:is(.panel, .queued, .counts-card, .radar-panel, .shortlist-panel, .pilot)::after {
  content: ""; position: absolute; left: 12px; right: 12px; top: -1px; height: 2px; border-radius: var(--radius-pill);
  pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--ember) 20%, var(--signal) 55%, var(--aurora) 80%, transparent);
  box-shadow: 0 0 10px 1px var(--glow);
  animation: catch calc(var(--dur-flare) * 0.6) var(--ease-glide) both;
}
:is(.d1, .d1 *):is(.panel, .queued, .counts-card, .radar-panel, .shortlist-panel, .pilot)::after { animation-delay: var(--cascade-step); }
:is(.d2, .d2 *):is(.panel, .queued, .counts-card, .radar-panel, .shortlist-panel, .pilot)::after { animation-delay: calc(var(--cascade-step) * 2); }
:is(.d3, .d3 *):is(.panel, .queued, .counts-card, .radar-panel, .shortlist-panel, .pilot)::after { animation-delay: calc(var(--cascade-step) * 3); }
:is(.d4, .d4 *):is(.panel, .queued, .counts-card, .radar-panel, .shortlist-panel, .pilot)::after { animation-delay: calc(var(--cascade-step) * 4); }
@keyframes catch { 0% { opacity: 0; transform: scaleX(0.4); } 35% { opacity: 1; transform: none; } 100% { opacity: 0; } }
[data-motion="off"] :is(.ring.waiting, .ring.waiting .primary, .dial-wrap svg.flicker, .pilot-flame),
[data-motion="off"] :is(.panel, .queued, .counts-card, .radar-panel, .shortlist-panel, .pilot)::after { animation: none; }
