/* Typing Coach — a calm, typography-led look. Tokens first (light, then dark: system or chosen). */
:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --bg-2: #ece9e1;
  --surface: #fffefb;
  --surface-2: #f8f6f1;
  --ink: #1b1d23;
  --ink-2: #3a3e47;
  --muted: #5f6470;
  --typed: #6a707b;
  --line: rgba(27, 29, 35, 0.085);
  --line-2: rgba(27, 29, 35, 0.15);
  --accent: #3b4fd4;
  --accent-2: #12a39b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(59, 79, 212, 0.1);
  --bad: #b8213f;
  --bad-soft: rgba(225, 45, 85, 0.13);
  --was: rgba(214, 150, 20, 0.55);
  --star: #e8a317;
  --star-off: rgba(27, 29, 35, 0.12);
  --caret: #3b4fd4;
  --key: #ffffff;
  --key-edge: rgba(27, 29, 35, 0.13);
  --key-ink: #2c3038;
  --hand: rgba(27, 29, 35, 0.045);
  --hand-edge: rgba(27, 29, 35, 0.12);
  --shadow: 0 1px 2px rgba(27, 29, 35, 0.04), 0 8px 28px -12px rgba(27, 29, 35, 0.16);
  --f-p: #8b5cf6;
  --f-r: #2f7ff0;
  --f-m: #0fa979;
  --f-i: #e8930c;
  --f-t: #8a94a6;
  --heat-lo: #dcefe4;
  --heat-mid: #f6dfa4;
  --heat-hi: #f2a3b3;
  --ca-accent: #3b4fd4;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'JetBrains Mono', 'Roboto Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Inter, Roboto, 'Helvetica Neue', sans-serif;
  --serif: 'New York', 'Iowan Old Style', 'Charter', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --text-font: var(--mono);
  --ts: clamp(22px, calc(1.2vw / var(--ca-zoom, 1)) + 15px, 32px);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.013 0.6%, 0.05 1.2%, 0.2 2.7%, 0.442 4.5%, 0.725 6.6%, 0.946 8.5%, 1.098 10.3%, 1.181 11.9%, 1.215 13.6%, 1.207 15.5%, 1.164 17.6%, 1.031 23.4%, 0.981 27.1%, 0.97 30.6%, 0.976 34.6%, 0.998 45.4%, 1.004 53.3%, 1);
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #111318; --bg-2: #171a20; --surface: #1a1d24; --surface-2: #20242c; --ink: #eceef2; --ink-2: #cdd1d9; --muted: #9ba2ae; --typed: #8c93a0;
    --line: rgba(255, 255, 255, 0.075); --line-2: rgba(255, 255, 255, 0.14);
    --accent: #8e9bff; --accent-2: #4fd1c5; --accent-ink: #0e1124; --accent-soft: rgba(142, 155, 255, 0.15);
    --bad: #ff8fa6; --bad-soft: rgba(255, 110, 140, 0.17); --was: rgba(241, 184, 74, 0.55); --star: #f3bd3f; --star-off: rgba(255, 255, 255, 0.13);
    --caret: #a3adff; --key: #232731; --key-edge: rgba(0, 0, 0, 0.45); --key-ink: #d9dce3; --hand: rgba(255, 255, 255, 0.04); --hand-edge: rgba(255, 255, 255, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --heat-lo: #1f3b30; --heat-mid: #574718; --heat-hi: #6b2535; --ca-accent: #8e9bff;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111318; --bg-2: #171a20; --surface: #1a1d24; --surface-2: #20242c; --ink: #eceef2; --ink-2: #cdd1d9; --muted: #9ba2ae; --typed: #8c93a0;
  --line: rgba(255, 255, 255, 0.075); --line-2: rgba(255, 255, 255, 0.14);
  --accent: #8e9bff; --accent-2: #4fd1c5; --accent-ink: #0e1124; --accent-soft: rgba(142, 155, 255, 0.15);
  --bad: #ff8fa6; --bad-soft: rgba(255, 110, 140, 0.17); --was: rgba(241, 184, 74, 0.55); --star: #f3bd3f; --star-off: rgba(255, 255, 255, 0.13);
  --caret: #a3adff; --key: #232731; --key-edge: rgba(0, 0, 0, 0.45); --key-ink: #d9dce3; --hand: rgba(255, 255, 255, 0.04); --hand-edge: rgba(255, 255, 255, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --heat-lo: #1f3b30; --heat-mid: #574718; --heat-hi: #6b2535; --ca-accent: #8e9bff;
}
:root[data-font='sans'] { --text-font: var(--sans); }
:root[data-font='serif'] { --text-font: var(--serif); }
:root[data-size='s'] { --ts: clamp(19px, calc(0.9vw / var(--ca-zoom, 1)) + 14px, 26px); }
:root[data-size='l'] { --ts: clamp(26px, calc(1.5vw / var(--ca-zoom, 1)) + 18px, 40px); }

* { box-sizing: border-box; }
/* no double-tap zoom on iOS: js/touch-guard.js adds the same rule plus a JS fallback */
:where(html, body, body *) { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: calc(100dvh / var(--ca-zoom, 1));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* (--ca-space-top: the strip the call rests in while a race is run inside a Shared Space) */
  padding: calc(env(safe-area-inset-top) + var(--ca-space-top, 0px)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- the top bar (App Standard §4.1): the SDK's brand at the left; in a run Back and the run's name beside
   it (the app's name gives way to it, the mark and the icon stay), the live figures and the sound at the
   right, before the SDK's tools and the chip ------------------------------------------------------------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; max-width: 1180px; width: 100%; margin: 0 auto; min-height: 64px;
  --ca-tool-bg: var(--surface); --ca-tool-line: var(--line); --ca-tool-ink: var(--ink-2); --ca-tool-hover: var(--surface-2); }
.run-title { flex: 1 1 0; min-width: 0; color: var(--muted); font-size: 17px; font-weight: 540; letter-spacing: -0.01em; line-height: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-screen='type'] .ca-brand-name { display: none; }
.bar > .ca-start { min-width: var(--ca-brand-icon-w); }
/* a phone upright, in a run: the brand's icon is the way home (as Back is), Key sounds is in Settings —
   the live figures keep their room beside the chip and the friends' buttons */
@media (max-width: 420px) {
  .bar > #back, .bar > #sound-btn { display: none !important; }
  .bar .live { gap: 2px; padding: 3px; }
  .bar .live .stat { padding: 3px 4px; }
}
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; padding: 0; transition: background-color 0.15s, transform 0.2s var(--spring); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }
#sound-btn .mute { display: none; }
#sound-btn.off .wave { display: none; }
#sound-btn.off .mute { display: inline; }
#sound-btn.off { --ca-tool-ink: var(--muted); }
.live { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); contain: layout paint; }
.live .stat { display: flex; align-items: baseline; gap: 3px; padding: 3px 9px; font-variant-numeric: tabular-nums; }
.live .stat b { font-size: 17px; font-weight: 680; min-width: 2ch; text-align: right; }
.live .stat.time b { min-width: 4ch; }
.live small { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }

/* ---- buttons, pills ----------------------------------------------------------------------------------- */
.btn { min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 620; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.25s var(--spring), background-color 0.15s, box-shadow 0.2s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 90%, var(--ink)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 17px; border-radius: 16px; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 640; font-variant-numeric: tabular-nums; transition: transform 0.25s var(--spring), background-color 0.15s, color 0.15s, border-color 0.15s; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill:active { transform: scale(0.95); }
.pill.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-2); gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 38px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color 0.15s, color 0.15s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* ---- home ------------------------------------------------------------------------------------------------- */
.screen { width: 100%; }
body[data-screen='home'] { height: calc(100dvh / var(--ca-zoom, 1)); overflow: hidden; }
.home { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px max(20px, calc((100% - 1140px) / 2)) 56px; display: flex; flex-direction: column; gap: 18px; scrollbar-gutter: stable; }
.home > * { flex: none; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 32px 36px; border-radius: 30px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%), radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 55%), var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.hero-title { margin: 0; font-size: clamp(26px, calc(2.4vw / var(--ca-zoom, 1)) + 12px, 40px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 720; text-wrap: balance; }
.hero-sub { margin: 10px 0 0; color: var(--muted); font-size: 16px; max-width: 46ch; text-wrap: pretty; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 22px; flex-wrap: wrap; }
.hero-stars { display: inline-flex; gap: 4px; }
.hero-keys { display: flex; justify-content: center; align-items: center; gap: 14px; min-height: 150px; flex-wrap: wrap; }
.cap-big { --s: 104px; width: var(--s); height: var(--s); border-radius: calc(var(--s) * 0.2); background: var(--key); display: grid; place-items: center; font: 650 calc(var(--s) * 0.42) / 1 var(--sans); color: var(--key-ink); box-shadow: inset 0 -4px 0 var(--key-edge), 0 14px 26px -14px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--line); position: relative; animation: rise 0.7s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
.cap-big::after { content: ''; position: absolute; left: 26%; right: 26%; bottom: calc(var(--s) * 0.12); height: 4px; border-radius: 3px; background: var(--fc, var(--f-t)); opacity: 0.85; }
.cap-big.small { --s: 64px; }
.cap-big.wide { width: calc(var(--s) * 1.7); font-size: calc(var(--s) * 0.24); color: var(--muted); }
@keyframes rise { from { transform: translateY(14px) scale(0.92); opacity: 0; } }
.touch-note { margin: 0; padding: 14px 18px; border-radius: 18px; background: var(--accent-soft); color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.touch-note b { color: var(--ink); font-weight: 680; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card.tests, .card.race { grid-column: span 2; }
.card.tests { order: 1; } .card.daily { order: 2; } .card.race { order: 3; } .card.weak { order: 4; }
.card.race .lanes-mini { max-width: 520px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card .sub { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; flex: 1; text-wrap: pretty; }
.card .date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.card .mine { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.card.daily { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 60%); }
.lanes-mini { display: grid; gap: 7px; padding: 4px 0; }
.lanes-mini i { height: 6px; border-radius: 3px; background: var(--bg-2); position: relative; overflow: hidden; }
.lanes-mini i::after { content: ''; position: absolute; inset: 0; border-radius: 3px; transform-origin: left; background: var(--c); transform: scaleX(var(--p)); }
.lanes-mini i:nth-child(1) { --c: var(--f-i); --p: 0.72; }
.lanes-mini i:nth-child(2) { --c: var(--accent); --p: 0.86; }
.lanes-mini i:nth-child(3) { --c: var(--f-m); --p: 0.58; }
.weak-keys { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; align-items: center; }
.weak-keys .kc { min-width: 42px; height: 42px; padding: 0 8px; border-radius: 10px; background: var(--key); box-shadow: inset 0 -3px 0 var(--key-edge), 0 0 0 1px var(--line); display: grid; place-items: center; font: 650 19px/1 var(--sans); color: var(--key-ink); position: relative; }
.weak-keys .kc::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: 5px; height: 3px; border-radius: 2px; background: var(--fc, var(--f-t)); }
.weak-keys .none { color: var(--muted); font-size: 14px; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fig { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }
.fig b { font-size: 26px; font-weight: 720; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.fig span { color: var(--muted); font-size: 13px; line-height: 1.3; }
.fig .dots { display: flex; gap: 4px; margin-top: 6px; }
.fig .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.fig .dots i.on { background: var(--accent-2); }
.course { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.course-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 720; }
.layout-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; }
.units { display: flex; flex-direction: column; gap: 12px; }
.unit { padding: 16px 18px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.unit-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.unit-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.unit-head p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; min-width: 12ch; }
.unit-head .count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tile { position: relative; min-height: 84px; padding: 10px 10px 8px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface-2); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px; text-align: left; transition: transform 0.3s var(--spring), border-color 0.15s, background-color 0.15s, box-shadow 0.2s; }
.tile:hover { border-color: var(--accent); }
.tile:active { transform: scale(0.96); }
.tile .k { font: 650 18px/1.15 var(--mono); letter-spacing: 0.02em; color: var(--ink); word-break: break-all; }
.tile .k.word { font: 620 14px/1.25 var(--sans); letter-spacing: 0; word-break: normal; }
.tile .st { display: flex; gap: 2px; }
.tile.cur { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.tile.locked { opacity: 0.5; }
.tile.locked .k { color: var(--muted); }
.tile .lock { position: absolute; top: 9px; right: 9px; color: var(--muted); }
.star { width: 14px; height: 14px; display: inline-block; }
.star path { fill: var(--star-off); }
.star.on path { fill: var(--star); }
.hero-stars .star { width: 22px; height: 22px; }

/* ---- the typing screen --------------------------------------------------------------------------------- */
body[data-screen='type'] { height: calc(100dvh / var(--ca-zoom, 1)); overflow: hidden; }
body[data-screen='type'] .bar { max-width: none; }
.type { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 0 20px 14px; position: relative; }
.meter { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line); overflow: hidden; }
.meter i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.25s var(--ease); }
.paper { position: relative; width: min(1040px, 100%); margin: auto 0 0; padding: 26px 8px 8px; flex: none; }
.lines { position: relative; height: calc(var(--lh, 52px) * 3); overflow: hidden; font: 450 var(--ts) / 1.62 var(--text-font); letter-spacing: 0.005em; color: var(--ink); contain: layout paint; -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--lh, 52px) * 0.55), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - var(--lh, 52px) * 0.55), transparent); }
:root[data-font='mono'] .lines, :root:not([data-font]) .lines { letter-spacing: -0.01em; }
.text { transform: translateY(var(--scroll, 0)); transition: transform 0.32s var(--ease); white-space: normal; overflow-wrap: anywhere; }
.text .w { white-space: nowrap; }
.ch { border-radius: 4px; transition: color 0.12s; }
.ch.ok { color: var(--typed); }
.ch.ok.was { box-shadow: inset 0 -2px 0 var(--was); border-radius: 0; }
.ch.bad { color: var(--bad); background: var(--bad-soft); }
.ch.sp.bad { background: var(--bad-soft); }
.caret { position: absolute; left: 0; top: 0; width: 2.5px; height: calc(var(--lh, 52px) * 0.66); margin-top: calc(var(--lh, 52px) * 0.17); margin-left: -1.25px; border-radius: 2px; background: var(--caret); transform: translate3d(var(--x, 0), var(--y, 0), 0); transition: transform 0.09s cubic-bezier(0.3, 0.7, 0.3, 1); will-change: transform; box-shadow: 0 0 12px color-mix(in srgb, var(--caret) 45%, transparent); }
.caret.jump { transition: none; }
.caret.idle { animation: breathe 1.15s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.25; } }
.rival { position: absolute; left: 0; top: 0; width: 2px; height: calc(var(--lh, 52px) * 0.62); margin-top: calc(var(--lh, 52px) * 0.19); border-radius: 2px; background: var(--pc); opacity: 0.7; transform: translate3d(var(--x, 0), var(--y, 0), 0); transition: transform 0.3s var(--ease), opacity 0.2s; }
.rival::before { content: ''; position: absolute; top: -5px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }
.rival.off { opacity: 0; }
.veil { position: absolute; inset: 0; border: 0; padding: 0; background: color-mix(in srgb, var(--bg) 62%, transparent); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); display: none; place-items: center; color: var(--ink); border-radius: 18px; }
.veil.on { display: grid; animation: fade 0.25s var(--ease) both; }
.veil.soft { inset: auto 0 -64px 0; height: 56px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.veil.soft span { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.veil span { padding: 12px 20px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 620; border: 1px solid var(--line); max-width: 90%; text-align: center; }
@keyframes fade { from { opacity: 0; } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font: 760 clamp(64px, calc(9vw / var(--ca-zoom, 1)), 120px) / 1 var(--sans); color: var(--accent); }
.countdown b { animation: pop 0.9s var(--spring) both; text-shadow: 0 10px 40px color-mix(in srgb, var(--accent) 40%, transparent); }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 30% { opacity: 1; } 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.08); opacity: 0; } }
.hint { margin: 8px 0 0; min-height: 24px; color: var(--muted); font-size: 14.5px; display: flex; align-items: center; gap: 8px; justify-content: center; text-align: center; flex: none; }
.hint .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fc, var(--f-t)); flex: none; transition: background-color 0.15s; }
.board { width: min(1000px, 100%); margin: 14px 0 auto; flex: none; display: flex; justify-content: center; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sink { position: fixed; left: 50%; bottom: 40%; width: 2px; height: 2px; opacity: 0; padding: 0; border: 0; resize: none; pointer-events: none; font-size: 16px; caret-color: transparent; color: transparent; background: transparent; }
body.touch .board, body.touch .hint { display: none; }
body.touch .paper { margin-top: 12px; }

/* ---- the on-screen keyboard -------------------------------------------------------------------------------- */
.kbd { --u: 56px; position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 0.06); }
.keys { display: grid; grid-template-columns: repeat(60, calc(var(--u) / 4)); grid-template-rows: repeat(5, var(--u)); }
.key { grid-row: var(--r) / span 1; grid-column: var(--c, auto) / span var(--w); margin: calc(var(--u) * 0.045); border-radius: calc(var(--u) * 0.17); background: var(--key); color: var(--key-ink); position: relative; display: grid; place-items: center; font: 560 calc(var(--u) * 0.3) / 1 var(--sans); box-shadow: inset 0 calc(var(--u) * -0.05) 0 var(--key-edge), 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.05); transition: transform 0.42s var(--spring), background-color 0.18s, opacity 0.25s, box-shadow 0.18s; }
.key.tall { grid-row: 2 / span 2; }
.key::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: calc(var(--u) * 0.1); height: max(2px, calc(var(--u) * 0.045)); border-radius: 2px; background: var(--fc); opacity: 0.55; transition: opacity 0.2s; }
.key[data-f='lp'], .key[data-f='rp'] { --fc: var(--f-p); }
.key[data-f='lr'], .key[data-f='rr'] { --fc: var(--f-r); }
.key[data-f='lm'], .key[data-f='rm'] { --fc: var(--f-m); }
.key[data-f='li'], .key[data-f='ri'] { --fc: var(--f-i); }
.key[data-f='th'] { --fc: var(--f-t); }
.key.mod { font-size: calc(var(--u) * 0.22); color: var(--muted); font-weight: 600; }
.key.mod::after { opacity: 0.3; }
.key.two { place-items: stretch; }
.key.two .sh, .key.two .cap { position: absolute; left: 22%; }
.key.two .sh { top: 15%; font-size: calc(var(--u) * 0.22); color: var(--muted); }
.key.two .cap { bottom: 27%; }
.key .ag { position: absolute; right: 13%; bottom: 25%; font-size: calc(var(--u) * 0.2); color: var(--accent); opacity: 0; transition: opacity 0.2s; }
.kbd.show-ag .key .ag { opacity: 0.85; }
.key.bump .cap { position: relative; }
.key.bump .cap::after { content: ''; position: absolute; left: 50%; bottom: calc(var(--u) * -0.1); width: calc(var(--u) * 0.18); margin-left: calc(var(--u) * -0.09); height: 2px; border-radius: 1px; background: currentColor; opacity: 0.45; }
.key.dead .cap { color: var(--accent); }
.key.later { opacity: 0.38; }
.key.fresh::before { content: ''; position: absolute; top: calc(var(--u) * 0.1); right: calc(var(--u) * 0.1); width: calc(var(--u) * 0.1); height: calc(var(--u) * 0.1); border-radius: 50%; background: var(--accent); }
.key.next { background: color-mix(in srgb, var(--fc) 24%, var(--key)); color: var(--ink); box-shadow: inset 0 calc(var(--u) * -0.05) 0 color-mix(in srgb, var(--fc) 55%, var(--key-edge)), 0 0 0 2px var(--fc), 0 6px 18px -6px var(--fc); transform: translateY(calc(var(--u) * -0.03)); opacity: 1; }
.key.next::after { opacity: 1; }
.key.next-mod { background: color-mix(in srgb, var(--fc) 14%, var(--key)); box-shadow: inset 0 calc(var(--u) * -0.05) 0 var(--key-edge), 0 0 0 1.5px color-mix(in srgb, var(--fc) 75%, transparent); opacity: 1; }
.key.down { transform: translateY(calc(var(--u) * 0.045)) scale(0.955); transition: transform 0.04s ease-out, background-color 0.05s; box-shadow: inset 0 calc(var(--u) * -0.015) 0 var(--key-edge), 0 0 0 1px var(--line); }
.key.down.miss { background: color-mix(in srgb, var(--bad) 22%, var(--key)); }
.kbd.heat .key { opacity: 1; }
.kbd.heat .key.hot { background: color-mix(in oklab, color-mix(in oklab, var(--heat-lo), var(--heat-mid) calc(min(var(--heat), 0.5) * 200%)), var(--heat-hi) calc(max(var(--heat) - 0.5, 0) * 200%)); }
.kbd.heat .key::after, .kbd.heat .key.fresh::before { opacity: 0; }
/* the hands */
.hands { width: calc(var(--u) * 15); height: calc(var(--u) * 1.7); overflow: hidden; margin-top: calc(var(--u) * 0.02); }
.kbd.no-hands .hands { display: none; }
.hands .palm { fill: color-mix(in srgb, var(--ink) 3.5%, var(--bg)); stroke: var(--line-2); stroke-width: 2.5; }
.hands .finger .digit { fill: color-mix(in srgb, var(--fc) 11%, var(--bg)); stroke: color-mix(in srgb, var(--fc) 45%, var(--bg)); stroke-width: 2.5; transition: fill 0.18s, stroke 0.18s; }
.hands .finger .nail { fill: color-mix(in srgb, var(--fc) 18%, var(--bg)); transition: fill 0.18s; }
.hands .lift { transition: transform 0.45s var(--spring); }
.hands .finger.on .lift { transform: translateY(-14px); }
.hands .finger.on .digit { fill: color-mix(in srgb, var(--fc) 55%, var(--bg)); stroke: var(--fc); }
.hands .finger.on .nail { fill: color-mix(in srgb, #fff 60%, var(--fc)); }
.hands [data-f='lp'], .hands [data-f='rp'] { --fc: var(--f-p); }
.hands [data-f='lr'], .hands [data-f='rr'] { --fc: var(--f-r); }
.hands [data-f='lm'], .hands [data-f='rm'] { --fc: var(--f-m); }
.hands [data-f='li'], .hands [data-f='ri'] { --fc: var(--f-i); }
.hands [data-f='lt'], .hands [data-f='rt'] { --fc: var(--f-t); }

/* ---- the race ---------------------------------------------------------------------------------------------- */
.lanes { width: min(1040px, 100%); margin-top: 18px; display: grid; gap: 6px; flex: none; }
.lane { display: grid; grid-template-columns: minmax(80px, 150px) 1fr 64px; align-items: center; gap: 12px; height: 34px; --pc: var(--accent); }
.lane .who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 620; }
.lane .who i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; }
.lane .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane.left { opacity: 0.45; }
.lane .track { position: relative; height: 100%; }
.lane .track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 10px, transparent 10px 18px); }
.lane .track::after { content: ''; position: absolute; right: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: repeating-linear-gradient(180deg, var(--ink-2) 0 4px, transparent 4px 8px); opacity: 0.5; }
.lane .car { position: absolute; left: 0; top: 50%; width: 44px; height: 22px; margin-top: -11px; transform: translateX(calc(var(--p, 0) * var(--track, 0px))); transition: transform 0.35s var(--ease); color: var(--pc); }
.lane .car svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 4px color-mix(in srgb, var(--pc) 35%, transparent)); }
.lane .wpm { text-align: right; font-variant-numeric: tabular-nums; font-weight: 680; font-size: 14px; color: var(--ink-2); }
.lane .wpm small { color: var(--muted); font-weight: 600; font-size: 11px; margin-left: 2px; }
.lane.me .who span { color: var(--accent); }
.lane .place { color: var(--muted); font-weight: 700; margin-right: 2px; }

