:root {
  --bg: #0b1016;
  --surface: #121922;
  --surface-2: #18222d;
  --surface-3: #202c39;
  --text: #f4f7fb;
  --muted: #96a4b4;
  --line: rgba(255,255,255,.09);
  --primary: #50e3b1;
  --primary-strong: #22c995;
  --accent: #ffbf5f;
  --danger: #ff6b7a;
  --warning: #f6ca64;
  --success: #52d896;
  --shadow: 0 18px 48px rgba(0,0,0,.28);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1240px;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% -10%, rgba(80,227,177,.13), transparent 34%),
    radial-gradient(circle at 0% 35%, rgba(77,142,255,.08), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.eyebrow {
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-card {
  width: min(100%, 440px);
  background: rgba(18,25,34,.92);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 30px;
  backdrop-filter: blur(22px);
}
.brand-lockup { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--primary), #5d8eff);
  color: #07120f; font-weight: 950; letter-spacing: -.08em;
  box-shadow: 0 12px 30px rgba(80,227,177,.22);
}
.brand-copy h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.04em; }
.brand-copy p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.auth-card h2 { margin: 0 0 8px; font-size: 2rem; letter-spacing: -.05em; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.auth-switch { display: flex; gap: 8px; padding: 5px; background: var(--surface-2); border-radius: 15px; margin-bottom: 18px; }
.auth-switch button { flex: 1; border: 0; background: transparent; border-radius: 11px; padding: 10px; cursor: pointer; color: var(--muted); }
.auth-switch button.active { background: var(--surface-3); color: var(--text); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(10,15,21,.86);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
}
.sidebar .brand-lockup { margin: 0 8px 34px; }
.nav { display: grid; gap: 7px; }
.nav button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 14px;
  border: 0; border-radius: 14px; background: transparent;
  color: var(--muted); cursor: pointer; text-align: left;
}
.nav button:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav button.active { background: rgba(80,227,177,.12); color: var(--primary); }
.nav-icon { width: 22px; text-align: center; font-size: 1.1rem; }
.sidebar-footer { margin-top: auto; padding: 12px 8px 0; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 10px;
}
.sync-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); }
.sync-dot.ok { background: var(--success); box-shadow: 0 0 0 4px rgba(82,216,150,.08); }
.sync-dot.busy { background: var(--warning); animation: pulse 1s infinite; }
.sync-dot.offline { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 30px;
  background: linear-gradient(to bottom, rgba(11,16,22,.96), rgba(11,16,22,.76), transparent);
  backdrop-filter: blur(16px);
}
.topbar-title h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.04em; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content { width: min(100%, var(--max)); margin: 0 auto; padding: 8px 30px 110px; }

.hero {
  position: relative; overflow: hidden;
  padding: 28px; border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(80,227,177,.14), rgba(93,142,255,.06) 55%, rgba(255,191,95,.08)),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ''; position: absolute; width: 260px; height: 260px; right: -90px; top: -120px;
  border-radius: 50%; border: 38px solid rgba(80,227,177,.055);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.45fr .55fr; gap: 24px; align-items: center; }
