/* Fitness: native-iOS look. System fonts, system light/dark, inset grouped lists. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --r-train: #ff375f; --r-habits: #30d158; --r-meals: #64d2ff;
  --bg: #f2f2f7; --card: #fff; --raised: #fff; --sheet-bg: #f2f2f7; --sheet: rgba(249, 249, 249, .94);
  --sep: #c6c6c8; --label: #000; --sec: rgba(60, 60, 67, .6); --tert: rgba(60, 60, 67, .3);
  --fill: rgba(120, 120, 128, .12); --track: rgba(120, 120, 128, .2); --sw-off: rgba(120, 120, 128, .16);
  --seg-on: #fff; --bar: rgba(249, 249, 249, .8);
  --tint: #007aff; --orange: #ff9500; --red: #ff3b30; --green: #248a3d;
  --c-s: #af52de; --c-b: #32ade6; --c-c: #34c759; --c-w: #ffcc00;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --side: 0px; --nav: 44px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --card: #1c1c1e; --raised: #2c2c2e; --sheet-bg: #1c1c1e; --sheet: rgba(44, 44, 46, .94);
    --sep: #38383a; --label: #fff; --sec: rgba(235, 235, 245, .6); --tert: rgba(235, 235, 245, .3);
    --fill: rgba(120, 120, 128, .24); --track: rgba(120, 120, 128, .36); --sw-off: rgba(120, 120, 128, .32);
    --seg-on: #636366; --bar: rgba(29, 29, 31, .78);
    --tint: #0a84ff; --orange: #ff9f0a; --red: #ff453a; --green: #30d158;
    --c-s: #bf5af2; --c-b: #64d2ff; --c-c: #30d158; --c-w: #ffd60a;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation;
  max-width: 100%; overflow-x: clip; overscroll-behavior-x: none; background: var(--bg);
  -webkit-tap-highlight-color: transparent; scrollbar-gutter: stable;
}
body {
  margin: 0; max-width: 100%; min-height: 100dvh; overflow-x: clip; overscroll-behavior-x: none;
  background: var(--bg); color: var(--label); font: 17px/1.3 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
button, input, select, textarea, label, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, select, textarea { font: inherit; font-size: 17px; color: var(--label); background: none; border: 0; margin: 0; min-width: 0; -webkit-appearance: none; appearance: none; border-radius: 0; }
input::placeholder, textarea::placeholder { color: var(--tert); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; }
a { color: inherit; text-decoration: none; -webkit-touch-callout: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 6px; }
.group :focus-visible, .tile :focus-visible { outline-offset: -2px; }
.chev { width: 8px; height: 14px; flex: none; color: var(--tert); }
#view:focus { outline: none; }

/* ---------- shell ---------- */
#view {
  margin-left: var(--side); min-width: 0; container-type: inline-size;
  padding: calc(var(--nav) + var(--safe-t)) max(16px, var(--safe-r)) calc(49px + var(--safe-b) + 28px) max(16px, var(--safe-l));
}
body.bare #view { padding-bottom: calc(24px + var(--safe-b)); }
#navbar {
  position: fixed; z-index: 20; top: 0; left: var(--side); right: 0; height: calc(var(--nav) + var(--safe-t));
  padding: var(--safe-t) max(8px, var(--safe-r)) 0 max(8px, var(--safe-l));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: transparent; border-bottom: .5px solid transparent;
  transition: background-color .2s, border-color .2s;
}
#navbar.scrolled { background: var(--bar); border-bottom-color: var(--sep); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.nb-t { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .18s; white-space: nowrap; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
#navbar.show-title .nb-t { opacity: 1; }
.nb-l { justify-self: start; display: flex; } .nb-r { justify-self: end; display: flex; }
.nb-btn { min-width: 44px; height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--tint); font-size: 17px; border-radius: 10px; }
.nb-btn.strong { font-weight: 600; } .nb-btn:active { opacity: .45; }
.nb-btn:disabled { color: var(--tert); }
body.bare #navbar, body.bare #tabs { display: none; }
body.bare { --side: 0px; }

