/* Steady — calm & clinical. Tokens and layout from the design canvas:
   phone 390 wide with a bottom tab bar, desktop 1440 with a 240px sidebar. */

:root {
  --bg: #0f1214;
  --bg-side: #121517;
  --surface: #171b1f;
  --surface-2: #1a1f23;
  --surface-3: #232a2f;
  --surface-tint: #1f2a2e;
  --surface-alt: #131719;
  --border: #1f252a;
  --border-2: #2a3238;
  --border-3: #2f3a41;
  --text: #e8ecef;
  --text-2: #b3bcc3;
  --muted: #8a949c;
  --dim: #6f7a83;
  --ink: #0f1214;
  --accent: #4fd1c5;
  --blue: #5ea8f0;
  --blue-fg: #8fb8e8;
  --green: #5bc48a;
  --green-fg: #7fd6a3;
  --green-bg: #14231d;
  --amber: #e0a83c;
  --amber-fg: #f0c05a;
  --amber-bg: #2b2314;
  --red: #e06c5c;
  --rest: #3a444b;
  --row: #4fd1c5;
  --cf: #5ea8f0;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  --radius-lg: 16px;
  --tabbar: 84px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--sans); cursor: pointer; }
input, textarea, select { font-family: var(--sans); }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.ok { color: var(--green-fg); }
.warn { color: var(--amber-fg); }
.bad { color: var(--red); }
.accent { color: var(--accent); }
.hidden { display: none !important; }
@media (max-width: 959px) { .only-desktop { display: none !important; } }

