/* Point — phone-first, outdoor-readable. Keeps the original navy + amber identity. */
:root {
  --bg: #0a0e1a;
  --bg2: #121933;
  --card: #151d3a;
  --card2: #1b2548;
  --fg: #eef1f8;
  --muted: #9aa3bd;
  --faint: #6a7392;
  --line: #27304d;
  --accent: #ffb547;      /* target / truth */
  --accent-ink: #1a1205;
  --you: #7cc4ff;         /* your aim */
  --good: #4fe0a0;
  --warn: #ffcc4d;
  --danger: #ff7a7a;
  --radius: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
/* Outdoor / bright-sun mode: high contrast. */
:root[data-contrast="high"] { --bg: #000; --bg2: #000; --card: #0d0d0d; --card2: #161616; --fg: #fff; --muted: #d6d6d6; --line: #5a5a5a; }

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, var(--bg2), var(--bg) 70%) fixed, var(--bg);
  color: var(--fg);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--you); outline-offset: 3px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen:focus { outline: none; }
.screen:focus { outline: none; }
.screen { flex: 1; display: flex; flex-direction: column; padding: calc(14px + var(--safe-t)) 18px calc(18px + var(--safe-b)); gap: 16px; animation: in .25s var(--ease); min-height: 100dvh; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
.scroll { overflow-y: auto; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .fill { flex: 1; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------------------------------------------------------------- buttons, chips */
.btn { appearance: none; border: 0; border-radius: 16px; min-height: 52px; padding: 0 20px; font-weight: 700; font-size: 17px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, opacity .2s; touch-action: manipulation;
  background: var(--card2); color: var(--fg); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.big { min-height: 66px; font-size: 21px; border-radius: 20px; letter-spacing: .02em; }
.btn.block { width: 100%; }
.btn.small { min-height: 44px; font-size: 15px; padding: 0 14px; border-radius: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--card); color: var(--fg); display: grid; place-items: center; font-size: 20px; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.chip.good i { background: var(--good); } .chip.fair i { background: var(--warn); } .chip.poor i { background: var(--danger); }
.chip.poor { color: var(--danger); }

/* ---------------------------------------------------------------- home */
.topbar { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: -.01em; }
.logo { width: 34px; height: 34px; color: var(--fg); }
.logo .needle { fill: var(--accent); }
.level-chip { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--card); border: 0; border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; }
.level-ring { width: 34px; height: 34px; }
.level-ring circle { fill: none; stroke-width: 4; }
.level-ring .track { stroke: var(--line); } .level-ring .bar { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.level-ring text { fill: var(--fg); font-size: 13px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.daily { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(135deg, #2a2347, var(--card)); }
.daily h2 { font-size: 22px; letter-spacing: -.01em; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-height: 84px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.mode b { font-size: 17px; } .mode span { font-size: 13px; color: var(--muted); }
.mode .ico { font-size: 22px; margin-bottom: 4px; }
.mode:disabled { opacity: .45; }
.seg { display: flex; background: var(--card); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card2); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.note { font-size: 14px; color: var(--muted); }
.note.err { color: var(--danger); }

/* ---------------------------------------------------------------- play */
.play { gap: 10px; }
.hud { display: flex; align-items: center; gap: 10px; }
.hud .score { margin-left: auto; text-align: right; font-weight: 800; font-size: 20px; line-height: 1.1; }
.hud .score small { display: block; font-size: 12px; color: var(--muted); font-weight: 650; }
.timer { font-weight: 800; font-size: 20px; padding: 6px 12px; border-radius: 12px; background: var(--card); }
.timer.low { color: var(--danger); }
.target { text-align: center; }
.target .kicker { color: var(--muted); }
.target h1 { font-size: clamp(32px, 10vw, 46px); line-height: 1.05; letter-spacing: -.02em; margin: 4px 0 2px; overflow-wrap: anywhere; }
.target h1 .flag { margin-right: 8px; }
.target .sub { color: var(--muted); font-size: 15px; }

/* The play screen is exactly one viewport tall: the dial takes whatever height is left, so Lock in is always visible. */
.screen.play { height: 100dvh; min-height: 0; overflow: hidden; }
.stage { position: relative; flex: 1 1 0; min-height: 0; display: grid; place-items: center; touch-action: none; }
/* ---------------------------------------------------------------- the compass (hero) */
/* Square, sized to the space left between the target and the controls; everything inside scales with it (cq units). */
.dial { height: min(100%, 88vw, 400px); aspect-ratio: 1; max-width: 100%; position: relative; container-type: size; }
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial .rim { fill: none; stroke: url(#dial-rim); stroke-width: 14; }
.dial .face { fill: url(#dial-face); stroke: rgba(255,255,255,.08); stroke-width: 1.5; }
.dial .inner-ring { fill: none; stroke: rgba(255,255,255,.05); stroke-width: 1; }
.dial .tick { stroke-linecap: round; }
.dial .tick.minor { stroke: #3a4570; stroke-width: 1.5; }
.dial .tick.mid { stroke: #55618f; stroke-width: 2; }
.dial .tick.major { stroke: #8e98bd; stroke-width: 2.5; }
.dial .tick.cardinal { stroke: #dfe4f3; stroke-width: 3.5; }
.dial .lbl { fill: #e6eaf6; font-size: 26px; font-weight: 850; text-anchor: middle; dominant-baseline: central; }
.dial .lbl.n { fill: var(--danger); }
.dial .north-mark { fill: var(--danger); }
.dial .deg { fill: #7d88ad; font-size: 13px; font-weight: 750; text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.dial .lubber { stroke: var(--you); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .55; }
.dial .aim-pointer { fill: var(--you); stroke: #0a0e1a; stroke-width: 2; stroke-linejoin: round; }
.dial .approach { fill: none; stroke: var(--accent); stroke-width: 5; opacity: 0; }
.dial .hold-ring { fill: none; stroke: var(--good); stroke-width: 14; stroke-linecap: round; opacity: 0; }
.dial .target-marker { fill: var(--accent); stroke: #0a0e1a; stroke-width: 1.5; }
.dial .target-ray { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 4 6; }
.dial.aligned .rim { stroke: var(--good); transition: stroke .15s; }
.dial.aligned .dial-read .hdg { color: var(--good); }
.dial.aligned .target-marker { fill: var(--good); }
.dial[data-state='waiting'] .rose, .dial[data-state='waiting'] .dial-read { opacity: .25; transition: opacity .3s; }
/* Readouts: the heading number marks the exact center of the dial. */
/* The heading number is pinned to the exact center of the dial (independent of its width and of the text below it). */
.dial-read { isolation: isolate; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56%; text-align: center; pointer-events: none; line-height: 1; }
.dial-read::before { content: ''; position: absolute; left: -6%; right: -6%; top: -40%; bottom: -40%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(14,20,44,.92), rgba(14,20,44,0)); }
.dial-read .hdg { display: block; font-variant-numeric: tabular-nums; font-size: clamp(30px, 15cqw, 64px); font-weight: 850; letter-spacing: -.03em; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.dial-read .cp { position: absolute; left: 0; right: 0; top: 100%; margin-top: .45em; font-size: clamp(11px, 4.4cqw, 18px); font-weight: 800; color: var(--muted); letter-spacing: .14em; }
.dial .turn:empty { display: none; }
.dial .turn { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); white-space: nowrap; background: rgba(10,14,26,.78); padding: .3em .7em; border-radius: 999px; text-align: center; font-size: clamp(12px, 4.4cqw, 17px); font-weight: 800; color: var(--accent); pointer-events: none; }
.dial.aligned .turn { color: var(--good); }
.dial-status { position: absolute; left: 12%; right: 12%; top: 50%; transform: translateY(-50%); text-align: center; white-space: pre-line;
  font-size: clamp(13px, 4.6cqw, 17px); font-weight: 750; color: var(--fg); background: rgba(10,14,26,.82); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
/* Lock-in reveal on the compass */
.dial .reveal-ray { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 170; stroke-dashoffset: 170; }
.dial .reveal-dot { fill: var(--accent); opacity: 0; transform-box: fill-box; transform-origin: center; }
.dial .reveal-arc { fill: none; stroke: var(--fg); stroke-width: 2.5; stroke-dasharray: 3 5; opacity: 0; }
.dial .reveal-wedge { opacity: 0; }
.dial.hit .reveal-wedge { fill: var(--good); } .dial.miss .reveal-wedge { fill: var(--danger); }
.dial.revealing .reveal-ray { animation: draw-ray .38s var(--ease) forwards; }
.dial.revealing .reveal-dot { animation: dot-in .3s .3s var(--ease) forwards; }
.dial.revealing .reveal-arc { animation: fade-in .3s .45s forwards; }
.dial.revealing .reveal-wedge { animation: wedge-in .35s .45s forwards; }
.dial.hit .rim { stroke: var(--good); transition: stroke .3s .4s; }
.dial.hit svg { animation: pop .5s .45s var(--ease); }
.dial.miss .rim { stroke: var(--danger); transition: stroke .3s .4s; }
.dial.miss svg { animation: shake .42s .45s ease-in-out; }
.dial.revealing .dial-read .hdg { color: var(--fg); }
.dial.hit .dial-read .hdg { color: var(--good); } .dial.miss .dial-read .hdg { color: var(--danger); }
@keyframes draw-ray { to { stroke-dashoffset: 0; } }
@keyframes dot-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in { to { opacity: .6; } }
@keyframes wedge-in { to { opacity: .22; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.steady { display: flex; justify-content: center; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); min-height: 22px; }
.steady i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .2s; }
.steady.on i { background: var(--good); }
.hint { text-align: center; color: var(--muted); font-size: 14px; min-height: 1.4em; }
/* Lock in: fills up during the short minimum aiming time, then becomes active; shows when it is waiting for the server. */
.lock { position: relative; overflow: hidden; isolation: isolate; }
.lock::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(255,255,255,.18); transform-origin: left; transform: scaleX(var(--aim, 1)); }
.lock:disabled { opacity: .55; }
.lock.busy { opacity: 1; }

.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5, 8, 18, .93); display: flex; align-items: center; justify-content: center; padding: 24px; animation: in .2s var(--ease); }
.overlay .box { max-width: 380px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.overlay h2 { font-size: 26px; letter-spacing: -.01em; }
.fig8 { width: 180px; height: 120px; margin: 0 auto; }
.fig8 path { fill: none; stroke: var(--line); stroke-width: 4; }
.fig8 circle { fill: var(--accent); offset-path: path('M90 60 C 130 0, 170 60, 130 90 C 100 110, 80 10, 50 30 C 10 60, 50 120, 90 60'); animation: fig8 2.4s linear infinite; }
@keyframes fig8 { to { offset-distance: 100%; } }

/* ---------------------------------------------------------------- result */
.result { gap: 12px; }
.err-big { text-align: center; font-size: clamp(72px, 24vw, 104px); font-weight: 850; letter-spacing: -.04em; line-height: .95; }
.err-big small { font-size: 28px; font-weight: 650; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.grade { text-align: center; font-size: 20px; font-weight: 800; }
.grade.perfect, .grade.excellent { color: var(--good); } .grade.great, .grade.good { color: var(--you); } .grade.ok { color: var(--warn); } .grade.miss, .grade.wayoff { color: var(--danger); }
.points { text-align: center; font-size: 34px; font-weight: 850; color: var(--accent); }
.points small { display: block; font-size: 13px; font-weight: 650; color: var(--muted); }
.reveal-row { display: flex; gap: 10px; align-items: stretch; }
.reveal-row .mini-dial { width: 44%; aspect-ratio: 1; }
.reveal-row canvas { width: 56%; aspect-ratio: 1; border-radius: 16px; background: #0d1530; border: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { background: var(--card); border-radius: 14px; padding: 10px 12px; }
.fact b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.fact span { font-size: 12px; color: var(--muted); }
.fact.you b { color: var(--you); } .fact.truth b { color: var(--accent); }
.why { font-size: 13px; color: var(--muted); text-align: center; }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item .fill { flex: 1; min-width: 0; }
.list .item .fill b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .item .fill span { font-size: 13px; color: var(--muted); }
.list .item.you { background: rgba(255,181,71,.08); border-radius: 12px; padding: 12px 10px; }
.rank { width: 32px; text-align: center; font-weight: 800; color: var(--muted); }
.big-num { font-size: 52px; font-weight: 850; letter-spacing: -.03em; text-align: center; line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; font-size: 12px; color: var(--muted); }
.badge b { display: block; color: var(--fg); font-size: 13px; margin-top: 4px; }
.badge .ico { font-size: 24px; filter: grayscale(1); opacity: .4; }
.badge.on { border-color: rgba(255,181,71,.5); } .badge.on .ico { filter: none; opacity: 1; }
.xpbar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .8s var(--ease); }
.setting { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .fill b { display: block; font-size: 16px; } .setting .fill span { font-size: 13px; color: var(--muted); }
.switch { width: 52px; height: 32px; border-radius: 16px; border: 0; background: var(--line); position: relative; cursor: pointer; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--good); } .switch[aria-checked="true"]::after { transform: translateX(20px); }
input.text { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); padding: 0 12px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%) translateY(160%); background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 15px; z-index: 60; transition: transform .25s var(--ease); max-width: calc(100% - 32px); text-align: center; visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }

/* ---------------------------------------------------------------- onboarding */
.onb { justify-content: space-between; text-align: center; }
.onb h1 { font-size: clamp(32px, 9vw, 42px); line-height: 1.08; letter-spacing: -.02em; }
.onb p { color: var(--muted); font-size: 18px; }
.onb .art { font-size: 80px; line-height: 1; margin-top: 10vh; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .25s; }
.dots i.on { width: 22px; background: var(--accent); }

/* Short phones (iPhone SE): tighter spacing. */
@media (max-height: 680px) {
  .play { gap: 6px; padding-top: calc(8px + var(--safe-t)); }
  .target h1 { font-size: 30px; }
  .play .hint { display: none; }
  .btn.big { min-height: 58px; }
}
/* Landscape phones: dial on the left, everything else on the right. */
@media (orientation: landscape) and (max-height: 560px) {
  #app { max-width: none; }
  .screen.play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 42%); column-gap: 24px; row-gap: 8px;
    grid-template-rows: auto auto 1fr auto auto; grid-template-areas: 'stage hud' 'stage target' 'stage .' 'stage steady' 'stage lock';
    padding-left: calc(18px + env(safe-area-inset-left, 0px)); padding-right: calc(18px + env(safe-area-inset-right, 0px)); }
  .play .hud { grid-area: hud; } .play .target { grid-area: target; text-align: left; } .play .stage { grid-area: stage; height: 100%; }
  .play .steady { grid-area: steady; justify-content: flex-start; } .play .lock { grid-area: lock; } .play .hint { display: none; }
  .target h1 { font-size: 30px; }
  .screen.result, .screen.scroll { max-width: 640px; margin: 0 auto; }
}

:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.stack { display: flex; flex-direction: column; gap: 10px; }
/* Round outcome: a quiet color wash and a confident grade pop — satisfying, not childish. */
.screen.result { position: relative; }
.screen.result::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 360px; pointer-events: none; z-index: -1; opacity: 1;
  background: radial-gradient(70% 100% at 50% 0%, var(--wash, transparent), transparent 70%); }
.screen.result.win { --wash: rgba(79, 224, 160, .2); }
.screen.result.lose { --wash: rgba(255, 122, 122, .15); }
.reveal-row canvas.full { width: 100%; max-width: 360px; margin: 0 auto; }
.screen.result .grade { animation: grade-in .45s var(--ease) both; }
.screen.result.win .points { animation: grade-in .5s .1s var(--ease) both; }
@keyframes grade-in { from { opacity: 0; transform: scale(.85); } }
/* "Next target" always reachable with the thumb, however long the result is. */
.screen.result > .btn.primary:last-child { position: sticky; bottom: calc(10px + var(--safe-b)); z-index: 2; box-shadow: 0 -12px 28px 8px var(--bg); }
.screen.result, .screen.play { flex: none; } /* flex:1 would override the fixed viewport height */
.screen.result { height: 100dvh; min-height: 0; }

/* ---------------------------------------------------------------- accounts & social */
input, textarea, select { user-select: text; -webkit-user-select: text; }
.screen > .row > h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row.wrap { flex-wrap: wrap; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; flex-shrink: 0; line-height: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 700; font-size: 15px; }
.field-hint { font-size: 13px; color: var(--muted); }
.field-err { font-size: 14px; color: var(--danger); font-weight: 600; }
.field-err:empty { display: none; }
input.text[aria-invalid="true"] { border-color: var(--danger); }
textarea.text, select.text { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); padding: 10px 12px; color: var(--fg); }
.pw { position: relative; }
.pw input { padding-right: 76px; }
.reveal-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--card); color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; min-height: 0; }
a { color: var(--accent); }
.check, .radio { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; cursor: pointer; }
.check input, .radio input { width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; accent-color: var(--accent); }
.radio { padding: 10px 12px; background: var(--card2); border-radius: 12px; align-items: center; }
.btn.danger { background: var(--danger); color: #fff; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 22px 12px; }
.person { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; }
.person .fill { flex: 1; min-width: 0; }
.person .fill b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .fill span { font-size: 13px; color: var(--muted); }
.account-row:empty { display: none; }
.account-row .me { display: flex; align-items: center; gap: 10px; background: var(--card); border: 0; border-radius: 999px; padding: 4px 14px 4px 4px; color: inherit; cursor: pointer; max-width: 100%; }
.account-row .me > span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.icon-btn { position: relative; }
.icon-btn .dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.code { font-size: 26px; font-weight: 850; letter-spacing: .12em; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-grid button { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; background: var(--card2); font-size: 24px; cursor: pointer; }
.avatar-grid button[aria-checked="true"] { border-color: var(--accent); background: var(--card); }
.compare-head { display: flex; justify-content: space-around; align-items: center; text-align: center; }
.compare-head > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.item.compare b { width: 72px; text-align: center; }
.item.compare b.win { color: var(--good); }
.item.unread b { color: var(--fg); }
.item.unread { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px !important; }
.setting.link { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; text-align: left; cursor: pointer; padding: 6px 0; }
.setting.link:last-child { border-bottom: 0; }
.setting.link.danger b { color: var(--danger); }
.setting .chev { color: var(--faint); font-size: 22px; }
.setting .fill span { overflow-wrap: anywhere; }
.card > .kicker { margin-bottom: 4px; }
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 70; display: flex; align-items: flex-end; justify-content: center; animation: in .2s var(--ease); }
.sheet { width: 100%; max-width: 520px; background: var(--bg2); border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; max-height: 90dvh; overflow-y: auto; }
.sheet-title { font-size: 18px; text-align: center; margin-bottom: 4px; }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 65; background: var(--warn); color: #1a1205; text-align: center; font-weight: 700; font-size: 13px; padding: calc(4px + var(--safe-t)) 8px 4px; }
.setting > .fill { flex: 1; min-width: 0; }
/* Segmented choices get their own line under the label: readable at 320 px and with large text. */
.setting:has(> .seg) { flex-wrap: wrap; padding: 10px 0; }
.setting > .seg { flex: 1 1 100%; min-width: 0 !important; }
.level-chip .small { white-space: nowrap; }
.topbar { gap: 8px; }
@media (max-width: 380px) { .level-chip .small { display: none; } .level-chip { padding-right: 4px; } .topbar .brand { font-size: 21px; } }