#tabs {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, var(--safe-r)) calc(4px + var(--safe-b)) max(8px, var(--safe-l));
  background: var(--bar); border-top: .5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.tb-brand { display: none; }
.tb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; color: var(--sec); font-size: 10px; font-weight: 500; letter-spacing: .01em; -webkit-user-select: none; user-select: none; }
.tb svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tb[aria-current] { color: var(--tint); }
.tb[aria-current] svg { stroke-width: 2.1; }
@media (min-width: 768px) {
  :root { --side: 84px; }
  #view { padding-bottom: calc(var(--safe-b) + 32px); padding-left: max(24px, var(--safe-l)); padding-right: max(24px, var(--safe-r)); }
  #tabs { top: 0; right: auto; width: var(--side); grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 4px; padding: calc(14px + var(--safe-t)) 10px 12px max(10px, var(--safe-l)); border-top: 0; border-right: .5px solid var(--sep); }
  .tb-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 16px; font-size: 11px; font-weight: 700; }
  .tb-brand span { display: none; }
  .tb { border-radius: 10px; padding: 8px 0 6px; }
  .tb[aria-current] { background: color-mix(in srgb, var(--tint) 15%, transparent); }
  .tb:hover:not([aria-current]) { background: var(--fill); }
}
@media (min-width: 1100px) {
  :root { --side: 224px; }
  .tb-brand { flex-direction: row; gap: 10px; padding: 0 12px; margin-bottom: 14px; font-size: 20px; letter-spacing: .01em; }
  .tb-brand span { display: inline; }
  .tb { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; min-height: 44px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
  .tb svg { width: 24px; height: 24px; }
}

/* ---------- toast (iOS banner) ---------- */
.toast {
  position: fixed; z-index: 1000; top: calc(var(--safe-t) + 8px); left: 50%; width: min(calc(100vw - 24px), 420px);
  transform: translate(-50%, -160%); display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--sheet); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-radius: 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, .28), 0 0 0 .5px var(--sep); font-size: 15px; line-height: 1.3;
  pointer-events: none; opacity: 0; visibility: hidden; transition: transform .5s cubic-bezier(.2, 1.15, .3, 1), opacity .2s, visibility 0s .5s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition-delay: 0s; }
.tdot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--red); }
.toast.ok .tdot { background: var(--r-habits); }

/* ---------- large title ---------- */
.lt { padding: 6px 4px 14px; }
.lt .kick { font-size: 13px; font-weight: 600; color: var(--sec); margin-bottom: 2px; }
.lt h1 { font: 700 34px/1.1 var(--font); letter-spacing: .37px; text-wrap: balance; }
.lt-sub { margin-top: 5px; color: var(--sec); font-size: 15px; }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--ph, var(--tint)); }

