:root {
  color-scheme: dark;
  --bg: #0d0f0e;
  --surface: #161917;
  --surface-2: #1f2320;
  --surface-3: #2b302c;
  --line: #262b27;
  --text: #f2f5f0;
  --muted: #929b92;
  --faint: #626b63;
  --accent: #c6f25a;
  --accent-ink: #0d0f0e;
  --accent-soft: #c6f25a1f;
  --down: #ffb35c;
  --down-soft: #ffb35c1f;
  --danger: #ff6b5e;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--text); overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.num, .elapsed, #clock { font-variant-numeric: tabular-nums; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; }
.view { display: none; min-height: 100dvh; padding-bottom: calc(var(--dock, 80px) + 24px); }
.view.active { display: block; animation: enter .18s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* Top bars */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(var(--top) + 8px) 12px 8px; min-height: calc(var(--top) + 60px); background: #0d0f0ee6; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid transparent; }
.topbar.large { padding: calc(var(--top) + 20px) 20px 12px; align-items: flex-end; justify-content: space-between; position: static; }
.topbar.large h1 { font-size: 34px; letter-spacing: -.8px; margin: 2px 0 0; font-weight: 800; }
.date { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.topbar-title { flex: 1; min-width: 0; text-align: center; }
.topbar-title h1 { font-size: 16px; margin: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.icon-btn:active { background: var(--surface-2); }
.text-btn { min-width: 44px; height: 44px; padding: 0 10px; color: var(--accent); font-weight: 700; font-size: 15px; }
.counter { min-width: 44px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.sync-pill { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; }
.sync-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.sync-pill.ok::before { background: var(--accent); }
.sync-pill.pending::before { background: var(--down); }
.banner { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--top) + 10px) 16px 10px; background: #3a2414; color: #ffd8b0; font-size: 13px; }
.banner button { color: var(--down); font-weight: 700; min-height: 36px; }

.content { padding: 4px 16px 0; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 28px 4px 10px; }
.group { background: var(--surface); border-radius: 18px; padding: 16px; }
.group.list { padding: 0; overflow: hidden; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.status { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.footnote { text-align: center; color: var(--faint); font-size: 12px; margin: 28px 0 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 15px; text-decoration: none; }
.btn:active { filter: brightness(1.15); transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.btn.danger { color: var(--danger); }
.btn.subtle { background: transparent; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1 1 calc(50% - 4px); min-height: 44px; padding: 0 10px; font-size: 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 54px; padding: 0 16px; text-align: left; color: var(--text); text-decoration: none; font-size: 15px; cursor: pointer; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row small { color: var(--muted); font-size: 13px; }
.list-row svg { color: var(--faint); width: 18px; height: 18px; }
.list-row:active { background: var(--surface-2); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 8px; }
#cloud input:not([type=file]) { display: block; width: 100%; min-height: 48px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 0 14px; font-size: 16px; }
#connectForm .btn { margin-top: 10px; }

/* Home */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 20px; background: radial-gradient(120% 90% at 100% 0%, #c6f25a2e, transparent 60%), var(--surface); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; letter-spacing: .5px; text-transform: uppercase; color: var(--accent); }
.eyebrow.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.hero h2 { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 2px; font-size: 30px; letter-spacing: -.6px; font-weight: 800; }
.hero h2 .letter { font-size: 44px; line-height: 1; color: var(--accent); }
.hero .desc { margin: 0; color: var(--muted); font-size: 14px; }
.stats { display: flex; gap: 18px; margin: 18px 0; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-size: 20px; font-weight: 750; }
.stats span { color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.chips li { font-size: 12px; padding: 6px 10px; border-radius: 10px; background: #ffffff0d; color: #c9d0c8; }
.chips li.up { background: var(--accent-soft); color: var(--accent); }
.chips li.down { background: var(--down-soft); color: var(--down); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.hero .progress { margin: 16px 0 6px; }
.hero .progress-label { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.days { display: flex; flex-direction: column; gap: 8px; }
.day-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 18px; background: var(--surface); text-align: left; }
.day-row:active { background: var(--surface-2); }
.badge { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); font-weight: 800; font-size: 19px; flex-shrink: 0; }
.day-row.next .badge { background: var(--accent); color: var(--accent-ink); }
.day-row div { flex: 1; min-width: 0; }
.day-row strong { display: block; font-size: 16px; }
.day-row small { color: var(--muted); font-size: 13px; }
.day-row svg { color: var(--faint); width: 18px; }
.tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 4px 8px; }
.week { display: flex; justify-content: space-between; padding: 16px; background: var(--surface); border-radius: 18px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.week i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); font-style: normal; font-size: 12px; font-weight: 800; color: var(--muted); }
.week .today i { box-shadow: inset 0 0 0 2px var(--surface-3); color: var(--text); }
.week .trained i { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.week-note { margin: 10px 4px 0; font-size: 13px; color: var(--muted); }
.tip { display: flex; gap: 14px; align-items: center; width: 100%; padding: 16px; border-radius: 18px; background: var(--surface); text-align: left; }
.tip strong { display: block; font-size: 15px; margin-bottom: 3px; }
.tip span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.tip svg { color: var(--accent); }

/* Session */
.session-progress { display: flex; align-items: center; gap: 12px; margin: 6px 4px 18px; }
.session-progress .progress { flex: 1; }
.session-progress span { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.warmup { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.warmup strong { color: var(--text); }
.warmup svg { color: var(--down); margin-top: 1px; }
.ex-list { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ex-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 18px; background: var(--surface); text-align: left; }
.ex-row:active { background: var(--surface-2); }
.ring { --p: 0; position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); flex-shrink: 0; font-size: 14px; font-weight: 800; }
.ring::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; }
.ex-row.complete .ring { background: var(--accent); color: var(--accent-ink); }
.ex-row.complete .ring::before { display: none; }
.ring svg { position: relative; width: 20px; height: 20px; stroke-width: 2.6; }
.ex-row div { flex: 1; min-width: 0; }
.ex-row strong { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-row small { color: var(--muted); font-size: 13px; }
.ex-row .count { color: var(--muted); font-size: 13px; font-weight: 600; }
.ex-row.complete strong { color: var(--muted); }
.trend { font-weight: 700; }
.trend.up { color: var(--accent); }
.trend.down { color: var(--down); }
.session-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Exercise */
.ex-head { margin: 4px 4px 0; }
.ex-head h2 { font-size: 26px; letter-spacing: -.5px; margin: 0; font-weight: 800; line-height: 1.15; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.ex-meta span { font-size: 12px; font-weight: 650; padding: 6px 10px; border-radius: 10px; background: var(--surface); color: #c9d0c8; }
.cue { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 4px 14px; }
.video-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 20px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 650; margin: 0 0 18px 4px; }
.video-btn svg { color: var(--accent); width: 20px; height: 20px; }
.card { background: var(--surface); border-radius: 20px; padding: 16px; margin-bottom: 12px; }
.card-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.card-label small { font-weight: 500; color: var(--faint); font-size: 12px; text-align: right; }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; }
.stepper button { height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; }
.stepper button:active { background: var(--surface-3); }
.stepper .field { position: relative; }
.stepper input { width: 100%; height: 56px; border: 0; border-radius: 16px; background: var(--bg); text-align: center; font-size: 28px; font-weight: 800; padding: 0 34px 0 8px; -moz-appearance: textfield; appearance: textfield; }
.stepper .field span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; font-weight: 700; pointer-events: none; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.suggest { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); font-size: 13px; line-height: 1.45; color: #c9d0c8; }
.suggest.up { background: var(--accent-soft); }
.suggest.down { background: var(--down-soft); }
.suggest .arrow { font-weight: 900; font-size: 16px; line-height: 1.2; }
.suggest.up .arrow { color: var(--accent); }
.suggest.down .arrow { color: var(--down); }
.suggest div { flex: 1; }
.suggest strong { color: var(--text); }
.suggest button { color: var(--accent); font-weight: 700; font-size: 13px; min-height: 32px; white-space: nowrap; }
.suggest.down button { color: var(--down); }
.sets-head, .set-row { display: grid; grid-template-columns: 26px 62px minmax(0, 1fr) 52px; align-items: center; gap: 8px; }
.sets-head { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); margin: 0 0 6px; }
.sets-head span:nth-child(3) { text-align: center; }
.set-row { padding: 6px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row > .n { font-weight: 800; color: var(--muted); text-align: center; }
.set-row > .prev { font-size: 13px; color: var(--faint); line-height: 1.3; }
.set-row > .prev small { display: block; color: var(--accent); font-size: 11px; font-weight: 700; }
.reps { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 4px; align-items: center; }
.reps button { height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.reps button svg { width: 18px; height: 18px; }
.reps input { width: 100%; min-width: 0; height: 44px; border: 0; border-radius: 12px; background: var(--bg); text-align: center; font-size: 19px; font-weight: 750; -moz-appearance: textfield; appearance: textfield; }
.reps input::placeholder { color: var(--faint); opacity: .7; font-weight: 500; }
.check { appearance: none; -webkit-appearance: none; width: 52px; height: 48px; margin: 0; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.check::after { content: ''; width: 18px; height: 10px; border: solid var(--muted); border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }
.check:checked { background: var(--accent); }
.check:checked::after { border-color: var(--accent-ink); }
.set-row.done .reps input { color: var(--accent); }
.feel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.feel button { min-height: 44px; border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 650; color: #c9d0c8; }
.feel button[aria-pressed=true] { background: var(--text); color: var(--bg); }
.feel-hint { font-size: 12px; color: var(--faint); margin: 10px 0 0; }
textarea.notes { display: block; width: 100%; min-height: 72px; resize: vertical; border: 0; border-radius: 14px; background: var(--bg); padding: 12px; font-size: 15px; line-height: 1.5; }
.past { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.past li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: #c9d0c8; }
.past li + li { border-top: 1px solid var(--line); }
.past li span:first-child { color: var(--muted); }

/* Summary */
.done-hero { text-align: center; padding: calc(var(--top) + 48px) 8px 8px; }
.done-hero .medal { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.done-hero .medal svg { width: 40px; height: 40px; stroke-width: 2.6; }
.done-hero h1 { font-size: 30px; letter-spacing: -.6px; margin: 0 0 6px; }
.done-hero p { color: var(--muted); margin: 0; }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 8px; }
.done-stats div { background: var(--surface); border-radius: 16px; padding: 14px 8px; text-align: center; }
.done-stats strong { display: block; font-size: 22px; font-weight: 800; }
.done-stats span { font-size: 12px; color: var(--muted); }
.next-list { list-style: none; margin: 0; padding: 0; }
.next-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; font-size: 15px; }
.next-list li + li { border-top: 1px solid var(--line); }
.next-list li span:last-child { white-space: nowrap; font-weight: 700; color: var(--muted); }

/* History */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }
.session-card { background: var(--surface); border-radius: 18px; margin-bottom: 8px; overflow: hidden; }
.session-card summary { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 68px; }
.session-card summary::-webkit-details-marker { display: none; }
.session-card summary div { flex: 1; min-width: 0; }
.session-card summary strong { display: block; font-size: 16px; }
.session-card summary small { color: var(--muted); font-size: 13px; }
.session-card summary > svg { color: var(--faint); width: 18px; transition: transform .2s; }
.session-card[open] summary > svg { transform: rotate(90deg); }
.session-card .partial { font-size: 11px; font-weight: 700; color: var(--down); background: var(--down-soft); border-radius: 8px; padding: 4px 8px; }
.session-body { padding: 0 16px 8px; }
.session-body p { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--muted); }
.session-body p strong { color: var(--text); font-size: 14px; }
.more { margin-top: 8px; }

/* Cycle review */
.review-tip { margin-top: 12px; }
.review-tip div { flex: 1; min-width: 0; }
.review-tip svg:last-child { color: var(--faint); width: 18px; }
.cycle-hero h2 { font-size: 26px; }
.cycle-hero .progress { margin: 16px 0 2px; }
.review-advice { margin: -2px 4px 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.review-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.review-row + .review-row { border-top: 1px solid var(--line); }
.review-row .badge { width: 34px; height: 34px; border-radius: 11px; font-size: 15px; }
.review-row div { flex: 1; min-width: 0; }
.review-row strong { display: block; font-size: 15px; font-weight: 650; }
.review-row small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.review-row small.signals { color: var(--down); }
.review-list[data-status=progressing] .badge { background: var(--accent-soft); color: var(--accent); }
.review-list[data-status=attention] .badge, .review-list[data-status=regressing] .badge { background: var(--down-soft); color: var(--down); }
.delta { font-size: 14px; font-weight: 750; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--accent); }
.delta.down { color: var(--down); }
.review-few { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; }
.review-few span { font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: #c9d0c8; }
.review-few small { color: var(--faint); font-weight: 700; margin-left: 2px; }
.review-text { min-height: 180px; font-size: 13px; }

/* Dock: rest timer, pager and tab bar */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 520px; margin: 0 auto; pointer-events: none; }
.dock > * { pointer-events: auto; }
.tabbar { display: flex; height: calc(var(--tabbar) + var(--bottom)); padding-bottom: var(--bottom); background: #121513f2; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--faint); }
.tabbar button.active { color: var(--accent); }
.pager { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 10px 16px calc(var(--bottom) + 10px); background: #0d0f0ef2; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.pager .btn { min-height: 52px; }
.pager .btn:only-child { grid-column: 1 / -1; }
.rest { position: relative; overflow: hidden; display: flex; align-items: center; gap: 6px; margin: 0 12px 10px; padding: 8px 8px 8px 16px; border-radius: 20px; background: var(--surface-2); box-shadow: 0 10px 40px #000a; }
.dock.bare .rest { margin-bottom: calc(var(--bottom) + 12px); }
.rest-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #c6f25a14; transition: width .25s linear; pointer-events: none; }
.rest-time { position: relative; flex: 1; display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 48px; justify-content: center; }
.rest-time small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
#clock { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.rest.paused #clock { color: var(--muted); }
.rest.finished { background: var(--accent); color: var(--accent-ink); }
.rest.finished small { color: var(--accent-ink); }
.rest.finished .rest-btn { background: #0d0f0e22; color: var(--accent-ink); }
.rest-btn { position: relative; min-width: 48px; height: 48px; padding: 0 8px; border-radius: 14px; background: var(--surface-3); font-weight: 750; font-size: 14px; display: grid; place-items: center; }

.toast { position: fixed; left: 50%; top: calc(var(--top) + 12px); z-index: 30; max-width: calc(100% - 32px); width: max-content; transform: translate(-50%, -16px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; line-height: 1.4; box-shadow: 0 10px 40px #0008; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Sheets */
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 520px; max-height: calc(100dvh - var(--top) - 24px); overflow: auto; border: 0; border-radius: 24px 24px 0 0; padding: 10px 20px calc(var(--bottom) + 20px); background: var(--surface); color: var(--text); }
dialog.sheet[open] { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
dialog::backdrop { background: #000b; }
body:has(dialog[open]) { overflow: hidden; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 16px; }
.sheet h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.3px; }
#finishSheet p { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
#finishSheet .btn + .btn { margin-top: 8px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0 12px; position: sticky; top: -10px; background: var(--surface); z-index: 1; }
.sheet-head small { color: var(--accent); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; }
.sheet-head h2 { font-size: 20px; margin: 4px 0 0; }
.sheet-head .icon-btn { background: var(--surface-2); flex-shrink: 0; }
.video-frame { aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-source { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.video-source a { min-height: 44px; display: flex; align-items: center; white-space: nowrap; font-weight: 650; }
.guide p, .guide li { color: #c9d0c8; font-size: 15px; line-height: 1.6; }
.guide h3 { font-size: 16px; margin: 22px 0 6px; }
.guide ul { padding-left: 20px; }

@media (min-width: 560px) {
  dialog.sheet { border-radius: 24px; margin: auto; padding-bottom: 20px; }
  .dock { bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
