/* HUGE: dark by default, light when the device asks for it. */
:root {
  --bg: #0e0f12;
  --panel: #17191e;
  --panel-2: #1f2228;
  --line: #2b2f37;
  --text: #f2f3f5;
  --muted: #9aa1ad;
  --accent: #c6ff3d;
  --accent-ink: #0e0f12;
  --accent-text: #c6ff3d;
  --danger: #ff6b6b;
  --warn: #ffc94d;
  --ok: #51cf66;
  --radius: 14px;
  --shadow: 0 8px 30px rgb(0 0 0 / 35%);
  --tabbar-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Arial Black", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f1;
    --panel: #ffffff;
    --panel-2: #eef0ea;
    --line: #dde0d8;
    --text: #121418;
    --muted: #5e6470;
    --accent-text: #4a7a00;
    --shadow: 0 8px 30px rgb(0 0 0 / 10%);
    color-scheme: light;
  }
}

/* body areas */
.area-chest { --area: #ff6b6b; }
.area-back { --area: #4dabf7; }
.area-shoulders { --area: #ffa94d; }
.area-arms { --area: #f06595; }
.area-legs { --area: #51cf66; }
.area-glutes { --area: #9775fa; }
.area-core { --area: #fcc419; }
.area-cardio { --area: #22b8cf; }
.area-mobility { --area: #adb5bd; }
.area-stretching { --area: #63e6be; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.brand, .page-title, .mega, .big-num, .stat b, .clock, .rest-time, .title-input { font-weight: 900; }
h2 { font-size: 1.05rem; letter-spacing: .01em; }
h3 { font-size: .95rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* layout */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wrap.narrow { max-width: 620px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font-family: var(--display); font-size: 1.9rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mega { font-family: var(--display); font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: -.02em; line-height: 1; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; margin-bottom: 6px; }
.crumb { font-size: .9rem; }

/* header and navigation */
.top { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 1.35rem; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.top-nav { display: flex; gap: 4px; flex: 1; }
.top-nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.top-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.top-nav a.on { color: var(--text); background: var(--panel-2); }
.logout { margin-left: auto; }
.tabbar { display: none; }

@media (max-width: 760px) {
  .top-nav { display: none; }
  .top-inner { padding: 8px 16px; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.tab-go svg { width: 46px; height: 46px; padding: 10px; margin-top: -18px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
}
@media (min-width: 761px) { .wrap { padding-bottom: 48px; } }

/* cards and lists */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-card { padding: 4px 16px; }
.pad { padding: 14px 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }

/* buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); color: var(--text);
  font: 700 .95rem var(--font); cursor: pointer; text-decoration: none !important;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-go:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-big { min-height: 54px; font-size: 1.05rem; padding: 12px 22px; text-transform: uppercase; letter-spacing: .04em; }
.btn-big svg { width: 22px; height: 22px; }
.btn-danger { color: var(--danger); }
.btn-small { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.linkish:hover { color: var(--text); text-decoration: underline; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
  color: var(--text); font-size: 1.1rem; cursor: pointer; text-decoration: none !important;
}
.icon-btn:hover { border-color: var(--muted); }
.icon-btn.disabled, .icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); min-width: 0; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
  font: 400 1rem var(--font);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); margin: 0; flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .9rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; padding: 0; }
.with-unit { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 400; }
.with-unit input { width: 90px; flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }

/* segmented control */
.seg { display: flex; padding: 4px; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.seg legend { float: left; width: 100%; }
.seg-small { display: flex; flex-wrap: wrap; background: none; border: 0; padding: 0; }
.seg-small label { flex: 0 0 auto; }
.seg label { flex: 1; flex-direction: row; justify-content: center; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; width: 100%; text-align: center; padding: 10px 14px; border-radius: 9px; color: var(--muted); font-weight: 700; cursor: pointer; white-space: nowrap; }
.seg-small span { border: 1px solid var(--line); background: var(--panel-2); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg input:disabled + span { opacity: .4; cursor: not-allowed; }

/* chips, pills, badges, dots */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap;
  color: var(--area); background: color-mix(in srgb, var(--area) 16%, transparent); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: var(--warn);
  background: color-mix(in srgb, var(--warn) 15%, transparent); vertical-align: middle; }
.badge-done { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.badge-off { color: var(--muted); background: var(--panel-2); }
.dots { display: inline-flex; gap: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--area, var(--muted)); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 600; font-size: .9rem; }
.pill:hover { text-decoration: none; border-color: var(--muted); }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.area-pill.on { background: var(--area); border-color: var(--area); color: #111; }
.tabs { display: flex; gap: 6px; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; }
.tabs a.on { background: var(--panel-2); color: var(--text); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* toasts */
.toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); box-shadow: var(--shadow); transition: opacity .4s, transform .4s; }
.toast span { flex: 1; }
.toast-ok { border-left: 4px solid var(--accent); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warn { border-left: 4px solid var(--warn); }
.toast.gone { opacity: 0; transform: translateY(-8px); }
.toast-close { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; line-height: 1; }

/* auth */
.auth { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 6vh; text-align: center; }
.auth form { width: 100%; text-align: left; }
.auth-logo { border-radius: 18px; }
.empty { text-align: center; padding: 10vh 0; display: flex; flex-direction: column; gap: 16px; align-items: center; }

/* home */
.resume { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); color: var(--text); }
.resume:hover { text-decoration: none; }
.resume > span:first-child { display: flex; flex-direction: column; }
.resume-go { font-weight: 800; color: var(--warn); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 0; }
.hero .btn-big { flex: 0 0 auto; }
@media (max-width: 560px) { .hero .btn-big { width: 100%; } }
.week-head { display: flex; justify-content: space-between; align-items: baseline; }
.big-num { font-family: var(--display); font-size: 2rem; }
.big-num small { font-size: 1rem; color: var(--muted); }
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.wd { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: .75rem; border: 2px solid transparent; }
.wd b { font-size: 1rem; color: var(--text); }
.wd:hover { text-decoration: none; border-color: var(--line); }
.wd.done { background: var(--accent); color: var(--accent-ink); }
.wd.done b { color: var(--accent-ink); }
.wd.today { border-color: var(--accent); }
.wd.future { opacity: .45; }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.meter > span { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); border-radius: 99px; transition: width .4s; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.stat b small { font-size: .9rem; color: var(--muted); }
.stat span { color: var(--muted); font-size: .85rem; }
.stat em { font-style: normal; display: block; font-size: .78rem; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: grid; grid-template-columns: 80px 1fr 28px; align-items: center; gap: 10px; font-size: .88rem; }
.bar { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--area); border-radius: 99px; min-width: 2px; transition: width .4s; }
.bar-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { margin-top: 14px; font-size: .9rem; }

/* workout rows */
.wrow, .hist-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); }
.wrow:first-child, .card-head + .wrow, .card-head + .hist-row, .hist-row:first-of-type { border-top: 0; }
.list-card > .wrow:first-child { border-top: 0; }
.wrow:hover, .hist-row:hover { text-decoration: none; }
.wrow:hover strong { color: var(--accent-text); }
.wrow-date { color: var(--muted); font-size: .85rem; font-weight: 600; }
.wrow-main { display: flex; flex-direction: column; min-width: 0; }
.wrow-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrow-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 480px) {
  .wrow { grid-template-columns: 1fr auto; }
  .wrow-date { grid-column: 1 / -1; margin-bottom: -8px; }
  a.hist-row { grid-template-columns: 1fr; gap: 6px; }
  .hist-row .wrow-date { margin-bottom: 0; }
}
.hist-row { grid-template-columns: 92px 1fr; }
.hist-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.set-chip { padding: 2px 9px; border-radius: 8px; background: var(--panel-2); font-size: .85rem; color: var(--muted); }
.set-chip.done { color: var(--text); }
.pager { display: flex; gap: 10px; justify-content: center; }

/* generator */
.gen-form { display: flex; flex-direction: column; gap: 16px; }
.mode-note { color: var(--muted); font-size: .92rem; }
.area-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.area-pick { position: relative; }
.area-pick input { position: absolute; opacity: 0; }
.area-pick span { display: block; text-align: center; padding: 12px 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 700; cursor: pointer; }
.area-pick input:checked + span { border-color: var(--area); background: color-mix(in srgb, var(--area) 22%, var(--panel)); }
.area-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.gen-go { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gen-go .roll { flex: 1 1 200px; }
.count { flex: 0 0 auto; }
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 48px; background: var(--panel-2); border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.stepper input { width: 60px; text-align: center; border: 0; border-radius: 0; font-weight: 800; font-size: 1.1rem; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.gen-result { display: flex; flex-direction: column; gap: 12px; }
.gen-message { color: var(--warn); }
.title-field input { font-size: 1.1rem; font-weight: 700; }
.picks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: pick; }
.pick { display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 12px 0; overflow: hidden; animation: pop .35s ease both; }
.pick-area { align-self: stretch; background: var(--area); border-radius: 0 4px 4px 0; }
.pick-name { font-size: 1.05rem; }
.pick-name::before { counter-increment: pick; content: counter(pick) ". "; color: var(--muted); }
.pick-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pick-main:hover .pick-name { color: var(--accent-text); }
.pick-actions { display: flex; gap: 6px; }
.pick.locked { border-color: var(--accent); }
.pick .lock { color: var(--muted); }
.pick.locked .lock { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.pick.spin { animation: spin .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spin { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.sticky-go { position: sticky; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 5; }
.sticky-go .btn { width: 100%; box-shadow: var(--shadow); }
@media (min-width: 761px) { .sticky-go { bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .pick, .pick.spin { animation: none; } }

/* workout editor */
.wk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wk-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.title-input { font-family: var(--display); font-size: 1.6rem; padding: 4px 8px; margin-left: -8px; background: transparent; border-color: transparent; }
.title-input:hover { border-color: var(--line); }
.wk-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wk-sub input[type=date] { width: auto; min-height: 36px; padding: 4px 8px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.clock small { font: 600 .72rem var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.wk-progress { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .9rem; }
.wk-progress b { color: var(--text); }
.wk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ex { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ex.complete { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.ex-top { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 14px 8px; border-left: 6px solid var(--area); }
.ex-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-name-btn { display: inline-flex; align-items: baseline; gap: 6px; padding: 0; background: none; border: 0; color: var(--text); font: 800 1.08rem var(--font); text-align: left; cursor: pointer; }
.ex-name-btn:hover { color: var(--accent-text); }
.ex-name-btn { align-items: center; }

/* how-to popup: a small card floating in the middle of the screen */
.how-dialog { width: min(400px, calc(100% - 40px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.how-dialog::backdrop { background: rgb(0 0 0 / 50%); backdrop-filter: blur(2px); }
.how-dialog[open] { animation: pop .18s ease both; }
@media (prefers-reduced-motion: reduce) { .how-dialog[open] { animation: none; } }
.how-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; border-top: 5px solid var(--area, var(--accent)); border-radius: 18px; }
.how-head { display: flex; justify-content: space-between; align-items: center; }
.how-head .icon-btn { width: 34px; height: 34px; font-size: .95rem; }
.how-card h2 { font-size: 1.3rem; }
.how-body { font-size: 1rem; line-height: 1.5; }
.ex-meta { font-size: .82rem; color: var(--muted); }
.ex-menu { display: flex; gap: 4px; align-items: flex-start; }
.ex-menu .icon-btn { width: 34px; height: 34px; font-size: .95rem; }
.sets { width: 100%; border-collapse: collapse; }
.sets th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; text-align: left; padding: 4px 6px; }
.sets td { padding: 4px 6px; }
.sets th:first-child, .sets td:first-child { padding-left: 14px; width: 36px; color: var(--muted); font-weight: 700; }
.sets th:last-child, .sets td:last-child { padding-right: 14px; text-align: right; width: 1%; white-space: nowrap; }
.sets input { min-height: 42px; padding: 6px 8px; text-align: center; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sets tr.done input { color: var(--muted); }
.tick { width: 44px; height: 42px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel-2); color: transparent; font-size: 1.2rem; font-weight: 900; cursor: pointer; }
.tick:hover { border-color: var(--accent); }
tr.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.play, .del-set { width: 34px; height: 42px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.play:hover, .del-set:hover { color: var(--text); }
.play.running { color: var(--accent-text); }
.ex-foot { display: flex; gap: 10px; align-items: center; padding: 6px 14px 12px; flex-wrap: wrap; }
.ex-foot input { flex: 1 1 160px; min-height: 36px; font-size: .9rem; padding: 6px 10px; }
.ex-cue { font-size: .82rem; color: var(--muted); }
.ex-last { font-size: .82rem; color: var(--accent-text); }
.wk-add { display: flex; justify-content: center; }
.wk-add .btn { width: 100%; border-style: dashed; }
.finish { display: flex; flex-direction: column; gap: 14px; }
.feel { display: flex; flex-wrap: wrap; gap: 6px; }
.feel legend { width: 100%; }
.feel label { position: relative; flex: 1 1 80px; }
.feel input { position: absolute; opacity: 0; }
.feel span { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); cursor: pointer; font-size: .9rem; }
.feel input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.feel input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.rest {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 18px; border-radius: 16px;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow);
}
@media (min-width: 761px) { .rest { bottom: 20px; } }
.rest-label { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.rest-time { font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; min-width: 70px; }
.rest .btn { background: rgb(0 0 0 / 12%); border-color: transparent; color: var(--accent-ink); }
.rest.over { background: var(--warn); }
.save-state.error { color: var(--danger); }

/* exercise picker */
.picker { width: min(560px, calc(100% - 24px)); max-height: min(720px, calc(100% - 40px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.picker::backdrop { background: rgb(0 0 0 / 55%); }
.picker-inner { display: flex; flex-direction: column; gap: 12px; padding: 16px; max-height: inherit; }
.picker-head { display: flex; justify-content: space-between; align-items: center; }
.picker-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 200px; }
.picker-list button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 12px 8px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; }
.picker-list button:hover { background: var(--panel-2); }
.picker-list .small { display: block; }
.picker .pill { cursor: pointer; font: 600 .85rem var(--font); }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-head .page-title { text-align: center; }
.cal-sub { text-align: center; font-size: .9rem; margin-top: -8px; }
.cal { display: flex; flex-direction: column; gap: 6px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow span { text-align: center; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cal-day { position: relative; min-height: 92px; padding: 6px 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal-day:hover { text-decoration: none; border-color: var(--muted); }
.cal-day.other { opacity: .35; }
.cal-day.future { background: transparent; }
.cal-day.has { background: color-mix(in srgb, var(--accent) 13%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); }
.cal-day.picked { outline: 2px solid var(--text); outline-offset: -2px; }
.cal-num { align-self: flex-start; min-width: 26px; height: 26px; line-height: 26px; padding: 0 6px; border-radius: 99px; text-align: center; font-weight: 800; font-size: .9rem; }
.cal-titles { display: flex; flex-direction: column; font-size: .74rem; font-weight: 600; line-height: 1.25; min-width: 0; }
.cal-titles span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day .dots { margin-top: auto; flex-wrap: wrap; }
@media (max-width: 640px) {
  .cal, .cal-row { gap: 4px; }
  .cal-day { min-height: 54px; padding: 4px; align-items: center; }
  .cal-num { align-self: center; font-size: .82rem; min-width: 24px; height: 24px; line-height: 24px; padding: 0 4px; }
  .cal-titles { display: none; }
  .cal-day .dots { justify-content: center; }
  .dot { width: 6px; height: 6px; }
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.log-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding-top: 14px; border-top: 1px solid var(--line); }

/* calendar day popup: a centred card, or a sheet from the bottom on phones */
.day-dialog {
  width: min(560px, calc(100% - 32px)); max-height: min(80vh, 760px);
  padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow);
  overflow-y: auto; overscroll-behavior: contain;
}
.day-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.day-dialog[open] { animation: pop .2s ease both; }
@media (max-width: 640px) {
  .day-dialog { width: 100%; max-width: 100%; max-height: 85vh; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .day-dialog[open] { animation: sheet .25s ease both; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .day-dialog[open] { animation: none; } }
.day-pop { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.day-pop-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -16px; margin: -16px -16px 0; padding: 14px 16px 12px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1; }
.day-pop-head h2 { flex: 1; text-align: center; font-size: 1.1rem; }
.day-pop-head h2 .muted { font-weight: 500; font-size: .9rem; }
.day-close { margin-left: 4px; }
.day-workout { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.day-workout:last-of-type { border-bottom: 0; padding-bottom: 0; }
.day-w-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-w-head a { color: var(--text); font-size: 1.1rem; }
.day-w-head .dots { margin-left: auto; }
.day-ex { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.day-ex li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; align-items: baseline; padding: 7px 10px; border-left: 4px solid var(--area); background: var(--panel-2); border-radius: 0 8px 8px 0; font-size: .92rem; }
.day-ex-name a { color: var(--text); }
.day-ex-sets { margin-left: auto; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.day-notes { font-style: italic; color: var(--muted); font-size: .9rem; }
.day-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.day-empty { padding: 8px 0; }

/* library */
.filter input { max-width: 360px; }
.ex-list { list-style: none; margin: 0; }
.ex-list li { border-top: 1px solid var(--line); }
.ex-list li:first-child { border-top: 0; }
.ex-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; color: var(--text); }
.ex-list a:hover { text-decoration: none; }
.ex-list a:hover strong { color: var(--accent-text); }
.ex-main { display: flex; flex-direction: column; min-width: 0; }
.ex-list .is-hidden strong { color: var(--muted); text-decoration: line-through; }
.note { padding: 10px 14px; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: .9rem; }
.cue-big { font-size: 1.05rem; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; }
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pool { display: flex; flex-direction: column; gap: 8px; }
.pool-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.pool-actions .btn { flex: 1; }
.pool-form { display: flex; flex-direction: column; gap: 12px; }
.pool-pick-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.pool-pick-head input[type=search] { flex: 1 1 180px; width: auto; }
.pool-group { padding: 8px 16px; }
.pool-group legend { padding-top: 8px; margin-bottom: 4px; }
.check-row { flex-direction: row; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); font-weight: 500; cursor: pointer; }
.check-row:first-of-type { border-top: 0; }
.check-row span:nth-child(2) { flex: 1; }
.pool-form.only-chosen .check-row:not(:has(input:checked)) { display: none; }

/* settings */
.hidden-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.add-exercise summary { list-style: none; width: fit-content; }
.add-exercise summary::-webkit-details-marker { display: none; }
.add-exercise[open] summary { margin-bottom: 14px; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 700; }
.danger-zone form { margin-top: 12px; }

/* privacy */
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose h2 { margin-top: 6px; }
