/* PADELENS design system: dark charcoal slate (#171B20 / #1E2329) paired with optic
   lime (#B2F718) in dark mode and deep court lime (#3F6212) in light mode for WCAG AA contrast. */

:root {
  --charcoal: #171B20;
  --slate: #1E2329;
  --lime: #B2F718;
  --lime-ink: #12161B;
  --lime-deep: #3F6212;

  --bg: #F5F7F4;
  --surface: #FFFFFF;
  --surface-2: #E9EEEA;
  --ink: #171B20;
  --muted: #4C5661;
  --line: #D4DCD6;
  --brand: #171B20;
  --brand-ink: #F2F5F7;
  --brand-soft: #E8F7C5;
  --accent: var(--lime-deep);
  --accent-ink: #FFFFFF;
  --accent-soft: #E8F7C5;
  --ok: #1F6E3D;
  --warn: #8A5308;
  --err: #B3261E;
  --focus: var(--lime-deep);
  --shadow: 0 8px 28px rgb(23 27 32 / 14%);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --side: 240px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
:root:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161B; --surface: #1B2027; --surface-2: #242B34; --ink: #F2F5F7; --muted: #9CA7B4; --line: #2F3844;
    --brand: var(--lime); --brand-ink: var(--lime-ink); --brand-soft: #263119; --accent: var(--lime); --accent-ink: var(--lime-ink); --accent-soft: #263119;
    --ok: #7BD88F; --warn: #F0BC5E; --err: #F28B82; --focus: var(--lime); --shadow: 0 10px 30px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161B; --surface: #1B2027; --surface-2: #242B34; --ink: #F2F5F7; --muted: #9CA7B4; --line: #2F3844;
  --brand: var(--lime); --brand-ink: var(--lime-ink); --brand-soft: #263119; --accent: var(--lime); --accent-ink: var(--lime-ink); --accent-soft: #263119;
  --ok: #7BD88F; --warn: #F0BC5E; --err: #F28B82; --focus: var(--lime); --shadow: 0 10px 30px rgb(0 0 0 / 45%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
a[href], button:not(:disabled), summary, select, label[for] { cursor: pointer; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: var(--s2) var(--s3); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

/* ---- Splashscreen (Padel racket + ball rally counter) --------------------------------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--s5);
  background: radial-gradient(circle at 50% 42%, #222830 0%, #171B20 75%); color: #F2F5F7;
  transition: opacity 0.28s ease-out;
}
.splash.is-leaving { opacity: 0; pointer-events: none; }
.splash-card { width: min(380px, 100%); display: grid; gap: var(--s4); justify-items: center; text-align: center; }
.splash-brand { display: inline-flex; align-items: center; gap: var(--s3); }
.splash-word { font-size: 1.45rem; font-weight: 800; letter-spacing: 0.14em; color: #FFFFFF; }
.brand-lens { font-style: normal; color: var(--lime); }
.splash-court { width: 100%; max-width: 360px; height: auto; overflow: visible; }
.court-floor { stroke: #313944; stroke-width: 2.5; stroke-linecap: round; }
.court-net { stroke: #444F5E; stroke-width: 2; stroke-dasharray: 4 3; }
.court-net-tape { stroke: #F2F5F7; stroke-width: 3; stroke-linecap: round; }
.racket { fill: none; stroke: var(--lime); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.racket-left { transform-origin: 52px 102px; }
.racket-right { transform-origin: 308px 102px; }
.hit-ring { fill: none; stroke: var(--lime); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.padel-ball { transform: translate3d(76px, 56px, 0); }
.ball-body { fill: var(--lime); }
.ball-seam { fill: none; stroke: #171B20; stroke-width: 1.5; stroke-linecap: round; }

@media (prefers-reduced-motion: no-preference) {
  .racket { transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1); }
  .racket.is-swing { transform: rotate(20deg); }
  .racket-right.is-swing { transform: rotate(-20deg); }
  .hit-ring.is-hit { animation: hit-pulse 0.36s ease-out forwards; }
}
@keyframes hit-pulse {
  0% { opacity: 0.85; transform: scale(0.55); }
  100% { opacity: 0; transform: scale(1.65); }
}

.splash-meter { width: 100%; display: grid; gap: var(--s2); }
.splash-counter-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.splash-stage { font-size: 0.86rem; color: #9CA7B4; text-align: left; }
.splash-pct { font-size: 1.5rem; font-weight: 800; color: var(--lime); font-variant-numeric: tabular-nums; }
.splash-bar { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: #262D36; appearance: none; }
.splash-bar::-webkit-progress-bar { background: #262D36; border-radius: 999px; }
.splash-bar::-webkit-progress-value { background: var(--lime); border-radius: 999px; }
.splash-bar::-moz-progress-bar { background: var(--lime); border-radius: 999px; }
.splash-skip { color: #F2F5F7; border-color: rgb(242 245 247 / 22%); }

/* ---- Shell: sidebar on desktop, top bar + tab bar on phones ---------------------------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--side) 1fr; }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s5);
  padding: var(--s5) var(--s4); background: var(--charcoal); color: #F2F5F7; border-right: 1px solid #252B34;
}
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; }
.brand-word strong { font-weight: 800; letter-spacing: 0.08em; }
.brand small { display: block; font-size: 0.75rem; color: #9CA7B4; }
.side .brand img { border-radius: 9px; outline: 1px solid rgb(178 247 24 / 28%); }
.nav { display: grid; gap: var(--s1); }
.nav a { padding: var(--s2) var(--s3); border-radius: var(--r-md); text-decoration: none; color: #D5DCE4; }
.nav a:hover { background: rgb(255 255 255 / 8%); color: #FFFFFF; }
.nav a[aria-current="page"] { background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: var(--s2); }
.side .side-foot .btn { justify-content: flex-start; color: #F2F5F7; border-color: rgb(255 255 255 / 22%); background: transparent; }
.side .side-foot .btn:hover:not(:disabled), .shell .topbar .btn:hover:not(:disabled) { background: rgb(255 255 255 / 12%); color: #FFFFFF; }
.jobs { font-size: 0.82rem; color: #9CA7B4; min-height: 1.2em; }
.topbar, .tabbar { display: none; }
main { min-width: 0; padding: var(--s6) clamp(var(--s4), 3vw, var(--s7)) var(--s7); outline: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
    padding: calc(var(--s2) + env(safe-area-inset-top)) var(--s4) var(--s2); background: var(--charcoal); color: #F2F5F7;
    border-bottom: 1px solid #252B34;
  }
  .topbar .brand img { border-radius: 8px; }
  .topbar .btn { color: #F2F5F7; border-color: rgb(255 255 255 / 22%); background: transparent; }
  .tabbar {
    display: grid; grid-template-columns: 1fr 1fr; position: fixed; inset: auto 0 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: var(--s2) 0; font-size: 0.75rem; text-decoration: none; color: var(--muted); min-height: 56px; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
  main { padding: var(--s4) var(--s4) calc(88px + env(safe-area-inset-bottom)); }
}

/* ---- Controls ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px;
  padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 500;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); }
.btn.small { min-height: 34px; padding: 0 var(--s3); font-size: 0.86rem; }
.btn.icon { width: 40px; padding: 0; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (pointer: coarse), (max-width: 860px) {
  .btn.small { min-height: 44px; padding: 0 var(--s3); }
  .chip { min-height: 44px !important; }
  .seg button { min-height: 44px !important; }
  .mark-chip button { width: 36px !important; height: 36px !important; }
}
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }

.field { display: grid; gap: var(--s1); }
.field label, .label { font-size: 0.86rem; font-weight: 600; }
.input {
  width: 100%; min-height: 42px; padding: var(--s2) var(--s3); border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
}
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chip {
  min-height: 36px; padding: 0 var(--s3); border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 0.86rem;
}
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.err { color: var(--err); }
.rank {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.85rem;
}
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); transition: width 0.3s ease; }

/* ---- Pages ------------------------------------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head p { margin-top: var(--s1); }
.toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-bottom: var(--s5); }
.toolbar .input { max-width: 320px; }

.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card:hover { border-color: var(--brand); transform: translateY(-2px); }
.thumb { aspect-ratio: 16 / 9; background: var(--surface-2); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgb(18 22 27 / 82%); color: #fff; font-size: 0.75rem; padding: 1px 6px; border-radius: 4px; }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.86rem; padding: var(--s3); text-align: center; }
.card-body { padding: var(--s3) var(--s4) var(--s4); display: grid; gap: var(--s2); }
.card-body h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty {
  border: 1px dashed var(--line); border-radius: var(--r-lg); padding: var(--s7) var(--s5); text-align: center;
  display: grid; gap: var(--s3); justify-items: center; background: var(--surface);
}
.empty p { max-width: 46ch; }

/* ---- Upload ------------------------------------------------------------------------ */
.upload-layout { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .upload-layout { grid-template-columns: 1fr; } }
.drop {
  border: 2px dashed var(--line); border-radius: var(--r-lg); padding: var(--s7) var(--s5); text-align: center; background: var(--surface);
  display: grid; gap: var(--s3); justify-items: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop svg { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); display: grid; gap: var(--s4); }
.form-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.uploads { display: grid; gap: var(--s3); }
.upload-item { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
details.more summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
details.more[open] summary { margin-bottom: var(--s3); }

/* ---- Session workspace ------------------------------------------------------------- */
.ws-head { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.ws-head .back { font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.ws-head .back:hover { color: var(--ink); }
.title-edit { border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); padding: 2px 6px; margin-left: -6px; font-weight: 700; font-size: clamp(1.3rem, 1.05rem + 1vw, 1.8rem); width: min(100%, 36ch); }
.title-edit:hover { border-color: var(--line); }
.title-edit:focus { border-color: var(--focus); outline: none; background: var(--surface); }
.workspace { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); align-items: start; }
@media (max-width: 1100px) { .workspace { grid-template-columns: 1fr; } }
.stage { display: grid; gap: var(--s3); min-width: 0; }
.player { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.preview-tag {
  position: absolute; left: 12px; top: 12px; background: var(--accent); color: var(--accent-ink); font-size: 0.8rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-sm); pointer-events: none;
}
/* On phones the player stays pinned under the top bar while the moments scroll past it. Sticky
   needs the player's parent to span the moments too, so the stage box is flattened. */
@media (max-width: 860px) {
  .workspace { display: block; }
  .stage { display: contents; }
  .player { border-radius: 0; margin-inline: calc(var(--s4) * -1); position: sticky; top: 52px; z-index: 10; }
  .timeline-wrap, .controls { margin-top: var(--s3); }
  .side-panel { margin-top: var(--s5); }
}
.timeline-wrap { display: grid; gap: var(--s2); }
.timeline {
  position: relative; height: 84px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  touch-action: none; cursor: pointer; user-select: none;
}
.timeline canvas { width: 100%; height: 100%; }
.timeline .tip {
  position: absolute; top: -28px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 0.75rem;
  padding: 2px 6px; border-radius: 4px; pointer-events: none; white-space: nowrap;
}
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.controls { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.selection { font-size: 0.86rem; color: var(--muted); }
.selection strong { color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 0 var(--s3); min-height: 38px; cursor: pointer; font-size: 0.86rem; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }

.side-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
@media (min-width: 1101px) { .side-panel { position: sticky; top: var(--s5); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; } }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button {
  flex: 1; min-height: 46px; border: 0; background: none; cursor: pointer; padding: 0 var(--s3); color: var(--muted);
  border-bottom: 2px solid transparent; font-weight: 600; font-size: 0.9rem; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-body { padding: var(--s4); display: grid; gap: var(--s3); overflow-y: auto; }

.processing { display: grid; gap: var(--s3); padding: var(--s5); border-radius: var(--r-lg); background: var(--brand-soft); }
.processing .bar { height: 8px; background: var(--surface); }
.error-box { padding: var(--s4); border-radius: var(--r-md); background: color-mix(in srgb, var(--err) 12%, var(--surface)); color: var(--ink); display: grid; gap: var(--s2); }

.reel {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; padding: var(--s3);
  border-radius: var(--r-md); background: var(--charcoal); color: #F2F5F7; border: 1px solid #2A313C;
}
.reel .btn { color: #F2F5F7; border-color: rgb(255 255 255 / 24%); background: transparent; }
.reel .btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); font-weight: 700; }

.moment { display: grid; grid-template-columns: 112px 1fr; gap: var(--s3); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.moment.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.moment .mthumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); cursor: pointer; border: 0; padding: 0; }
.moment .mthumb.vertical { aspect-ratio: 9 / 16; width: 56px; justify-self: center; }
.moment .mthumb img { width: 100%; height: 100%; object-fit: cover; }
.moment .mthumb .rank { position: absolute; left: 4px; top: 4px; min-width: 24px; height: 24px; font-size: 0.78rem; }
.moment .mthumb .state { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.72rem; color: var(--muted); text-align: center; padding: 4px; }
.moment-main { display: grid; gap: 4px; min-width: 0; }
.moment-main h3 { font-size: 0.95rem; }
.facts { font-size: 0.8rem; color: var(--muted); }
.moment-actions { grid-column: 1 / -1; display: flex; gap: var(--s1); flex-wrap: wrap; }
.trim { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line); }
.trim .group { display: grid; gap: 4px; }
.trim .group .row { flex-wrap: nowrap; }
.cand { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: center; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.stat { padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); }
.stat b { display: block; font-size: 1.35rem; }
.stat span { font-size: 0.8rem; color: var(--muted); }
.chart { display: grid; gap: var(--s2); }
.chart svg { width: 100%; height: 120px; }

.range { display: grid; gap: 2px; }
.range .spread span { font-size: 0.86rem; }
.range output { font-weight: 600; font-size: 0.86rem; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 28px; }
.weights { display: grid; gap: var(--s2); grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .weights { grid-template-columns: 1fr; } }
.marks-list { display: flex; flex-wrap: wrap; gap: var(--s1); }
.mark-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 0.82rem; }
.mark-chip button { border: 0; background: none; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; color: inherit; }
.mark-chip button:hover { background: rgb(0 0 0 / 8%); }

/* ---- Toasts, dialogs ---------------------------------------------------------------- */
.toasts { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 60; display: grid; gap: var(--s2); width: min(380px, calc(100vw - 32px)); }
@media (max-width: 860px) { .toasts { bottom: calc(72px + env(safe-area-inset-bottom)); left: var(--s4); right: var(--s4); width: auto; } }
.toast { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 0.9rem; }
.toast.err { background: var(--err); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: in 0.18s ease-out; }
}
@keyframes in { from { transform: translateY(6px); opacity: 0; } }
.dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgb(18 22 27 / 60%); }
.dialog .dbody { padding: var(--s5); display: grid; gap: var(--s4); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); font-size: 0.9rem; }
kbd { font: 600 0.8rem var(--font); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); }
