/* TimSlim — one stylesheet, light and dark. Brand: red #f03e3e, charcoal #2f3131. */

:root {
  --accent: #e63535;
  --accent-ink: #fff;
  --accent-soft: #fdecec;
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --ink: #1b1c1c;
  --ink-2: #4f5252;
  --ink-3: #868a8a;
  --line: #e4e4e0;
  --line-2: #d2d2cc;
  --ok: #2b9a5e;
  --ok-soft: #e4f5ea;
  --warn: #d98c0a;
  --warn-soft: #fff3dc;
  --over: #c92a2a;
  --over-soft: #fde3e3;
  --info-soft: #e7f0fb;
  --focus: #2f6fdb;
  --m-p: #e63535;
  --m-c: #3b82c4;
  --m-f: #d98c0a;
  --track: #ebebe8;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --radius: 14px;
  --nav-w: 230px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #f25555;
    --accent-soft: #3a1c1c;
    --bg: #111213;
    --surface: #1b1d1e;
    --surface-2: #232627;
    --ink: #f1f1ee;
    --ink-2: #b9bcbc;
    --ink-3: #7f8484;
    --line: #2c2f30;
    --line-2: #3a3e3f;
    --ok: #3fbf78;
    --ok-soft: #15301f;
    --warn: #f0a526;
    --warn-soft: #332a12;
    --over: #ff6b6b;
    --over-soft: #3b1a1a;
    --info-soft: #172334;
    --m-c: #5aa0e0;
    --track: #2a2d2e;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #f25555;
  --accent-soft: #3a1c1c;
  --bg: #111213;
  --surface: #1b1d1e;
  --surface-2: #232627;
  --ink: #f1f1ee;
  --ink-2: #b9bcbc;
  --ink-3: #7f8484;
  --line: #2c2f30;
  --line-2: #3a3e3f;
  --ok: #3fbf78;
  --ok-soft: #15301f;
  --warn: #f0a526;
  --warn-soft: #332a12;
  --over: #ff6b6b;
  --over-soft: #3b1a1a;
  --info-soft: #172334;
  --m-c: #5aa0e0;
  --track: #2a2d2e;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a.plain { color: var(--ink-2); }
a.plain:hover { color: var(--ink); }
h1 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 26px 0 10px; font-weight: 650; }
h2:first-of-type { margin-top: 6px; }
h3 { font-size: 16px; margin: 0 0 6px; }
h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 14px 0 5px; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.hidden { display: none !important; }
small { color: var(--ink-3); }
b, strong { font-weight: 650; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* theme logos */
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none !important; } :root:not([data-theme="light"]) .logo-dark { display: inline !important; } }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: inline !important; }
.auth .logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth .logo-dark { display: block !important; } }
:root[data-theme="dark"] .auth .logo-dark { display: block !important; }
.themebtn .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .themebtn .sun { display: none; } :root:not([data-theme="light"]) .themebtn .moon { display: inline; } }
:root[data-theme="dark"] .themebtn .sun { display: none; }
:root[data-theme="dark"] .themebtn .moon { display: inline; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: var(--nav-w); flex: none; position: sticky; top: 0; height: 100vh; padding: 22px 16px;
  background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px;
}
.brand img { height: 36px; width: auto; vertical-align: middle; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .tabs a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 550; font-size: 14.5px;
}
.nav a svg, .tabs a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.who { font-weight: 650; color: var(--ink); }
.modes { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-block; font-size: 11px; font-weight: 650; letter-spacing: .03em; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.chip-c { background: var(--info-soft); color: var(--focus); border-color: transparent; }
.chip-w { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.themebtn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 34px; cursor: pointer; color: var(--ink); font-size: 17px; line-height: 1; }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.wrap { max-width: 760px; margin: 0 auto; padding: 26px 22px 40px; }
.wrap.narrow { max-width: 460px; }
.tabs { display: none; }

@media (max-width: 820px) {
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  }
  .brand-sm img { display: block; }
  .topbar-title { font-weight: 700; font-size: 17px; flex: 1; letter-spacing: -.01em; }
  .wrap { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .tabs {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
    background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    overflow-x: auto; scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 10px; letter-spacing: -.01em; }
  .tabs a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .tabs a.on { color: var(--accent); }
  .tabs a svg { width: 22px; height: 22px; }
}

/* ---------- cards, tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 10px 0; box-shadow: var(--shadow); }
.card.pad0 { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; }
.card.accent { border-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tiles.two { grid-template-columns: repeat(2, 1fr); }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } .tiles.three { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 650; }
.tile .v { font-size: 24px; font-weight: 700; margin: 3px 0 1px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .v.ok { color: var(--ok); } .tile .v.warn { color: var(--warn); } .tile .v.over { color: var(--over); }
.tile .n { font-size: 12px; color: var(--ink-2); }
.tile.big .v { font-size: 34px; }
.bar { height: 7px; border-radius: 4px; background: var(--track); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .2s; }
.bar i.ok { background: var(--ok); } .bar i.warn { background: var(--warn); } .bar i.over { background: var(--over); } .bar i.soft { background: var(--ink-3); }
.flash { max-width: 760px; margin: 14px auto -8px; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 550; }
.flash-ok { background: var(--ok-soft); color: var(--ok); } .flash-err { background: var(--over-soft); color: var(--over); } .flash-info { background: var(--info-soft); color: var(--focus); }
@media (max-width: 820px) { .flash { margin: 12px 16px -4px; } }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: var(--ink-2); }
.note.warn { background: var(--warn-soft); color: var(--ink); } .note.ok { background: var(--ok-soft); } .note.info { background: var(--info-soft); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); vertical-align: 2px; }
.badge.grey { background: var(--surface-2); color: var(--ink-2); } .badge.red { background: var(--accent-soft); color: var(--accent); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--ink-3); text-align: center; padding: 14px; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: flex-end; } .row > * { flex: 1; min-width: 0; }
.row.auto > * { flex: 0 0 auto; }
.split { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- forms ---------- */
label.f { display: block; font-size: 12px; font-weight: 650; color: var(--ink-2); margin: 0 0 4px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; min-height: 42px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
textarea { min-height: 70px; resize: vertical; }
button, .btn {
  font: inherit; font-weight: 650; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); border-radius: 10px;
  padding: 10px 16px; min-height: 42px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--ink-3); }