/* ---------- grouped lists ---------- */
.group { background: var(--card); border-radius: 12px; overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top; }
.gh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; margin-bottom: 7px; font: 700 20px/1.2 var(--font); letter-spacing: .2px; color: var(--c, var(--label)); }
.gh-r { font: 400 13px var(--font); letter-spacing: 0; color: var(--sec); text-align: right; }
.gf { margin: 7px 0 0; padding: 0 16px; font-size: 13px; line-height: 1.35; color: var(--sec); }
.gf:empty { display: none; }
.gf.bad { color: var(--red); } .gf.warn { color: var(--orange); } .gf.ok { color: var(--green); }
.sec { margin: 0 0 24px; break-inside: avoid; }
.add-row { width: 100%; text-align: left; color: var(--tint); gap: 10px; }
.add-row svg { flex: none; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 0 20px; border-radius: 14px; font-size: 17px; font-weight: 600; }
.btn-tint { background: var(--tint); color: #fff; margin-top: 14px; }
.btn:active { opacity: .75; } .btn:disabled { opacity: .45; }
.act { width: 100%; justify-content: center; color: var(--tint); } .act.dest { color: var(--red); } .act:disabled { opacity: .5; }
.act:active, .add-row:active, .day:active, .it-menu:active { background: var(--fill); }
.lf { justify-content: space-between; cursor: text; }
.lf > span:first-child { flex: none; }
.lf input[type=text], .lf input[type=email], .lf input[type=password], .lf input[type=time] { flex: 1; text-align: right; width: 100%; padding: 10px 0; }
.lf input[type=date], .lf input[type=time] { flex: none; width: auto; color: var(--label); min-height: 34px; }
.lf .sel { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 8px; }
.lf select { text-align: right; text-align-last: right; padding: 10px 0; color: var(--sec); max-width: 100%; }
.lf .val { display: flex; flex: 1; align-items: baseline; justify-content: flex-end; gap: 6px; }
.lf .val input { text-align: right; width: 100%; padding: 10px 0; }
.unit { color: var(--sec); font-style: normal; min-width: 0; }
.row:focus-within { background: color-mix(in srgb, var(--tint) 7%, transparent); }
.fs-err { margin: 8px 4px 0; color: var(--red); font-size: 13px; }
.fs-err[hidden] { display: none; }

/* switch + segmented */
.sw-row { justify-content: space-between; padding-block: 6px; cursor: pointer; }
.ios-sw { position: relative; flex: none; width: 51px; height: 31px; border-radius: 99px; background: var(--sw-off); cursor: pointer; transition: background-color .25s; }
.ios-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .3s cubic-bezier(.3, 1.3, .5, 1); }
.ios-sw:checked { background: var(--r-habits); } .ios-sw:checked::after { transform: translateX(20px); }
.ios-sw:focus-visible { outline: 2px solid var(--tint); outline-offset: 3px; border-radius: 99px; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 9px; background: var(--fill); -webkit-user-select: none; user-select: none; }
.seg label { position: relative; display: grid; place-items: center; min-width: 38px; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .2s, box-shadow .2s; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--seg-on); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--tint); outline-offset: 1px; }

/* ---------- Today ---------- */
.hero { display: grid; gap: 12px; margin-bottom: 8px; }
.ringcard { padding: 16px; }
.ringrow { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 20px; align-items: center; }
.rings { display: block; width: 124px; height: 124px; }
.rg { transition: stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.rg-total { font: 700 21px var(--round); fill: var(--label); }
.legend { display: grid; gap: 11px; }
.lg { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.lg i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.lg span { font-weight: 600; font-size: 16px; color: var(--c); }
.lg b { font: 700 24px/1 var(--round); }
.lg b small { font: 600 14px var(--round); color: var(--sec); margin-left: 1px; }
.done-msg { padding: 16px; color: var(--sec); }
.body { columns: 1; column-gap: 22px; }
.it { display: grid; grid-template-columns: minmax(0, 1fr) 44px; padding: 0 0 0 16px; }
.it-main { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 44px; padding: 9px 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
.it-main input { position: absolute; left: 0; top: 0; width: 24px; height: 100%; margin: 0; opacity: 0; }
.ck { position: relative; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--tert); display: grid; place-items: center; transition: background-color .18s, border-color .18s; }
.ck::after { content: ""; width: 6.5px; height: 12px; margin-top: -2px; border: solid #fff; border-width: 0 2.5px 2.5px 0; border-radius: 1px; transform: rotate(45deg) scale(0); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.it-main input:checked + .ck { background: var(--c); border-color: var(--c); }
.it-main input:checked + .ck::after { transform: rotate(45deg) scale(1); }
.it-main input:focus-visible + .ck { outline: 2px solid var(--tint); outline-offset: 2px; }
.it-t { min-width: 0; }
.it-l { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.it-t small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--sec); }
.it-main input:checked ~ .it-t .it-l { color: var(--sec); text-decoration: line-through; text-decoration-color: var(--tert); }
.tag { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 2px 8px; margin-left: 8px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); vertical-align: 1px; white-space: nowrap; text-decoration: none; display: inline-block; }
.it-d { font: 500 15px var(--round); color: var(--sec); white-space: nowrap; text-align: right; }
.it-menu { align-self: stretch; display: grid; place-items: center; color: var(--sec); }
.kn { display: grid; gap: 4px; padding: 12px 16px 10px; align-items: stretch; }
.kn-top { display: flex; justify-content: space-between; align-items: baseline; }
.kv { font: 700 26px/1 var(--round); } .kv small { font: 500 15px var(--round); color: var(--sec); margin-left: 2px; }
.kv[data-lvl=ok] { color: var(--green); } .kv[data-lvl=warn] { color: var(--orange); } .kv[data-lvl=bad] { color: var(--red); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; margin: 0; background: transparent; --p: 0%; --lv: var(--tint); }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--lv) var(--p), var(--track) var(--p)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--lv); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16), 0 0 0 .5px rgba(0, 0, 0, .04); }
.range::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15); }
.range.unset::-webkit-slider-thumb { opacity: .75; }
.range:focus-visible { outline-offset: 2px; }
.en { justify-content: space-between; padding-block: 8px; }
.nt { padding: 2px 16px; }
.nt textarea { width: 100%; padding: 10px 0; resize: none; line-height: 1.35; display: block; }
.knee-rule { }

