/* ==========================================================================
   Trenn: disainisüsteem
   ========================================================================== */

:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #efefeb;
  --surface-3: #e6e6e1;
  --line: #e5e5e0;
  --line-strong: #d2d2cc;
  --text: #17181a;
  --text-2: #55585e;
  --text-3: #8b8e94;
  --accent: #d9481f;
  --accent-hover: #c43f19;
  --accent-ink: #ffffff;
  --accent-soft: #fbe7de;
  --accent-text: #b83c17;
  --ok: #1d8348;
  --ok-soft: #e3f2e8;
  --warn: #a86410;
  --warn-soft: #fdf1dc;
  --danger: #c42b1c;
  --pr: #a8690b;
  --body-fill: #ebebe7;
  --body-line: #cfcfc9;
  --muscle: #d6d6d0;
  --muscle-hover: #c2c2bb;
  --muscle-sec: #f2b9a3;
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, .05);
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 4px 16px rgba(20, 20, 20, .06);
  --shadow-lg: 0 8px 40px rgba(20, 20, 20, .18);
  --r: 12px;
  --r-sm: 8px;
  --r-md: 10px;
  --topbar-h: 52px;
  --tabbar-h: 58px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #111214;
  --surface: #191a1d;
  --surface-2: #222327;
  --surface-3: #2b2c31;
  --line: #26272b;
  --line-strong: #36383d;
  --text: #ececea;
  --text-2: #a9abb0;
  --text-3: #75787e;
  --accent: #f2643a;
  --accent-hover: #ff7650;
  --accent-ink: #ffffff;
  --accent-soft: #3a2018;
  --accent-text: #ff8a63;
  --ok: #3fb56f;
  --ok-soft: #173023;
  --warn: #e0a43a;
  --warn-soft: #33270f;
  --danger: #ef5d4d;
  --pr: #e0a43a;
  --body-fill: #26272b;
  --body-line: #45474d;
  --muscle: #44464c;
  --muscle-hover: #585a61;
  --muscle-sec: #7a3a24;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Alus ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.has-sheet { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { justify-content: center; }
.ico { flex: none; }
.ico.muted { color: var(--text-3); }

/* ---------- Kest ---------- */

.app { min-height: 100vh; min-height: 100dvh; }
.app.is-booting .main, .app.is-booting .tabbar { visibility: hidden; }
.sidebar { display: none; }

