/* MONOLITH — basalt and bone, after dark.
   Hairlines, tracked-out caps, monochrome verdicts; the patience of a
   runway show. One dark theater now: basalt paper where decisions are
   read, framed by the ink proscenium (film header, top bar, tab bar),
   which stays a step deeper. The bone that was the paper is now the ink.
   Motion is slow and architectural, never bouncy. */

/* ---------------------------------------------------------------- tokens */

:root {
  /* basalt paper: dark, architectural, one step lighter than the stage */
  --bg: #1a1815;
  --panel: #1a1815;
  --line: #38342b;
  --ink: #e7e4db;
  --dim: #938d7e;
  --faint: #857f6f;

  /* the ink proscenium: runway film, topbar, tabbar (deeper than paper) */
  --stage: #0f0e0c;
  --stage-2: #191713;
  --stage-ink: #e9e6df;
  --stage-dim: rgba(233, 230, 223, 0.62);
  --stage-line: rgba(233, 230, 223, 0.16);

  /* type */
  --sans: "Helvetica Neue", -apple-system, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  /* editorial serif for display moments: Didot on Apple platforms,
     graceful fallbacks elsewhere */
  --serif: "Didot", "Bodoni 72", "New York", "Times New Roman", serif;

  /* the scale: tracked miniature caps up to display light.
     Display and title moments moved to the editorial serif; labels,
     sections, and body stay sans, numerals stay mono. */
  --t-label: 400 9px/1.45 var(--sans);     /* field labels, block heads */
  --t-section: 400 10px/1.5 var(--sans);   /* section heads */
  --t-body: 14px/1.6 var(--sans);
  --t-display: 300 clamp(26px, 7.4vw, 40px)/1.12 var(--serif);
  --t-title: 300 clamp(22px, 6.2vw, 30px)/1.2 var(--serif);

  /* motion: unhurried, deliberate */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.35s;
  --dur: 0.7s;
  --dur-slow: 1.4s;
}

/* ------------------------------------------------------------ base/reset */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font: var(--t-body);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--bg); }

/* Keyboard focus is a hairline offset frame: architectural, consistent. */
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
#tabbar :focus-visible, .wear-prompt :focus-visible { outline-color: var(--stage-ink); }
input:focus, select:focus, textarea:focus { outline: none; }

/* ------------------------------------------------------ motion primitives */

@keyframes surface-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.8; }
}

/* Tab switches enter like a page turn: once per switch, applied by the
   tabbar handler only — DECIDE re-renders on love/eye taps must never
   replay it (that reads as lag, not motion). */
@keyframes tab-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
#view.tab-enter { animation: tab-in var(--dur) var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------- the runway film */
/* One long, unhurried cut: a dark stage, the app icon's monolith restaged,
   a single spotlight pass (56s), a barely perceptible push-in (90s).
   Pure CSS: zero bytes over the network, pausing when scrolled away
   (observer in index.html). Under prefers-reduced-motion the pass and the
   push are removed and the explicit overrides below compose a lit still. */

#runway {
  background: var(--stage);
  height: clamp(140px, 22vh, 224px);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.rw-scene {
  position: absolute;
  inset: 0;
  animation: rw-push 90s var(--ease) infinite alternate;
  transform-origin: 50% 62%;
}
@keyframes rw-push {
  from { transform: scale(1); }
  to   { transform: scale(1.055); }
}

/* backdrop: near-black, the faintest glow rising off the floor */
.rw-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 100%, #17150f 0%, transparent 55%),
    linear-gradient(#0d0c0a, #12100d);
}

/* licensed/original footage drops in as .rw-film (see index.html seam) */
#runway video.rw-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(0.85);
}

/* the runway floor line */
.rw-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(233, 230, 223, 0.13) 30%,
    rgba(233, 230, 223, 0.13) 70%, transparent);
}

/* the slab: the icon's monolith (0.22 x 0.56 of the mark), edge-lit */
.rw-monolith {
  position: absolute;
  left: 41%;
  bottom: 22%;
  width: clamp(34px, 9vw, 54px);
  height: 56%;
  background: linear-gradient(105deg, #282419 0%, #191711 55%, #121007 100%);
  box-shadow: -1px 0 0 rgba(233, 230, 223, 0.22);
}
.rw-monolith::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 36%;
  background: linear-gradient(rgba(233, 230, 223, 0.05), transparent 80%);
}

