/* opportune app. Brand tokens from site/index.html; dark by default, light when the system asks. */
:root {
  --night: #090b22; --night-2: #11143a; --glass: rgba(255,255,255,.055); --line: rgba(190,196,255,.16);
  --ink: #eeedf8; --mute: #a4a8cf; --ember: #ff6b3d; --flame: #ffbe45; --flame-soft: rgba(255,190,69,.12); --magenta: #d63fc6; --volt: #4a74ff; --mint: #4ad99a;
  --spectrum: linear-gradient(90deg, var(--ember), var(--magenta) 50%, var(--volt));
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", "Helvetica Neue", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --bg: var(--night); --card: #121539; --card-2: #181c4c; --fg: var(--ink); --muted: var(--mute);
  --ember-ink: #1a0b05; --sky: radial-gradient(900px 520px at 50% -240px, rgba(74,116,255,.22), transparent 70%);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.28);
  --lantern-metal: #8187c2; --lantern-glass: rgba(255,255,255,.06);
  --radius: 18px; --tap: 48px; --gutter: 16px; --tabbar: 64px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f5ff; --card: #ffffff; --card-2: #ededff; --fg: #15173a; --muted: #5a5e8a; --line: rgba(20,24,80,.14); --glass: rgba(20,24,80,.05);
    --sky: radial-gradient(900px 520px at 50% -240px, rgba(74,116,255,.12), transparent 70%);
    --shadow: 0 1px 2px rgba(20,24,80,.06), 0 12px 32px rgba(20,24,80,.08);
    --lantern-metal: #4b508c; --lantern-glass: rgba(20,24,80,.06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f5ff; --card: #ffffff; --card-2: #ededff; --fg: #15173a; --muted: #5a5e8a; --line: rgba(20,24,80,.14); --glass: rgba(20,24,80,.05);
  --sky: radial-gradient(900px 520px at 50% -240px, rgba(74,116,255,.12), transparent 70%);
  --shadow: 0 1px 2px rgba(20,24,80,.06), 0 12px 32px rgba(20,24,80,.08);
  --lantern-metal: #4b508c; --lantern-glass: rgba(20,24,80,.06);
  color-scheme: light;
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
html, body { margin: 0 }
body {
  min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--sky), var(--bg); color: var(--fg);
  font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer; -webkit-tap-highlight-color: transparent }
a { color: var(--volt) }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -.02em; text-wrap: balance }
h2 { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px }
h2:first-child { margin-top: 6px }
code { font: 13px var(--mono); background: var(--glass); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; word-break: break-all }
.muted { color: var(--muted) }
.small { font-size: 13px }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 8px }
[hidden] { display: none !important }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gutter) 6px; padding-top: max(14px, env(safe-area-inset-top)) }
.brand { display: flex; align-items: center; gap: 9px; font: 700 20px var(--display); letter-spacing: -.02em }
.brand img { border-radius: 9px; box-shadow: 0 0 18px rgba(74,116,255,.35) }
.who { font-size: 14px; color: var(--muted); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

/* main + screens */
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 4px var(--gutter) 24px }
.screen-map { padding: 0 }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; text-wrap: balance }
.gate { padding: 40px 0; text-align: center }
.gate h1 { font-size: 26px; margin-bottom: 8px }

/* tab bar: bottom on phones, under the header on wide screens */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent);   /* solid first: iOS < 16.2 has no color-mix */ backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button { position: relative; flex: 1; min-height: var(--tabbar); border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; letter-spacing: .01em }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.tabbar button[aria-selected="true"] { color: var(--ember) }
.tabbar button[aria-selected="true"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--ember) }
.tabbar .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ember); color: var(--ember-ink); font: 700 11px/18px var(--body); font-style: normal; text-align: center }
@media (min-width: 760px) {
  body { padding-bottom: 0 }
  .tabbar { position: sticky; top: 0; bottom: auto; order: 1; max-width: 720px; width: 100%; margin: 0 auto; border: 1px solid var(--line); border-radius: 16px; padding-bottom: 0 }
  .tabbar button { min-height: 56px }
  .tabbar button[aria-selected="true"]::before { top: auto; bottom: 0; border-radius: 3px 3px 0 0 }
  main { order: 2; padding-top: 16px }
}