/* ---- the result ---------------------------------------------------------------------------------------------- */
.type.show-result .paper, .type.show-result .hint, .type.show-result .board, .type.show-result .lanes { display: none; }
.result { margin: auto 0; width: min(760px, 100%); padding: 30px 32px 26px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; animation: card-in 0.55s var(--spring) both; max-height: 100%; overflow: auto; overscroll-behavior: contain; outline: none; }
@keyframes card-in { from { transform: translateY(22px) scale(0.97); opacity: 0; } }
.result .r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.result .r-eyebrow { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.result h2 { margin: 2px 0 0; font-size: 26px; letter-spacing: -0.02em; font-weight: 720; }
.result .r-stars { display: flex; gap: 6px; }
.result .r-stars .star { width: 38px; height: 38px; }
.result .r-stars .star.on { animation: star-in 0.6s var(--spring) both; animation-delay: calc(var(--i) * 150ms + 250ms); }
@keyframes star-in { from { transform: scale(0.2) rotate(-30deg); opacity: 0; } }
.result .r-main { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end; }
.result .r-big b { display: block; font-size: clamp(56px, calc(7vw / var(--ca-zoom, 1)), 84px); line-height: 0.95; font-weight: 760; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.result .r-big span { color: var(--muted); font-weight: 620; font-size: 14px; }
.result .r-big .best { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--star) 22%, transparent); color: var(--ink); font-size: 12.5px; font-weight: 700; animation: rise 0.6s var(--spring) 0.6s both; }
.result .curve { width: 100%; height: 70px; }
.result .r-main.solo { grid-template-columns: 1fr; }
.result .r-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.result .r-figs div { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.result .r-figs b { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result .r-figs span { color: var(--muted); font-size: 13px; }
.result .r-missed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.result .r-missed .kc { min-width: 36px; height: 36px; padding: 0 7px; border-radius: 9px; background: var(--key); box-shadow: inset 0 -3px 0 var(--key-edge), 0 0 0 1px var(--line); display: inline-grid; place-items: center; font: 650 16px/1 var(--sans); color: var(--key-ink); }
.result .r-missed .m { display: inline-flex; align-items: center; gap: 5px; }
.result .r-missed .m small { color: var(--bad); font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.result .r-note { margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--ink-2); font-size: 14.5px; }
.result .r-note.warn { background: color-mix(in srgb, var(--star) 16%, transparent); }
.result .r-actions { position: sticky; bottom: -26px; margin: 0 -4px -6px; padding: 10px 4px 6px; background: var(--surface); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.result .podium { display: grid; gap: 8px; }
.result .podium .row { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); animation: rise 0.5s var(--spring) both; animation-delay: calc(var(--i) * 80ms); }
.result .podium .row.me { background: var(--accent-soft); }
.result .podium .pl { font-weight: 760; font-size: 18px; color: var(--muted); text-align: center; }
.result .podium .row:first-child .pl { color: var(--star); }
.result .podium .nm { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.result .podium .nm i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; }
.result .podium .w { font-variant-numeric: tabular-nums; font-weight: 700; }
.result .podium .a { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; min-width: 5ch; text-align: right; }

/* ---- sheets ---------------------------------------------------------------------------------------------------- */
.sheet { border: 0; padding: 0; border-radius: 24px; width: min(calc(94vw / var(--ca-zoom, 1)), 480px); max-height: min(calc(88dvh / var(--ca-zoom, 1)), 820px); background: var(--surface); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.55); display: none; flex-direction: column; overflow: hidden; }
.sheet[open] { display: flex; animation: sheet-in 0.38s var(--spring) both; }
.sheet.wide { width: min(calc(94vw / var(--ca-zoom, 1)), 780px); }
.sheet::backdrop { background: rgba(10, 12, 18, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes sheet-in { from { transform: translateY(18px) scale(0.98); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 10px 22px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.015em; }
.sheet-head form { margin: 0; }
.sheet-body { padding: 4px 22px 22px; overflow: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.row > span:first-child { display: flex; flex-direction: column; font-weight: 550; }
.row select { min-height: 40px; max-width: 58%; padding: 0 30px 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); 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% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.note { color: var(--muted); font-size: 13.5px; font-weight: 450; margin: 2px 0 0; line-height: 1.45; }
input.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; margin: 0; flex: none; cursor: pointer; transition: background-color 0.2s; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.3s var(--spring); }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(20px); }
input[type='range'] { width: 46%; accent-color: var(--accent); }
.field { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); resize: vertical; min-height: 140px; -webkit-user-select: text; user-select: text; font: 15px/1.5 var(--sans); margin: 10px 0 4px; }
.sheet-body > .btn.primary { width: 100%; margin-top: 10px; }
.prose { -webkit-user-select: text; user-select: text; }
.prose h3 { margin: 18px 0 4px; font-size: 16px; }
.prose h3:first-child { margin-top: 4px; }
.prose p { margin: 0; color: var(--ink-2); line-height: 1.6; text-wrap: pretty; }
.prose .version { color: var(--muted); font-size: 13px; margin-top: 18px; }
.tabs { display: flex; gap: 4px; padding: 0 22px 10px; flex: none; overflow-x: auto; }
.tabs button { border: 0; background: transparent; min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 640; color: var(--muted); white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.tabs button.on { background: var(--accent-soft); color: var(--accent); }
.res-sec { margin: 6px 0 20px; animation: fade 0.3s var(--ease) both; }
.res-sec h3 { margin: 0 0 8px; font-size: 15px; font-weight: 680; }
.res-sec .note { margin-bottom: 8px; }
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.totals div { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.totals b { display: block; font-size: 20px; font-weight: 720; font-variant-numeric: tabular-nums; }
.totals span { color: var(--muted); font-size: 12.5px; }
.chart, .bars { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart text, .bars text { fill: var(--muted); font: 500 11.5px var(--sans); }
.chart .empty { font-size: 14px; }
.chart .area { fill: color-mix(in srgb, var(--accent) 12%, transparent); animation: fade 0.8s var(--ease) 0.3s both; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) 0.1s forwards; }
.chart .acc { fill: none; stroke: var(--accent-2); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.85; animation: draw 1.3s var(--ease) 0.25s forwards; }
.chart .dots circle { fill: color-mix(in srgb, var(--accent) 35%, transparent); }
.chart .head { fill: var(--surface); stroke: var(--accent); stroke-width: 3; animation: rise 0.5s var(--spring) 1s both; }
.chart .acc-tick { fill: color-mix(in srgb, var(--accent-2) 80%, var(--muted)); }
.chart .legend text { font-weight: 650; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.bars .bar rect { fill: var(--line-2); transform-box: fill-box; transform-origin: bottom; animation: grow 0.6s var(--spring) both; animation-delay: calc(var(--i) * 25ms); }
.bars .bar.on rect { fill: var(--accent-2); }
.bars .val { fill: var(--ink-2); font-weight: 650; }
@keyframes grow { from { transform: scaleY(0); } }
.curve .area { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.curve .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s var(--ease) 0.3s forwards; }
.heat-wrap { display: flex; justify-content: center; margin: 4px 0 10px; }
.heat-legend { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 12.5px; }
.heat-legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--heat-lo), var(--heat-mid), var(--heat-hi)); }
.fingers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.fingers div { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border-left: 4px solid var(--fc); }
.fingers b { display: block; font-size: 13.5px; font-weight: 650; }
.fingers span { display: block; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fingers [data-f='lp'], .fingers [data-f='rp'] { --fc: var(--f-p); }
.fingers [data-f='lr'], .fingers [data-f='rr'] { --fc: var(--f-r); }
.fingers [data-f='lm'], .fingers [data-f='rm'] { --fc: var(--f-m); }
.fingers [data-f='li'], .fingers [data-f='ri'] { --fc: var(--f-i); }
.board-tabs { margin-bottom: 10px; }
.check { text-align: center; }
.check-q { font-size: 17px; font-weight: 620; margin: 6px 0 12px; }
.check-a { min-height: 24px; color: var(--muted); margin: 10px 0; }
.check-kbd { display: flex; justify-content: center; overflow: hidden; }
.check .pills { justify-content: center; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.5); font-size: 14.5px; max-width: calc(100vw / var(--ca-zoom, 1) - 32px); animation: toast-in 0.45s var(--spring) both; }
.toast .btn { min-height: 36px; background: var(--bg); color: var(--ink); border: 0; }
@keyframes toast-in { from { transform: translate(-50%, 16px); opacity: 0; } }

/* ---- smaller screens ------------------------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.race { grid-column: span 2; }
  .card.tests { grid-column: span 2; }
  .hero { grid-template-columns: 1fr; padding: 24px 22px; gap: 10px; }
  .hero-keys { order: -1; justify-content: flex-start; min-height: 0; gap: 10px; }
  .hero-keys .cap-big { --s: 62px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .totals, .result .r-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fingers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card.tests, .card.race { grid-column: auto; }
  .bar { padding: 10px 14px; min-height: 58px; gap: 8px; }
  .home { padding: 2px 14px 40px; gap: 14px; scrollbar-gutter: auto; }
  .hero { border-radius: 24px; padding: 20px 18px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 15px; }
  .btn.big { width: 100%; }
  .card { padding: 16px; border-radius: 20px; }
  .unit { padding: 14px; }
  .lessons { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .tile { min-height: 74px; }
  .fig b { font-size: 22px; }
  .type { padding: 0 12px 10px; }
  .live .stat { padding: 3px 5px; }
  .live .stat b { font-size: 15px; }
  .live .stat:first-child small { display: none; }
  .run-title { visibility: hidden; }
  .result { padding: 22px 18px 18px; border-radius: 22px; }
  .result .r-main { grid-template-columns: 1fr; gap: 8px; }
  .result .r-actions .btn { flex: 1; }
  .lane { grid-template-columns: 76px 1fr 46px; gap: 8px; height: 28px; }
  .lane .car { width: 34px; height: 17px; margin-top: -8.5px; }
  .sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: calc(92dvh / var(--ca-zoom, 1)); }
  .sheet.wide { width: 100%; }
  .row select { max-width: 60%; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .bar { min-height: 50px; padding-top: 6px; padding-bottom: 6px; }
  .paper { padding-top: 10px; }
}
@media (max-height: 700px) {
  .result { gap: 12px; padding: 18px 20px 16px; margin: 10px 0; }
  .result .r-main > div:last-child { display: none; }
  .result .r-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .result .r-figs div { padding: 8px 10px; border-radius: 12px; }
  .result .r-figs b { font-size: 17px; }
  .result .r-figs span { font-size: 11.5px; }
  .result .r-big b { font-size: 54px; }
  .result h2 { font-size: 21px; }
  .result .r-stars .star { width: 30px; height: 30px; }
  .result .r-actions { bottom: -16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
  .chart .line, .chart .acc, .curve .line { stroke-dashoffset: 0; }
}

/* cloud-apps bar 1.30.0 */
:root { --ca-brand-icon-w: 89px; } /* the brand's width with the icon alone (the mark, the divider, the app's icon) */
.ca-start { display: flex; align-items: center; flex: 0 100 auto; min-width: min(var(--ca-brand-icon-w), 100%); }
.ca-brand { display: flex; align-items: center; min-width: 0; height: 40px; color: inherit; font-family: inherit; }
.ca-brand a { display: flex !important; align-items: center !important; box-sizing: border-box !important; color: inherit !important; text-decoration: none !important; border-radius: 12px !important; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease; }
.ca-brand-home { flex: none !important; justify-content: center !important; width: 40px !important; height: 40px !important; padding: 0 !important; margin: 0 0 0 -5px !important; }
.ca-brand-home img { display: block !important; width: 30px !important; height: 30px !important; margin: 0 !important; transition: transform .38s cubic-bezier(.34, 1.56, .64, 1); }
.ca-brand-sep { flex: none; display: block; width: 1.5px; height: 18px; margin: 0 4px; border-radius: 1px; background: currentColor; opacity: .22; transform: rotate(18deg); }
.ca-brand-app { flex: 0 1 auto !important; min-width: 44px !important; height: 40px !important; padding: 0 9px 0 5px !important; margin: 0 !important; }
.ca-brand-in { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; column-gap: 9px; min-width: 0; height: 40px; overflow: hidden; }
.ca-brand-in img { flex: none; display: block !important; width: 30px !important; height: 30px !important; margin: 5px 0 !important; border-radius: 8px; }
.ca-brand[data-ca-icon] .ca-brand-name { display: none !important; }
.ca-brand[data-ca-icon] .ca-brand-app { padding-right: 5px !important; }
.ca-brand-name { display: block; height: 40px; margin: 0 !important; padding: 0 !important; line-height: 40px !important; white-space: nowrap; font-family: var(--ca-brand-font, inherit); font-size: 17px !important; font-weight: 700; letter-spacing: -.015em; color: inherit; text-shadow: var(--ca-brand-shadow, none); }
@media (hover: hover) { .ca-brand a:hover { background-color: color-mix(in srgb, currentColor 7%, transparent); } .ca-brand-home:hover img { transform: rotate(-6deg) scale(1.06); } }
.ca-brand a:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: -3px; }
.ca-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; min-width: 0; }
.ca-tools { display: flex; align-items: center; gap: 6px; }
.ca-tools[hidden] { display: none !important; }
.ca-tool { position: relative; flex: none; display: inline-grid; place-items: center !important; box-sizing: border-box !important; width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; padding: 0 !important; margin: 0; border-radius: 50% !important;
  border: 1px solid var(--ca-tool-line, color-mix(in srgb, currentColor 16%, transparent)) !important; background: var(--ca-tool-bg, color-mix(in srgb, currentColor 6%, transparent)) !important; color: var(--ca-tool-ink, inherit) !important;
  font: inherit; line-height: 0 !important; letter-spacing: 0; text-decoration: none !important; box-shadow: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, transform .12s ease; }