/* --- Layout ------------------------------------------------------------- */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.page {
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(var(--tabbar) + 24px) 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.page.no-tabs { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head .titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.page-head.with-back { align-items: center; }
.eyebrow {
  font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.h1.sub { font-size: 20px; }
.actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-label {
  font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; padding: 0 4px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.section-label .hint { text-transform: none; letter-spacing: 0; }
.spacer { flex: 1; }
.flash {
  margin: 12px 20px 0; padding: 10px 14px; border-radius: 12px; background: var(--green-bg); color: var(--green-fg);
  font-size: 13px; font-weight: 500;
}
.flash.error { background: #2b1a17; color: var(--red); }

/* --- Sidebar (desktop) / bottom tabs (phone) ------------------------------ */
.sidebar { display: none; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: flex-start;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 10px 8px env(safe-area-inset-bottom) 8px;
  border-top: 1px solid var(--border); background: var(--bg);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; height: 48px;
  color: var(--muted); font-size: 11px; font-weight: 500;
}
.bottomnav a.active { color: var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }

/* --- Cards & tiles ---------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.tight { padding: 14px; border-radius: var(--radius); gap: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head .eyebrow { flex: 1; }
.tiles { display: grid; gap: 8px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 3px; padding: 12px; background: var(--surface); border-radius: 12px; min-width: 0; }
.tile.inset { background: var(--surface-2); }
.tile .label { font-size: 11px; color: var(--muted); }
.tile .value { font-family: var(--mono); font-size: 18px; font-weight: 500; white-space: nowrap; }
.tile .value .unit { font-size: 11px; color: var(--muted); }
.tile .sub { font-size: 11px; color: var(--muted); }
.tiles-3.big .tile { padding: 14px 12px; }
.tiles-3.big .value { font-size: 24px; }
.tiles-3.big .value .unit, .tiles-3.big .sub, .tiles-3.big .label { font-size: 12px; }

/* --- Pills, dots, bars ------------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; white-space: nowrap; flex-shrink: 0; background: var(--surface-2); color: var(--dim);
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill-ok { background: var(--green-bg); color: var(--green-fg); }
.pill-info { background: var(--surface-tint); color: var(--blue-fg); }
.pill-warn { background: var(--amber-bg); color: var(--amber-fg); }
.pill-bad { background: #2b1a17; color: var(--red); }
.pill-dim { background: var(--surface-2); color: var(--dim); }
.pill-lg { padding: 6px 14px; font-size: 14px; gap: 8px; }
.pill-lg .dot { width: 8px; height: 8px; }
.pill-accent { background: transparent; color: var(--accent); padding: 0; }
.type-bar { width: 3px; height: 40px; border-radius: 999px; flex-shrink: 0; }
.type-row { background: var(--row); }
.type-crossfit { background: var(--cf); }
.type-other { background: var(--amber); }
.type-rest { background: var(--rest); }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.progress.thin { height: 5px; }
.timeline { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; }
.timeline > span { display: block; background: var(--border-3); }
.timeline > span.work { background: var(--accent); }
.legend { display: flex; gap: 16px; padding: 0 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* --- Buttons ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 600; color: var(--text); background: var(--surface-3); white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-green { background: var(--green); color: var(--ink); }
.btn-ghost { background: transparent; border: 1px solid var(--border-2); font-weight: 500; }
.btn-dashed { background: transparent; border: 1px dashed var(--border-3); color: var(--accent); font-weight: 500; height: 44px; }
.btn-danger { background: transparent; color: var(--red); font-weight: 500; }
.btn-sm { height: 44px; font-size: 14px; padding: 0 16px; }
.btn-xs { height: 36px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.btn-tall { height: 52px; }
.btn-block { flex: 1; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-btn.ghost { background: transparent; border: 1px solid var(--border-2); }
.icon-btn.plain { background: transparent; color: var(--muted); }
.btn-row { display: flex; gap: 10px; }
.link { font-size: 12px; color: var(--accent); }
.avatar {
  border-radius: 999px; color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0; background: var(--accent);
}
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.avatar.md { width: 48px; height: 48px; font-size: 16px; border: 3px solid var(--surface); }
.avatar.lg { width: 60px; height: 60px; font-size: 24px; }
.avatar.xl { width: 64px; height: 64px; font-size: 24px; }

/* --- Forms ---------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; color: var(--muted); }
.input {
  width: 100%; height: 48px; padding: 0 14px; background: var(--surface); border-radius: 12px; border: 1px solid var(--border-2);
  color: var(--text); font-size: 15px; outline: none; -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--accent); }
.input.mono { font-family: var(--mono); }
.input.sm { height: 44px; padding: 0 12px; }
textarea.input { height: auto; min-height: 64px; padding: 12px 14px; resize: none; line-height: 1.45; }
textarea.input.code { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); background: var(--surface); }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238a949c' 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 12px center; padding-right: 38px;
}
input[type="date"].input, input[type="time"].input { color-scheme: dark; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg { display: flex; gap: 6px; padding: 4px; background: var(--surface); border-radius: 12px; }
.seg > * {
  flex: 1; height: 44px; border-radius: 9px; border: none; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center;
}
.seg > .active { background: var(--accent); color: var(--ink); font-weight: 600; }
.seg.dim > .active { background: var(--surface-3); color: var(--text); }
.seg.sm > * { height: 40px; font-size: 13px; }
.seg.pill-seg { border-radius: 999px; padding: 3px; gap: 4px; }
.seg.pill-seg > * { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; flex: 0 0 auto; }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--border-2); position: relative; cursor: pointer; flex-shrink: 0; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: var(--ink); transition: left .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 23px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: none; background: var(--surface-3); color: var(--text); font-size: 18px; }
.stepper .val { width: 52px; text-align: center; font-family: var(--mono); font-size: 16px; }
.stepper.sm button { width: 32px; height: 32px; border-radius: 8px; font-size: 16px; }
.stepper.sm .val { width: 40px; font-size: 14px; }
.list { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.list-row .t { font-size: 14px; font-weight: 500; }
.list-row .d { font-size: 11px; color: var(--muted); }
.list-row.link { color: var(--text); }
.list-row.danger { color: var(--red); }
.rpe { display: flex; gap: 4px; }
.rpe label { flex: 1; }
.rpe input { display: none; }
.rpe span { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 8px; background: var(--surface); color: var(--text-2); font-family: var(--mono); font-size: 14px; cursor: pointer; }
.rpe input:checked + span { background: var(--accent); color: var(--ink); }
.note { display: flex; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; font-size: 12px; color: var(--text-2); line-height: 1.4; align-items: flex-start; }
.note svg { flex-shrink: 0; margin-top: 1px; }
.note.tint { background: var(--surface-tint); }
.note.warn { background: var(--amber-bg); color: var(--amber-fg); }
.note.bad { background: #2b1a17; color: var(--red); }

/* --- Day rows (plan, sessions) ------------------------------------------------- */
.day-row {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border-radius: var(--radius);
  min-height: 64px;
}
.day-row.dim { opacity: 0.6; }
.day-row.today { border: 1px solid var(--accent); }
.day-row .day { display: flex; flex-direction: column; align-items: center; width: 36px; flex-shrink: 0; }
.day-row .day .dow { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.day-row .day .date { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.day-row .day .date.today { color: var(--accent); }
.day-row .body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.day-row .body .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-row .body .d { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-row .body .d.mono { font-family: var(--mono); }
.day-row .body .t.rest { color: var(--muted); font-weight: 500; }
.day-row .side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.day-stack { display: flex; flex-direction: column; gap: 8px; }
.day-multi { display: flex; flex-direction: column; gap: 6px; }
.fab {
  position: fixed; right: 20px; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); z-index: 15;
  width: 64px; height: 64px; border-radius: 999px; background: var(--green); color: var(--ink);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

/* --- Readiness ring ---------------------------------------------------------------- */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.ring-wrap svg { width: 220px; height: 220px; }
.readiness-text { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.session-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent); }
.session-title { font-size: 17px; font-weight: 600; }
.session-detail { font-size: 13px; color: var(--muted); }
.explain { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.block-card { display: flex; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); align-items: flex-start; }
.block-card .bar { width: 3px; align-self: stretch; border-radius: 999px; background: var(--rest); flex-shrink: 0; }
.block-card .bar.work { background: var(--accent); }
.block-card .body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.block-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.block-card .head .t { font-size: 15px; font-weight: 600; }
.block-card .head .dur { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.block-card .kv { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.block-card .kv b { font-family: var(--mono); color: var(--text); font-weight: 500; margin-left: 4px; }
.block-card .cue { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.block-stack { display: flex; flex-direction: column; gap: 8px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 72px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 1px; }
.bars .col .cf { background: var(--cf); border-radius: 2px 2px 0 0; }
.bars .col .row { background: var(--row); border-radius: 0 0 2px 2px; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.axis .mid { display: inline-flex; align-items: center; gap: 6px; }
.axis i { width: 10px; height: 10px; border-radius: 2px; background: var(--surface-tint); display: inline-block; }
.axis .ring-i { width: 10px; height: 10px; border-radius: 999px; border: 2px solid var(--amber); box-sizing: border-box; background: transparent; }
.reps { display: flex; align-items: flex-end; gap: 8px; height: 64px; }
.reps .rep { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; justify-content: flex-end; height: 100%; }
.reps .rep span { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.reps .rep i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.reps .rep i.over { background: var(--amber); }
.goal { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); }
.goal .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.goal .head .t { font-size: 14px; font-weight: 500; }
.goal .head .v { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.goal .head .v span { color: var(--muted); }
.goal .note-t { font-size: 12px; color: var(--muted); }
.zones { display: flex; height: 28px; border-radius: 8px; overflow: hidden; gap: 2px; }
.zones span { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; }
.kv-rows { display: flex; flex-direction: column; }
.kv-rows .r { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv-rows .r .k { color: var(--muted); }
.kv-rows .r .vv { display: flex; gap: 12px; font-family: var(--mono); }
.kv-rows .r .vv .p { color: var(--muted); }
.empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* --- Login ----------------------------------------------------------------------- */
.login { min-height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: calc(64px + env(safe-area-inset-top)) 24px 32px; }
.login .mark { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login .mark .t { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.login .mark .s { font-size: 13px; color: var(--muted); }
.profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 12px; border-radius: 18px;
  border: 2px solid var(--border-2); background: var(--surface); color: var(--text); font-family: var(--sans);
}
.profile-card.active { border-color: var(--accent); }
.profile-card .n { font-size: 16px; font-weight: 600; }
.profile-card .l { font-size: 12px; color: var(--muted); }
.pin-dots { display: flex; justify-content: center; gap: 14px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 999px; background: var(--border-2); }
.pin-dots span.on { background: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 12px; }
.keypad button { height: 60px; border-radius: 14px; border: none; background: var(--surface); color: var(--text); font-family: var(--mono); font-size: 24px; font-weight: 500; }
.keypad button.blank { background: transparent; }
.keypad button.del { background: transparent; color: var(--muted); }
.login .foot { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); text-align: center; }
.login-hero { display: none; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.login .error { color: var(--red); font-size: 13px; text-align: center; }

/* --- Chat --------------------------------------------------------------------------- */
.messages { display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto; min-height: 240px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--ink); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
.chatform { display: flex; gap: 8px; align-items: flex-end; }
.chatform textarea { flex: 1; min-height: 48px; }

/* --- Trends chart --------------------------------------------------------------------- */
.chart { width: 100%; height: auto; }

/* --- Desktop ------------------------------------------------------------------------- */
@media (min-width: 960px) {
  .only-mobile { display: none !important; }
  .only-desktop.flex { display: flex !important; }
  .only-desktop.grid { display: grid !important; }
  .bottomnav, .fab { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 28px; width: 240px; flex-shrink: 0; padding: 28px 16px;
    border-right: 1px solid var(--border); background: var(--bg-side); position: sticky; top: 0; height: 100vh;
  }
  .sidebar .brand { padding: 0 8px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
  .sidebar nav a.active { background: var(--surface-tint); color: var(--accent); }
  .sidebar nav a:hover { background: var(--surface); }
  .sidebar .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface); }
  .sidebar .me.active { background: var(--surface-tint); }
  .sidebar .me .n { font-size: 14px; font-weight: 500; }
  .sidebar .me .p { font-size: 11px; color: var(--muted); }
  .page { padding: 32px 40px 40px; gap: 24px; max-width: 1440px; }
  .h1 { font-size: 28px; }
  .h1.sub { font-size: 28px; }
  .card { padding: 24px; gap: 14px; }
  .card.pad-lg { padding: 28px; gap: 18px; }
  .flash { margin: 24px 40px 0; }
  .tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile .value { font-size: 22px; }
  .tile .value .unit { font-size: 12px; }
  .tiles-4.hero .tile { padding: 16px 18px; border-radius: var(--radius-lg); }
  .tiles-4.hero .value { font-size: 28px; }
  .tiles-4.hero .value .unit { font-size: 14px; }
  .tiles-4.hero .label { font-size: 12px; }
  .timeline.tall { height: 14px; gap: 3px; }
  .day-row { padding: 10px 14px; gap: 14px; }
  .day-row .day { width: 44px; }
  .day-row .day .date { font-size: 20px; }
  .day-row.desk { background: var(--surface-alt); border: 1px solid var(--border); }
  .day-row.desk.today { background: var(--surface); border-color: var(--accent); }
  .type-bar { width: 4px; align-self: stretch; height: auto; min-height: 44px; }
  .block-card { padding: 16px 20px; gap: 16px; border-radius: var(--radius-lg); }
  .block-card .bar { width: 4px; }
  .block-card .body { gap: 10px; }
  .block-card .head .t { font-size: 16px; }
  .block-card .kv { gap: 8px; }
  .block-card .kv span { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 8px; background: #1f2529; font-size: 11px; }
  .block-card .kv b { font-size: 13px; margin: 0; }
  .block-card .cue { font-size: 13px; }
  .login { flex-direction: row; padding: 0; gap: 0; }
  .login-hero { display: flex; flex-direction: column; justify-content: space-between; flex: 1; padding: 56px 64px; background: var(--bg-side); border-right: 1px solid var(--border); }
  .login-hero .tag { font-size: 44px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; max-width: 560px; }
  .login-hero .lead { font-size: 16px; color: var(--text-2); line-height: 1.55; max-width: 560px; margin-top: 20px; }
  .login-hero .brand { font-size: 20px; }
  .login-form { width: 560px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 64px 72px; }
  .login .mark { align-items: flex-start; }
  .login .mark .t { font-size: 24px; }
  .profile-card { padding: 20px 12px; border-radius: 16px; }
  .messages { min-height: 420px; }

  /* page grids */
  .today-grid { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 24px; align-items: start; }
  .today-right { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  .today-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .readiness-card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; gap: 20px; }
  .readiness-card .ring-row { display: flex; align-items: center; gap: 24px; }
  .readiness-card .ring-wrap { padding: 0; align-items: flex-start; }
  .readiness-card .ring-wrap svg { width: 180px; height: 180px; }
  .readiness-card .tile { background: var(--surface-2); }
  .session-card { padding: 28px; gap: 18px; }
  .session-card .session-icon { width: 56px; height: 56px; border-radius: 14px; }
  .session-card .session-title { font-size: 22px; }
  .session-card .session-detail { font-size: 14px; }
  .session-card .explain { font-size: 14px; line-height: 1.5; }
  .week-list { display: flex; flex-direction: column; gap: 0; }
  .week-list .wr { display: flex; align-items: center; gap: 12px; height: 34px; font-size: 14px; }
  .week-list .wr .dow { width: 32px; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
  .week-list .wr .type-bar { width: 3px; height: 22px; min-height: 22px; }
  .week-list .wr.dim { opacity: 0.55; }
  .goal.flat { background: transparent; padding: 10px 0; border-radius: 0; border-bottom: 1px solid var(--border); }
  .goal.flat:last-child { border-bottom: none; }
  .split-grid { display: flex; gap: 24px; align-items: stretch; min-height: 0; }
  .split-grid > .left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
  .split-grid > .right { width: 360px; flex-shrink: 0; }
  .split-grid > .right.wide { width: 380px; }
  .split-grid > .right.wider { width: 420px; }
  .panel { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 32px; }
  .panel .tile { background: var(--surface-2); }
  .panel .input { background: var(--surface-2); }
  .panel .seg { background: var(--surface-2); }
  .panel .seg > * { height: 36px; font-size: 13px; }
  .panel .block-row { background: var(--surface-2); }
  .panel .rpe span { background: var(--surface-2); height: 36px; font-size: 13px; }
  .panel .list { background: transparent; }
  .log-grid { display: grid; grid-template-columns: 60px 4px minmax(0, 1fr) 150px 90px 90px 80px 80px; gap: 14px; align-items: center; }
  .log-grid.head { padding: 0 14px 4px; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
  .log-grid .num { font-family: var(--mono); font-size: 14px; }
  .trends-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
  .trends-left { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  .trends-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .bars.tall { height: 120px; gap: 10px; }
  .import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
  .import-grid textarea.input.code { min-height: 520px; font-size: 12.5px; background: var(--bg); padding: 16px; }
  .profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .profile-col { display: flex; flex-direction: column; gap: 24px; }
  .list.flat { background: var(--surface); border-radius: var(--radius-lg); padding: 8px 24px; }
  .list.flat .list-row { padding: 8px 0; min-height: 60px; }
  .list.flat .list-row .d { font-size: 12px; }
  .list.flat .section-label { padding: 16px 0 8px; }
  .zones { height: 36px; }
  .zones span { font-size: 12px; }
  .session-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
  .seg.pill-seg { background: transparent; padding: 0; gap: 10px; }
  .seg.pill-seg > * { height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-2); color: var(--text); }
  .seg.pill-seg > .active { background: var(--surface-3); color: var(--text); }
}

@media (max-width: 400px) {
  .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