/* cards & rows */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow) }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); padding: 10px 0; border-top: 1px solid var(--line) }
.row:first-child, .card > h3 + .row { border-top: 0 }
.row .lbl { flex: 1; min-width: 0 }
.row .ico { flex: none; width: 22px; height: 22px; color: var(--muted) }
.row .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.row .lbl b { display: block; font-weight: 600 }
.row .lbl span { display: block; font-size: 13px; color: var(--muted) }
.row .lbl .story { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.row .arrow { font-size: 22px; line-height: 1 }
.row .lbl code { display: inline-block; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom }
.card > h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px }
.card > p { margin: 0 0 10px }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 8px; vertical-align: middle; opacity: .5 }
.dot.on { background: var(--mint); opacity: 1; box-shadow: 0 0 8px var(--mint) }
.dot.off { background: var(--ember); opacity: 1 }

/* buttons */
.btn { min-height: var(--tap); padding: 10px 18px; border: 0; border-radius: 14px; background: var(--ember); color: var(--ember-ink); font: 600 16px var(--body); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .08s, opacity .15s }
.btn:active { transform: scale(.97) }
.btn:disabled { opacity: .5; pointer-events: none }
.btn.ghost { background: var(--glass); color: var(--fg); border: 1px solid var(--line) }
.btn.volt { background: var(--volt); color: #fff }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 14px; border-radius: 11px }
.btn.block { display: flex; width: 100% }
.link { background: none; border: 0; padding: 0; color: var(--volt); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer }
.chips { display: flex; gap: 8px; flex-wrap: wrap }
.chip { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--fg); font-weight: 600 }
.chip.on { border-color: var(--flame); color: var(--flame); background: var(--flame-soft) }
.chip.volt.on { border-color: var(--volt); color: var(--volt); background: rgba(74,116,255,.12) }
.chip.dark.on { border-color: var(--muted); color: var(--fg); background: var(--glass) }
.seg { display: flex; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px }
.seg button { flex: 1; min-height: 38px; border: 0; background: transparent; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted) }
.seg button[aria-pressed="true"] { background: var(--card-2); color: var(--fg) }
.toggle { position: relative; width: 48px; height: 28px; border-radius: 99px; border: 0; background: var(--line); flex: 0 0 auto; transition: background .15s }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3) }
.toggle[aria-checked="true"] { background: var(--mint) }
.toggle[aria-checked="true"]::after { transform: translateX(20px) }
.toggle[disabled] { opacity: .5 }

