:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --panel: #fff;
  --ink: #182034;
  --muted: #596478;
  --line: #e3e8f0;
  --accent: #214ef5;
  --focus: #3056fb;
  --soft: #edf2ff;
  --track: #edf0f6;
  --good: #188153;
  --warn: #aa591a;
  --danger: #b73240;
  --radius: 18px;
  --shadow: 0 5px 21px #24365308;
  font: 16px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101420;
  --panel: #191f2e;
  --ink: #eef1fa;
  --muted: #abb5ca;
  --line: #2c364b;
  --accent: #829bff;
  --focus: #a4b5ff;
  --soft: #222f58;
  --track: #252d40;
  --good: #6bdbab;
  --warn: #ffad75;
  --danger: #ff929f;
  --shadow: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-width: 0; }
button, input, select, textarea { font: inherit; }
button, select, input[type="checkbox"], input[type="radio"] { cursor: pointer; }
button[disabled] { cursor: default; opacity: .55; }
button { color: inherit; }
a { color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.17; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 750; }
h2 { font-size: clamp(1.28rem, 3vw, 1.57rem); font-weight: 720; }
h3 { font-size: 1.03rem; font-weight: 720; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.skip { position: absolute; z-index: 20; top: 10px; left: 10px; transform: translateY(-180%); background: var(--panel); padding: 10px; }
.skip:focus { transform: none; }
.boot { max-width: 620px; margin: 12vh auto; padding: 24px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.eyebrow { color: var(--muted); font-size: .69rem; line-height: 1.3; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.stack { display: grid; gap: 14px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack > :last-child { margin-bottom: 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 15px; border-radius: 10px; font-weight: 680;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  text-decoration: none; line-height: 1.2; font-size: .88rem; text-align: center;
}
.button:hover { background: var(--track); }
.button.primary { color: #fff; background: #214ef5; border-color: #214ef5; }
.button.primary:hover { background: #163cce; }
.button.secondary { color: var(--accent); background: var(--soft); border-color: transparent; }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.ghost:hover { background: var(--track); color: var(--ink); }
.button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger), transparent 72%); }
.button.icon-only { width: 44px; padding-inline: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.section-head > :first-child { min-width: 0; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 999px;
  background: var(--soft); color: var(--accent); padding: 5px 10px; border: 1px solid transparent;
  font-size: .76rem; font-weight: 700; line-height: 1.2;
}
button.chip { min-height: 42px; }
.field { display: grid; gap: 6px; color: var(--ink); font-weight: 640; font-size: .86rem; min-width: 0; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  width: 100%; min-height: 44px; min-width: 0; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 1rem;
}
input[type="checkbox"], input[type="radio"] { accent-color: #214ef5; width: 17px; height: 17px; }
textarea { resize: vertical; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { margin-bottom: 7px; font-size: .86rem; font-weight: 650; }
details summary { cursor: pointer; font-weight: 650; }
details[open] > summary { margin-bottom: 11px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.callout { padding: 13px 15px; background: var(--soft); color: var(--ink); border-radius: 10px; }
.callout.attention { border-inline-start: 3px solid var(--warn); }
.page-head { display: grid; gap: 5px; margin: 0 0 23px; }
.page-head p { color: var(--muted); margin-top: 2px; max-width: 65ch; }
.shell { --sidebar: 218px; min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 4; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column;
  gap: 33px; background: var(--panel); border-right: 1px solid var(--line); padding: 29px 16px 21px;
}
.brand { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 0 5px; text-align: left; }
.brand img { border-radius: 9px; width: 33px; height: 33px; }
.brand strong { font-size: 1.06rem; letter-spacing: -.055em; }
.nav-group { display: grid; gap: 5px; }
.nav-group + .nav-group { margin-top: 27px; }
.nav-group .eyebrow { margin: 0 0 4px 10px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 44px;
  padding: 8px 10px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); text-align: left; font-size: .88rem; font-weight: 640;
}
.nav-link:hover { color: var(--ink); background: var(--track); }
.nav-link[aria-current="page"] { color: var(--accent); background: var(--soft); font-weight: 720; }
.nav-link .icon { width: 19px; height: 19px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 11px; }
.sidebar-bottom .nav-link { width: 100%; }
.sidebar-bottom .local-label { margin-left: 10px; }
.body-pane { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { height: 68px; border-bottom: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; }
.topbar-inner { max-width: 1260px; width: 100%; margin-inline: auto; padding-inline: clamp(23px, 3vw, 43px); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topbar-label { font-size: .91rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.topbar-label .icon { color: var(--muted); width: 16px; height: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions .button { min-height: 39px; }
.local-label { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.local-label::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; background: #35ac72; border-radius: 50%; }
.avatar { min-width: 36px; min-height: 36px; border-radius: 50%; border: 1px solid var(--line); color: var(--accent); background: var(--soft); display: grid; place-items: center; font-size: .75rem; font-weight: 760; }
#content { max-width: 1260px; margin-inline: auto; padding: 28px clamp(23px, 3vw, 43px) 55px; outline: none; }
.mobile-nav, .mobile-brand { display: none; }
.dashboard-title { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 21px; }
.dashboard-title h1 { margin-top: 4px; }
.dashboard-title .heading-caption { color: var(--muted); font-size: .9rem; margin-top: 5px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(260px, 1fr); gap: 17px; align-items: start; }
.dashboard-primary, .dashboard-aside { display: grid; gap: 17px; min-width: 0; }
.hero {
  position: relative; display: grid; align-content: center; justify-items: start; min-height: 273px; border-radius: 19px;
  overflow: hidden; padding: 23px 27px 26px; color: #fff; background: #111b29 url("../assets/training.jpg") 64% center / cover no-repeat;
  box-shadow: 0 9px 22px #15264525;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0c1522f5, #0c152294 52%, #0c15220d 100%); }
.hero > * { position: relative; }
.hero .eyebrow { color: #c3d1fc; }
.hero h2 { font-size: clamp(1.85rem, 4vw, 2.73rem); font-weight: 760; margin: 9px 0 8px; width: min(100%, 13ch); }
.hero p { color: #e0e6f8; font-size: .89rem; max-width: 35ch; }
.hero .button { margin-top: 17px; }
.hero .hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 2px; }
.hero-meta .icon { width: 16px; height: 16px; }
.shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.shortcut {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow);
  display: grid; text-align: left; justify-items: start; align-content: center; gap: 7px; padding: 13px 11px; min-height: 88px;
}
.shortcut:hover { border-color: var(--accent); }
.shortcut .tile-icon, .tile-icon {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  background: var(--soft); color: var(--accent); flex: 0 0 auto;
}
.tile-icon .icon { width: 17px; height: 17px; }
.shortcut strong { font-size: .81rem; line-height: 1.23; }
.dashboard-grid .card { padding: 17px; }
.dashboard-grid .card h2 { font-size: 1.17rem; }
.dashboard-aside .status-row { display: flex; align-items: flex-start; gap: 11px; margin-top: 14px; }
.status-row strong { display: block; margin-bottom: 2px; }
.status-row p { font-size: .81rem; color: var(--muted); }
.status-row .tile-icon { color: var(--good); background: color-mix(in srgb, var(--good), var(--panel) 90%); }
.metric-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.metric-pair > div { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; min-width: 0; }
.metric-pair strong { font-size: 1.35rem; font-weight: 760; letter-spacing: -.055em; display: block; line-height: 1.1; }
.metric-pair span { color: var(--muted); font-size: .73rem; }
.week-line { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; margin-top: 13px; }
.week-day { border: 1px solid var(--line); background: var(--bg); border-radius: 9px; min-height: 52px; display: grid; place-content: center; justify-items: center; gap: 2px; font-size: .72rem; color: var(--muted); line-height: 1.2; padding: 0; }
.week-day.today { border-color: var(--accent); background: var(--soft); color: var(--accent); font-weight: 720; }
.week-day strong { font-size: .9rem; color: var(--ink); }
.week-day i { border-radius: 50%; width: 5px; height: 5px; background: transparent; }
.week-day.has-workout i { background: var(--accent); }
.week-day.has-logged i { background: var(--good); }
.next-workout { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .88rem; }
.next-workout p { color: var(--muted); font-size: .79rem; }
.text-button { color: var(--accent); padding: 5px 0; min-height: 39px; border: 0; background: transparent; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.text-button .icon { width: 15px; height: 15px; }
.plans, .live-grid, .quick-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.plan-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-date { min-width: 52px; text-align: center; border-radius: 8px; padding: 7px 4px; background: var(--soft); color: var(--accent); font-weight: 730; font-size: .76rem; }
.exercise-row { padding: 13px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.exercise-row p { font-size: .86rem; color: var(--muted); }
.exercise-row details { font-size: .82rem; }
.exercise-row:first-child { border-top: 0; }
.exercise-media { color: var(--accent); }
.exercise-media svg { display: block; max-width: 100%; width: 100%; height: min(28vh, 190px); }
.live-media { background: var(--soft); border-radius: 13px; padding: 12px; overflow: hidden; }
.live-head { display: grid; gap: 5px; }
.live-head h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); }
.timer { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px; }
.timer output { font-size: 1.4rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.set-control { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 4px; }
.set-control input { text-align: center; appearance: textfield; padding-inline: 0; }
.set-control input::-webkit-inner-spin-button { appearance: none; }
.set-control .button { padding-inline: 0; }
.live-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.notice { position: fixed; z-index: 20; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 13px; background: #151e32; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 12px 30px #11203c46; width: max-content; max-width: calc(100% - 24px); font-size: .88rem; }
.notice .text-button { color: #ccd7ff; min-height: 30px; }
dialog { width: min(480px, calc(100% - 28px)); max-height: min(80vh, 720px); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
dialog::backdrop { background: #07112496; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px; }
.check-list label { display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; border: 1px solid var(--line); padding: 6px 8px; font-size: .83rem; min-height: 42px; }
.check-list label:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.anatomy-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(230px,1fr); gap: 15px; }
@media (min-width: 1450px) { .shell { --sidebar: 230px; } }
@media (max-width: 1080px) {
  .shell { --sidebar: 190px; }
  .sidebar { padding-inline: 12px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.6fr) minmax(235px,1fr); }
}
@media (max-width: 825px) {
  .shell { --sidebar: 0px; }
  .sidebar, .topbar-label, .topbar-actions .local-label { display: none; }
  .mobile-brand { display: flex; }
  .topbar { height: 56px; }
  .topbar-inner { padding-inline: 14px; }
  #content { padding: 21px 14px calc(84px + env(safe-area-inset-bottom)); }
  .mobile-nav {
    position: fixed; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); z-index: 9; inset: auto 0 0;
    padding: 4px 4px max(6px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line);
  }
  .mobile-nav .nav-link { display: grid; justify-items: center; place-content: center; text-align: center; padding: 4px 0; font-size: .67rem; gap: 3px; min-height: 50px; }
  .notice { bottom: calc(67px + env(safe-area-inset-bottom)); }
}
@media (max-width: 620px) {
  .dashboard-grid, .plans, .live-grid, .quick-grid, .anatomy-layout { grid-template-columns: minmax(0,1fr); }
  .dashboard-grid, .dashboard-primary, .dashboard-aside { gap: 12px; }
  .dashboard-title { margin-bottom: 15px; }
  .dashboard-title > .button { font-size: .75rem; padding-inline: 9px; }
  .dashboard-title > .button .icon { display: none; }
  .hero { min-height: 245px; padding: 20px; background-position: 68% center; }
  .hero::before { background: linear-gradient(90deg,#0c1522f5,#0c152299 64%,#0c152243); }
  .card { padding: 16px; }
  .form-grid { gap: 9px; }
  .dashboard-title .heading-caption { font-size: .79rem; }
}
@media (max-width: 375px) {
  .form-grid.responsive { grid-template-columns: minmax(0,1fr); }
  .topbar-actions .button { font-size: .76rem; padding-inline: 8px; }
  .shortcuts { gap: 6px; }
  .shortcut { padding: 9px 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::after, *::before { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