/* ---------- Plan ---------- */
.plan-grid { display: grid; gap: 4px; }
.road-card { padding: 12px 10px 12px; }
.road { position: relative; height: 210px; }
.road-svg { position: absolute; left: 0; right: 0; top: 20px; width: 100%; height: calc(100% - 46px); display: block; overflow: visible; }
.cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(31, minmax(0, 1fr)); }
.col { display: flex; flex-direction: column; justify-content: space-between; align-items: center; min-width: 0; border-radius: 7px; transition: background-color .15s; }
.col.sel { background: var(--fill); }
.col:focus-visible { outline-offset: -1px; }
.mk { display: grid; place-items: center; height: 16px; color: var(--label); }
.wn { display: grid; place-items: center; height: 22px; font-size: 10px; font-weight: 500; color: var(--sec); font-variant-numeric: tabular-nums; }
.wn b { font-weight: inherit; }
.col.cur .wn b { background: var(--r-train); color: #fff; font-weight: 700; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; }
.road-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 6px 0; font-size: 12px; color: var(--sec); }
.road-legend span { display: inline-flex; align-items: center; gap: 5px; }
.road-legend i { width: 8px; height: 8px; border-radius: 50%; }
.plan-week { margin-top: 14px; }
.wk-meta { margin: -2px 4px 9px; color: var(--sec); font-size: 14px; }
.day { min-height: 62px; padding: 0 14px 0 18px; gap: 12px; }
.day::after { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 3px 3px 0; background: var(--tc); }
.dd { display: grid; justify-items: center; width: 34px; line-height: 1.1; }
.dd small { font-size: 11px; color: var(--sec); font-weight: 500; }
.dd b { font: 600 21px var(--round); }
.day.is-today .dd b { color: var(--r-train); }
.dt { flex: 1; min-width: 0; display: grid; }
.dt strong { font-weight: 600; font-size: 16px; line-height: 1.25; }
.dt small { color: var(--sec); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm { color: var(--sec); font-size: 14px; white-space: nowrap; }
.dring { width: 24px; height: 24px; flex: none; }

/* ---------- Progress ---------- */
.prog-grid { display: grid; gap: 22px; grid-template-areas: "tiles" "form" "charts" "list"; }
.a-tiles { grid-area: tiles; min-width: 0; } .a-form { grid-area: form; min-width: 0; } .a-charts { grid-area: charts; min-width: 0; } .a-list { grid-area: list; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; gap: 3px; align-content: start; min-height: 108px; padding: 14px; border-radius: 16px; background: var(--card); }
.tl { font-size: 13px; font-weight: 500; color: var(--sec); line-height: 1.2; }
.tile:has(.mring) .tl { padding-right: 38px; }
.tv { font: 700 32px/1.1 var(--round); letter-spacing: -.3px; }
.tv small { font: 600 15px var(--round); color: var(--sec); margin-left: 3px; letter-spacing: 0; }
.ts { font-size: 12.5px; line-height: 1.25; color: var(--sec); }
.mring { position: absolute; top: 11px; right: 11px; width: 32px; height: 32px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 24px; }
.chart-card { padding: 14px 14px 8px; }
.cc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cc-n { font-weight: 600; font-size: 15px; } .cc-s { color: var(--sec); font-size: 13px; }
.cc-v { font: 700 28px/1.15 var(--round); letter-spacing: -.3px; }
.cc-v small { font: 600 15px var(--round); color: var(--sec); margin-left: 4px; letter-spacing: 0; }
.lchart { display: block; width: 100%; height: auto; margin-top: 4px; overflow: visible; }
.gl { stroke: var(--sep); stroke-width: .6; } .ax { font: 10px var(--font); fill: var(--sec); } .lv { font: 700 12px var(--round); fill: var(--label); }
.cal-wrap { margin-bottom: 24px; }
.wide-all { grid-column: 1 / -1; }
.lt + .body { margin-top: 8px; }
.cal-card { padding: 14px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-template-columns: repeat(31, minmax(0, 1fr)); gap: 2px; }
.cal i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--fill); min-width: 0; }
.cal i.fut { background: transparent; box-shadow: inset 0 0 0 1px var(--fill); }
.cal i.now { outline: 2px solid var(--label); outline-offset: 1px; }
.mrow { gap: 10px; padding-right: 0; }
.md { flex: none; width: 74px; font-size: 14px; color: var(--sec); white-space: nowrap; }
.mt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv { font-weight: 600; white-space: nowrap; }
.mdel { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--red); opacity: .9; }