/* the single spotlight pass: one continuous cut, never a montage */
.rw-light {
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: 0;
  width: 55%;
  transform: translateX(-110%) skewX(-8deg);
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(236, 233, 224, 0.03) 30%,
    rgba(236, 233, 224, 0.085) 50%,
    rgba(236, 233, 224, 0.03) 70%,
    transparent 100%);
  /* negative delay: the pass is already onstage at first paint */
  animation: rw-pass 56s linear -18s infinite;
}
@keyframes rw-pass {
  0%   { transform: translateX(-110%) skewX(-8deg); }
  100% { transform: translateX(292%) skewX(-8deg); }
}

/* vignette + film grain */
.rw-veil { position: absolute; inset: 0; }
.rw-veil::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(5, 5, 4, 0.5) 100%);
}
.rw-veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
}

/* the wordmark in the film: a title card that surfaces as the light
   passes and recedes with it — the show introduces itself */
.rw-credit {
  position: absolute;
  top: 24%;
  left: 0;
  right: 0;
  text-align: center;
  font: 300 clamp(11px, 2.6vw, 14px)/1 var(--sans);
  letter-spacing: 0.85em;
  text-indent: 0.85em;
  color: var(--stage-ink);
  opacity: 0;
  animation: rw-credit 56s linear -18s infinite;
}
@keyframes rw-credit {
  0%, 28%  { opacity: 0; }
  42%, 56% { opacity: 0.34; }
  72%, 100% { opacity: 0; }
}

/* scrolled away or reduced motion: the film holds a lit still */
#runway.rw-paused * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .rw-scene { animation: none; }
  .rw-light { animation: none; transform: translateX(30%) skewX(-8deg); }
  .rw-credit { animation: none; opacity: 0.22; }
}

/* ----------------------------------------------------------------- chrome */
/* The top bar continues the film: one ink proscenium, wordmark as the
   credit line. The bottom tab bar closes the frame. */

#topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 15px) 18px 14px;
  position: sticky;
  top: 0;
  background: var(--stage);
  color: var(--stage-ink);
  z-index: 10;
}
/* wordmark block left; budget and account stack on the right */
#topbar > div:first-child { grid-column: 1; grid-row: 1 / span 2; }

.wordmark {
  font-weight: 300;
  letter-spacing: 0.55em;
  font-size: 16px;
  cursor: pointer;
}

.tagline {
  font-size: 7.5px;
  letter-spacing: 0.3em;
  color: var(--stage-dim);
  margin-top: 5px;
  white-space: nowrap;
}

button.budget-strip {
  grid-column: 2;
  justify-self: end;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--stage-dim);
  transition: color var(--dur-fast) var(--ease);
}
.budget-strip.over { color: var(--stage-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.account-btn {
  grid-column: 2;
  justify-self: end;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--stage-dim);
  border: 1px solid var(--stage-line);
  background: transparent;
  padding: 4px 8px;
  margin-top: 5px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.account-btn:hover { border-color: var(--stage-ink); color: var(--stage-ink); }

#view {
  flex: 1;
  padding: 24px 18px calc(env(safe-area-inset-bottom, 0px) + 96px);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* Beta feedback line. Sits in flow after #view, so it needs its own
   clearance under the fixed tabbar. Hidden via [hidden] until boot()
   confirms a multi-user server. */
#beta-footer {
  text-align: center;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 84px);
}
#beta-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

#tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--stage);
  border-top: 1px solid var(--stage);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 10;
}

#tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--stage-dim);
  font: 400 11px/1 var(--sans);
  letter-spacing: 0.3em;
  text-indent: 0.3em; /* optically recenter tracked text */
  padding: 20px 0 18px;
  cursor: pointer;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
#tabbar button.active { color: var(--stage); background: var(--stage-ink); }
#tabbar .tabsub {
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  /* explicit muted bone, not inherited-dim x opacity: the stacked math
     bottomed out near 2:1 on the ink bar (design-review must-fix) */
  color: var(--stage-dim);
  opacity: 1;
  text-indent: 0;
}
#tabbar button.active .tabsub { color: inherit; opacity: 0.7; }

@media (min-width: 720px) {
  #tabbar {
    max-width: 720px;
    margin: 0 auto;
    border-left: 1px solid var(--ink);
    border-right: 1px solid var(--ink);
  }
}

/* ------------------------------------------------------------------- type */

