/* Úkolníček – styles. Light + dark theme, section colours via --c, no build step. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/assets/fonts/nunito-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/assets/fonts/nunito-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ tokens */
:root {
  --font: "Nunito", ui-rounded, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --bg: #F6F4EF;
  --bg2: #EEEAE3;
  --card: #FFFFFF;
  --card2: #FAF8F4;
  --ink: #1C2333;
  --ink2: #586174;
  --ink3: #8B93A4;
  --line: #E8E3DB;
  --line2: #DDD7CD;
  --accent: #0D9488;
  --on-accent: #FFFFFF;
  --danger: #E11D48;
  --ok: #10B981;
  --shadow-sm: 0 1px 2px rgba(28, 35, 51, .05);
  --shadow: 0 1px 2px rgba(28, 35, 51, .04), 0 6px 20px -6px rgba(28, 35, 51, .10);
  --shadow-lg: 0 10px 40px -10px rgba(28, 35, 51, .25);
  --r: 22px;
  --r-sm: 14px;
  --tap: 46px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1320; --bg2: #131A2A; --card: #171E2E; --card2: #1C2437;
    --ink: #E9EDF5; --ink2: #A6AFC2; --ink3: #6E778D; --line: #252E44; --line2: #2E3850;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 50px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1320; --bg2: #131A2A; --card: #171E2E; --card2: #1C2437;
  --ink: #E9EDF5; --ink2: #A6AFC2; --ink3: #6E778D; --line: #252E44; --line2: #2E3850;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 50px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* section / accent palette: every coloured thing reads --c */
.c-amber   { --c: #F59E0B; }
.c-orange  { --c: #F97316; }
.c-rose    { --c: #F43F5E; }
.c-pink    { --c: #EC4899; }
.c-violet  { --c: #8B5CF6; }
.c-indigo  { --c: #6366F1; }
.c-sky     { --c: #0EA5E9; }
.c-teal    { --c: #14B8A6; }
.c-emerald { --c: #10B981; }
.c-lime    { --c: #84CC16; }
.c-slate   { --c: #64748B; }
[class*="c-"] { --soft: color-mix(in srgb, var(--c) 14%, var(--card)); --soft2: color-mix(in srgb, var(--c) 8%, var(--card)); }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); font-size: 16px; line-height: 1.45; font-weight: 500;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, video, iframe { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 850; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--ink2); }
.faint { color: var(--ink3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.eyebrow { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ layout */
.app { min-height: 100vh; min-height: 100dvh; }
.view {
  max-width: 760px; margin: 0 auto; outline: none;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 16px calc(var(--nav-h) + var(--safe-b) + 32px);
  animation: view-in .35s var(--ease);
}
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.view.bare { max-width: none; padding: 0; }
.boot { display: grid; place-items: center; min-height: 70vh; }
.boot img { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }

.nav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 6px 8px var(--safe-b);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.nav .brand { display: none; }
.nav a {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink3); font-size: 12px; font-weight: 750; border-radius: 16px; text-decoration: none;
  transition: color .2s;
}
.nav a .ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .25s var(--ease), transform .25s var(--spring); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] .ico { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.nav a:active .ico { transform: scale(.9); }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .nav {
    position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 26px 16px; border-top: 0; border-right: 1px solid var(--line); background: var(--bg);
    backdrop-filter: none;
  }
  .nav .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-weight: 900; font-size: 20px; color: var(--ink); }
  .nav .brand img { width: 34px; height: 34px; }
  .nav a { flex: 0 0 auto; max-width: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 8px 10px; font-size: 15.5px; }
  .nav a .ico { width: 38px; height: 34px; border-radius: 12px; }
  .nav a:hover { color: var(--ink); background: var(--bg2); text-decoration: none; }
  .nav .nav-foot { margin-top: auto; }
  .view { padding-bottom: 60px; padding-top: 40px; }
}
@media (min-width: 1240px) {
  .view.wide { max-width: 1040px; }
  .view.wide .sections { display: block; columns: 2; column-gap: 16px; }
  .view.wide .sections > .sec { break-inside: avoid; margin-bottom: 16px; display: inline-block; width: 100%; }
  .view.wide .hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; margin-bottom: 20px; }
  .view.wide .hero-row .hero, .view.wide .hero-row .week { margin-bottom: 0; }
}

/* ------------------------------------------------------------------ buttons, inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 800; font-size: 15.5px; white-space: nowrap; text-decoration: none !important;
  background: var(--bg2); color: var(--ink);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.colored { background: var(--c); color: #fff; box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--c) 75%, transparent); }
.btn.soft { background: var(--soft, var(--bg2)); color: var(--c, var(--ink)); }
.btn.ghost { background: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--bg2); color: var(--ink); }
.btn.line { background: transparent; border-color: var(--line2); }
.btn.danger { background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink2);
  transition: background .2s, color .2s, transform .15s;
}
.icon-btn:hover { background: var(--bg2); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.filled { background: var(--card); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }

.field { display: block; }
.field > span, .label { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink2); margin: 0 0 6px 4px; }
.field .hint { display: block; font-size: 13px; color: var(--ink3); margin: 6px 0 0 4px; font-weight: 600; }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line2); background: var(--card); color: var(--ink); font-weight: 600;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.4; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--ink3); font-weight: 500; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid > .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* segmented control */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--bg2); max-width: 100%; overflow-x: auto; }
.seg button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--ink2);
  white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }

/* chips (week days etc.) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-width: 44px; height: 38px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line2);
  background: var(--card); font-weight: 800; font-size: 14px; color: var(--ink2);
  transition: all .18s var(--ease);
}
.chip[aria-pressed="true"] { background: var(--c, var(--accent)); border-color: transparent; color: #fff; }
.chip:active { transform: scale(.94); }

/* switch */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line2); transition: background .25s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--spring);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.card.pad { padding: 20px; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.page-head .grow > p { margin-top: 4px; }
.back { margin: -6px 0 10px -10px; }
.empty { text-align: center; padding: 34px 20px; color: var(--ink2); }
.empty .big { font-size: 44px; margin-bottom: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--bg2); color: var(--ink2); font-size: 12.5px; font-weight: 800; white-space: nowrap;
}
.badge.c { background: var(--soft); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.badge svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ today */
.hello { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.hello h1 { font-size: 27px; }
.hello .date { margin-top: 4px; color: var(--ink2); font-weight: 700; text-transform: none; }
.streak {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 11px; border-radius: 999px;
  background: linear-gradient(135deg, #FFF1D6, #FFE0E0); color: #B45309; font-weight: 900; font-size: 16px; flex: none;
  box-shadow: 0 6px 16px -8px rgba(234, 88, 12, .5); border: 0;
}
:root[data-theme="dark"] .streak { background: linear-gradient(135deg, #3A2A12, #3B1D24); color: #FDBA74; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .streak { background: linear-gradient(135deg, #3A2A12, #3B1D24); color: #FDBA74; } }
.streak.zero { background: var(--bg2); color: var(--ink3); box-shadow: none; }
.streak .flame { font-size: 18px; line-height: 1; }

.hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; padding: 20px 22px; margin-bottom: 14px;
  border-radius: 26px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 70%, #fff) 0%, var(--accent) 45%, color-mix(in srgb, var(--accent) 70%, #0B1220) 100%);
  box-shadow: 0 16px 36px -18px color-mix(in srgb, var(--accent) 80%, transparent);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero .ring-wrap { position: relative; flex: none; width: 92px; height: 92px; }
.hero .ring-wrap .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 900; }
.hero h2 { font-size: 21px; color: #fff; }
.hero p { color: rgba(255,255,255,.85); font-weight: 700; margin-top: 3px; }
.hero.done { background: radial-gradient(120% 140% at 0% 0%, #6EE7B7 0%, #10B981 45%, #047857 100%); box-shadow: 0 16px 36px -18px rgba(16,185,129,.8); }
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease), stroke .3s; }

.week { display: flex; align-items: center; gap: 4px; margin: 0 -6px 20px; }
.week .days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.week .day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 7px; border: 0; border-radius: 16px;
  background: transparent; color: var(--ink2); font-weight: 800; font-size: 12px; transition: background .2s;
}
.week .day:hover { background: var(--bg2); }
.week .day .mini { position: relative; width: 36px; height: 36px; }
.week .day .mini b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13.5px; color: var(--ink); font-weight: 850; }
.week .day.today .dname { color: var(--accent); }
.week .day[aria-current="date"] { background: var(--card); box-shadow: var(--shadow); }
.week .day.future { opacity: .45; }
.week .day.full .mini::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.week .day.full .mini b { color: #fff; z-index: 1; }

.sections { display: grid; gap: 14px; }
.sec { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); animation: rise .45s var(--ease) both; }
.sec:nth-child(2) { animation-delay: .04s; } .sec:nth-child(3) { animation-delay: .08s; } .sec:nth-child(4) { animation-delay: .12s; }
.sec:nth-child(5) { animation-delay: .16s; } .sec:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.sec-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px 16px; cursor: pointer; }
.sec-head:hover .sec-name { color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.bubble {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 15px;
  background: var(--soft); font-size: 23px; line-height: 1;
}
.bubble.lg { width: 64px; height: 64px; border-radius: 22px; font-size: 34px; }
.sec-name { font-size: 17.5px; font-weight: 850; transition: color .2s; }
.sec-sub { font-size: 13px; color: var(--ink3); font-weight: 700; margin-top: 1px; }
.sec-count { font-weight: 900; font-size: 14px; color: var(--ink2); padding: 4px 10px; border-radius: 999px; background: var(--bg2); }
.sec.complete .sec-count { background: var(--c); color: #fff; }
.bar { height: 6px; border-radius: 99px; background: var(--soft2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width .6s var(--ease); }
.sec > .bar { margin: 0 16px 6px; }
.items { list-style: none; margin: 0; padding: 4px 6px 8px; }

.item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 7px 10px; border-radius: 16px;
  cursor: pointer; user-select: none; -webkit-user-select: none; transition: background .2s;
}
.item:hover { background: var(--soft2); }
.item .txt { flex: 1; min-width: 0; }
.item .title { font-weight: 750; font-size: 16px; transition: color .25s, opacity .25s; overflow-wrap: anywhere; }
.item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--ink3); font-weight: 700; }
.item .meta .dot::before { content: "·"; margin-right: 6px; }
.item.done .title { color: var(--ink3); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--c) 50%, transparent); }
.item .num { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--bg2); font-size: 13px; font-weight: 900; color: var(--ink2); }
.item .side { display: flex; align-items: center; gap: 2px; flex: none; }
.item .side .icon-btn { width: 36px; height: 36px; }
.item.future { cursor: default; }

.tick {
  position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--c) 45%, var(--line2));
  display: grid; place-items: center; background: transparent; padding: 0; color: #fff;
  transition: background .25s var(--ease), border-color .25s, transform .3s var(--spring);
}
.tick svg { width: 18px; height: 18px; }
.tick svg path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s var(--ease) .05s; }
.done > .tick, .tick.on { background: var(--c); border-color: var(--c); }
.done > .tick svg path, .tick.on svg path { stroke-dashoffset: 0; }
.pop > .tick { animation: pop .45s var(--spring); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.tick::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; }
.pop > .tick::after { animation: ripple .6s var(--ease); }
@keyframes ripple { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }

/* counter (8 glasses of water) */
.counter { display: flex; align-items: center; gap: 4px; flex: none; }
.counter .val { min-width: 46px; text-align: center; font-weight: 900; font-size: 14.5px; }
.counter .icon-btn { width: 34px; height: 34px; background: var(--soft2); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.counter .icon-btn:hover { background: var(--soft); }
.pips { display: flex; gap: 3px; margin-top: 5px; flex-wrap: wrap; }
.pips i { width: 14px; height: 6px; border-radius: 99px; background: var(--soft); transition: background .3s; }
.pips i.on { background: var(--c); }

.quick { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px 14px; }
.quick .add-link {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink3); font-weight: 800; font-size: 14.5px;
  padding: 8px 6px; border-radius: 12px;
}
.quick .add-link:hover { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.quick form { flex: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quick input { flex: 1 1 160px; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--card2); font-weight: 650; }
.quick input:focus { outline: none; border-color: var(--c); box-shadow: 0 0 0 4px var(--soft); }
.workout-cta { display: flex; align-items: center; gap: 10px; padding: 2px 16px 14px; flex-wrap: wrap; }

.welcome { padding: 30px 24px; text-align: center; }
.welcome .wave { font-size: 52px; display: inline-block; animation: wave 2s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } 60% { transform: rotate(0); } }
.welcome h2 { font-size: 24px; margin: 8px 0; }
.welcome .actions { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin: 22px auto 0; }

