/* Crew Board app. iPhone first: system font, large titles, bottom tab bar, slides between tabs.
   Light and dark follow the phone. The motorway sign stays motorway blue in both. */
:root {
  --bg: #f2f3f7;
  --card: #ffffff;
  --card-line: #0000000f;
  --ink: #0d1016;
  --dim: #6b7280;
  --faint: #00000014;
  --tabbar: #f9f9fbd9;
  --tab-off: #8e8e93;
  --accent: #e8890c;      /* sodium amber, darkened for light mode contrast */
  --accent-ink: #ffffff;
  --go: #1f9d55;
  --warn: #d4461f;
  --sign: #0b4fa8;
  --sign-ink: #ffffff;
  --shadow: 0 1px 2px #0000000d, 0 6px 20px #0000000a;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070a12;
    --card: #121826;
    --card-line: #ffffff14;
    --ink: #f1f4fa;
    --dim: #b9c3d4;
    --faint: #ffffff1a;
    --tabbar: #0a0e16d9;
    --tab-off: #7d879a;
    --accent: #ffb04a;
    --accent-ink: #241400;
    --go: #45c97a;
    --warn: #ff7a59;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Panes slide sideways like a native tab pager */
.viewport { flex: 1; overflow: hidden; position: relative; }
.track { display: flex; height: 100%; width: 100%; transition: transform .42s cubic-bezier(.22, .9, .2, 1); will-change: transform; }
.track.dragging { transition: none; }
.pane {
  flex: 0 0 100%; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) max(16px, env(safe-area-inset-right, 0px)) calc(110px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 16px;
}
.pane > * { width: 100%; max-width: 620px; margin-left: auto; margin-right: auto; }

.big-head { padding: 6px 4px 2px; }
.big-head h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: .01em; }
.kicker { margin: 0 0 2px; color: var(--dim); font-size: 15px; font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.card h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.card-h { font-size: 13px !important; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.fine { margin: 0; color: var(--dim); font-size: 14px; }
.fine:empty { display: none; }
.center { text-align: center; }

/* Motorway sign */
.sign { background: var(--sign); color: var(--sign-ink); border-radius: 16px; padding: 16px 18px 14px; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--sign), var(--shadow); display: grid; gap: 12px; margin-top: 3px; }
.sign-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sign-k { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.sign-dest { margin: 2px 0 0; font-size: 24px; font-weight: 800; line-height: 1.1; }
.sign-pct { font-size: 52px; line-height: .9; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sign-next { margin: 0; font-weight: 600; font-size: 16px; }
.road { --f: 0; position: relative; height: 30px; border-radius: 15px; background: #06274f; box-shadow: inset 0 0 0 2px #ffffff55; overflow: hidden; }
.road::before { content: ''; position: absolute; left: 16px; right: 16px; top: 50%; height: 3px; margin-top: -1.5px; background: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 28px); opacity: .5; }
.road-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(19px + (100% - 38px) * var(--f)); background: linear-gradient(90deg, #ffb04a00, #ffb04a99); border-radius: 15px; transition: width 1.6s cubic-bezier(.2, .9, .1, 1); }
.car { position: absolute; top: 3px; left: calc((100% - 38px) * var(--f) + 2px); transition: left 1.6s cubic-bezier(.2, .9, .1, 1); filter: drop-shadow(8px 0 8px #ffb04a99); }
.car svg { display: block; }

/* Buzz card */
.buzz-row { display: flex; gap: 14px; align-items: center; }
.buzz-ico { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.buzz.on .buzz-ico { background: color-mix(in srgb, var(--go) 18%, transparent); color: var(--go); }
.buzz.err .buzz-ico { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.buzz-tx { min-width: 0; }
.buzz-tx p { margin: 2px 0 0; color: var(--dim); font-size: 15px; }

.btn { border: 0; border-radius: 14px; min-height: 50px; padding: 12px 18px; font-weight: 700; font-size: 17px; cursor: pointer; transition: transform .12s ease, opacity .2s; touch-action: manipulation; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
.btn.quiet { background: transparent; color: var(--dim); min-height: 44px; font-weight: 600; font-size: 15px; padding: 8px; }

/* Install steps */
.install { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-size: 16px; }
.steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sign); color: #fff; font-weight: 800; font-size: 14px; }
.inl { vertical-align: -3px; color: #0a84ff; }

.next-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.next-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: 16px; }
.next-list i { font-style: normal; color: var(--dim); }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); margin-top: 4px; }
.dot.done { background: var(--go); border-color: var(--go); }
.dot.now { border-color: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); } }

/* Lanes */
.lanes { display: grid; gap: 12px; }
.lane-card { --hue: #ffb04a; position: relative; display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: linear-gradient(180deg, color-mix(in srgb, var(--hue) 14%, transparent), transparent 70%), var(--card); border: 1px solid color-mix(in srgb, var(--hue) 40%, var(--card-line)); box-shadow: var(--shadow); }
.lane-card.later { opacity: .6; }
.l-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.l-top b { font-size: 22px; font-weight: 800; }
.l-pct { font-size: 26px; font-weight: 800; color: var(--hue); font-variant-numeric: tabular-nums; }
.l-note { margin: 0; color: var(--dim); font-size: 15px; }
.segs { display: flex; gap: 4px; height: 8px; }
.seg { flex: 1; border-radius: 4px; background: var(--faint); }
.seg.done { background: var(--hue); }
.seg.now { background: var(--hue); animation: segp 1.2s ease-in-out infinite; }
@keyframes segp { 50% { opacity: .3; } }

/* To-do empty state */
.empty { text-align: center; justify-items: center; padding: 28px 20px; }
.empty p { margin: 0; color: var(--dim); }
.empty-ico { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: color-mix(in srgb, var(--go) 16%, transparent); color: var(--go); }

/* Crew */
.crew { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.crew li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 11px 16px; min-height: 64px; }
.crew li + li { box-shadow: inset 72px 1px 0 -71px var(--faint); border-top: 1px solid var(--faint); }
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #0a0e16; background: radial-gradient(circle at 35% 30%, #ffffff8c, transparent 50%), var(--av, #9eaabf); }
.crew b { display: block; font-size: 17px; }
.crew small { display: block; color: var(--dim); font-size: 14px; }

/* Bottom tab bar */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(4px + env(safe-area-inset-bottom, 0px));
  background: var(--tabbar); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border-top: .5px solid var(--faint);
}
.tab { flex: 1; max-width: 120px; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 4px 0; border: 0; background: none; color: var(--tab-off); cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .01em; touch-action: manipulation; }
.tab svg { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tab.on { color: var(--accent); }
.tab.on svg { transform: scale(1.08); }
.tab:active svg { transform: scale(.88); }

.toast { position: absolute; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 20; margin: 0 auto; max-width: 520px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px #0005; animation: up .35s cubic-bezier(.2, .9, .2, 1); }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .track, .road-fill, .car, .tab svg { transition: none; }
  .dot.now, .seg.now, .toast { animation: none; }
}

/* ===== Drop 1: the board in your pocket ===== */
.synced { margin: 4px 0 0; color: var(--dim); font-size: 13px; }
.synced:empty { display: none; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.count { min-width: 30px; height: 30px; padding: 0 9px; display: grid; place-items: center; border-radius: 999px; background: var(--faint); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.count.hot { background: var(--accent); color: var(--accent-ink); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.row { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 10px 4px; min-height: 60px; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.row:active { background: var(--faint); }
.row-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.row-ico.paper { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.row-ico.todo { background: color-mix(in srgb, var(--go) 18%, transparent); color: var(--go); }
.row-tx { min-width: 0; display: grid; gap: 2px; }
.row-tx b { font-size: 16px; line-height: 1.3; font-weight: 650; overflow-wrap: anywhere; }
.row-tx small { color: var(--dim); font-size: 13px; }
.chev { color: var(--dim); font-size: 26px; line-height: 1; }
.more-line, .empty-line { color: var(--dim); font-size: 14px; padding: 6px 4px; margin: 0; list-style: none; }
.sign { cursor: pointer; }
.buzz.slim { padding: 12px 16px; }
.buzz.slim .buzz-ico { width: 40px; height: 40px; border-radius: 12px; }
.buzz.slim h2 { font-size: 17px; }

.tab { position: relative; }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font: 700 11px/18px -apple-system, system-ui, sans-serif; font-style: normal; }

.lane-card { text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; }
.lane-card:active { transform: scale(.985); }
.l-sign { margin: -4px 0 0; color: var(--dim); font-size: 14px; font-weight: 600; }
.l-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--dim); }
.l-now { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.l-drivers { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.todos { display: grid; gap: 14px; }
.todo h2 { font-size: 19px; line-height: 1.3; }
.todo p { margin: 0; font-size: 15px; color: var(--dim); line-height: 1.45; overflow-wrap: anywhere; }
.todo p b { color: var(--ink); }
.todo.gone { opacity: 0; transform: translateX(40px); transition: opacity .35s, transform .35s; }
.say { display: grid; gap: 8px; }
.say pre { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--faint); font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow: auto; user-select: all; -webkit-user-select: all; }
.btn.ghost { background: transparent; border: 1px solid var(--faint); color: var(--ink); }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 15px; justify-self: start; }
.btn.arm { background: var(--go); color: #fff; }
.donebox { padding: 12px 16px; }
.donebox summary { cursor: pointer; font-weight: 700; color: var(--dim); min-height: 32px; display: flex; align-items: center; gap: 6px; }
.done-row { display: flex; gap: 10px; padding: 6px 0; color: var(--dim); font-size: 15px; }
.done-row .tick { color: var(--go); font-weight: 800; }

.crew-row { width: 100%; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.crew .av { position: relative; }
.cdot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--card); background: #8e8e93; }
.cdot.on { background: var(--go); }
.cdot.wait { background: var(--accent); }
.crew-tx { min-width: 0; }
.crew-tx small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-scrim { position: absolute; inset: 0; background: #0008; opacity: 0; transition: opacity .3s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - env(safe-area-inset-top, 0px) - 12px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  transform: translateY(100%); transition: transform .38s cubic-bezier(.22, .9, .2, 1); box-shadow: 0 -10px 40px #0004; }
.sheet > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--faint); margin: 2px auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--faint); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.sheet-title { margin: 4px 0 14px; font-size: 26px; line-height: 1.15; font-weight: 800; }
.sheet-body { display: grid; gap: 16px; }
.p-head { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 650; }
.psec { display: grid; gap: 6px; }
.psec h3, .answer h3, .quiz h3 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.psec p, .para { margin: 0; line-height: 1.55; }
.plist { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.nums div { background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.nums span { font-size: 12px; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.nums b { font-size: 22px; font-weight: 800; }
.nums small { color: var(--dim); font-size: 12px; }
.quiz { background: var(--card); border: 1px solid var(--card-line); border-radius: 16px; padding: 14px; display: grid; gap: 8px; }
.quiz .q { margin: 0; font-weight: 650; }
.qopt { text-align: left; border: 1px solid var(--faint); background: transparent; border-radius: 12px; padding: 10px 12px; min-height: 44px; cursor: pointer; font: inherit; color: inherit; }
.qopt.right { border-color: var(--go); background: color-mix(in srgb, var(--go) 15%, transparent); }
.qopt.wrong { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.q-out { margin: 0; color: var(--dim); font-size: 15px; }
.answer { background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--card-line)); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.picks { display: grid; gap: 8px; }
.pick { text-align: left; display: grid; gap: 3px; padding: 12px 14px; min-height: 56px; border-radius: 14px; border: 2px solid var(--faint); background: transparent; cursor: pointer; font: inherit; color: inherit; }
.pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pick b { font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pick em { font-style: normal; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 3px 6px; border-radius: 5px; }
.pick small { color: var(--dim); font-size: 14px; }
.answer textarea { width: 100%; font: 16px/1.4 inherit; font-family: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--faint); background: var(--bg); color: var(--ink); resize: vertical; }
.said { margin: 0; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--go) 15%, transparent); font-weight: 650; }
.bsec { border-top: 1px solid var(--faint); padding: 8px 0; }
.bsec summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.bsec summary::-webkit-details-marker { display: none; }
.bsec summary b { font-size: 17px; }
.tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--faint); color: var(--dim); white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--go) 18%, transparent); color: var(--go); }
.tag.live { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.bnote { margin: 0 0 8px; color: var(--dim); font-size: 14px; }
.junctions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.j { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; }
.j .num { height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 13px; border: 2px solid var(--faint); color: var(--dim); }
.j.done .num { background: var(--go); border-color: var(--go); color: #fff; }
.j.now .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.jtx { display: grid; gap: 4px; min-width: 0; }
.jtx b { font-size: 15px; font-weight: 650; }
.j.done .jtx b { color: var(--dim); }
.jtx small { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }

/* Pairing */
.pair { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.pair-in { width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: center; justify-items: center; }
.pair-ico { border-radius: 20px; box-shadow: var(--shadow); }
.pair h1 { margin: 6px 0 0; font-size: 30px; }
.pair p { margin: 0; color: var(--dim); }
.pair-code { width: 100%; text-align: center; font: 700 30px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; padding: 14px; border-radius: 16px; border: 2px solid var(--faint); background: var(--card); color: var(--ink); }
.pair-code:focus { outline: none; border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-scrim, .todo.gone { transition: none; } }
.lanes, .todos, .rows { grid-template-columns: minmax(0, 1fr); }
.lane-card, .row, .crew-row { min-width: 0; }
.l-top b { min-width: 0; overflow-wrap: anywhere; }
.lane-card > *, .l-foot, .segs { min-width: 0; }
.segs { overflow: hidden; }
.crew li { display: block; }

/* ===== Whole board: news, quizzes, other boards ===== */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.feed li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
.feed time { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.feed-tx { display: grid; gap: 2px; min-width: 0; }
.feed-tx small { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.feed-tx span { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sheet .feed-tx span { -webkit-line-clamp: unset; display: block; }
.quizcard { border-color: color-mix(in srgb, var(--accent) 40%, var(--card-line)); }
.quizcard .q { margin: 0; font-weight: 650; font-size: 17px; }
.qz-title { margin: -6px 0 0; color: var(--dim); font-size: 14px; }
.qz-n { color: var(--dim); font-size: 13px; font-weight: 700; }
.sec-h { margin: 10px 4px 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.others { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.other { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; min-height: 64px; border-radius: var(--radius); border: 1px solid var(--card-line); background: var(--card); box-shadow: var(--shadow); cursor: pointer; font: inherit; color: inherit; }
.other:active { transform: scale(.985); }
.other .row-tx small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.linkish { justify-self: start; background: none; border: 0; padding: 4px 0; color: var(--accent); font: 600 14px/1.3 inherit; font-family: inherit; cursor: pointer; }

/* ===== Feels like a real iPhone app ===== */
html, body { overscroll-behavior: none; height: 100%; overflow: hidden; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
img { -webkit-user-drag: none; pointer-events: none; }
a { -webkit-touch-callout: none; }
.say pre, textarea, input, .pair-code { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* Content runs under the see-through status bar; a soft shade keeps the clock readable in light mode */
.statusbar-scrim { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); z-index: 30; pointer-events: none; background: linear-gradient(#000a, #0000); }
@media (prefers-color-scheme: dark) { .statusbar-scrim { background: linear-gradient(#070a12, #070a1200); } }
/* Every tap gives a little press */
button, .row, .lane-card, .other, .crew-row, .pick, .qopt, .sign { transition: transform .14s cubic-bezier(.3, .7, .4, 1), background-color .2s, opacity .2s; }
button:active, .row:active, .lane-card:active, .other:active, .crew-row:active, .pick:active, .qopt:active, .sign:active { transform: scale(.965); }
.tab:active { transform: none; }
/* Large titles shrink into a bar as you scroll */
:root { --mini: 0; }
.big-head { transform-origin: left bottom; transform: scale(calc(1 - var(--y, 0) / 900)); opacity: calc(1 - var(--y, 0) / 110); }
.mini-head { position: fixed; top: 0; left: 0; right: 0; z-index: 25; pointer-events: none;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; text-align: center; font-weight: 700; font-size: 17px; color: var(--ink);
  background: var(--tabbar); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border-bottom: .5px solid var(--faint); opacity: var(--mini); transform: translateY(calc((1 - var(--mini)) * -6px)); }
/* Skeleton cards while loading */
.skel { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-line); list-style: none; }
.skel i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--faint) 25%, color-mix(in srgb, var(--faint) 40%, transparent) 50%, var(--faint) 75%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel i:first-child { width: 55%; height: 18px; } .skel i:last-child { width: 35%; }
@keyframes shimmer { to { background-position: -200% 0; } }
body.loading .count, body.loading .synced { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .skel i { animation: none; } .big-head { transform: none; } }
.faceid { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.pair .or { margin-top: 10px; font-size: 14px; }
.faceid-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--card-line)); }
.row-ico.idea { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 17px; }
.empty .rows { width: 100%; text-align: left; margin-top: 4px; }
body.refreshing .app { opacity: .4; transition: opacity .25s; }
/* Receipts */
.receipts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rc { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.2;
  background: color-mix(in srgb, var(--go) 14%, transparent); color: var(--go); text-decoration: none; white-space: nowrap; }
.rc.warn { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
a.rc { background: color-mix(in srgb, #0a84ff 14%, transparent); color: #0a84ff; -webkit-touch-callout: none; }
.feed-tx .receipts { margin-top: 6px; }


/* ---- To-do cards, clearer ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--faint); color: var(--dim); }
.chip.from { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.todo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.todo-steps > li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.todo-steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sign); color: #fff; font-weight: 800; font-size: 13px; margin-top: 1px; }
.todo-steps .st { display: grid; gap: 6px; min-width: 0; }
.todo-steps .st p { color: var(--ink); font-size: 16px; }
.todo-steps .say pre { font-size: 13px; max-height: none; }
.copy-all { justify-self: start; }
.btn.ok { color: var(--go); }
.todo-why summary { cursor: pointer; color: var(--dim); font-weight: 600; font-size: 15px; list-style: none; }
.todo-why summary::-webkit-details-marker { display: none; }
.todo-why summary::before { content: '▸ '; }
.todo-why[open] summary::before { content: '▾ '; }
.todo-why p { margin-top: 6px !important; }
.codebox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; width: 100%; text-align: left; border: 1px solid var(--card-line); background: var(--faint); color: var(--ink); border-radius: 12px; padding: 10px 10px 10px 12px; cursor: pointer; font: inherit; }
.codebox code { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.cb-label { font-size: 12px; font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); padding: 4px 9px; border-radius: 999px; }
.cb-label.ok { color: var(--go); background: color-mix(in srgb, var(--go) 16%, transparent); }

/* ---- Lane sheet: the story ---- */
.lane-hero { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(160deg, color-mix(in srgb, var(--hue, var(--accent)) 26%, transparent), transparent 80%), var(--card); border: 1px solid color-mix(in srgb, var(--hue, var(--accent)) 40%, var(--card-line)); margin-bottom: 8px; }
.lh-big { display: flex; align-items: baseline; gap: 10px; }
.lh-big b { font-size: 40px; font-weight: 800; color: var(--hue, var(--accent)); font-variant-numeric: tabular-nums; line-height: 1; }
.lh-big span { color: var(--dim); font-size: 15px; font-weight: 600; }
.lh-bar, .bs-bar { height: 8px; border-radius: 4px; background: var(--faint); overflow: hidden; }
.lh-bar i, .bs-bar i { display: block; height: 100%; border-radius: 4px; background: var(--hue, var(--accent)); }
.bs-bar { height: 5px; margin-top: 6px; }
.lh-now { margin: 0; font-weight: 700; font-size: 16px; }
.lh-drivers { margin: 0; color: var(--dim); font-size: 14px; }
.bs-t { flex: 1; min-width: 0; }
.bsec.fin summary b { color: var(--dim); }
.story { display: grid; gap: 8px; margin: 4px 0 8px; }
.story-h { margin: 6px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hue, var(--accent)); }
.fold { border: 1px solid var(--faint); border-radius: 12px; padding: 0 12px; }
.fold summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--dim); }
.fold summary::-webkit-details-marker { display: none; }
.fold.done summary { color: var(--go); }
.fold[open] { padding-bottom: 10px; }
/* ---- Other boards ---- */
.other .bs-bar { max-width: 220px; }
.tag.pause { background: var(--faint); color: var(--dim); }
/* ---- Crew: player cards ---- */
.crew { background: none; border: 0; box-shadow: none; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.crew li, .crew li + li { display: block; padding: 0; min-height: 0; border: 0; box-shadow: none; }
.pcard { width: 100%; height: 100%; display: grid; align-content: start; gap: 4px; text-align: left; padding: 14px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--av) 35%, var(--card-line)); background: linear-gradient(170deg, color-mix(in srgb, var(--av) 18%, transparent), transparent 60%), var(--card); box-shadow: var(--shadow); color: inherit; font: inherit; cursor: pointer; }
.pcard.off, .pcard.pause { opacity: .72; }
.pc-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: 6px; }
.av.big { width: 52px; height: 52px; font-size: 22px; }
.av.huge { width: 76px; height: 76px; font-size: 32px; flex: none; }
.pc-name { font-size: 18px; }
.pc-role { color: var(--dim); font-size: 13px; line-height: 1.3; }
.pc-quote { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 13px; line-height: 1.35; font-style: italic; color: var(--ink); opacity: .85; }
.pc-quote.big { -webkit-line-clamp: unset; font-size: 16px; margin-top: 8px; }
.pill { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: var(--faint); color: var(--dim); white-space: nowrap; }
.pill.on { background: color-mix(in srgb, var(--go) 20%, transparent); color: var(--go); }
.pill.wait { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.profile { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.autotick { display: flex; gap: 8px; align-items: center; margin: 0 !important; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--go) 12%, transparent); color: var(--go) !important; font-weight: 700; }
.pulse-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--go); animation: pulse-go 1.6s infinite; }
@keyframes pulse-go { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--go) 25%, transparent); } }
.auto-proof { display: block; color: var(--go); font-size: 12px; margin-left: 26px; }
@media (prefers-reduced-motion: reduce) { .pulse-dot { animation: none; } }

/* ---- Mission control (Today) ---- */
.needs.clear .card-top h2::after { content: ' · all clear ✓'; color: var(--go); font-size: 15px; font-weight: 700; }
.needs.clear .row small, .feed .ftx { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.floor { display: grid; gap: 10px; }
.floor-h { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.floor-h h2 { font-size: 20px; margin: 0; }
.live-pill { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 800; color: var(--go); background: color-mix(in srgb, var(--go) 14%, transparent); padding: 5px 10px; border-radius: 999px; }
.floor-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
.floor-row::-webkit-scrollbar { display: none; }
.fchip { flex: none; scroll-snap-align: start; width: 220px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--av) 35%, var(--card-line)); background: linear-gradient(170deg, color-mix(in srgb, var(--av) 16%, transparent), transparent 70%), var(--card); color: inherit; font: inherit; cursor: pointer; }
.fchip .av { position: relative; }
.fchip.off, .fchip.pause { opacity: .65; width: 170px; }
.fc-tx { min-width: 0; }
.fc-tx b { display: block; font-size: 16px; }
.fc-tx small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--dim); font-size: 13px; line-height: 1.3; }
.count.win { background: color-mix(in srgb, var(--go) 20%, transparent); color: var(--go); }
.win-list, .peek-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.win { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; border: 0; background: none; padding: 8px 0; color: inherit; font: inherit; cursor: pointer; }
.win + .win, .win-list li + li { border-top: 1px solid var(--faint); }
.trophy { font-size: 22px; line-height: 1.2; }
.win .row-tx small { color: var(--dim); }
.peek-list li { padding: 8px 0; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.peek-list li + li { border-top: 1px solid var(--faint); }
.peek-list b { color: var(--accent); }
.wins .card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wins .card-top h2 { flex: 1; white-space: nowrap; }
.count.win { flex: 0 0 auto; width: auto; min-width: 36px; padding: 4px 12px; font-weight: 800; text-align: center; }
.count.win::after { content: ' 🔥'; }

/* ---- Radio, rebuilt ---- */
.tab { max-width: 96px; }
.onair { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; touch-action: pan-x; }
.onair::-webkit-scrollbar { display: none; }
.air-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--av, var(--accent)) 40%, var(--card-line)); background: color-mix(in srgb, var(--av, var(--accent)) 12%, var(--card)); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.air-chip.all { padding-left: 12px; }
.av.sm { width: 32px; height: 32px; font-size: 14px; position: relative; flex: none; }
.av.sm .cdot { width: 11px; height: 11px; right: -2px; bottom: -2px; border-color: var(--card); }
.av.ghost { background: none; }
.radio { list-style: none; margin: 0; padding: 0 0 130px; display: flex; flex-direction: column; gap: 4px; }
.radio .day { align-self: center; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); background: var(--faint); padding: 4px 10px; border-radius: 999px; margin: 10px 0 6px; }
.radio .msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; margin-top: 6px; }
.radio .msg.cont { margin-top: 0; }
.radio .msg.me { align-self: flex-end; flex-direction: row-reverse; }
.bub { background: var(--card); border: 1px solid var(--card-line); border-left: 3px solid var(--av); border-radius: 18px 18px 18px 6px; padding: 8px 13px 9px; min-width: 0; box-shadow: var(--shadow); }
.msg.me .bub { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 18px 18px 6px 18px; }
.msg.dm .bub { background: linear-gradient(160deg, color-mix(in srgb, var(--sign) 30%, transparent), transparent 80%), var(--card); }
.msg.me.dm .bub { background: var(--accent); }
.bub .who { display: flex; gap: 6px; align-items: baseline; font-size: 13px; font-weight: 800; color: var(--av); margin-bottom: 2px; }
.msg.me .bub .who { color: inherit; opacity: .8; }
.bub .to { font-weight: 700; color: var(--dim); }
.msg.me .bub .to { color: inherit; }
.bub time { margin-left: auto; padding-left: 10px; font-weight: 600; font-size: 12px; color: var(--dim); }
.msg.me .bub time { color: inherit; }
.bub .tx { margin: 0; font-size: 16px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.radio .empty { align-self: stretch; display: grid; gap: 4px; text-align: center; padding: 28px 18px; border: 1px dashed var(--faint); border-radius: var(--radius); color: var(--dim); }
.radio .empty b { color: var(--ink); font-size: 17px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom, 0px)); z-index: 30; padding: 8px max(12px, env(safe-area-inset-left, 0px)) 8px; background: var(--tabbar); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); border-top: 1px solid var(--faint); display: grid; gap: 8px; }
.composer > * { width: 100%; max-width: 620px; margin: 0 auto; }
.quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.qchip { flex: none; border: 1px solid var(--card-line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.radio-say { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--card-line); border-radius: 26px; padding: 4px 4px 4px 6px; }
.to-pill { flex: none; font-size: 13px; font-weight: 800; padding: 6px 10px; border-radius: 999px; background: var(--faint); color: var(--dim); }
.to-pill.dm { background: color-mix(in srgb, var(--sign) 35%, transparent); color: var(--ink); }
.radio-say input { flex: 1; min-width: 0; min-height: 42px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 16px; outline: none; -webkit-user-select: text; user-select: text; }
.send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); cursor: pointer; }

/* ---- One calm motion style (no sideways swiping) ---- */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --quick: .18s; --calm: .28s; }
.track, .track.dragging { transition: none !important; }
.pane { touch-action: pan-y; }
.pane.enter { animation: pane-in var(--calm) var(--ease); }
@keyframes pane-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
button, .row, .lane-card, .other, .crew-row, .pick, .qopt, .sign, .pcard, .fchip, .codebox, .air-chip, .qchip { transition: transform var(--quick) var(--ease), background-color var(--quick), opacity var(--quick); }
button:active, .row:active, .lane-card:active, .other:active, .crew-row:active, .pick:active, .qopt:active, .sign:active, .pcard:active, .fchip:active, .codebox:active, .air-chip:active, .qchip:active { transform: scale(.98); }
.tab svg { transition: transform var(--quick) var(--ease); }
@media (prefers-reduced-motion: reduce) { .pane.enter { animation: none; } }