/* inputs */
input[type=text], input[type=url], textarea { width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); color: var(--fg); outline: none }
input:focus, textarea:focus { border-color: var(--volt); box-shadow: 0 0 0 3px rgba(74,116,255,.25) }
textarea { resize: vertical; min-height: 64px }
input.code { font: 500 22px var(--mono); letter-spacing: .3em; text-transform: uppercase; text-align: center }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8 }
.copy { display: flex; gap: 8px; align-items: center; margin-top: 8px }
.copy code { flex: 1; padding: 8px 10px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

/* the lantern */
.lantern { color: var(--lantern-metal); display: block; overflow: visible }
.lantern .glass { fill: var(--lantern-glass); transition: fill .5s }
.lantern .flame, .lantern .core { opacity: 0; transition: opacity .4s; transform-box: fill-box; transform-origin: 50% 100% }
.lantern .halo { opacity: 0; transition: opacity .6s; transform-box: fill-box; transform-origin: center }
.lantern[data-state="open"] { filter: drop-shadow(0 0 12px rgba(255,107,61,.55)) }
.lantern[data-state="open"] .glass { fill: rgba(255,150,70,.34) }
.lantern[data-state="open"] .flame { opacity: 1; fill: var(--flame); animation: flame 2.8s ease-in-out infinite }
.lantern[data-state="open"] .core { opacity: 1; fill: #ffecc2 }
.lantern[data-state="open"] .halo { opacity: 1; animation: halo 3.4s ease-in-out infinite }
.lantern[data-state="ask"] .glass { fill: rgba(74,116,255,.14) }
.lantern[data-state="ask"] .flame { opacity: .5; fill: #c88a5c; transform: scale(.8) }
.lantern[data-state="ask"] .halo { opacity: .18 }
.lantern[data-state="closed"] .flame { opacity: .22; fill: #5a5f93; transform: scale(.7) }
.lantern[data-strength="fading"] { filter: drop-shadow(0 0 7px rgba(255,107,61,.35)) }
.lantern[data-strength="fading"] .halo { opacity: .5 }
.lantern[data-strength="last-call"] { filter: drop-shadow(0 0 4px rgba(255,107,61,.25)) }
.lantern[data-strength="last-call"] .halo { opacity: .3; animation: flicker 1.4s steps(2, end) infinite }
.lantern[data-strength="last-call"] .flame { animation: flicker 1.1s steps(2, end) infinite }
@keyframes halo { 0%, 100% { opacity: .82; transform: scale(1) } 50% { opacity: 1; transform: scale(1.07) } }
@keyframes flame { 0%, 100% { transform: scaleY(1) } 50% { transform: scaleY(1.06) scaleX(.97) } }
@keyframes flicker { 0%, 100% { opacity: .38 } 50% { opacity: .16 } }
@keyframes breathe { 0%, 100% { opacity: .75 } 50% { opacity: 1 } }
@keyframes up { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .lantern *, .hero::before, .sheet { animation: none !important } }

/* home: hero */
.hero { position: relative; overflow: hidden; text-align: center; padding: 26px 16px 18px; cursor: pointer; user-select: none }
.hero::before { content: ""; position: absolute; left: -20%; right: -20%; top: -45%; height: 115%; background: radial-gradient(closest-side, rgba(255,107,61,.32), transparent 72%); opacity: 0; transition: opacity .6s; pointer-events: none }
.hero[data-state="open"]::before { opacity: 1; animation: breathe 4s ease-in-out infinite }
.hero[data-state="ask"]::before { opacity: .45; background: radial-gradient(closest-side, rgba(74,116,255,.3), transparent 72%) }
.hero > * { position: relative }
.lamp { position: relative; width: 168px; height: 168px; margin: 0 auto 6px; display: grid; place-items: center }
.lamp .lantern { width: 118px; height: 148px }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); pointer-events: none }
.ring svg { width: 100%; height: 100%; display: block; overflow: visible }
.ring circle { fill: none; stroke-width: 3 }
.ring .track { stroke: var(--line) }
.ring .fill { stroke: var(--ember); stroke-linecap: round; transition: stroke-dashoffset .6s }
.hero[data-state="closed"] .ring .fill { stroke: var(--muted) }
.hero h1 { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 2px 0 4px }
.hero .sub { color: var(--muted); font-size: 15px }
.hero .note { font-style: italic; margin-top: 6px; font-size: 16px }
.hero .hint { font: 500 11px var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 14px }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; background: linear-gradient(90deg, rgba(255,107,61,.16), rgba(214,63,198,.12) 50%, rgba(74,116,255,.16)); border: 1px solid var(--line); font-size: 15px }
.banner .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px }

/* home: belief card ("What I think is going on"): quiet, for auditing */
.belief { padding: 10px 16px 4px }
.belief h3 { font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 }
.belief .fact { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; min-height: 44px; padding: 7px 0; border-top: 1px solid var(--line) }
.belief h3 + .fact { border-top: 0 }
.belief .k { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.belief .v { min-width: 0 }
.belief .v b { display: block; font: 600 15px/1.3 var(--display); overflow-wrap: anywhere }
.belief .v .basis { display: block; font-size: 12px; color: var(--muted) }
.belief .wrong { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 4px 11px; font-size: 12px; min-height: 30px }
.belief .wrong:active { color: var(--fg) }

/* home: friends */
.friend { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 14px 16px }
.friend .lantern { width: 52px; height: 65px }
.friend .name { font: 600 18px var(--display); display: flex; align-items: center; gap: 6px; min-width: 0 }
.friend .name .star { color: #f0b429; font-size: 14px }
.friend .state { font-size: 14px; font-weight: 600; margin-top: 1px }
.friend[data-state="open"] .state { color: var(--flame) }
.friend .where { color: var(--muted); font-size: 13px; margin-top: 1px }
.friend .note { font-style: italic; font-size: 14px; margin-top: 3px }
.friend .story { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.friend .story.open { display: block; -webkit-line-clamp: unset }
.friend .more { font-size: 12px; color: var(--muted) }
.friend .act { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px }
.answer { flex: 1 1 100%; font-size: 14px; padding: 9px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line) }
.answer.yes, .answer.likely { border-color: var(--mint); color: var(--mint) }
.answer.no, .answer.unlikely { border-color: rgba(255,107,61,.5) }
.answer b { color: var(--fg) }

/* nudges */
.nudge .text { font-size: 16px }
.nudge .when { font: 12px var(--mono); color: var(--muted); margin-top: 4px }
.nudge .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px }
.nudge.done { opacity: .55 }
.nudge .you { font-size: 13px; color: var(--mint); margin-top: 8px }
.nudge .you.bad { color: var(--muted) }
.nudge.fresh { border-color: var(--ember) }
.screen-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 10px }
.screen-head h2 { margin: 0 }