.hero h2 { margin: 7px 0 10px; font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.07em; line-height: .98; }
.hero p { color: #b4c0ce; max-width: 650px; line-height: 1.65; margin: 0 0 22px; }
.hero-stat { text-align: right; }
.hero-stat strong { display: block; font-size: clamp(3rem, 7vw, 5.4rem); line-height: .85; letter-spacing: -.08em; color: var(--primary); }
.hero-stat span { color: var(--muted); font-size: .85rem; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-head h2 { margin: 0; letter-spacing: -.04em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.card {
  background: rgba(18,25,34,.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card.compact { padding: 16px; }
.card h3 { margin: 0 0 7px; letter-spacing: -.03em; }
.card p { color: var(--muted); line-height: 1.55; }
.stat-card strong { display: block; font-size: 2rem; letter-spacing: -.06em; }
.stat-card span { color: var(--muted); font-size: .82rem; }

.btn {
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 14px; padding: 11px 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 750; transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--surface-3); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); color: #06130f; border-color: transparent; }
.btn.primary:hover { background: #6aebbd; }
.btn.danger { background: rgba(255,107,122,.12); color: #ff97a1; border-color: rgba(255,107,122,.22); }
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 11px; border-radius: 11px; font-size: .82rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; display: grid; place-items: center;
}

.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-size: .82rem; font-weight: 750; color: #c8d1dc; }
.input, select, textarea {
  width: 100%; color: var(--text); background: #0e151d;
  border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 13px; outline: none;
}
.input:focus, select:focus, textarea:focus { border-color: rgba(80,227,177,.5); box-shadow: 0 0 0 4px rgba(80,227,177,.07); }
textarea { min-height: 90px; resize: vertical; }
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.range-row output { width: 42px; text-align: center; font-size: 1.25rem; font-weight: 900; color: var(--primary); }
input[type="range"] { accent-color: var(--primary); }
.segmented { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented button { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.segmented button.active { background: rgba(80,227,177,.13); color: var(--primary); border-color: rgba(80,227,177,.3); }

.today-card { display: grid; grid-template-columns: 84px 1fr auto; gap: 18px; align-items: center; }
.today-icon {
  width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(80,227,177,.18), rgba(93,142,255,.12));
  font-size: 2rem; border: 1px solid rgba(80,227,177,.16);
}
.status-badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.status-planned { background: rgba(93,142,255,.12); color: #88acff; }
.status-done { background: rgba(82,216,150,.12); color: #7ae2ac; }
.status-skipped { background: rgba(255,107,122,.11); color: #ff8e99; }
.status-moved { background: rgba(246,202,100,.12); color: #f6ca64; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; }
.day-chip { min-width: 0; padding: 14px 10px; border-radius: 17px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: center; }
.day-chip.today { border-color: rgba(80,227,177,.4); box-shadow: inset 0 0 0 1px rgba(80,227,177,.14); }
.day-chip.done { background: rgba(82,216,150,.07); }
.day-chip .dow { color: var(--muted); font-size: .73rem; text-transform: uppercase; font-weight: 800; }
.day-chip strong { display: block; margin: 5px 0; font-size: 1.2rem; }
.day-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 8px auto 0; }
.day-chip .dot.guided { background: #5d8eff; }
.day-chip .dot.milon { background: var(--primary); }
.day-chip .dot.bike { background: var(--accent); }
.day-chip .dot.recovery { background: #b284ff; }

.ui-icon, .type-icon { width: 22px; height: 22px; display:block; }
.nav-icon .ui-icon { width:20px; height:20px; }

.week-toolbar {
  display:grid; grid-template-columns:48px minmax(0,1fr) 48px; gap:10px; align-items:center;
  margin:4px 0 16px; padding:8px;
  background:rgba(18,25,34,.7); border:1px solid var(--line); border-radius:20px;
}
.week-nav-btn {
  width:48px; height:48px; display:grid; place-items:center; border:0; border-radius:14px;
  color:var(--text); background:var(--surface-2); cursor:pointer;
}
.week-nav-btn:hover { background:var(--surface-3); }
.week-nav-btn .ui-icon { width:22px; height:22px; }
.week-range {
  min-width:0; display:grid; gap:2px; justify-items:center; padding:6px 10px;
  border:0; background:transparent; color:inherit; cursor:pointer; text-align:center;
}
.week-range strong { font-size:1.18rem; letter-spacing:-.035em; white-space:nowrap; }
.week-range span { color:var(--muted); font-size:.74rem; }

.week-list { display:grid; gap:12px; }
.week-card {
  position:relative; overflow:hidden; display:grid; grid-template-columns:58px minmax(0,1fr); gap:14px;
  align-items:start; padding:16px; border:1px solid var(--line); border-radius:20px;
  background:rgba(18,25,34,.82); transition:border-color .16s, transform .16s, background .16s;
}
.week-card::before {
  content:''; position:absolute; left:0; top:16px; bottom:16px; width:3px; border-radius:0 4px 4px 0;
  background:var(--card-accent, rgba(255,255,255,.12)); opacity:.9;
}
.week-card.type-guided { --card-accent:#7e9eff; }
.week-card.type-milon { --card-accent:var(--primary); }
.week-card.type-bike { --card-accent:var(--accent); }
.week-card.type-recovery { --card-accent:#b892ff; }
.week-card.type-rest { --card-accent:rgba(150,164,180,.45); }
.week-card.is-today { border-color:rgba(80,227,177,.38); background:linear-gradient(135deg,rgba(80,227,177,.085),rgba(18,25,34,.9) 58%); }
.week-card.status-done { background:linear-gradient(135deg,rgba(82,216,150,.07),rgba(18,25,34,.82) 55%); }
.week-card.status-skipped { opacity:.72; }
.week-date-tile {
  width:58px; min-height:62px; padding:9px 5px; display:grid; place-items:center;
  border-radius:16px; background:var(--surface-2); border:1px solid var(--line); line-height:1;
}
.week-date-tile span { color:var(--muted); font-size:.68rem; font-weight:850; text-transform:uppercase; }
.week-date-tile strong { font-size:1.45rem; letter-spacing:-.06em; }
.week-card.is-today .week-date-tile { background:rgba(80,227,177,.13); border-color:rgba(80,227,177,.22); color:var(--primary); }
.week-card-main { min-width:0; display:grid; gap:13px; }
.week-card-top { min-width:0; display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:10px; align-items:start; }
.week-type-icon {
  width:38px; height:38px; display:grid; place-items:center; border-radius:12px;
  color:var(--card-accent); background:color-mix(in srgb, var(--card-accent) 12%, transparent);
}
.week-type-icon .type-icon { width:21px; height:21px; }
.week-card-copy { min-width:0; padding-top:1px; }
.week-card-copy h3 { margin:0; font-size:1.05rem; line-height:1.22; letter-spacing:-.035em; }
.week-card-copy p { margin:5px 0 0; color:var(--muted); font-size:.79rem; line-height:1.35; }
.week-state {
  display:inline-flex; align-items:center; gap:5px; white-space:nowrap; padding:5px 8px;
  border-radius:999px; font-size:.66rem; font-weight:850;
}
.week-state .ui-icon { width:13px; height:13px; }
.week-state.planned { color:#8eadff; background:rgba(93,142,255,.12); }
.week-state.today { color:var(--primary); background:rgba(80,227,177,.12); }
.week-state.done { color:#7ae2ac; background:rgba(82,216,150,.12); }
.week-state.skipped { color:#ff9aa4; background:rgba(255,107,122,.1); }
.week-state.moved { color:#f6ca64; background:rgba(246,202,100,.1); }
.week-state.rest { color:#a9b5c3; background:rgba(150,164,180,.1); }
.week-actions { display:grid; grid-template-columns:minmax(128px,1fr) auto auto; gap:8px; }
.week-actions.two { grid-template-columns:minmax(128px,1fr) auto; }
.week-actions .btn { min-height:44px; padding:10px 13px; border-radius:13px; }
.week-actions .ui-icon { width:18px; height:18px; flex:0 0 auto; }
.week-primary { justify-content:center; }
.week-secondary { min-width:46px; }
.week-secondary.danger-soft { color:#ff9aa4; }
.week-card.type-rest { align-items:center; padding-top:13px; padding-bottom:13px; }
.week-card.type-rest .week-card-main { align-self:center; }
.week-card.type-rest .week-card-top { align-items:center; }

.history-item { display:grid; grid-template-columns:58px 1fr auto; gap:14px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.history-item:last-child { border-bottom:0; }
.history-icon { width:52px; height:52px; border-radius:16px; background:var(--surface-2); display:grid; place-items:center; font-size:1.35rem; }
.history-item h3 { margin:0 0 4px; font-size:1rem; }
.history-item p { margin:0; color:var(--muted); font-size:.84rem; }
.history-score { text-align:right; }
.history-score strong { display:block; }
.history-score span { color:var(--muted); font-size:.75rem; }

.chart-wrap { width:100%; min-height:220px; }
.chart-wrap svg { width:100%; height:auto; overflow:visible; }
.chart-grid { stroke:rgba(255,255,255,.07); stroke-width:1; }
.chart-line { fill:none; stroke:var(--primary); stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.chart-area { fill:url(#areaGradient); }
.chart-label { fill:var(--muted); font-size:11px; }

.modal-layer {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3,7,11,.75); backdrop-filter: blur(16px);
  display: grid; place-items: center; padding: 18px;
}
.modal {
  width: min(100%, 720px); max-height: min(92vh, 980px); overflow:auto;
  background: #111922; border:1px solid var(--line); border-radius:28px;
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
}
.modal.wide { width:min(100%, 980px); }
.modal-head { position:sticky; top:0; z-index:4; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:20px 22px; background:rgba(17,25,34,.94); backdrop-filter:blur(18px); border-bottom:1px solid var(--line); }
.modal-head h2 { margin:0; letter-spacing:-.04em; }
.modal-body { padding:22px; }

.runner { min-height:100vh; background:var(--bg); }
.runner-top { position:sticky; top:0; z-index:20; display:flex; align-items:center; gap:14px; padding:16px 20px; background:rgba(11,16,22,.9); backdrop-filter:blur(16px); border-bottom:1px solid var(--line); }
.runner-progress { flex:1; height:7px; border-radius:999px; overflow:hidden; background:var(--surface-3); }
.runner-progress span { display:block; height:100%; background:linear-gradient(90deg,var(--primary),#5d8eff); }
.runner-main { width:min(100%, 800px); margin:0 auto; padding:24px 20px 110px; }
.exercise-visual { display:grid; grid-template-columns:minmax(180px, 34%) 1fr; gap:24px; align-items:center; padding:20px; border:1px solid var(--line); border-radius:26px; background:var(--surface); }
.exercise-visual img { width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:20px; background:var(--surface-2); }
.exercise-visual h1 { margin:6px 0 8px; font-size:clamp(2rem,7vw,3.3rem); line-height:1; letter-spacing:-.07em; }
.cue-list { display:grid; gap:8px; margin:16px 0 0; padding:0; list-style:none; }
.cue-list li { display:flex; gap:9px; align-items:flex-start; color:#c2ccd7; }
.cue-list li::before { content:'✓'; color:var(--primary); font-weight:900; }
.set-table { margin-top:18px; overflow:hidden; border:1px solid var(--line); border-radius:18px; }
.set-row { display:grid; grid-template-columns:60px 1fr 1fr 54px; gap:10px; align-items:center; padding:12px; border-bottom:1px solid var(--line); }
.set-row:last-child { border-bottom:0; }
.set-row.header { color:var(--muted); font-size:.75rem; font-weight:800; background:var(--surface-2); }
.set-row input { min-width:0; width:100%; background:#0c131a; border:1px solid var(--line); color:var(--text); border-radius:10px; padding:10px; }
.check-btn { width:42px; height:42px; border-radius:12px; border:1px solid var(--line); background:var(--surface-2); cursor:pointer; }
.check-btn.done { background:var(--primary); color:#06130f; }
.runner-actions { position:fixed; left:0; right:0; bottom:0; z-index:25; display:flex; justify-content:center; padding:14px 18px calc(14px + env(safe-area-inset-bottom)); background:linear-gradient(to top,rgba(11,16,22,1) 65%,transparent); }
.runner-actions-inner { width:min(100%,800px); display:grid; grid-template-columns:auto 1fr; gap:10px; }
.exercise-rating-panel { scroll-margin-top:88px; scroll-margin-bottom:130px; overflow:hidden; }
.exercise-set-summary { margin:-1px -1px 24px; padding:18px; border-radius:20px; background:var(--surface-2); border:1px solid var(--line); }
.exercise-set-summary-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.exercise-set-summary-head h3 { margin:4px 0 0; }
.exercise-set-summary-head > strong { display:grid; place-items:center; min-width:52px; height:52px; padding:0 10px; border-radius:16px; background:rgba(80,227,177,.12); color:var(--primary); font-size:1.1rem; }
.exercise-set-summary-list { display:grid; gap:8px; margin-top:16px; }
.exercise-set-summary-row { display:grid; grid-template-columns:72px 1fr auto; gap:10px; align-items:center; padding:11px 12px; border-radius:13px; background:#0c131a; border:1px solid var(--line); }
.exercise-set-summary-row > span:first-child { color:var(--muted); font-size:.82rem; }
.exercise-set-summary-row > span:last-child { font-size:.76rem; font-weight:800; }
.exercise-set-summary-row.done > span:last-child { color:var(--primary); }
.exercise-set-summary-row.pending > span:last-child { color:var(--warning); }
.exercise-rating-fields > h2 { margin-top:0; }

.timer-face { display:grid; place-items:center; text-align:center; min-height:50vh; }
.timer-ring { width:min(70vw,330px); aspect-ratio:1; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--primary) var(--timer-progress,0%),var(--surface-3) 0); position:relative; }
.timer-ring::before { content:''; position:absolute; inset:16px; border-radius:50%; background:var(--bg); }
.timer-content { position:relative; z-index:1; }
.timer-content strong { display:block; font-size:clamp(3.4rem,12vw,6rem); letter-spacing:-.08em; }
.timer-content span { color:var(--muted); }
.milon-sequence { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:20px; }
.milon-step { padding:12px; border-radius:14px; background:var(--surface); border:1px solid var(--line); }
.milon-step strong { display:block; font-size:.88rem; }
.milon-step span { color:var(--muted); font-size:.76rem; }

.insight { padding:18px; border-left:4px solid var(--primary); border-radius:0 18px 18px 0; background:rgba(80,227,177,.075); line-height:1.6; }
.insight.warning { border-left-color:var(--warning); background:rgba(246,202,100,.075); }
.insight.danger { border-left-color:var(--danger); background:rgba(255,107,122,.075); }

.template-row { display:grid; grid-template-columns:42px 1fr auto; gap:12px; align-items:center; padding:11px 0; border-bottom:1px solid var(--line); }
.template-row:last-child { border-bottom:0; }
.drag-handle { color:var(--muted); text-align:center; }

.toast { position:fixed; right:18px; bottom:18px; z-index:999; max-width:min(380px,calc(100vw - 36px)); padding:14px 16px; border-radius:14px; color:var(--text); background:#1b2632; border:1px solid var(--line); box-shadow:var(--shadow); animation:toastIn .2s ease-out; }
.toast.error { border-color:rgba(255,107,122,.35); }
.toast.success { border-color:rgba(82,216,150,.35); }
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } }

.mobile-nav { display:none; }

@media (max-width: 620px) {
  .exercise-set-summary-row { grid-template-columns:64px 1fr; }
  .exercise-set-summary-row > span:last-child { grid-column:2; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns:1fr; }
  .sidebar { display:none; }
  .mobile-nav {
    position:fixed; left:12px; right:12px; bottom:10px; z-index:50;
    display:grid; grid-template-columns:repeat(5,1fr); gap:4px;
    padding:7px; border-radius:21px; background:rgba(16,23,31,.94); border:1px solid var(--line); backdrop-filter:blur(20px); box-shadow:var(--shadow);
  }
  .mobile-nav button { border:0; background:transparent; border-radius:14px; padding:8px 4px; color:var(--muted); font-size:.68rem; display:grid; gap:4px; place-items:center; }
  .mobile-nav-icon { display:grid; place-items:center; }
  .mobile-nav-icon .ui-icon { width:20px; height:20px; }
  .mobile-nav button.active { background:rgba(80,227,177,.11); color:var(--primary); }
  .topbar { padding:16px 20px; }
  .content { padding:5px 20px 110px; }
  .grid.four { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 720px) {
  .hero { padding:22px; border-radius:24px; }
  .hero-grid { grid-template-columns:1fr; }
  .hero-stat { text-align:left; }
  .grid.two, .grid.three { grid-template-columns:1fr; }
  .week-strip { gap:6px; }
  .day-chip { padding:10px 4px; border-radius:13px; }
  .day-chip .dow { font-size:.62rem; }
  .day-chip strong { font-size:1rem; }
  .week-toolbar { margin-top:2px; }
  .week-card { grid-template-columns:52px minmax(0,1fr); gap:12px; padding:14px; border-radius:18px; }
  .week-card::before { top:14px; bottom:14px; }
  .week-date-tile { width:52px; min-height:58px; border-radius:14px; }
  .week-card-top { grid-template-columns:34px minmax(0,1fr) auto; gap:9px; }
  .week-type-icon { width:34px; height:34px; border-radius:11px; }
  .week-card-copy h3 { font-size:1rem; }
  .week-card-copy p { font-size:.76rem; }
  .week-actions .btn { min-height:46px; }
  .week-secondary { width:46px; padding:0 !important; }
  .week-secondary span { display:none; }
  .today-card { grid-template-columns:60px 1fr; }
  .today-icon { width:60px; height:60px; border-radius:17px; }
  .today-card > .button-row { grid-column:1/-1; }
  .exercise-visual { grid-template-columns:1fr; padding:16px; }
  .exercise-visual img { max-height:230px; }
  .set-row { grid-template-columns:42px 1fr 1fr 44px; padding:9px; gap:7px; }
  .milon-sequence { grid-template-columns:repeat(2,1fr); }
  .modal-layer { padding:0; align-items:end; }
  .modal { width:100%; max-height:94vh; border-radius:26px 26px 0 0; }
}

@media (max-width: 430px) {
  .topbar { padding:14px 16px 12px; }
  .content { padding:4px 14px 118px; }
  .topbar-actions .sync-pill { width:40px; height:40px; padding:0; justify-content:center; }
  .topbar-actions .sync-pill .sync-dot { width:9px; height:9px; }
  .topbar-actions .sync-pill { font-size:0; }
  .week-toolbar { grid-template-columns:44px minmax(0,1fr) 44px; gap:7px; padding:6px; border-radius:18px; }
  .week-nav-btn { width:44px; height:44px; border-radius:13px; }
  .week-range strong { font-size:1.05rem; }
  .week-range span { font-size:.68rem; }
  .week-card { padding-top:15px; }
  .week-card-top { grid-template-columns:34px minmax(0,1fr); padding-right:0; }
  .week-card-copy { padding-right:2px; }
  .week-state { grid-column:2; justify-self:start; margin-top:1px; }
  .week-state.planned, .week-state.rest { display:none; }
  .week-actions { grid-template-columns:minmax(0,1fr) 46px 46px; }
  .week-actions.two { grid-template-columns:minmax(0,1fr) 46px; }
  .mobile-nav { left:10px; right:10px; bottom:8px; padding:6px; border-radius:20px; }
}

@media print {
  body { background:white; color:black; }
  .sidebar,.mobile-nav,.topbar,.btn,.icon-btn { display:none !important; }
  .app-shell { display:block; }
  .content { width:100%; padding:0; }
  .card,.hero { border:1px solid #ddd; background:white; box-shadow:none; color:black; break-inside:avoid; }
  .muted,.card p { color:#555 !important; }
}

.quick-add-card {
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.quick-add-card:hover { transform: translateY(-2px); border-color: rgba(80,227,177,.35); background: var(--surface-2); }
.quick-add-icon { font-size: 2rem; margin-bottom: 8px; }
.quick-add-card h3 { margin: 0 0 6px; }
.quick-add-card p { margin: 0; }
.quick-add-wide { grid-column: 1 / -1; }
@media (max-width: 720px) { .quick-add-wide { grid-column: auto; } }

/* v0.1.7 — nawigacja i cofanie przesunięcia */
.week-moved-notice {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 11px;
  border:1px solid rgba(246,202,100,.18);
  border-radius:12px;
  background:rgba(246,202,100,.07);
  color:#f6ca64;
  font-size:.75rem;
  font-weight:750;
}
.week-moved-notice > span { display:flex; align-items:center; gap:7px; min-width:0; }
.week-moved-notice .ui-icon { width:16px; height:16px; flex:0 0 auto; }
.week-moved-notice button {
  flex:0 0 auto;
  border:0;
  border-radius:9px;
  padding:7px 9px;
  background:rgba(246,202,100,.13);
  color:inherit;
  font:inherit;
  cursor:pointer;
  touch-action:manipulation;
}

@media (max-width: 980px) {
  .mobile-nav {
    isolation:isolate;
    transform:translateZ(0);
    pointer-events:auto;
    bottom:max(10px, env(safe-area-inset-bottom));
  }
  .mobile-nav button {
    position:relative;
    z-index:1;
    min-width:0;
    min-height:52px;
    cursor:pointer;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
    user-select:none;
    -webkit-user-select:none;
  }
  .mobile-nav button > * { pointer-events:none; }
}

@media (max-width: 430px) {
  .week-moved-notice { align-items:flex-start; }
  .week-moved-notice > span { line-height:1.35; }
}

/* v0.1.8 — diagnostyka i stabilizacja synchronizacji */
.sync-diagnostics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}
.sync-diagnostics > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.sync-diagnostics span,
.sync-diagnostics strong {
  display: block;
}
.sync-diagnostics span {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.sync-diagnostics strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
@media (max-width: 540px) {
  .sync-diagnostics { grid-template-columns: 1fr; }
}