/* ------------------------------------------------------------------ section page / exercises */
.sec-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.sec-hero h1 { font-size: 28px; }
.sec-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.note-box { padding: 14px 16px; border-radius: 16px; background: var(--soft2); color: var(--ink2); font-weight: 650; margin-bottom: 16px; white-space: pre-line; }
.ex-list { display: grid; gap: 14px; }
.ex { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.ex .ex-body { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 16px; }
.ex .ex-body .tick { margin-top: 2px; }
.ex .step { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); color: color-mix(in srgb, var(--c) 85%, var(--ink)); font-weight: 900; }
.ex h3 { font-size: 17.5px; }
.ex .note { color: var(--ink2); font-size: 14.5px; margin-top: 6px; white-space: pre-line; font-weight: 600; }
.ex.done h3 { color: var(--ink3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c) 50%, transparent); }
.media { position: relative; aspect-ratio: 16 / 9; background: #0B0F19; overflow: hidden; }
.media iframe, .media video, .media img.fill { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.media img.fill.cover { object-fit: cover; }
.yt-thumb { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: #000 center / cover no-repeat; cursor: pointer; }
.yt-thumb::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45)); }
.play {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.94); color: #111; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: transform .25s var(--spring);
}
.yt-thumb:hover .play { transform: scale(1.08); }
.play svg { margin-left: 4px; }
.media .tag { position: absolute; left: 12px; bottom: 10px; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.media.none { display: grid; place-items: center; aspect-ratio: auto; height: 120px; background: var(--soft2); color: var(--ink3); font-weight: 700; font-size: 14px; }
.media.none a { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }

/* ------------------------------------------------------------------ workout player */
.wo {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  background: radial-gradient(140% 100% at 50% 0%, color-mix(in srgb, var(--c) 35%, #0B1020) 0%, #0A0E18 60%);
  color: #fff; animation: fade .3s var(--ease);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
@keyframes fade { from { opacity: 0; } }
.wo-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.wo-top .icon-btn { color: #fff; background: rgba(255,255,255,.1); }
.wo-top .icon-btn:hover { background: rgba(255,255,255,.18); }
.wo-title { flex: 1; min-width: 0; font-weight: 800; color: rgba(255,255,255,.85); }
.wo-steps { display: flex; gap: 5px; padding: 0 16px 12px; }
.wo-steps i { flex: 1; height: 5px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; position: relative; }
.wo-steps i.done { background: var(--c); }
.wo-steps i.cur::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: #fff; border-radius: inherit; transition: width .3s linear; }
.wo-main { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 0 16px 14px; }
.wo-stage { width: 100%; max-width: 860px; }
.wo .media { border-radius: 22px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.8); }
.wo .media.none { background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); height: auto; aspect-ratio: 16 / 7; border-radius: 22px; font-size: 64px; }
.wo-info { text-align: center; margin: 18px 0 6px; }
.wo-info .kicker { font-weight: 800; color: rgba(255,255,255,.6); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.wo-info h2 { font-size: clamp(26px, 6vw, 38px); color: #fff; margin-top: 4px; font-weight: 900; }
.wo-info .reps { display: inline-block; margin-top: 10px; padding: 6px 16px; border-radius: 999px; background: rgba(255,255,255,.12); font-weight: 900; font-size: 20px; }
.wo-info .note { color: rgba(255,255,255,.7); margin-top: 10px; font-weight: 600; white-space: pre-line; }
.wo-timer { position: relative; width: 150px; height: 150px; margin: 10px auto 0; cursor: pointer; }
.wo-timer .t { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 900; }
.wo-timer .t small { display: block; font-size: 13px; font-weight: 800; color: rgba(255,255,255,.6); text-align: center; margin-top: -6px; }
.wo-ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 16px 18px; }
.wo-ctrl .icon-btn { width: 54px; height: 54px; background: rgba(255,255,255,.1); color: #fff; }
.wo-ctrl .icon-btn:hover { background: rgba(255,255,255,.2); }
.wo-ctrl .icon-btn:disabled { opacity: .3; }
.wo-ctrl .btn { min-width: 190px; }
.wo-ctrl .btn.white { background: #fff; color: #0B1020; }
.wo-rest { text-align: center; padding-top: 4vh; }
.wo-rest .big { font-size: 88px; font-weight: 900; line-height: 1; margin: 10px 0; }
.wo-next { display: flex; align-items: center; gap: 14px; max-width: 420px; margin: 26px auto 0; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.08); text-align: left; }
.wo-next .thumb { width: 96px; aspect-ratio: 16/9; border-radius: 10px; background: rgba(255,255,255,.1) center / cover; flex: none; display: grid; place-items: center; font-size: 26px; }
.wo-count { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 120px; font-weight: 900; background: rgba(10,14,24,.55); backdrop-filter: blur(4px); animation: fade .2s; }
.wo-count span { animation: count-pop 1s var(--ease) infinite; }
@keyframes count-pop { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(.85); } }
.wo-finish { text-align: center; padding: 8vh 20px 20px; }
.wo-finish .trophy { font-size: 90px; animation: bounce-in .7s var(--spring); }
@keyframes bounce-in { from { transform: scale(.3); opacity: 0; } }
.wo-finish h2 { font-size: 34px; margin: 10px 0 8px; color: #fff; }
.wo-finish .stats { display: flex; justify-content: center; gap: 12px; margin: 22px 0 28px; flex-wrap: wrap; }
.wo-finish .stats div { padding: 12px 20px; border-radius: 18px; background: rgba(255,255,255,.08); min-width: 120px; }
.wo-finish .stats b { display: block; font-size: 26px; }
.wo-finish .stats span { color: rgba(255,255,255,.65); font-weight: 700; font-size: 14px; }

/* ------------------------------------------------------------------ edit */
.sortable { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.srow {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 6px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow-sm); border: 1px solid var(--line); cursor: pointer;
  transition: box-shadow .2s, transform .2s var(--ease), background .2s;
}
.srow:hover { box-shadow: var(--shadow); }
.srow.dragging { z-index: 5; position: relative; box-shadow: var(--shadow-lg); transform: scale(1.02); transition: box-shadow .2s, transform 0s; cursor: grabbing; }
.srow.archived { opacity: .6; }
.handle { display: grid; place-items: center; width: 34px; height: 40px; flex: none; color: var(--ink3); cursor: grab; touch-action: none; border-radius: 10px; border: 0; background: transparent; }
.handle:hover { background: var(--bg2); color: var(--ink2); }
.srow .bubble { width: 40px; height: 40px; border-radius: 13px; font-size: 21px; }
.srow .t { font-weight: 800; }
.srow .s { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.srow .thumb { width: 64px; aspect-ratio: 16/9; border-radius: 9px; background: var(--bg2) center / cover; flex: none; display: grid; place-items: center; color: var(--ink3); }
.add-row {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; margin-top: 10px; border-radius: 18px;
  border: 2px dashed var(--line2); background: transparent; color: var(--ink2); font-weight: 800; transition: all .2s;
}
.add-row:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.group-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 4px 10px; }
.saved { font-size: 13px; font-weight: 800; color: var(--ok); opacity: 0; transition: opacity .3s; }
.saved.show { opacity: 1; }
.danger-zone { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--c); position: relative;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c) 70%, #000 0%); transition: transform .2s var(--spring);
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid var(--c); }
.emoji-btn { width: 64px; height: 64px; border-radius: 20px; border: 2px dashed var(--line2); background: var(--soft, var(--bg2)); font-size: 32px; display: grid; place-items: center; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; max-height: 260px; overflow-y: auto; padding: 4px; }
.emoji-grid button { height: 44px; border: 0; border-radius: 12px; background: transparent; font-size: 24px; transition: background .15s, transform .15s; }
.emoji-grid button:hover { background: var(--bg2); transform: scale(1.12); }
.vid-preview { margin-top: 10px; border-radius: 16px; overflow: hidden; }
.upload-bar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 10px; }
.upload-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--line2); border-radius: 999px; padding: 3px; background: var(--card); }
.stepper input { width: 64px !important; text-align: center; border: 0 !important; min-height: 36px !important; padding: 0 !important; box-shadow: none !important; background: transparent !important; font-weight: 900 !important; }
.stepper .icon-btn { width: 36px; height: 36px; background: var(--bg2); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ------------------------------------------------------------------ sheet (modal) */
.backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(10, 14, 24, .45); backdrop-filter: blur(3px); animation: fade .25s var(--ease); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 620px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  padding: 10px 20px calc(22px + var(--safe-b)); animation: sheet-up .38s var(--ease);
}
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line2); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-head h2 { flex: 1; }
.sheet-foot { display: flex; gap: 10px; margin-top: 22px; position: sticky; bottom: calc(-22px - var(--safe-b)); background: var(--card); padding: 12px 0 0; }
.sheet-foot .btn.primary { flex: 1; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: 28px; max-height: 88vh; padding-bottom: 22px; }
  .sheet::before { display: none; }
  .sheet-foot { bottom: -22px; }
}
.dialog { max-width: 420px; }
.fieldset { border: 0; padding: 16px; margin: 0; border-radius: 18px; background: var(--card2); border: 1px solid var(--line); }
.fieldset > legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-weight: 850; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.fieldset > legend + * { clear: both; }

