:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --background: #15151b;
  --surface: #22222c;
  --raised: #2c2b38;
  --purple: #a78bfa;
  --lime: #d8ff72;
  --muted: #a4a2b2;
  --border: #ffffff16;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: #fff; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
a { color: var(--purple); }
p, h1, h2, h3, ul, figure { margin: 0; }
p, li, summary { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 5vw, 2.65rem); line-height: 1.16; letter-spacing: -.04em; }
h2 { font-size: 1.17rem; }
h3 { font-size: 1rem; }
.shell { width: min(100% - 32px, 860px); margin-inline: auto; }
.top { position: sticky; top: 0; z-index: 2; background: var(--background); border-bottom: 1px solid var(--border); }
.header-inner, .account { display: flex; align-items: center; gap: .55rem; }
.header-inner { min-height: 64px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .36rem; color: white; text-decoration: none; font-weight: 850; }
.brand img { border-radius: 8px; margin-inline-end: .30rem; }
.brand span { color: var(--purple); }
button { border: 1px solid var(--border); border-radius: 11px; min-height: 44px; padding: 8px 13px; background: var(--raised); color: #fff; font-weight: 650; }
.quiet, .icon-button { background: transparent; border-color: transparent; }
.icon-button { width: 44px; padding: 10px; position: relative; display: grid; place-items: center; }
svg { stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; width: 23px; height: 23px; }
.badge { position: absolute; top: 2px; right: 0; background: var(--lime); color: #15151b; border-radius: 99px; min-width: 18px; font-size: .68rem; padding-inline: 2px; }
.primary { background: var(--lime); color: #181b12; }
main.shell { display: grid; align-content: start; gap: 16px; padding-block: 27px calc(105px + env(safe-area-inset-bottom)); }
.screen-title { display: grid; gap: 4px; margin-block: 4px 6px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; min-width: 0; display: grid; gap: 9px; align-content: start; }
.muted, time { color: var(--muted); }
time, .caption { font-size: .88rem; }
.body-text { white-space: pre-wrap; }
.stack { display: grid; gap: 11px; min-width: 0; }
.row, .segments { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.segments button[aria-pressed="true"] { background: var(--purple); color: var(--background); }
.programs { flex-wrap: nowrap; padding: 3px 4px; overflow-x: auto; }
.programs button { flex: 0 0 auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); }
.metric { color: var(--lime); font-size: 1.38rem; font-weight: 750; }
.notice-unread { border-left: 4px solid var(--purple); }
.status-error { color: #ffb9c0; }
.notice-image { width: 100%; max-height: 420px; object-fit: contain; display: block; background: var(--background); border-radius: 10px; }
summary { cursor: pointer; min-height: 44px; display: list-item; padding-block: 8px; font-weight: 650; }
details > .stack { margin-block: 6px 12px; }
.exercise-square { width: 100%; aspect-ratio: 1; display: block; background: var(--raised); border-radius: 11px; overflow: hidden; }
.exercise-square img { display: block; width: 100%; height: 100%; object-fit: contain; }
.exercise-thumbnail { width: min(100%, 176px); min-height: 0; padding: 0; }
.exercise-preview { width: min(92vw, 680px, calc(100dvh - 80px)); max-width: none; padding: 12px; color: white; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.exercise-preview[open] { display: grid; gap: 10px; }
.exercise-preview::backdrop { background: #101017cc; }
.pair { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pair > :last-child { text-align: end; }
.radar-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 14px; }
canvas { display: block; width: min(100%, 360px); height: auto; margin: auto; }
ul { padding-inline-start: 1.2em; }
progress { width: 100%; accent-color: var(--purple); }
.media-frame { width: 100%; aspect-ratio: 16 / 9; min-height: 200px; border: 0; border-radius: 12px; background: var(--background); }
.music-frame { aspect-ratio: auto; min-height: 365px; }
#navigation { position: fixed; inset: auto 0 0; z-index: 2; background: var(--background); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.navigation-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 860px); }
.navigation-inner button { border: 0; background: transparent; color: var(--muted); border-radius: 0; padding: 7px 2px; display: grid; place-items: center; gap: 3px; font-size: clamp(.66rem, 2.8vw, .87rem); }
.navigation-inner button[aria-current="page"] { color: var(--lime); }
.activation { max-width: 440px; width: 100%; margin: min(11vh, 90px) auto 0; padding: clamp(16px, 5vw, 30px); gap: 14px; }
.activation form { display: grid; gap: 12px; }
input { min-height: 48px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); color: #fff; }
input[type="checkbox"] { min-height: 0; width: 1.2rem; height: 1.2rem; accent-color: var(--lime); }
label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
@media (min-width: 620px) {
  main.shell { padding-top: 35px; }
  .radar-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panel { padding: 20px; }
}
.activation-code { font-family: ui-monospace, monospace; font-size: 1.25rem; letter-spacing: .18em; }
.avatar-current { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: #302646; color: #e0d2ff; font-size: 2rem; font-weight: 700; }
.avatar-current img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions, .avatar-crop { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.avatar-actions input { max-width: 100%; font-size: .9rem; }
.avatar-crop { width: min(100%, 420px); }
.avatar-crop canvas { width: min(85vw, 264px); height: auto; border-radius: 50%; background: var(--surface); }
.avatar-range { display: grid; width: 100%; gap: 3px; }
.avatar-range input { width: 100%; margin: 0; accent-color: var(--lime); }
.avatar-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(84px, 100%), 1fr)); gap: 8px; }
.avatar-choices button { display: grid; place-items: center; gap: 6px; padding: .45rem; font-size: .82rem; }
.avatar-choices button[aria-pressed="true"] { outline: 2px solid var(--lime); }
.avatar-choices img { max-width: 100%; border-radius: 50%; }

.video-queue { display:grid; gap:10px; border:1px solid var(--border); border-radius:16px; padding:12px; min-width:0; }
.video-entry { padding:12px; scroll-margin-top:80px; min-width:0; }
.video-entry.video-active { border-color:var(--purple); background:#242033; }
.video-title-row { display:grid; grid-template-columns:1.5rem minmax(0,1fr) 44px; align-items:center; gap:8px; min-width:0; }
.video-title-row h2 { overflow-wrap:anywhere; min-width:0; }
.video-number,.video-status { color:#c7b2f3; }
.video-icon { width:44px; height:44px; min-width:44px; min-height:44px; display:grid; place-items:center; padding:0; border:0; border-radius:12px; background:#7650bb; flex-shrink:0; }
.video-icon svg { pointer-events:none; stroke-width:2.2; width:24px; height:24px; }
.video-icon:disabled { opacity:.35; cursor:default; }
.video-controls { display:grid; grid-template-columns:44px 52px 44px minmax(0,1fr) 44px; gap:8px; align-items:center; }
.video-controls .video-toggle { width:52px; height:48px; background:#9263e2; }
.video-controls .video-close { grid-column:5; background:#42394f; }
.video-inline-frame { display:block; min-height:0; aspect-ratio:16/9; width:100%; }