h2.section {
  font: var(--t-section);
  letter-spacing: 0.42em;
  color: var(--dim);
  margin: 40px 0 14px;
  font-weight: 400;
}
h2.section:first-child { margin-top: 6px; }

/* The opening question of each surface is its editorial title:
   large, light, patient — and serif now, the magazine voice.
   Serifs carry their own air; tracking eases off accordingly. */
#view > div:first-child > h2.section:first-child {
  font: 300 clamp(20px, 5.4vw, 26px)/1.3 var(--serif);
  letter-spacing: 0.1em;
  color: var(--ink);
  margin: 14px 0 20px;
}

.muted { color: var(--dim); font-size: 11.5px; line-height: 1.7; max-width: 60ch; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------------ forms */

label {
  display: block;
  font: var(--t-label);
  letter-spacing: 0.3em;
  color: var(--dim);
  margin-bottom: 6px;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  caret-color: var(--ink);
  /* 16px holds off iOS focus-zoom; the form stays where you put it */
  font: 16px/1.4 var(--mono);
  padding: 11px 2px;
  margin-bottom: 16px;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}
textarea { border: 1px solid var(--line); padding: 13px 12px; }
textarea:focus { border-color: var(--ink); box-shadow: none; }

/* the point of temptation: the paste box carries real weight */
#g-urls { min-height: 96px; }
#qc-urls { min-height: 84px; }

select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e7e4db' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
}

/* --------------------------------------------------------------- buttons */

button.cta {
  width: 100%;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font: 400 11.5px/1 var(--sans);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  padding: 18px 0 17px;
  cursor: pointer;
  border-radius: 0;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    letter-spacing 1.1s var(--ease),
    opacity var(--dur-fast) var(--ease);
}
@media (hover: hover) {
  button.cta:hover:not(:disabled) {
    background: transparent;
    color: var(--ink);
    letter-spacing: 0.5em;
  }
}
button.cta:active:not(:disabled) { opacity: 0.75; }
button.cta:disabled { opacity: 0.35; }