/* ------------------------------------------------------------------ stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.stat .v { font-size: 30px; font-weight: 900; line-height: 1.1; }
.stat .l { color: var(--ink2); font-weight: 750; font-size: 13.5px; margin-top: 4px; }
.stat .e { font-size: 22px; }
.cal { padding: 16px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h3 { flex: 1; text-transform: capitalize; font-size: 17px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .wd { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink3); padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1; border-radius: 14px; border: 0; display: grid; place-items: center; font-weight: 850; font-size: 14px;
  background: var(--bg2); color: var(--ink2); position: relative; transition: transform .15s;
}
.cal-day:hover { transform: scale(1.06); }
.cal-day.lvl1 { background: color-mix(in srgb, var(--accent) 22%, var(--card)); color: var(--ink); }
.cal-day.lvl2 { background: color-mix(in srgb, var(--accent) 45%, var(--card)); color: var(--ink); }
.cal-day.lvl3 { background: color-mix(in srgb, var(--accent) 70%, var(--card)); color: #fff; }
.cal-day.lvl4 { background: var(--accent); color: #fff; }
.cal-day.today { box-shadow: 0 0 0 2.5px var(--ink); }
.cal-day.future, .cal-day.none { background: transparent; color: var(--ink3); }
.cal-day.blank { visibility: hidden; }
.legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--ink3); font-weight: 700; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sbars { padding: 18px; display: grid; gap: 14px; }
.sbar .top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 800; }
.sbar .top .e { font-size: 20px; }
.sbar .bar { height: 10px; }

/* ------------------------------------------------------------------ settings, lists */
.group { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); overflow: hidden; }
.group + .group-label { margin-top: 26px; }
.group-label { margin: 0 6px 8px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 14px 18px; min-height: 60px; }
.lrow + .lrow { border-top: 1px solid var(--line); }
.lrow .k { font-weight: 800; }
.lrow .d { font-size: 13.5px; color: var(--ink3); font-weight: 650; margin-top: 2px; }
a.lrow, button.lrow { width: 100%; border: 0; background: transparent; text-align: left; color: var(--ink); text-decoration: none; }
a.lrow:hover, button.lrow:hover { background: var(--card2); }
.lrow .ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--bg2); color: var(--ink2); flex: none; }
.avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 60%, #fff), var(--accent)); color: #fff; font-weight: 900; font-size: 19px; flex: none; }
.user-row .who { font-weight: 800; }
.invite-box { margin-top: 12px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent); }
.invite-box code { display: block; word-break: break-all; font-size: 13px; margin: 8px 0 10px; font-weight: 700; }