/* map */
.screen-map .map { height: calc(100dvh - 150px - var(--tabbar)); min-height: 320px; background: var(--card); border-radius: var(--radius); overflow: hidden }
.map-legend { margin: 10px 0 0; font-size: 13px; color: var(--muted); padding: 0 2px }
.leaflet-container { font: inherit }
.pin { display: flex; align-items: center; gap: 4px; background: var(--card); color: var(--fg); border-radius: 99px; padding: 3px 9px 3px 4px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap }
.pin i { width: 10px; height: 10px; border-radius: 50%; background: var(--volt); display: inline-block }
.pin.me i { background: var(--ember) }
.pin small { font-weight: 400; color: var(--muted) }

/* sub-screen header (review, sources, windows) */
.screen-head .back { background: none; border: 0; padding: 0; color: var(--volt); font: 600 14px var(--body); cursor: pointer }
.screen-head .back::before { content: "← " }

/* sources: progress card + source cards */
.progress { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; cursor: pointer; padding: 14px 16px }
.progress b { grid-column: 1; grid-row: 1; font: 600 17px var(--display) }
.progress .sub { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--muted) }
.progress .arrow { grid-column: 2; grid-row: 1 / span 3; color: var(--muted); font-size: 22px }
.progress .bar { grid-column: 1; grid-row: 3; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px }
.progress .bar i { display: block; height: 100%; background: var(--spectrum); border-radius: 3px; transition: width .4s }
.progress.done .bar i { background: var(--mint) }
.src .head { display: flex; align-items: center; gap: 10px }
.src .head .name { flex: 1; min-width: 0; font: 600 17px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.src .desc { margin: 4px 0 8px; font-size: 14px; color: var(--muted) }
.src .cfg { font-size: 13px; color: var(--muted); word-break: break-word }
.src .err { font-size: 13px; color: var(--ember); margin-top: 4px }
.src .foot { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap }
.tag { display: inline-block; font: 600 11px var(--body); padding: 2px 8px; border-radius: 99px; background: var(--glass); color: var(--muted); border: 1px solid var(--line); white-space: nowrap }
.tag.on { color: var(--mint); border-color: rgba(74,217,154,.4) }
.tag.err { color: var(--ember); border-color: rgba(255,107,61,.5) }
details { border-top: 1px solid var(--line); padding: 4px 0; margin-top: 6px }
summary { cursor: pointer; font-weight: 600; padding: 8px 0; list-style: none; display: flex; justify-content: space-between; min-height: 40px; align-items: center }
summary::after { content: "+"; color: var(--muted); font-size: 18px }
details[open] summary::after { content: "–" }
summary::-webkit-details-marker { display: none }
.field { display: grid; gap: 6px; padding: 8px 0 }
.field label { font-weight: 600; font-size: 14px }
.field .instr { font-size: 13px; color: var(--muted); background: var(--glass); border: 1px solid var(--line); padding: 8px 10px; border-radius: 10px }
input[type=password], input[type=number], input[type=email], select { width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); color: var(--fg); outline: none }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px }
select option { color: #15173a; background: #fff }
select.auto { width: auto; min-height: 40px; padding: 6px 32px 6px 12px; border-radius: 10px }
input[type=number] { width: 88px; min-height: 40px; padding: 6px 12px; border-radius: 10px }
.form-foot { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap }

/* people */
.person .head { display: flex; align-items: center; gap: 8px }
.person .head .name { flex: 1; min-width: 0; font: 600 18px var(--display) }
.person .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px }
.person .star { border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 4px; color: var(--line); transition: transform .1s }
.person .star[aria-pressed="true"] { color: #f0b429 }
.person .star:active { transform: scale(1.2) }
.person .seg { min-width: 200px }
.slider { display: flex; align-items: center; gap: 10px; min-width: 180px }
.slider input { flex: 1; accent-color: var(--ember); min-height: auto; padding: 0; width: auto }
.slider output { font-size: 13px; color: var(--muted); min-width: 92px; text-align: right }
.custom { font-size: 11px; color: var(--volt); margin-left: 6px; cursor: pointer; background: none; border: 0; padding: 0; text-decoration: underline dotted }
.saved { font-size: 12px; color: var(--muted); min-height: 16px; text-align: right }
.chips.small .chip { min-height: 32px; padding: 4px 11px; font-size: 13px; font-weight: 500 }
.chips.small .chip.on { border-color: rgba(74,217,154,.5); color: var(--mint); background: rgba(74,217,154,.08) }

/* review (the judge's calls) */
.decision { display: grid; grid-template-columns: 28px 1fr; gap: 10px }
.decision .icon { font-size: 20px; line-height: 1.3 }
.corrections { padding: 12px 16px 6px }
.corrections h3 { font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px }
.corrections .c { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px }
.corrections h3 + .c { border-top: 0 }
.corrections .k { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 64px }
.corrections .when { font: 12px var(--mono); color: var(--muted); margin-left: auto }
.decision .summary { font-weight: 500 }
.decision .reason { color: var(--muted); font-size: 14px; margin-top: 2px }
.decision .when { font: 12px var(--mono); color: var(--muted); margin-top: 4px }
.decision .rate { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap }
.rate button { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 6px 12px; font-size: 14px; color: var(--fg); min-height: 36px }
.rate button[aria-pressed="true"] { background: var(--glass); border-color: var(--ember) }
.rate .note { font-size: 12px; color: var(--muted) }
.filter { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 14px; color: var(--muted) }
.filter input { accent-color: var(--ember); width: 18px; height: 18px }

/* drop-in windows editor */
.inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.window { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px dashed var(--line) }
.days { display: flex; gap: 3px }
.days button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 600; color: var(--muted) }
.days button[aria-pressed="true"] { background: var(--ember); color: var(--ember-ink); border-color: var(--ember) }
.x { border: 0; background: transparent; color: var(--muted); font-size: 20px; padding: 2px 8px; min-height: 32px }