.main { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.app.has-wbar .main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }
.app.is-bare .main, .app.is-focus .main { padding-bottom: calc(var(--safe-b) + 24px); }
.app.is-focus .main { padding-bottom: calc(var(--safe-b) + 120px); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px;
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) 8px 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar.has-back { padding-left: 4px; }
.topbar-left { display: flex; }
.topbar-title { font-size: 17px; font-weight: 650; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.topbar-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.app.is-bare .topbar { display: none; }
.save-state { margin-right: 4px; white-space: nowrap; }

.view { padding: 16px; max-width: 760px; margin: 0 auto; outline: none; }
.page { display: flex; flex-direction: column; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > .stats { margin: 0; }

.netbar { background: var(--warn-soft); color: var(--warn); font-size: 13px; text-align: center; padding: 7px 16px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar .nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 550; color: var(--text-3); }
.tabbar .nav-item.active { color: var(--accent-text); }
.app.is-bare .tabbar, .app.is-focus .tabbar { display: none; }

.wbar {
  position: fixed; z-index: 29; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px;
  background: var(--text); color: var(--bg); border-radius: var(--r); box-shadow: var(--shadow-lg);
}
.wbar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.wbar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; }
.wbar-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wbar-main span { opacity: .75; font-variant-numeric: tabular-nums; }
.wbar-rest { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wbar-go { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; opacity: .85; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: url(../img/icon.svg) center/cover; flex: none; }
.brand-mark.lg { width: 44px; height: 44px; border-radius: 11px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 14px; flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 19px; }

/* Lai ekraan: külgmenüü */
@media (min-width: 960px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 20px;
    position: fixed; top: 0; bottom: 0; left: 0; width: 232px; padding: 22px 14px;
    background: var(--surface); border-right: 1px solid var(--line); z-index: 25;
  }
  .brand { padding: 0 8px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .side-nav .nav-item { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 550; }
  .side-nav .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .side-nav .nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
  .side-sep { flex: 1; }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-weight: 550; font-size: 14px; }
  .main { margin-left: 232px; padding-bottom: 48px; }
  .app.has-wbar .main { padding-bottom: 96px; }
  .tabbar { display: none; }
  .app.is-bare .sidebar { display: none; }
  .app.is-bare .main { margin-left: 0; }
  .wbar { left: auto; right: 24px; bottom: 24px; width: 380px; }
  .only-mobile { display: none !important; }
  .topbar { padding-left: 24px; }
  .view { padding: 24px; }
}

/* ---------- Kaardid ja read ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); }
a.card { display: block; }
.card-row, a.card.card-row { display: flex; align-items: center; gap: 12px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head .card-title { margin: 0; }
.card-title { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-title.lg { font-size: 20px; }
.sub-title { font-size: 14px; margin: 16px 0 6px; }
.eyebrow { font-size: 13px; color: var(--text-2); font-weight: 550; margin-bottom: 2px; }
.link { color: var(--accent-text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent-text); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.display { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.display.sm { font-size: 21px; }
.notice { background: var(--surface-2); box-shadow: none; }

.rows { list-style: none; }
.rows > li { border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; }
li.row { cursor: default; }
.row-val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.row-val small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.row-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.row-ico.pr { color: var(--pr); }
.row-date { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.row-date b { font-size: 18px; }
.row-date small { font-size: 11px; color: var(--text-2); }
.card-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; }

.tag-pr { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; color: var(--pr); white-space: nowrap; vertical-align: middle; }

/* ---------- Nupud ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, transform .08s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn-lg { height: 52px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn.grow { flex: 1; }
.btn-col { display: flex; flex-direction: column; gap: 8px; }
.btn-col .btn { justify-content: flex-start; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--text); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .3; }

/* ---------- Vormid ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field input, .field select, .field textarea, .input, .inline-form input, select {
  width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea, .field textarea, textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; line-height: 1.4; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8e94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .inline-form input:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.has-error input { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 500; }
.form-msg:empty { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-unit { position: relative; }
.input-unit input { padding-right: 42px; }
.input-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 14px; pointer-events: none; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form .input-unit { flex: 1; }

.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }

/* Segmentnupud */
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg-full { display: flex; width: 100%; }
.seg-full > * { flex: 1; }
.seg button, .seg a, .seg label > span {
  display: flex; align-items: center; justify-content: center; height: 34px; padding: 0 12px; border-radius: 8px;
  border: 0; background: transparent; font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer; white-space: nowrap; text-align: center;
}
.seg label { display: flex; cursor: pointer; }
.seg label > span { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .is-on, .seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-sm button { height: 28px; padding: 0 10px; font-size: 13px; }
.tabs { margin-bottom: 4px; }

/* Kiibid */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 14px; font-weight: 550; color: var(--text); cursor: pointer; white-space: nowrap;
}
.chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-snap-type: x proximity; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { scroll-snap-align: center; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { width: 80px !important; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.stepper-btn { width: 46px; height: 46px; border-radius: var(--r-md); border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.stepper-unit { color: var(--text-2); font-size: 14px; }

/* ---------- Leht (sheet) ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 12, .42); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; background: var(--surface); border-radius: 16px 16px 0 0;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-wrap.is-full .sheet { height: 92vh; height: 92dvh; }
.sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 16px 8px 10px 16px; touch-action: none; flex: none; }
.sheet-grab { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
.sheet-title { flex: 1; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 20px; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn-danger-ghost { flex: 0 0 auto; }
.is-dialog .sheet-body { padding-bottom: 8px; }
.dialog-text { color: var(--text-2); }
.is-menu .sheet-body { padding-bottom: calc(16px + var(--safe-b)); }

.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 12px; border: 0; background: transparent; border-radius: var(--r-md); text-align: left; cursor: pointer; font-size: 16px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ico { color: var(--text-2); }
.menu-item.is-danger, .menu-item.is-danger .ico { color: var(--danger); }
.pick-plan { margin-bottom: 14px; }
.pick-plan h4 { font-size: 14px; margin: 6px 0 4px; }
.tpl { align-items: flex-start; }
.tpl-days { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--text-3); }

@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; max-height: 86vh; border-radius: 16px;
    transform: translate(-50%, -46%); opacity: 0; transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .18s;
  }
  .sheet-wrap.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-wrap.is-full .sheet { width: 720px; height: 86vh; }
  .is-dialog .sheet { width: 420px; }
  .sheet-grab { display: none; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 200;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 12px 16px;
  background: #1d1e21; color: #fff; border-radius: var(--r-md); font-size: 14px; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast.error { background: #8f1f14; }
.toast-action { background: none; border: 0; color: #ffb59c; font-weight: 700; cursor: pointer; padding: 0; }
.app.is-focus ~ .toast, .app.is-bare ~ .toast { bottom: calc(var(--safe-b) + 24px); }
@media (min-width: 960px) { .toast { bottom: 24px; } }

/* Tühi olek ja laadimine */
.empty { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ico { width: 60px; height: 60px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; margin-bottom: 4px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--text-2); max-width: 340px; }
.empty .btn, .empty .btn-row { margin-top: 10px; }
.loading { display: grid; place-items: center; padding: 48px 0; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pisipildid ja harjutuse animatsioon ---------- */

.thumb { flex: none; display: block; overflow: hidden; border-radius: 7px; background: #fff; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-sm { width: 46px; height: 32px; border-radius: 6px; }
.thumb-md { width: 60px; height: 40px; }
.thumb-body { background: var(--surface-2); padding: 2px; }
[data-theme="dark"] .thumb img, [data-theme="dark"] .ex-anim img { filter: brightness(.9); }

.ex-anim { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--r); background: #fff; }
.ex-anim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-anim-b { animation: exflip 2.6s ease-in-out infinite; }
@keyframes exflip { 0%, 36% { opacity: 0; } 50%, 86% { opacity: 1; } 100% { opacity: 0; } }
.ex-anim-empty { display: grid; place-items: center; background: var(--surface-2); padding: 12px; }
.ex-anim-sm { width: 96px; border-radius: 8px; flex: none; }
.ex-anim-sheet { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .ex-anim-b { animation: none; opacity: 0; } }

/* ---------- Kehakaart ---------- */

.bm-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 420px; margin: 0 auto; }
.bm { width: 100%; height: auto; max-height: 300px; }
.bm-outline { fill: var(--body-fill); stroke: var(--body-line); stroke-width: 2; }
.bm-part path { fill: var(--body-fill); }
.bm-m path { fill: var(--muscle); transition: fill .15s; }
.bm-interactive .bm-m { cursor: pointer; outline: none; }
.bm-interactive .bm-m:hover path, .bm-interactive .bm-m:focus-visible path { fill: var(--muscle-hover); }
.bm-m.is-sec path { fill: var(--muscle-sec); }
.bm-m.is-pri path, .bm-m.is-sel path, .bm-interactive .bm-m.is-sel:hover path { fill: var(--accent); }
.bm-m.is-heat path { fill: color-mix(in srgb, var(--accent) var(--hp), var(--muscle)); }
.bm-thumb { display: grid; grid-template-columns: 1fr 1fr; height: 100%; align-items: center; }
.bm-thumb .bm { max-height: 100%; }
.bm-thumb.is-large { width: 70%; max-width: 280px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--text-2); justify-content: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-pri { background: var(--accent); }
.sw-sec { background: var(--muscle-sec); }

/* ---------- Harjutuste sirvija ---------- */

.exb { display: flex; flex-direction: column; gap: 10px; }
.exb-top { display: flex; gap: 8px; position: sticky; top: calc(var(--topbar-h) + var(--safe-t)); z-index: 5; background: var(--bg); padding: 4px 0 6px; margin-top: -4px; }
.is-pick .exb-top { top: 0; background: var(--surface); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-strong); color: var(--text-3); }
.is-pick .search { background: var(--surface-2); border-color: transparent; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--text); height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }
.search-x { border: 0; background: var(--surface-3); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.btn-filter { position: relative; }
.btn-filter .badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.exb-map { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; }
.is-pick .exb-map { border: 0; background: var(--surface-2); }
.exb-map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.exb-map-label { font-weight: 650; font-size: 15px; color: var(--text-2); }
.exb-map-label.is-set { color: var(--accent-text); }
.exb-map.is-hidden .exb-bodies { display: none; }
.exb-map.is-hidden .exb-map-head { margin: 0; }
.exb-bodies .bm { max-height: 260px; }
.exb-meta { padding: 0 2px; min-height: 18px; }
.exb-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px; }
.is-pick .exb-list { border: 0; padding: 0; }
.exb-list:empty { display: none; }
.exb-foot { text-align: center; padding: 8px; }
.ex-row { cursor: pointer; }
.ex-name { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.pick-box { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; transition: all .15s; }
.is-picked .pick-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.is-picked .ex-name { color: var(--accent-text); }
.ex-info { color: var(--text-3); width: 34px; height: 34px; }
.filter-group { margin-bottom: 16px; }
.filter-group h4 { font-size: 14px; margin-bottom: 8px; color: var(--text-2); }

/* Harjutuse detail */
.ex-detail .ex-hero { margin: -16px -16px 0; }
.ex-detail .ex-anim-hero { border-radius: 0; }
@media (min-width: 600px) { .ex-detail .ex-hero { margin: 0; } .ex-detail .ex-anim-hero { border-radius: var(--r); } }
.ex-head { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.ex-meta { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.steps { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.steps li::marker { color: var(--text-3); font-weight: 650; }
.ex-muscles .bm { max-height: 240px; }
.set-line { white-space: normal; font-variant-numeric: tabular-nums; }

/* Statistika */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 12px 0; }
.stats-3 { margin: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--surface-2); border-radius: var(--r-md); min-width: 0; }
.stats-3 .stat { background: var(--surface); border: 1px solid var(--line); }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 550; }
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; color: var(--text-3); }
.hero-num { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hero-num small { font-size: 17px; font-weight: 600; color: var(--text-2); margin-left: 4px; }

/* ---------- Graafikud ---------- */

.chart-box { position: relative; margin-top: 12px; min-height: 40px; touch-action: pan-y; }
.chart-box.is-empty { min-height: 0; }
.chart-svg { width: 100%; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--accent); opacity: .1; }
.chart-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-hot { pointer-events: none; transition: opacity .1s; }
.chart-cross { stroke: var(--line-strong); stroke-width: 1; pointer-events: none; }
.chart-end { fill: var(--text); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--surface-3); }
.chart-bar.is-current { fill: var(--accent); }
.chart-tip {
  position: absolute; z-index: 3; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.3; white-space: nowrap;
  display: flex; flex-direction: column; opacity: 0; transition: opacity .12s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-size: 13px; }
.chart-tip span { opacity: .75; }
.chart-cap { margin-top: 6px; }

/* ---------- Avaleht ---------- */

.today-head { padding: 4px 2px 4px; }
.live-card { border-color: var(--accent); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.today-card.is-done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.today-card.is-done .eyebrow { color: var(--ok); }
.mini-list { list-style: none; margin: 10px 0 0; }
.mini-list a { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.mini-list .more { padding: 6px 0 0 56px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wd { font-size: 12px; color: var(--text-3); font-weight: 600; }
.wd-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.week-day.is-planned .wd-dot { box-shadow: inset 0 0 0 2px var(--line-strong); background: transparent; }
.week-day.is-done .wd-dot { background: var(--accent); color: #fff; box-shadow: none; }
.week-day.is-today .wd { color: var(--text); }
.week-day.is-today:not(.is-done) .wd-dot { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-text); background: transparent; }
.week-day.is-future:not(.is-planned) .wd-dot { background: transparent; color: var(--text-3); }
.week-sum { margin-top: 12px; }
.reminder-head { display: flex; gap: 12px; align-items: flex-start; }
.reminder-head .card-title { margin-bottom: 2px; }
.reminder > .ico, .reminder-head > .ico { color: var(--text-2); margin-top: 2px; }

/* ---------- Kavad ---------- */

.plan-card.is-active { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.plan-card .eyebrow { color: var(--accent-text); }
.plan-days { list-style: none; display: flex; flex-direction: column; }
.plan-days li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.pd-wd { width: 54px; flex: none; font-size: 13px; font-weight: 650; color: var(--text-2); padding-top: 1px; }
.title-input { width: 100%; border: 0; background: transparent; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; padding: 2px 0; outline: none; border-bottom: 2px solid transparent; }
.title-input:focus { border-bottom-color: var(--accent); }
.day-head { display: flex; align-items: center; gap: 6px; margin: -4px -6px 10px 0; }
.day-name { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 18px; font-weight: 650; padding: 6px 0; outline: none; border-bottom: 2px solid transparent; }
.day-name:focus { border-bottom-color: var(--accent); }
.wd-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.wd-btn { height: 36px; border-radius: var(--r-sm); border: 0; background: var(--surface-2); font-weight: 650; font-size: 14px; color: var(--text-2); cursor: pointer; }
.wd-btn.is-on { background: var(--accent); color: #fff; }
.day-items { margin-top: 4px; }
.sort-item { background: var(--surface); position: relative; transition: transform .15s; }
.sort-item.dragging { z-index: 3; transition: none; box-shadow: var(--shadow-lg); border-radius: var(--r-sm); }
.drag { width: 28px; height: 40px; display: grid; place-items: center; color: var(--text-3); cursor: grab; touch-action: none; margin-left: -6px; flex: none; }
.day-empty { padding: 10px 0 0; }
.item-ex { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-md); margin-bottom: 14px; }
.item-ex .muted { flex: 1; }

/* ---------- Trenn ---------- */

.w-stats { display: flex; gap: 16px; align-items: center; font-size: 14px; color: var(--text-2); padding: 0 2px; font-variant-numeric: tabular-nums; }
.w-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.w-stats b { color: var(--text); }
.w-list { display: flex; flex-direction: column; gap: 12px; }
.w-empty { text-align: center; padding: 24px 0; }
.wx { padding: 12px 12px 8px; transition: border-color .2s; }
.wx.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wx-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.wx-media { padding: 0; border: 0; background: none; cursor: pointer; flex: none; }
.wx-title h3 { font-size: 16px; line-height: 1.25; }
.wx-ok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; }
.wx.is-done .wx-head h3 { color: var(--text-2); }
.wx-prev { margin: 0 0 6px; }
.wx-note { display: flex; gap: 6px; align-items: center; color: var(--text-2); margin-bottom: 6px; }
.sets { display: flex; flex-direction: column; gap: 4px; }
.set { display: grid; grid-template-columns: 34px minmax(0, 1fr) 76px 66px 44px; gap: 6px; align-items: center; padding: 3px 4px; border-radius: var(--r-sm); transition: background .15s; }
.set-head { font-size: 12px; color: var(--text-3); font-weight: 600; padding-bottom: 0; }
.set-head span { text-align: center; }
.set-head span:nth-child(2) { text-align: left; }
.set-no { width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--surface-2); font-weight: 700; font-size: 14px; cursor: pointer; justify-self: center; }
.set.is-warm .set-no { color: var(--warn); background: var(--warn-soft); }
.set-prev { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.set-in { width: 100%; height: 40px; border: 1px solid transparent; border-radius: var(--r-sm); background: var(--surface-2); text-align: center; font-size: 17px; font-weight: 650; outline: none; font-variant-numeric: tabular-nums; padding: 0 4px; }
.set-in::placeholder { color: var(--text-3); font-weight: 500; opacity: 1; }
.set-in:focus { border-color: var(--accent); background: var(--surface); }
.set-check { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line-strong); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; justify-self: center; transition: all .12s; }
.set.is-done { background: var(--ok-soft); }
.set.is-done .set-in { background: transparent; }
.set.is-done .set-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.sets-time .set { grid-template-columns: 34px minmax(0, 1fr) 0 90px 44px; }
.add-set { margin: 6px 0 2px 4px; }
.w-notes { margin-top: 4px; }

.rest-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 28; background: var(--surface);
  border-top: 1px solid var(--line); padding: 0 16px calc(10px + var(--safe-b)); box-shadow: var(--shadow-lg);
  transform: translateY(110%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.rest-panel.show { transform: translateY(0); }
.rest-bar { height: 3px; margin: 0 -16px 10px; background: var(--surface-2); overflow: hidden; }
.rest-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform .5s linear; }
.rest-row { display: flex; align-items: center; gap: 8px; max-width: 728px; margin: 0 auto; }
.rest-time { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.rest-time small { font-size: 12px; color: var(--text-2); }
.rest-time b { font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
@media (min-width: 960px) { .rest-panel { left: 232px; } }

.finish { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.finish-check { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin-top: 4px; }
.finish h3 { font-size: 20px; }
.finish .stats { width: 100%; }
.finish-prs { width: 100%; text-align: left; }
.finish-prs h4 { display: flex; align-items: center; gap: 6px; color: var(--pr); margin-bottom: 4px; }

/* Ajalugu */
.hx-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hx-sets { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.hx-sets li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.hx-sets li.is-skipped { color: var(--text-3); }
.hx-no { width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.is-warm .hx-no { color: var(--warn); background: var(--warn-soft); }
.w-note { margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-md); white-space: pre-wrap; }

/* Progress */
.heat-legend { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--text-2); margin: 10px 0 12px; }
.heat-legend i { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, var(--muscle)), var(--accent)); }
.heat-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.heat-list li { display: grid; grid-template-columns: 120px 1fr 36px; gap: 10px; align-items: center; font-size: 14px; }
.heat-list b { text-align: right; font-variant-numeric: tabular-nums; }
.heat-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.heat-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.hint-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-md); }
.hint-line .ico { margin-top: 1px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -6px 8px; }
.cal-head h3 { font-size: 17px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--text-3); font-weight: 600; padding-bottom: 4px; }
.cal-cell { aspect-ratio: 1; max-height: 46px; display: grid; place-items: center; border-radius: var(--r-sm); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.cal-cell.has-w { background: var(--accent); color: #fff; font-weight: 700; }
.cal-cell.is-today:not(.has-w) { box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); font-weight: 700; }

/* Keha */
.measures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.measure { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 0; cursor: pointer; text-align: left; }
.measure span { font-size: 12px; color: var(--text-2); font-weight: 550; }
.measure b { font-size: 18px; font-variant-numeric: tabular-nums; }
.measure small { font-size: 12px; color: var(--text-3); }
.measure.is-on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.delta { font-weight: 600; color: var(--text); }
.rem-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rem-row select { width: auto; min-width: 150px; height: 40px; font-size: 15px; }
.reminders p { margin-top: 12px; }
.reminders .btn-row { margin-top: 8px; }
.measures-form summary { cursor: pointer; font-weight: 650; padding: 6px 0 10px; }
.measures-form .grid-2 { margin-bottom: 4px; }
.measures.measures-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .measures.measures-4 { grid-template-columns: repeat(4, 1fr); } }
.measure small.cls { color: var(--text-2); font-weight: 550; }
.comp-note { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.hero-metric .hero-num small { margin-left: 3px; }
.metric-back { margin-left: 6px; }

/* Mõõtude kehajoonis */
.mm { position: relative; width: 100%; max-width: 460px; margin: 0 auto; aspect-ratio: 1450 / 1320; }
.mm-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; }
.mm-line { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mm-tape.is-empty .mm-line { stroke: var(--text-3); stroke-dasharray: 3 4; }
.mm-tape.is-on .mm-line { stroke: var(--accent); stroke-width: 4; stroke-dasharray: none; }
.mm-lead { fill: none; stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mm-tape.is-on .mm-lead { stroke: var(--accent); }
.mm-dim line { stroke: var(--text-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mm-dim.is-on line { stroke: var(--accent); stroke-width: 2; }
.mm-svg .mm-hit { stroke: transparent; stroke-width: 22; pointer-events: stroke; cursor: pointer; }
.mm-label {
  position: absolute; transform: translateY(-50%); max-width: 24.5%; display: flex; flex-direction: column; gap: 1px;
  padding: 4px 7px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; line-height: 1.15;
}
.mm-l { align-items: flex-end; text-align: right; }
.mm-r { align-items: flex-start; text-align: left; }
.mm-name { font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.mm-v { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.mm-v b { font-size: 15px; font-variant-numeric: tabular-nums; }
.mm-v small { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mm-label.is-empty b, .mm-label.is-prev b { color: var(--text-3); font-weight: 500; }
.mm-label:hover { background: var(--surface-2); }
.mm-label.is-on { background: var(--accent-soft); }
.mm-label.is-on .mm-name { color: var(--accent-text); }
.mm-label:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mm-hint { text-align: center; margin-top: 4px; }

/* Mõõdu sisestus joonise all */
.mm-editor { background: var(--surface-2); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mm-field { display: none; }
.mm-field.is-active { display: flex; flex-direction: column; gap: 10px; }
.mm-field .hint { font-weight: 500; text-align: right; }
.mm-section .card-head { margin-bottom: 4px; }
.mm-field .field > span:first-child { display: flex; justify-content: space-between; gap: 8px; }
.mm-field .field input { background: var(--surface); }
.mm-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mm-nav .btn { min-width: 96px; }
.mm-result { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.mm-result:empty { display: none; }
.mm-result b { font-variant-numeric: tabular-nums; }
.mm-editor .btn-secondary { background: var(--surface); }
.mm-editor .btn-secondary:disabled { opacity: .45; }
.mm-editor .seg { background: var(--surface); }
.mm-editor .seg .is-on { background: var(--accent); color: #fff; box-shadow: none; }

/* Kuupäevavalija */
.dp { position: relative; }
.dp-btn {
  width: 100%; height: 46px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  font-size: 16px; cursor: pointer; font-variant-numeric: tabular-nums; text-align: left;
}
.dp-btn svg { color: var(--text-3); flex: none; }
.dp-val.is-empty { color: var(--text-3); }
.dp.is-open .dp-btn, .dp-btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.dp.has-error .dp-btn { border-color: var(--danger); }
.dp-pop {
  position: absolute; top: calc(100% + 6px); z-index: 40; width: 300px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { border: 0; background: none; font-size: 16px; font-weight: 700; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.dp-title:hover { background: var(--surface-2); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 4px 0; }
.dp-day {
  height: 38px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 15px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-day:hover:not(:disabled) { background: var(--surface-2); }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.dp-day.is-sel { background: var(--accent); color: #fff; font-weight: 700; box-shadow: none; }
.dp-day:disabled { color: var(--text-3); opacity: .45; cursor: default; }
.dp-day:focus-visible, .dp-month:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-month { height: 44px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 15px; cursor: pointer; }
.dp-month.is-sel { background: var(--accent); color: #fff; font-weight: 700; }
.dp-month:disabled { opacity: .4; cursor: default; }
.dp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Seaded */
.profile { display: flex; align-items: center; gap: 12px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row select { width: auto; min-width: 120px; height: 40px; font-size: 15px; }
.set-row small { font-size: 12px; }

/* Sisselogimine */
.auth { min-height: calc(100vh - 48px); min-height: calc(100dvh - 48px); display: grid; place-items: center; padding: calc(24px + var(--safe-t)) 0 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 10px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 750; margin-bottom: 18px; }
.auth h1 { font-size: 26px; letter-spacing: -0.02em; }
.auth .form { margin-top: 14px; }
.auth-switch { text-align: center; color: var(--text-2); margin-top: 10px; }
.auth-switch a { color: var(--accent-text); font-weight: 650; }

@media (max-width: 380px) {
  .set { grid-template-columns: 30px minmax(0, 1fr) 68px 58px 42px; gap: 4px; }
  .measures { grid-template-columns: repeat(2, 1fr); }
  .heat-list li { grid-template-columns: 104px 1fr 32px; }
}

@media (hover: hover) {
  a.card:hover, .ex-row:hover { border-color: var(--line-strong); }
  .exb-list .ex-row:hover .ex-name { color: var(--accent-text); }
}