/* ------------------------------------------------------------------ auth */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.auth::before, .auth::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: -1; }
.auth::before { width: 380px; height: 380px; background: #5EEAD4; top: -120px; left: -100px; }
.auth::after { width: 340px; height: 340px; background: #FDE68A; bottom: -120px; right: -80px; }
:root[data-theme="dark"] .auth::before, :root[data-theme="dark"] .auth::after { opacity: .18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth::before, :root:not([data-theme="light"]) .auth::after { opacity: .18; } }
.auth-card { width: 100%; max-width: 400px; padding: 30px 26px 26px; animation: rise .5s var(--ease); }
.auth-card .logo { width: 64px; height: 64px; margin: 0 auto 14px; filter: drop-shadow(0 10px 18px rgba(13,148,136,.35)); }
.auth-card h1 { text-align: center; font-size: 28px; }
.auth-card .sub { text-align: center; color: var(--ink2); margin: 6px 0 22px; font-weight: 650; }
.auth-card form { display: grid; gap: 14px; }
.auth .lang { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; }
.error { color: var(--danger); font-weight: 750; font-size: 14px; }

/* ------------------------------------------------------------------ toast, confetti */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: #1C2333; color: #fff; font-weight: 750;
  box-shadow: var(--shadow-lg); animation: toast-in .3s var(--spring); display: flex; align-items: center; gap: 12px;
}
.toast button { border: 0; background: transparent; color: #5EEAD4; font-weight: 900; padding: 4px 6px; }
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } }
@media (min-width: 960px) { .toast { bottom: 28px; } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 120; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