/* ---------- Settings ---------- */
.meal { align-items: flex-start; gap: 4px; padding: 6px 12px 6px 4px; }
.rm { flex: none; width: 40px; height: 44px; display: grid; place-items: center; color: var(--red); }
.mf { flex: 1; min-width: 0; display: grid; }
.mf input { width: 100%; }
.m-l { font-weight: 600; padding: 6px 0 2px; } .m-d { font-size: 14px; color: var(--sec); padding: 2px 0 6px; }
.m-d { color: var(--sec); }
.m-p { display: flex; align-items: center; gap: 3px; padding-top: 8px; color: var(--sec); }
.m-p input { width: 38px; text-align: right; color: var(--label); padding: 4px 0; }
.ovr { padding-right: 0; }
.ov-t { flex: 1; min-width: 0; display: grid; padding: 8px 0; }
.ov-t strong { font-weight: 500; overflow-wrap: anywhere; } .ov-t small { color: var(--sec); font-size: 13px; }
.set-body { }

/* ---------- Login ---------- */
.login { max-width: 400px; margin: 0 auto; min-height: calc(100dvh - 40px - var(--safe-t) - var(--safe-b)); display: grid; align-content: center; justify-items: center; text-align: center; gap: 4px; padding-top: calc(var(--safe-t) + 16px); }
.lg-mark { width: 96px; height: 96px; margin-bottom: 12px; }
.login h1 { font: 700 34px/1.1 var(--font); letter-spacing: .37px; }
.lg-form { width: 100%; margin-top: 22px; text-align: left; }