button.ghost {
  width: 100%;
  background: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  font: 400 10px/1 var(--sans);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  padding: 14px 0 13px;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
@media (hover: hover) {
  button.ghost:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
}

button.mini {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font: 400 9px/1 var(--sans);
  letter-spacing: 0.18em;
  padding: 9px 10px 8px;
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}
@media (hover: hover) {
  button.mini:hover:not(:disabled) { border-color: var(--ink); }
}
button.mini.danger { border-color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.geo-pick.picked, .therm.picked, .stopb.picked, .mini.picked {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ------------------------------------------------------- panels and rows */

.panel {
  border: 1px solid var(--line);
  background: transparent;
  padding: 20px 18px;
  margin-bottom: 16px;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: none; }

/* rows that act as buttons invite quietly */
.item-row[role="button"] {
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
  transition: background-color var(--dur-fast) var(--ease);
}
@media (hover: hover) {
  .item-row[role="button"]:hover { background: rgba(231, 228, 219, 0.05); }
}
.item-row .meta { font: 10px/1.7 var(--mono); letter-spacing: 0.03em; color: var(--dim); }
.item-row .title { font-weight: 500; font-size: 13.5px; letter-spacing: 0.02em; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.bar { height: 2px; background: var(--line); position: relative; margin: 16px 0; }
.bar .fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--ink); }
.bar .fill.over { background: var(--ink); }

/* CAPITAL: what remains, as the surface's one large numeral */
.capital-num {
  font: 300 clamp(30px, 8.5vw, 40px)/1.1 var(--mono);
  letter-spacing: 0.01em;
  color: var(--ink);
}
.capital-num .capital-unit {
  font: 400 10px/1 var(--sans);
  letter-spacing: 0.3em;
  color: var(--dim);
}

.alert { border: 1px solid var(--ink); padding: 15px 14px; font-size: 13px; margin-bottom: 14px; color: var(--ink); }
.alert.warn { background: var(--ink); color: var(--bg); }
.alert.warn .finding, .alert.warn .finding::before { color: var(--bg); }

/* Care state worn by the vault rows it protects. */
.care-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.care-badge {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.care-badge.warn { background: var(--ink); color: var(--bg); }

/* ---------------------------------------------------------- verdict card */

/* Monochrome states: solid = rejected, outline = approved, dashed =
   insufficient. The word carries the weight. */
.verdict {
  border: 1px solid var(--ink);
  margin: 18px 0;
  background: transparent;
  animation: surface-in var(--dur) var(--ease) both;
}
.verdict .head {
  padding: 24px 18px 22px;
  font: var(--t-display);
  letter-spacing: 0.16em;
}
.verdict.approve .head { background: transparent; color: var(--ink); border-bottom: 1px solid var(--ink); }
.verdict.reject .head { background: var(--ink); color: var(--bg); }
.verdict.insufficient { border-style: dashed; }
.verdict.insufficient .head { background: transparent; color: var(--ink); border-bottom: 1px dashed var(--ink); }
.verdict .sub {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.verdict .block { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.verdict .block:last-child { border-bottom: none; }
.verdict .block h4 {
  font: var(--t-label);
  letter-spacing: 0.35em;
  color: var(--dim);
  margin-bottom: 11px;
}

.finding { font-size: 13px; line-height: 1.6; margin-bottom: 8px; padding-left: 16px; position: relative; }
.finding::before { content: "·"; position: absolute; left: 0; color: var(--dim); }
.finding.violation { color: var(--ink); font-weight: 600; }
.finding.violation::before { content: "✕"; color: var(--ink); font-weight: 400; }
.finding.note { color: var(--dim); font-weight: 400; }
.finding.good { color: var(--ink); font-weight: 400; }
.finding.good::before { content: "+"; }
.finding .src { display: block; font: 9px/1.7 var(--mono); letter-spacing: 0.04em; color: var(--faint); }

.gate-line { display: flex; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; padding: 5px 0; }
.gate-line .status { font-weight: 700; min-width: 34px; }
.gate-line .pass { color: var(--ink); }
.gate-line .fail { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* The celebrated yes: an APPROVE is the reward, not a permission slip.
   Monochrome by design; the excitement is carried by scale and light
   weight, never color. */
.yes-hero { padding: 22px 18px 20px; border-bottom: 1px solid var(--line); }
.yes-mark {
  font: 300 clamp(20px, 5.6vw, 27px)/1.15 var(--serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.yes-line { font-size: 14px; line-height: 1.7; color: var(--ink); max-width: 46ch; }
.cpw { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cpw-num { font: 300 clamp(28px, 7.4vw, 36px)/1 var(--mono); letter-spacing: 0.01em; color: var(--ink); }
.cpw-num .cpw-unit { font-size: 13px; font-weight: 400; letter-spacing: 0.06em; color: var(--dim); }
.cpw-note {
  font: 10px/1.7 var(--mono);
  letter-spacing: 0.03em;
  color: var(--dim);
  margin-top: 8px;
  max-width: 46ch;
}
.cpw-note .src { display: block; color: var(--faint); margin-top: 2px; }

/* Recorded state replaces the CTA after a successful write. */
.recorded-state {
  font: 400 11px/1.7 var(--mono);
  letter-spacing: 0.06em;
  padding: 12px 0 2px;
}

/* Inline import errors */
.inline-errors { margin-top: 8px; }
.inline-errors .finding { font-family: var(--mono); font-size: 11px; }

/* ----------------------------------------------------------- quests (DECIDE) */

.quest-head { margin-bottom: 6px; }
.quest-title {
  font: var(--t-title);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 12px;
  color: var(--ink);
}
.quest-brief {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 16px;
}
.qb-band {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 9px;
}

/* the composite score: the decisive numeral reads like a bib number */
.score-num {
  font: 300 clamp(24px, 6.4vw, 30px)/1 var(--mono);
  letter-spacing: 0;
  color: var(--ink);
  flex-shrink: 0;
}

/* --------------------------------------------------------- wear prompt */

/* One-tap wear log: the evening bar rises off the tab bar like a stage
   door opening — same ink world as the proscenium. */
.wear-prompt {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--stage);
  color: var(--stage-ink);
  border-top: 1px solid var(--stage-line);
  padding: 14px 18px 16px;
  max-height: 45vh;
  overflow-y: auto;
  animation: surface-in var(--dur) var(--ease) both;
}
.wear-prompt .wp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 400 10px/1 var(--sans);
  letter-spacing: 0.3em;
  color: var(--stage-dim);
  margin-bottom: 12px;
}
.wear-prompt .wp-x {
  background: none;
  border: none;
  color: var(--stage-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.wear-prompt .wp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.wear-prompt .wp-chip {
  border: 1px solid var(--stage-line);
  background: none;
  color: var(--stage-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 8px 11px;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.wear-prompt .wp-chip.on { border-color: var(--stage-ink); background: var(--stage-ink); color: var(--stage); }
.wear-prompt .wp-actions { display: flex; gap: 8px; align-items: center; }
.wear-prompt .wp-actions .cta {
  flex: 1;
  margin: 0;
  background: var(--stage-ink);
  color: var(--stage);
  border-color: var(--stage-ink);
}
@media (hover: hover) {
  .wear-prompt .wp-actions .cta:hover:not(:disabled) { background: transparent; color: var(--stage-ink); }
}
.wear-prompt .wp-actions .cta:disabled { opacity: 0.3; }
.wear-prompt .wp-actions .ghost {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  padding-left: 14px;
  padding-right: 14px;
  border-color: var(--stage-line);
  color: var(--stage-ink);
}
@media (hover: hover) {
  .wear-prompt .wp-actions .ghost:hover:not(:disabled) { background: var(--stage-ink); color: var(--stage); }
}

/* ------------------------------------------------- empty, loading, toast */

.empty {
  color: var(--dim);
  font: 400 10px/2.1 var(--sans);
  letter-spacing: 0.3em;
  padding: 30px 0;
  text-align: center;
}
.empty.loading { animation: breathe 2.6s var(--ease) infinite; }

.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font: 400 10px/1.6 var(--mono);
  letter-spacing: 0.12em;
  padding: 14px 20px;
  z-index: 50;
  max-width: 90vw;
  animation: fade-in var(--dur-fast) var(--ease) both;
}

/* ----------------------------------------------------- details / manual */

details.manual > summary {
  font: 400 10px/1.5 var(--sans);
  letter-spacing: 0.3em;
  color: var(--dim);
  cursor: pointer;
  padding: 12px 0 2px;
  list-style: none;
  transition: color var(--dur-fast) var(--ease);
}
details.manual > summary::-webkit-details-marker { display: none; }
details.manual > summary::after { content: "  +"; font-family: var(--mono); }
details.manual[open] > summary::after { content: "  \2212"; }
details.manual[open] > summary { margin-bottom: 12px; }
@media (hover: hover) {
  details.manual > summary:hover { color: var(--ink); }
}

/* -------------------------------------------- sign-in gate + intake */

/* gate-mode: the tabbar and budget strip stand down until there is a
   signed-in owner with a profile */
body.gate-mode #tabbar, body.gate-mode #budget-strip { display: none; }

.auth-gate { max-width: 420px; margin: 10vh auto 0; text-align: center; }
.auth-gate .gate-copy {
  font-size: 12px;
  letter-spacing: 0.22em;
  line-height: 2.1;
  margin-bottom: 28px;
}
.auth-gate .dim { color: var(--dim); font-size: 10px; letter-spacing: 0.18em; }
#clerk-signin { display: flex; justify-content: center; }

.intake { max-width: 460px; margin: 6vh auto 0; }
.istep-count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--dim);
  margin-bottom: 10px;
}
/* the walk so far: a hairline of progress under the step count */
.ibar { height: 1px; background: var(--line); margin-bottom: 22px; }
.ibar span { display: block; height: 100%; background: var(--ink); }
.ititle { font: var(--t-title); letter-spacing: 0.18em; margin-bottom: 12px; }
.isub { color: var(--dim); font-size: 12.5px; line-height: 1.75; margin-bottom: 28px; max-width: 40ch; }
.ilbl {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink);
  margin: 18px 0 6px;
}
.ilbl .dim { color: var(--dim); text-transform: none; letter-spacing: 0.08em; }
.intake input, .intake textarea { width: 100%; }
.igrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.georow { display: flex; gap: 8px; align-items: stretch; }
.georow input { flex: 1; }
.georow .ghost { width: auto; flex-shrink: 0; margin-top: 0; padding-left: 18px; padding-right: 18px; }
#it-geo-results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 24px; }
.ichoice { display: flex; flex-wrap: wrap; gap: 8px; }
.ierr { color: var(--ink); font-size: 11px; min-height: 18px; margin-top: 16px; font-weight: 700; }
.inav { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.istep-note { font-size: 10px; letter-spacing: 0.08em; margin-top: 12px; }
.ireview { display: grid; gap: 10px; font-size: 12.5px; line-height: 1.6; }
.ireview .dim {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  display: block;
}

@media (max-width: 480px) {
  .intake { margin-top: 2vh; }
  .igrid { grid-template-columns: 1fr; }
}
