:root {
  --bg: #0b1020;
  --panel: #111a2f;
  --panel-2: #16223b;
  --text: #f4f7fb;
  --muted: #aab7cc;
  --line: rgba(255,255,255,.12);
  --accent: #79e0b3;
  --accent-2: #84b6ff;
  --danger: #ff6b6b;
  --warn: #ffd166;
  --shadow: 0 22px 50px rgba(0,0,0,.35);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #213256 0, var(--bg) 40%, #060915 100%);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, textarea { font: inherit; }
button { min-height: 44px; }
.hero {
  padding: max(24px, env(safe-area-inset-top)) 18px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  max-width: 1120px;
  margin: 0 auto;
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-size: .76rem; margin: 0 0 6px; font-weight: 800; }
h1 { font-size: clamp(2rem, 7vw, 4rem); line-height: .95; margin: 0; }
h2, h3 { margin: 0; }
.subtitle { color: var(--muted); max-width: 650px; font-size: 1rem; line-height: 1.5; }
main { max-width: 1120px; margin: 0 auto; padding: 0 14px 24px; }
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sync-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,.22); display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; background: var(--warn); }
.dot.online { background: var(--accent); }
.dot.offline { background: var(--danger); }
.controls { padding: 14px; display: grid; grid-template-columns: 1.1fr 1.6fr auto auto auto; gap: 12px; align-items: end; }
.field label { display: block; color: var(--muted); font-size: .8rem; margin: 0 0 6px; font-weight: 700; }
input, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: rgba(7,11,24,.86);
  border-radius: 14px;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(132,182,255,.16); }
button { border: 0; border-radius: 14px; padding: 12px 14px; color: #05111a; background: var(--accent); font-weight: 900; cursor: pointer; }
button.secondary { background: rgba(255,255,255,.12); color: var(--text); border: 1px solid var(--line); }
button.danger { background: rgba(255,107,107,.16); color: #ffd4d4; border: 1px solid rgba(255,107,107,.35); }
.day-tabs { position: sticky; top: 0; z-index: 5; display: flex; overflow-x: auto; gap: 10px; padding: 12px 0; backdrop-filter: blur(16px); }
.day-tab { flex: 0 0 auto; background: rgba(255,255,255,.1); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 12px 16px; }
.day-tab.active { background: var(--accent-2); color: #061020; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.metric { padding: 16px; }
.metric span { color: var(--muted); display: block; margin-bottom: 4px; }
.metric strong { font-size: 1.45rem; }
.day-header { padding: 18px; margin-bottom: 14px; }
.day-header p { color: var(--muted); line-height: 1.45; margin: 8px 0 0; }
.exercise-list { display: grid; gap: 14px; }
.exercise-card { padding: 16px; border-radius: var(--radius); background: rgba(17,26,47,.92); border: 1px solid var(--line); box-shadow: var(--shadow); }
.exercise-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.exercise-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.exercise-title h3 { font-size: 1.16rem; }
.badge { font-size: .74rem; padding: 5px 8px; border-radius: 999px; color: #061020; background: var(--accent); font-weight: 900; }
.exercise-meta { color: var(--muted); margin: 8px 0 14px; line-height: 1.45; }
.demo-btn { background: rgba(132,182,255,.18); color: #dbeaff; border: 1px solid rgba(132,182,255,.4); white-space: nowrap; }
.set-grid { display: grid; grid-template-columns: 44px 1fr 1fr 54px; gap: 8px; align-items: center; margin-top: 8px; }
.set-num { color: var(--muted); text-align: center; font-weight: 900; }
.check-wrap { display: flex; justify-content: center; }
.check-wrap input { width: 24px; min-height: 24px; accent-color: var(--accent); }
.notes { margin-top: 12px; }
.notes label { color: var(--muted); font-size: .8rem; font-weight: 800; }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.58); z-index: 20; display: none; padding: 16px; align-items: center; justify-content: center; }
.drawer.open { display: flex; }
.drawer-card { width: min(920px, 100%); max-height: 92vh; overflow: auto; background: #0d1427; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 16px; }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.icon-btn { width: 48px; height: 48px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: var(--text); border: 1px solid var(--line); font-size: 1.7rem; }
.demo-frame-wrap { aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: #050814; border: 1px solid var(--line); display: grid; place-items: center; }
.demo-frame-wrap iframe { width: 100%; height: 100%; border: 0; }
.demo-placeholder { padding: 22px; color: var(--muted); text-align: center; line-height: 1.5; }
.demo-note { color: var(--muted); line-height: 1.45; }
.primary-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 16px; border-radius: 14px; background: var(--accent); color: #061020; text-decoration: none; font-weight: 900; }
footer { color: var(--muted); max-width: 1120px; margin: 0 auto; padding: 16px; line-height: 1.4; }
@media (max-width: 760px) {
  .hero { display: block; padding-left: 14px; padding-right: 14px; }
  .sync-card { margin-top: 14px; width: fit-content; }
  .controls { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .day-tabs { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .exercise-top { display: block; }
  .demo-btn { width: 100%; margin-top: 12px; }
  .set-grid { grid-template-columns: 38px 1fr 1fr 44px; gap: 7px; }
  .set-grid input { padding: 10px 9px; min-height: 46px; }
  .token-field { display: block; }
  h1 { font-size: 2.45rem; }
}
@media (max-width: 380px) {
  .set-grid { grid-template-columns: 32px 1fr 1fr 38px; }
  main { padding-left: 10px; padding-right: 10px; }
}