button.go, .btn.go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.go:hover, .btn.go:hover { filter: brightness(.95); }
button.wide, .btn.wide { width: 100%; margin-top: 12px; }
button.sm, .btn.sm { padding: 6px 11px; min-height: 32px; font-size: 13px; border-radius: 8px; }
button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
button.danger { color: var(--over); }
button.del { background: none; border: none; color: var(--ink-3); font-size: 20px; padding: 2px 8px; min-height: 0; line-height: 1; }
button.del:hover { color: var(--over); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg label { padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + label { outline: 2px solid var(--focus); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.quick button { font-size: 13px; padding: 6px 11px; min-height: 34px; border-radius: 99px; }
.quick button .q { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.gearlist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 14px; }
@media (max-width: 480px) { .gearlist { grid-template-columns: 1fr; } }
.timeslots { display: flex; flex-wrap: wrap; gap: 6px; }
.timeslots input { width: 110px; }
.dayspick { display: flex; gap: 4px; flex-wrap: wrap; }
.dayspick label { padding: 6px 0; width: 40px; text-align: center; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.dayspick input { position: absolute; opacity: 0; width: 0; height: 0; }
.dayspick input:checked + label { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ---------- lists & tables ---------- */
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
ul.list li:first-child { border-top: none; }
ul.list .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ul.list .mc { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
ul.list form { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.today td { background: var(--accent-soft); }
.tscroll { overflow-x: auto; }

/* ---------- day nav ---------- */
.daynav { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.daynav > a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: var(--ink-2); flex: none; }
.daynav > a.off { opacity: .35; pointer-events: none; }
.dn-form { position: relative; width: 44px; height: 38px; flex: none; }
.dn-form input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.dn-form::before { content: "\1F4C5"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 17px; pointer-events: none; }
.dn-label { flex: 1; font-weight: 700; font-size: 17px; line-height: 1.1; }
.dn-label small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.today-link { font-size: 13px; }

/* ---------- training ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week a { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12px; }
.week a .m { font-size: 15px; } .week a .t { font-size: 10px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.week a.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.week a.rest { opacity: .6; }
.week a.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
details.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; box-shadow: var(--shadow); }
details.ex > summary { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; list-style: none; }
details.ex > summary::-webkit-details-marker { display: none; }
details.ex > summary::after { content: "+"; color: var(--ink-3); font-size: 20px; width: 14px; text-align: center; flex: none; }
details.ex[open] > summary::after { content: "\2212"; }
details.ex .exn { flex: 1; font-weight: 650; min-width: 0; }
details.ex .sch { font-size: 13px; color: var(--ink-2); text-align: right; max-width: 55%; }
details.ex .exbody { padding: 0 16px 16px; font-size: 14px; color: var(--ink-2); }
details.ex .exbody ul, details.ex .exbody ol { margin: 0; padding-left: 20px; } details.ex .exbody li { margin: 3px 0; }
details.ex .meta { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
details.ex .you { background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 9px 12px; margin-top: 12px; font-size: 13.5px; }
.liftrow { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; } .liftrow > div { flex: 1; } .liftrow button { flex: none; }
.last { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.muscles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; }
.muscles .mg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.muscles .mg span:first-child { width: 86px; flex: none; color: var(--ink-2); }
.muscles .mg .bar { flex: 1; margin: 0; } .muscles .mg small { width: 40px; text-align: right; }
ol.warm { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; } ol.warm li { margin: 3px 0; }
.planday { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.planday .head .h-type { flex: 0 0 110px; } .planday .head .h-note { flex: 2; }
.planday .blocks { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.planday .blk { display: grid; grid-template-columns: 1fr 120px 80px auto auto; gap: 6px; align-items: center; }
@media (max-width: 600px) { .planday .blk { grid-template-columns: 1fr 1fr; } .planday .blk select { grid-column: 1 / -1; } }
.planday .blk input, .planday .blk select { min-height: 36px; padding: 6px 9px; font-size: 13.5px; }
.planday .blk button { min-height: 36px; padding: 4px 9px; }

/* ---------- meds ---------- */
.dose { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }
.dose:first-child { border-top: none; }
.dose .tm { width: 64px; flex: none; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.dose .body { flex: 1; min-width: 0; } .dose .body small { display: block; } .dose .ds { color: var(--ink-2); font-size: 13px; }
.dose .nm { font-weight: 600; }
.dose.taken .nm { text-decoration: line-through; color: var(--ink-3); }
.dose.skipped .nm { color: var(--ink-3); font-style: italic; }
.dose form { display: flex; gap: 4px; margin: 0; }
.dose button.take { background: var(--ok); color: #fff; border-color: var(--ok); }
.dose.taken button.take { background: var(--ok-soft); color: var(--ok); }
.dose .late { color: var(--warn); font-weight: 600; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { font-size: 10.5px; fill: var(--ink-3); font-family: inherit; }
.chart .lbl-bg { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .ref { stroke: var(--ink-3); stroke-width: 1.3; stroke-dasharray: 5 4; }
.chart .trend { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.chart rect.ok { fill: var(--ok); } .chart rect.warn { fill: var(--warn); } .chart rect.over { fill: var(--over); }
.macrobar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--track); margin-top: 6px; }
.macrobar i { display: block; height: 100%; }
.macrokey { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.macrokey b { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.m-p { background: var(--m-p); } .m-c { background: var(--m-c); } .m-f { background: var(--m-f); }

/* ---------- auth ---------- */
.auth { padding-top: 50px; }

.auth .card { padding: 22px 22px; }
.codeinput { letter-spacing: .2em; font-size: 20px; text-align: center; text-transform: uppercase; }
.pin { letter-spacing: .5em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.pics input { position: absolute; opacity: 0; width: 0; height: 0; }
.pics label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 8px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.pics label svg { width: 44px; height: 44px; }
.pics input:checked + label { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pics input:focus-visible + label { outline: 2px solid var(--focus); }
.setupcode { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; letter-spacing: .18em; text-align: center; padding: 14px; background: var(--surface-2); border-radius: 12px; font-weight: 700; }
.steps { counter-reset: s; padding-left: 0; list-style: none; }
.steps li { position: relative; padding-left: 32px; margin: 8px 0; color: var(--ink-2); font-size: 14px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.urlbox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.simple-only { display: none; }
html[data-ui="simple"] .adv-only { display: none !important; }
html[data-ui="simple"] .simple-only { display: initial; }

/* ---------- phone-width adjustments ---------- */
@media (max-width: 560px) {
  .muscles { grid-template-columns: 1fr; }
  .chart .lbl { font-size: 14px; }
  ul.list li { flex-wrap: wrap; } ul.list li form { order: 2; } ul.list .mc { flex: 1 1 100%; order: 3; white-space: normal; }
  .chart .ref, .chart .trend { stroke-width: 1.8; }
  ul.list .mc { font-size: 12px; }
  .dose { gap: 8px; padding: 10px 12px; } .dose .tm { width: 56px; font-size: 13px; }
  .dose form button.sm { padding: 6px 9px; }
  .actrow { flex-wrap: wrap; } .actrow > div:first-child { flex: 1 1 100%; }
  .planday .head { flex-wrap: wrap; } .planday .head .h-type { flex: 0 0 110px; } .planday .head .h-note { flex: 1 1 100%; }
  .planday .blk { grid-template-columns: 1fr 1fr auto auto; }
  .planday .blk select { grid-column: 1 / -1; }
  th, td { padding: 8px 10px; } td:first-child { white-space: nowrap; }
  .tile .v { font-size: 22px; } .tile.big .v { font-size: 28px; }
  h1 { font-size: 22px; }
}

/* ---------- motion ---------- */
/* Logo: the EKG trace is live. A bright pulse sweeps along it, pauses, and repeats. */
.logo-svg { display: block; height: 36px; width: auto; }
.brand .logo-svg { height: 38px; }
.brand-sm .logo-svg { height: 34px; }
.auth .logo-svg { height: 58px; margin: 0 auto 26px; }
.ekg { fill: none; stroke: #f03e3e; stroke-width: 46; stroke-linecap: round; stroke-linejoin: round; }
.ekg-pulse { stroke: #ffd7d4; stroke-width: 30; stroke-dasharray: 22 100; stroke-dashoffset: 22; animation: ekgsweep 2.4s linear infinite; filter: drop-shadow(0 0 6px rgba(240, 62, 62, .9)); }
@keyframes ekgsweep {
  0%   { stroke-dashoffset: 22; opacity: 1; }
  55%  { stroke-dashoffset: -100; opacity: 1; }
  56%  { opacity: 0; }
  100% { stroke-dashoffset: -100; opacity: 0; }
}
.logo-svg:hover .ekg-pulse { animation-duration: 1.2s; }

/* Content rises in, staggered */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wrap > * { animation: rise .38s cubic-bezier(.2, .7, .2, 1) both; }
.wrap > :nth-child(1) { animation-delay: .02s; } .wrap > :nth-child(2) { animation-delay: .06s; } .wrap > :nth-child(3) { animation-delay: .10s; }
.wrap > :nth-child(4) { animation-delay: .14s; } .wrap > :nth-child(5) { animation-delay: .18s; } .wrap > :nth-child(6) { animation-delay: .22s; }
.wrap > :nth-child(7) { animation-delay: .26s; } .wrap > :nth-child(8) { animation-delay: .30s; } .wrap > :nth-child(n+9) { animation-delay: .34s; }
.tiles > .tile { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
.tiles > .tile:nth-child(2) { animation-delay: .06s; } .tiles > .tile:nth-child(3) { animation-delay: .12s; } .tiles > .tile:nth-child(4) { animation-delay: .18s; }

/* Bars and the macro split fill from zero */
@keyframes grow { from { width: 0; } }
.bar i, .macrobar i { animation: grow .9s cubic-bezier(.2, .7, .2, 1) .25s both; }

/* Flash messages drop in */
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.flash { animation: drop .35s ease-out both; }

/* Taken: a little check-off pop */
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.dose.taken .tm, .week a.ok .m, .badge { animation: pop .35s cubic-bezier(.2, .7, .2, 1) both; }

/* Interaction feedback */
button, .btn, .nav a, .tabs a, .week a, .pics label, .quick button, .seg label, details.ex > summary, .tile, .card { transition: background-color .18s, color .18s, border-color .18s, transform .12s, box-shadow .18s, filter .18s; }
button:active, .btn:active, .quick button:active, .pics label:active, .week a:active { transform: scale(.96); }
.nav a svg, .tabs a svg { transition: transform .18s; }
.nav a:hover svg, .tabs a.on svg { transform: translateY(-1px) scale(1.08); }
.themebtn:hover { transform: rotate(15deg); }
details.ex .exbody { animation: rise .25s ease-out both; }
details.ex > summary::after { transition: transform .2s; }
details.ex[open] > summary::after { transform: rotate(180deg); }
body, .card, .tile, .side, .topbar, .tabs, input, select, textarea { transition: background-color .25s, color .25s, border-color .25s; }
.chart .line { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.4s ease-out .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart rect { transform-box: fill-box; transform-origin: bottom; animation: scaleup .6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes scaleup { from { transform: scaleY(0); } }
.chart .dot { animation: fadein .3s ease 1s both; }
@keyframes fadein { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chart .line { stroke-dashoffset: 0; }
}