/* onboarding */
.onboard { padding-top: 18px }
.onboard h1 { font-size: clamp(30px, 8.5vw, 42px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 10px }
.onboard h1 em { font-style: normal; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent }
.onboard .lede { color: var(--muted); font-size: 17px; margin: 0 0 22px; text-wrap: pretty }
.way { display: block; width: 100%; text-align: left; min-height: 64px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); color: var(--fg); margin-bottom: 10px; transition: border-color .15s }
.way b { display: block; font: 600 17px var(--display) }
.way span { color: var(--muted); font-size: 14px }
.way[aria-expanded="true"] { border-color: var(--ember); background: rgba(255,107,61,.07) }
.way-form { display: grid; gap: 10px; padding: 2px 2px 18px }
.way-form .err { color: var(--ember); font-size: 14px }
.nodeline { color: var(--muted); font: 13px var(--mono); margin-top: 20px; text-align: center; text-wrap: balance }
.perm { text-align: center; padding: 28px 16px }
.perm .lamp { margin-bottom: 10px }
.perm h1 { font-size: 26px; margin-bottom: 8px }
.perm p { color: var(--muted); margin: 0 auto 18px; max-width: 34ch }
.perm .btn { margin: 4px }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 60 }
.scrim { position: absolute; inset: 0; background: rgba(5,6,20,.6); backdrop-filter: blur(3px) }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .22s ease-out; box-shadow: 0 -10px 40px rgba(0,0,0,.4) }
.select-btn { width: auto; min-height: 40px; padding: 6px 30px 6px 14px; border-radius: 11px; font-weight: 600; font-size: 14px; background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50% }
.qr-big { background: #fff; border-radius: 16px; padding: 14px; width: min(100%, 300px); margin: 14px auto 0 }
.qr-big svg { display: block; width: 100%; height: auto }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px }
.sheet h3 { font-size: 21px; font-weight: 600; margin-bottom: 4px }
.sheet .lbl { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px }
.sheet .foot { display: flex; justify-content: flex-end; margin-top: 16px }
.sheet .standing { margin-top: 10px; line-height: 1.5 }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 70; max-width: calc(100% - 32px); box-shadow: var(--shadow) }
@media (min-width: 760px) { .toast { bottom: 24px } }