.ca-tool[hidden] { display: none !important; }
.ca-tool::before { content: ""; position: absolute; inset: -4px; }
.ca-tool svg { display: block; width: 20px !important; height: 20px !important; margin: 0 !important; pointer-events: none; }
.ca-tool svg[hidden] { display: none !important; }
@media (hover: hover) { .ca-tool:hover { background: var(--ca-tool-hover, color-mix(in srgb, currentColor 13%, transparent)) !important; } }
.ca-tool:active { transform: scale(.94); }
.ca-tool:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: 2px; }
.ca-tool-talk { color: var(--ca-accent, #4f6bff) !important; border-color: color-mix(in srgb, var(--ca-accent, #4f6bff) 50%, transparent) !important; background: color-mix(in srgb, var(--ca-accent, #4f6bff) 13%, transparent) !important; }
.ca-tool .ca-tlive { position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 30%, transparent); }
.ca-tool-talk.ca-new::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; animation: ca-bar-ring 1.2s ease-out 2; }
@keyframes ca-bar-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ca-accent, #4f6bff) 55%, transparent); } to { box-shadow: 0 0 0 11px transparent; } }
.ca-tool .ca-tcount, .ca-tool .ca-tunread { position: absolute; right: -5px; display: grid; place-items: center; box-sizing: border-box; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; color: #fff; font: 700 10.5px/1 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: 0; pointer-events: none; }
.ca-tool .ca-tcount { bottom: -5px; background: #1f9d55; }
.ca-tool .ca-tunread { top: -5px; background: #e5484d; }
@media (max-width: 599.98px), (max-height: 499.98px) { .ca-tools-app { display: none !important; } }
.ca-end[data-ca-cramped] .ca-tools-app { display: none !important; }
.ca-end[data-ca-tight] .ca-tool-friends { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ca-tool, .ca-brand a, .ca-brand-home img { transition: none; } .ca-tool-talk.ca-new::after { animation: none; } }
/* end of the cloud-apps bar */
/* ---- cloud-apps: big screens (App Standard §6.5) — written by `cloud-apps vendor-sdk`; do not edit ---- */
/* Past 1584 × 990 the page is laid out at about 1440 × 900 and zoomed to fill the screen; viewport
   units in this file are divided by --ca-zoom. cloud-kit.js turns it off where the engine has no
   standard zoom (html[data-ca-zoom="off"]). */
@media (min-width: 1585px) and (min-height: 991px) { :root { --ca-zoom: 1.1; } }
@media (min-width: 1656px) and (min-height: 1035px) { :root { --ca-zoom: 1.15; } }
@media (min-width: 1728px) and (min-height: 1080px) { :root { --ca-zoom: 1.2; } }
@media (min-width: 1800px) and (min-height: 1125px) { :root { --ca-zoom: 1.25; } }
@media (min-width: 1872px) and (min-height: 1170px) { :root { --ca-zoom: 1.3; } }
@media (min-width: 1945px) and (min-height: 1215px) { :root { --ca-zoom: 1.35; } }
@media (min-width: 2016px) and (min-height: 1260px) { :root { --ca-zoom: 1.4; } }
@media (min-width: 2088px) and (min-height: 1305px) { :root { --ca-zoom: 1.45; } }
@media (min-width: 2160px) and (min-height: 1350px) { :root { --ca-zoom: 1.5; } }
@media (min-width: 2232px) and (min-height: 1395px) { :root { --ca-zoom: 1.55; } }
@media (min-width: 2304px) and (min-height: 1440px) { :root { --ca-zoom: 1.6; } }
@media (min-width: 2376px) and (min-height: 1485px) { :root { --ca-zoom: 1.65; } }
@media (min-width: 2448px) and (min-height: 1530px) { :root { --ca-zoom: 1.7; } }
@media (min-width: 2520px) and (min-height: 1575px) { :root { --ca-zoom: 1.75; } }
@media (min-width: 2592px) and (min-height: 1620px) { :root { --ca-zoom: 1.8; } }
@media (min-width: 2664px) and (min-height: 1665px) { :root { --ca-zoom: 1.85; } }
@media (min-width: 2736px) and (min-height: 1710px) { :root { --ca-zoom: 1.9; } }
@media (min-width: 2808px) and (min-height: 1755px) { :root { --ca-zoom: 1.95; } }
@media (min-width: 2880px) and (min-height: 1800px) { :root { --ca-zoom: 2; } }
@media (min-width: 2952px) and (min-height: 1845px) { :root { --ca-zoom: 2.05; } }
@media (min-width: 3024px) and (min-height: 1890px) { :root { --ca-zoom: 2.1; } }
@media (min-width: 3096px) and (min-height: 1935px) { :root { --ca-zoom: 2.15; } }
@media (min-width: 3169px) and (min-height: 1981px) { :root { --ca-zoom: 2.2; } }
@media (min-width: 3240px) and (min-height: 2025px) { :root { --ca-zoom: 2.25; } }
@media (min-width: 3312px) and (min-height: 2070px) { :root { --ca-zoom: 2.3; } }
@media (min-width: 3384px) and (min-height: 2115px) { :root { --ca-zoom: 2.35; } }
@media (min-width: 3456px) and (min-height: 2160px) { :root { --ca-zoom: 2.4; } }
@media (min-width: 3529px) and (min-height: 2205px) { :root { --ca-zoom: 2.45; } }
@media (min-width: 3600px) and (min-height: 2250px) { :root { --ca-zoom: 2.5; } }
@media (min-width: 3672px) and (min-height: 2295px) { :root { --ca-zoom: 2.55; } }
@media (min-width: 3744px) and (min-height: 2340px) { :root { --ca-zoom: 2.6; } }
@media (min-width: 3816px) and (min-height: 2385px) { :root { --ca-zoom: 2.65; } }
@media (min-width: 3889px) and (min-height: 2430px) { :root { --ca-zoom: 2.7; } }
@media (min-width: 3960px) and (min-height: 2475px) { :root { --ca-zoom: 2.75; } }
@media (min-width: 4032px) and (min-height: 2520px) { :root { --ca-zoom: 2.8; } }
@media (min-width: 4104px) and (min-height: 2565px) { :root { --ca-zoom: 2.85; } }
@media (min-width: 4176px) and (min-height: 2610px) { :root { --ca-zoom: 2.9; } }
@media (min-width: 4248px) and (min-height: 2655px) { :root { --ca-zoom: 2.95; } }
@media (min-width: 4320px) and (min-height: 2700px) { :root { --ca-zoom: 3; } }
@media (min-width: 4392px) and (min-height: 2745px) { :root { --ca-zoom: 3.05; } }
@media (min-width: 4464px) and (min-height: 2790px) { :root { --ca-zoom: 3.1; } }
@media (min-width: 4536px) and (min-height: 2835px) { :root { --ca-zoom: 3.15; } }
@media (min-width: 4608px) and (min-height: 2880px) { :root { --ca-zoom: 3.2; } }
@media (min-width: 4680px) and (min-height: 2925px) { :root { --ca-zoom: 3.25; } }
@media (min-width: 4752px) and (min-height: 2970px) { :root { --ca-zoom: 3.3; } }
@media (min-width: 4824px) and (min-height: 3015px) { :root { --ca-zoom: 3.35; } }
@media (min-width: 4896px) and (min-height: 3060px) { :root { --ca-zoom: 3.4; } }
@media (min-width: 4968px) and (min-height: 3105px) { :root { --ca-zoom: 3.45; } }
@media (min-width: 5040px) and (min-height: 3150px) { :root { --ca-zoom: 3.5; } }
@media (min-width: 5112px) and (min-height: 3195px) { :root { --ca-zoom: 3.55; } }
@media (min-width: 5184px) and (min-height: 3240px) { :root { --ca-zoom: 3.6; } }
@media (min-width: 5256px) and (min-height: 3285px) { :root { --ca-zoom: 3.65; } }
@media (min-width: 5328px) and (min-height: 3330px) { :root { --ca-zoom: 3.7; } }
@media (min-width: 5400px) and (min-height: 3375px) { :root { --ca-zoom: 3.75; } }
@media (min-width: 5472px) and (min-height: 3420px) { :root { --ca-zoom: 3.8; } }
@media (min-width: 5544px) and (min-height: 3465px) { :root { --ca-zoom: 3.85; } }
@media (min-width: 5616px) and (min-height: 3510px) { :root { --ca-zoom: 3.9; } }
@media (min-width: 5688px) and (min-height: 3555px) { :root { --ca-zoom: 3.95; } }
@media (min-width: 5760px) and (min-height: 3600px) { :root { --ca-zoom: 4; } }
@media (min-width: 5832px) and (min-height: 3645px) { :root { --ca-zoom: 4.05; } }
@media (min-width: 5904px) and (min-height: 3690px) { :root { --ca-zoom: 4.1; } }
@media (min-width: 5977px) and (min-height: 3736px) { :root { --ca-zoom: 4.15; } }
@media (min-width: 6048px) and (min-height: 3780px) { :root { --ca-zoom: 4.2; } }
@media (min-width: 6120px) and (min-height: 3825px) { :root { --ca-zoom: 4.25; } }
@media (min-width: 6192px) and (min-height: 3870px) { :root { --ca-zoom: 4.3; } }
@media (min-width: 6264px) and (min-height: 3915px) { :root { --ca-zoom: 4.35; } }
@media (min-width: 6337px) and (min-height: 3961px) { :root { --ca-zoom: 4.4; } }
@media (min-width: 6408px) and (min-height: 4005px) { :root { --ca-zoom: 4.45; } }
@media (min-width: 6480px) and (min-height: 4050px) { :root { --ca-zoom: 4.5; } }
@media (min-width: 6552px) and (min-height: 4095px) { :root { --ca-zoom: 4.55; } }
@media (min-width: 6624px) and (min-height: 4140px) { :root { --ca-zoom: 4.6; } }
@media (min-width: 6697px) and (min-height: 4185px) { :root { --ca-zoom: 4.65; } }
@media (min-width: 6768px) and (min-height: 4230px) { :root { --ca-zoom: 4.7; } }
@media (min-width: 6840px) and (min-height: 4275px) { :root { --ca-zoom: 4.75; } }
@media (min-width: 6912px) and (min-height: 4320px) { :root { --ca-zoom: 4.8; } }
@media (min-width: 6984px) and (min-height: 4365px) { :root { --ca-zoom: 4.85; } }
@media (min-width: 7057px) and (min-height: 4410px) { :root { --ca-zoom: 4.9; } }
@media (min-width: 7128px) and (min-height: 4455px) { :root { --ca-zoom: 4.95; } }
@media (min-width: 7200px) and (min-height: 4500px) { :root { --ca-zoom: 5; } }
@media (min-width: 1585px) and (min-height: 991px) {
  html { zoom: var(--ca-zoom, 1); }
  html[data-ca-zoom='off'] { --ca-zoom: 1 !important; }
}
/* ---- end of big screens ---- */