/* ---------- states ---------- */
.state { padding: 36px 20px; text-align: center; }
.st-t { font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.st-d { color: var(--sec); font-size: 15px; max-width: 42ch; margin: 0 auto; }
.state .btn { width: auto; display: inline-flex; margin-top: 16px; min-height: 44px; }
.skel-wrap { display: grid; gap: 14px; padding-top: 24px; }
.skel { height: var(--h, 80px); border-radius: 12px; background: var(--card); animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- sheets ---------- */
dialog.sheet { border: 0; padding: 0; background: transparent; color: var(--label); max-width: none; max-height: none; overflow: visible; font: inherit; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .38); }
dialog.sheet[open]::backdrop { animation: fade .25s ease-out; }
.as-list { background: var(--sheet); border-radius: 14px; overflow: hidden; -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); }
.as-title { padding: 14px 16px; text-align: center; font-size: 13px; font-weight: 600; color: var(--sec); overflow-wrap: anywhere; }
.as-b { display: block; width: 100%; min-height: 56px; padding: 0 16px; font-size: 20px; color: var(--tint); text-align: center; border-top: .5px solid var(--sep); }
.as-b:first-child { border-top: 0; } .as-title + .as-b { border-top: .5px solid var(--sep); }
.as-b.dest { color: var(--red); } .as-cancel { font-weight: 600; }
.as-b:active { background: var(--fill); }
dialog.as { inset: auto 0 0 0; margin: 0; width: 100%; }
dialog.as .sh-in { display: grid; gap: 8px; max-width: 520px; margin: 0 auto; padding: 8px max(8px, var(--safe-r)) calc(8px + var(--safe-b)) max(8px, var(--safe-l)); }
dialog.as[open] .sh-in { animation: sheetUp .42s cubic-bezier(.2, .9, .25, 1.04); }
dialog.pop { inset: auto; margin: 0; position: fixed; width: 250px; }
dialog.pop .sh-in { background: var(--sheet); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(0, 0, 0, .35), 0 0 0 .5px var(--sep); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); }
dialog.pop .as-list { background: transparent; border-radius: 0; }
dialog.pop .as-title { padding: 10px 16px; text-align: left; }
dialog.pop .as-b { min-height: 44px; font-size: 17px; text-align: left; color: var(--label); }
dialog.pop .as-b.dest { color: var(--red); }
dialog.pop::backdrop { background: transparent; }
dialog.pop[open] { animation: popIn .22s cubic-bezier(.2, 1.2, .4, 1); transform-origin: 90% 0; }
dialog.fs { inset: calc(var(--safe-t) + 10px) 0 auto 0; margin: 0 auto; width: min(calc(100% - 20px), 520px); height: auto; }
dialog.fs .sh-in { background: var(--sheet-bg); border-radius: 14px; padding: 0 16px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
dialog.fs .group { background: var(--raised); }
dialog.fs[open] .sh-in { animation: sheetIn .4s cubic-bezier(.2, .9, .25, 1.04); }
.fs-hd { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 54px; margin: 0 -8px; }
.fs-hd h2 { font: 600 17px var(--font); text-align: center; white-space: nowrap; }
.fs-hd .nb-btn:first-child { justify-self: start; } .fs-hd .nb-btn:last-child { justify-self: end; }
.fs-row { cursor: text; } .fs-l { flex: none; width: 76px; }
.fs-i { flex: 1; width: 100%; padding: 10px 0; }
.fs-seg { padding: 8px 12px; } .fs-seg .seg { width: 100%; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(105%); } }
@keyframes sheetIn { from { transform: translateY(24px) scale(.97); opacity: 0; } }
@keyframes popIn { from { transform: scale(.88); opacity: 0; } }

/* ---------- container layouts ---------- */
@container (min-width: 560px) { .body { columns: 2; } .set-body { columns: 2; } }
@container (min-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); align-items: end; gap: 24px; }
  .hero.solo { grid-template-columns: minmax(0, 1fr); }
  .lt h1 { font-size: 40px; }
}
@container (min-width: 900px) {
  .body { columns: 3; }
  .plan-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .plan-week { margin-top: 0; }
  .plan-chart { position: sticky; top: calc(var(--nav) + var(--safe-t) + 8px); }
  .road { height: clamp(240px, 26vw, 360px); }
  .prog-grid { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "tiles form" "charts list"; align-items: start; gap: 24px; }
  .set-body { columns: 2; }
}
@container (min-width: 520px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1400px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 359px) {
  .lt h1 { font-size: 30px; }
  .ringrow { grid-template-columns: 108px minmax(0, 1fr); gap: 14px; } .rings { width: 108px; height: 108px; }
  .it { padding-left: 12px; } .row { padding: 0 12px; } .row + .row::before { left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
