/* Kitaeru 鍛える — sumi ink, washi paper, shu vermilion seal. Mobile-first, 360px+. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #F5F1E8; --surface: #FFFDF7; --surface-2: #F9F5EC; --ink: #1C1B19; --muted: #6B665C; --line: #E3DCCB; --line-strong: #CFC6B1;
  --accent: #C8372D; --accent-2: #D9A441; --ok: #3F7D58; --btn-bg: #C8372D; --btn-bg-hover: #B02E25; --on-accent: #FFF9F2;
  --accent-soft: rgba(200, 55, 45, .09); --gold-soft: rgba(217, 164, 65, .16); --ok-soft: rgba(63, 125, 88, .12);
  --muscle-primary: var(--accent); --muscle-secondary: var(--accent-2); --bone: #EFE8D8; --joint: #8A8374; --ink-muted: #8B8579;
  --hm-0: #EAE3D3; --hm-1: #EDC3B4; --hm-2: #E08C77; --hm-3: #CF5A45; --hm-4: #A8281F;
  --shadow: 0 1px 0 rgba(28, 27, 25, .03), 0 8px 24px -14px rgba(60, 45, 20, .22);
  --shadow-lg: 0 -10px 40px -12px rgba(40, 30, 10, .28);
  --paper: radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, .55), transparent 55%),
    repeating-linear-gradient(112deg, rgba(120, 96, 50, .028) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(21deg, rgba(120, 96, 50, .022) 0 1px, transparent 1px 13px);
  --serif: "Source Serif 4", "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --r: 16px; --r-sm: 11px; --gut: 20px; --tabh: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121110; --surface: #1C1A18; --surface-2: #181715; --ink: #EFEAE0; --muted: #A39D90; --line: #2E2B27; --line-strong: #3E3A34;
    --accent: #E0503F; --accent-2: #E3B45A; --ok: #6FB38A; --btn-bg: #B8392C; --btn-bg-hover: #C9412F; --on-accent: #FFF6EF;
    --accent-soft: rgba(224, 80, 63, .14); --gold-soft: rgba(227, 180, 90, .14); --ok-soft: rgba(111, 179, 138, .14);
    --bone: #3A3631; --joint: #A39D90; --ink-muted: #7D776C;
    --hm-0: #24211E; --hm-1: #4A2622; --hm-2: #7A3129; --hm-3: #B84334; --hm-4: #E86A55;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 26px -16px rgba(0, 0, 0, .8);
    --shadow-lg: 0 -10px 40px -10px rgba(0, 0, 0, .7);
    --paper: radial-gradient(120% 80% at 10% 0%, rgba(255, 240, 220, .035), transparent 55%),
      repeating-linear-gradient(112deg, rgba(255, 240, 220, .014) 0 1px, transparent 1px 6px),
      repeating-linear-gradient(21deg, rgba(255, 240, 220, .01) 0 1px, transparent 1px 13px);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110; --surface: #1C1A18; --surface-2: #181715; --ink: #EFEAE0; --muted: #A39D90; --line: #2E2B27; --line-strong: #3E3A34;
  --accent: #E0503F; --accent-2: #E3B45A; --ok: #6FB38A; --btn-bg: #B8392C; --btn-bg-hover: #C9412F; --on-accent: #FFF6EF;
  --accent-soft: rgba(224, 80, 63, .14); --gold-soft: rgba(227, 180, 90, .14); --ok-soft: rgba(111, 179, 138, .14);
  --bone: #3A3631; --joint: #A39D90; --ink-muted: #7D776C;
  --hm-0: #24211E; --hm-1: #4A2622; --hm-2: #7A3129; --hm-3: #B84334; --hm-4: #E86A55;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 26px -16px rgba(0, 0, 0, .8);
  --shadow-lg: 0 -10px 40px -10px rgba(0, 0, 0, .7);
  --paper: radial-gradient(120% 80% at 10% 0%, rgba(255, 240, 220, .035), transparent 55%),
    repeating-linear-gradient(112deg, rgba(255, 240, 220, .014) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(21deg, rgba(255, 240, 220, .01) 0 1px, transparent 1px 13px);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background-color: var(--bg); background-image: var(--paper); background-attachment: fixed;
  color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.25; margin: 0; letter-spacing: .01em; }
p { margin: 0 0 .75em; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip-link:focus { top: calc(8px + var(--safe-t)); }
.ico { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.danger-text { color: var(--accent) !important; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.app { min-height: 100vh; }
.view { outline: none; max-width: 560px; margin: 0 auto; padding: calc(12px + var(--safe-t)) var(--gut) 32px; }
body.has-tabs .view { padding-bottom: calc(var(--tabh) + var(--safe-b) + 28px); }
.view-library { max-width: 920px; }
.view-workout { padding-top: calc(4px + var(--safe-t)); }
.boot { min-height: 70vh; } /* blank washi while modules load: the splash is the only opening screen */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 0;
  padding: 6px max(8px, calc((100vw - 560px) / 2)) calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(14px); -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: .72rem; letter-spacing: .02em; border-radius: 12px; position: relative;
}
.tabbar a.active { color: var(--accent); }
.tabbar a.active::before { content: ""; position: absolute; top: -7px; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabbar a:hover { color: var(--ink); }
.tabbar a.active:hover { color: var(--accent); }

/* ---------- typography blocks ---------- */
.screen-head { margin: 10px 0 18px; }
.eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.title { font-size: 1.75rem; }
.title .jp { display: block; font-size: .95rem; color: var(--accent); letter-spacing: .12em; font-weight: 500; margin-bottom: 2px; }
.section { margin-top: 26px; }
.section-title { font-size: 1.05rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 14px; height: 1.5px; background: var(--accent); }
.h3 { font-size: 1rem; margin: 18px 0 6px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card-flush { padding: 4px 0; }
.card-inset { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-sm); padding: 14px; margin-top: 12px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-size: 1.4rem; margin: 2px 0 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; background: var(--surface); }
.badge-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.badge-gold { color: color-mix(in srgb, var(--accent-2) 55%, var(--ink)); border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); background: var(--gold-soft); }
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.tag { font: 600 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); padding: 4px 7px; border-radius: 99px; vertical-align: middle; margin-left: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent; background: none; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; transition: background .15s, transform .1s, border-color .15s, opacity .15s; user-select: none; white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn-primary { background: var(--btn-bg); color: var(--on-accent); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--btn-bg-hover); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-quiet { color: var(--muted); }
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: var(--accent-soft); }
.btn-danger { background: #9E2A21; color: #fff; }
.btn-lg { min-height: 54px; font-size: 1.05rem; padding: 12px 26px; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.btn-row .btn { flex: 1 1 0; min-width: 120px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 50%; color: var(--ink); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--accent-soft); }
.icon-btn:disabled { opacity: .3; }
.icon-btn-sm { width: 44px; height: 44px; color: var(--muted); }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 10px 6px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* ---------- chips / segmented ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; min-width: 44px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: .92rem; transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips-days { gap: 6px; }
.chips-days .chip { flex: 1 1 0; padding: 8px 0; min-width: 0; font-size: .85rem; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 calc(-1 * var(--gut)); padding-left: var(--gut); padding-right: var(--gut); }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex: none; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); max-width: 100%; }
.seg .chip { border: 0; min-height: 40px; padding: 6px 14px; background: transparent; }
.seg .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg-sm .chip { font-size: .86rem; padding: 6px 13px; }
.seg-xs { margin-bottom: 8px; }
.seg-xs .chip { min-height: 36px; font-size: .8rem; padding: 4px 12px; }
@media (pointer: coarse) { .seg-xs .chip { min-height: 44px; } }

/* ---------- forms ---------- */
.field { margin: 20px 0; }
.label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.num-row { display: flex; gap: 10px; flex-wrap: wrap; }
.num-field { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding-right: 12px; min-height: 52px; }
.num-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.num-field input { width: 84px; border: 0; background: none; padding: 10px 6px 10px 14px; font-size: 1.25rem; font-family: var(--serif); outline: none; font-variant-numeric: tabular-nums; }
.num-field .unit { color: var(--muted); font-size: .88rem; }
.hint { font-size: .86rem; color: var(--muted); margin: 8px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hint.ok { color: var(--ok); }
.hint.warn { color: var(--accent); }
.hint .link { padding: 4px 6px; min-height: 36px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: var(--r-sm); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent); margin: 16px 0; font-size: .92rem; }
.note p { margin: 0; }
.note .ico { color: color-mix(in srgb, var(--accent-2) 65%, var(--ink)); margin-top: 1px; }
.note-warn { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.note-warn .ico { color: var(--accent); }
.note-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.note-ok .ico { color: var(--ok); }
.select select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 46px; padding: 8px 34px 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--ink);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238B8579' stroke-width='1.6'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; }

/* switch */
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line-strong); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch:checked { background: var(--btn-bg); }
.switch:checked::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; min-height: 44px; }
.switch-row.card { margin-top: 14px; }
.switch-inline { margin-top: 10px; }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px; background: var(--surface); }
.step-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--ink); }
.step-btn:hover { background: var(--accent-soft); color: var(--accent); }
.step-val { min-width: 76px; text-align: center; font: 700 1.6rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.step-val small { font: 500 .8rem var(--sans); color: var(--muted); margin-left: 4px; }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(24px + var(--safe-t)) 32px calc(24px + var(--safe-b)); background-color: var(--bg); background-image: var(--paper); cursor: pointer;
  transition: opacity .7s var(--ease); }
.splash.out { opacity: 0; pointer-events: none; }
.splash > * { animation: fadeUp .9s var(--ease) both; }
.splash-seal { filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--accent) 35%, transparent)); animation: sealIn .9s var(--ease) both; margin-bottom: 24px; }
.splash-name { display: block; color: var(--ink); margin: 0; animation-delay: .45s; } /* KITAERU wordmark (paths) */
.splash-jp { font-family: var(--serif); color: var(--accent); letter-spacing: .18em; margin: 4px 0 0; animation-delay: .75s; }
.splash-rule { width: 56px; height: 2px; background: var(--ink); opacity: .7; margin: 22px auto; border-radius: 2px; animation-delay: 1.05s; }
.splash-line { font-family: var(--serif); color: var(--muted); max-width: 28ch; line-height: 1.6; margin: 0; animation-delay: 1.3s; animation-duration: 1.2s; }

/* ---------- welcome ---------- */
.welcome { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 0; }
.welcome-mark { margin-bottom: 26px; }
.seal-hero { filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--accent) 35%, transparent)); animation: sealIn .9s var(--ease) both; }
.welcome-title { font-size: 3.2rem; letter-spacing: .12em; font-weight: 700; }
.welcome-sub { font-family: var(--serif); color: var(--muted); letter-spacing: .06em; margin-top: 4px; }
.ink-rule { width: 64px; height: 2px; background: var(--ink); opacity: .75; margin: 20px auto; border-radius: 2px; }
.welcome-promise { max-width: 30ch; font-size: 1.08rem; margin-bottom: 10px; }
.welcome-free { max-width: 34ch; margin: 0 0 28px; }
.welcome .btn-lg { min-width: 220px; }
.welcome-foot { margin-top: 14px; }

/* ---------- onboarding ---------- */
.ob { display: flex; flex-direction: column; min-height: calc(100dvh - 20px); }
.ob-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; padding: 6px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); margin: 0 calc(-1 * var(--gut)); padding-left: 8px; padding-right: var(--gut); }
.ob-progress { flex: 1; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s var(--ease); }
.ob-count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.ob-body { flex: 1; padding: 14px 0 24px; }
.ob-body.enter { animation: fadeUp .35s var(--ease) both; }
.ob-title { font-size: 1.7rem; margin: 8px 0 6px; }
.ob-sub { font-size: 1.1rem; margin: 26px 0 10px; }
.ob-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0 calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 26%); margin-top: auto; }
.ob-foot .btn { flex: 1; }
.ob-foot .btn-primary { flex: 2; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.opt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.opt-card {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; min-height: 44px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s, background .15s, transform .1s;
}
.opt-card:hover { border-color: var(--line-strong); }
.opt-card:active { transform: scale(.99); }
.opt-card[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.opt-row { flex-direction: row; align-items: center; gap: 14px; }
.opt-kanji { font: 700 1.5rem/1 var(--serif); color: var(--accent); margin-bottom: 6px; }
.opt-name { display: block; font-weight: 650; margin: 0; }
.opt-desc { display: block; font-size: .84rem; color: var(--muted); line-height: 1.4; }
.opt-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); color: transparent; }
.opt-card[aria-pressed="true"] .opt-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.opt-level { font-size: .7rem; letter-spacing: 2px; color: var(--accent); flex: none; width: 48px; }
.base-row { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.base-name { font-weight: 600; }
.base-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.base-ctl .chip { font-size: .82rem; }
.equip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.equip { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 64px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; font-size: .9rem; line-height: 1.25; color: var(--ink); }
.equip svg { color: var(--muted); flex: none; }
.equip[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.equip[aria-pressed="true"] svg { color: var(--accent); }
.space-ico { width: 44px; height: 44px; flex: none; border: 1.5px solid var(--ink-muted); border-radius: 6px; position: relative; }
.space-ico::after { content: ""; position: absolute; background: var(--accent); border-radius: 3px; opacity: .8; }
.space-small::after { inset: 16px 8px; }
.space-medium::after { inset: 10px 5px; }
.space-large::after { inset: 4px; }
.parq { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; counter-reset: q; }
.parq li { counter-increment: q; margin: 0; padding: 14px 16px; }
.parq li p { font-size: .94rem; margin-bottom: 10px; }
.parq:not(.parq-plain) li p::before { content: counter(q) ". "; font-family: var(--serif); color: var(--accent); font-weight: 700; }
.disclaimer { margin: 16px 0; font-size: .88rem; color: var(--muted); }
.disclaimer summary { cursor: pointer; font-weight: 600; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.summary { margin: 16px 0 0; padding: 4px 16px; }
.welcome-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
.welcome-actions .btn { flex-direction: column; gap: 0; line-height: 1.2; min-height: 64px; }
.btn-sub { font-size: .76rem; font-weight: 500; opacity: .85; }
.btn-accent-outline { border-color: var(--accent); color: var(--accent); }
.quick-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.quick-card:hover { border-color: var(--accent); }
.quick-card.compact { padding: 12px 16px; }
.quick-mark { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--btn-bg); color: var(--on-accent); font: 700 1.3rem/1 var(--serif); }
.quick-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.quick-card > .ico { color: var(--muted); }
.invite-top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.invite-top p { margin: 0; }
.qhead { display: flex; gap: 6px; align-items: flex-start; margin-left: -10px; }
.qgoals .chip, .qfocus .chip { display: inline-flex; align-items: center; gap: 6px; }
.qk { font: 700 1rem/1 var(--serif); color: var(--accent); }
.chip[aria-pressed="true"] .qk { color: var(--accent-2); }
.qgoals, .qfocus { margin-top: 12px; }
.qmap-wrap { margin-top: 14px; }
.qmap { max-width: 340px; margin: 0 auto; }
.qmap svg { width: 100%; height: auto; }
.qmap .qm-hit { cursor: pointer; }
.qmap .bm-i.qm-hit { opacity: .22; }
.qmap .qm-hit:hover { opacity: .5; }
.qsel { text-align: center; margin: 8px 0 0; }
.qlist { margin-top: 10px; }
.qlist summary { min-height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; cursor: pointer; }
.qlist-grid { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 4px 16px; }
.qlist-h { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin: 8px 0 2px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.qgen { margin-top: 24px; }
.qpreview { margin-top: 18px; }
/* moments (v1.2): a third "Train for" choice */
.qseg .chip { padding: 6px 12px; }
.qmoments .chip { position: relative; }
.qhint-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); margin-left: 2px; flex: none; }
.qhint { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 6px 2px; min-height: 44px; background: none; border: 0; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; text-align: left; }
.qhint strong { color: var(--ink); font-weight: 600; }
.qhint:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.qmoment { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.qm-helper { margin: 0 0 10px; }
.qm-times .mk-times { margin-bottom: 8px; }
.qm-always { margin: 6px 0 0; }
.qm-why summary { min-height: 44px; display: flex; align-items: center; color: var(--muted); font-weight: 600; cursor: pointer; }
.qm-why p { margin: 0 0 6px; }
.qm-pick { margin: 12px 0 0; }
.qm-light { margin: 12px 0 0; }
.qpreview-moment .mk-preview { margin-top: 4px; }
.qactions { position: sticky; bottom: calc(12px + var(--safe-b)); }
.hub { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 14px 16px; }
.hub-text { display: flex; flex-direction: column; min-width: 0; }
.hub-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.hub-val { font-size: .94rem; }
.hub-row .btn { flex: none; }
.ob-edit-title { font-family: var(--serif); font-weight: 700; flex: 1; }
.sum-row { display: grid; grid-template-columns: 78px 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sum-row:last-child { border-bottom: 0; }
.sum-row dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.sum-row dd { margin: 0; font-size: .94rem; }
.sum-row .link { font-size: .85rem; }

/* forge overlay */
.forge-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg); background-image: var(--paper); opacity: 0; transition: opacity .35s; }
.forge-overlay.on { opacity: 1; }
.forge-overlay.out { opacity: 0; }
.forge-inner { text-align: center; }
.forge-inner .seal { margin: 0 auto; }
.forge-lines { list-style: none; padding: 0; margin: 28px 0 0; font-family: var(--serif); color: var(--muted); }
.forge-lines li { opacity: 0; animation: lineIn .5s var(--ease) forwards; margin: 6px 0; }
.forge-lines li:nth-child(1) { animation-delay: .5s; }
.forge-lines li:nth-child(2) { animation-delay: 1.05s; }
.forge-lines li:nth-child(3) { animation-delay: 1.6s; }
@keyframes lineIn { from { opacity: 0; transform: translateY(6px); letter-spacing: .12em; } to { opacity: 1; transform: none; letter-spacing: .02em; } }

/* seal & stamp */
.seal { display: block; }
.seal-inline { display: inline-block; vertical-align: middle; }
/* inside a vermilion button the seal inverts: paper-coloured stone, button-coloured carving */
.btn .seal-inline .seal-bg { fill: var(--on-accent); }
.btn .seal-inline .seal-ink { fill: var(--btn-bg); }
.stamp { animation: stampIn .75s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: 50% 60%; }
@keyframes stampIn { 0% { opacity: 0; transform: scale(1.9); filter: blur(3px); } 60% { opacity: 1; transform: scale(.94); filter: none; } 100% { transform: scale(1); } }
/* Seals and stamps all land straight (founder: no tilt anywhere); stamps keep the pressed-down bounce. */
@keyframes sealIn { 0% { opacity: 0; transform: scale(1.35); filter: blur(3px); } 60% { opacity: 1; transform: scale(.97); filter: none; } 100% { transform: scale(1); } }
.stamp-static { transform: none; }

/* ---------- toast & sheet ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(var(--tabh) + var(--safe-b) + 20px); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: .9rem; box-shadow: var(--shadow); animation: fadeUp .25s var(--ease); transition: opacity .3s, transform .3s; text-align: center; }
.toast.out { opacity: 0; transform: translateY(6px); }
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(20, 16, 10, .42); opacity: 0; transition: opacity .22s; }
.sheet {
  position: relative; width: 100%; max-width: 600px; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--surface); background-image: var(--paper); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .28s var(--ease); outline: none; padding-bottom: var(--safe-b);
}
.sheet-wrap.open .backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.closing .backdrop { opacity: 0; }
.sheet-wrap.closing .sheet { transform: translateY(100%); transition-duration: .2s; }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px 4px 22px; }
.sheet-title { font-size: 1.3rem; }
.sheet-body { padding: 6px 22px 24px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-small { max-width: 480px; }
.sheet-tall { min-height: 70dvh; }
.sheet-cta { margin-top: 18px; position: sticky; bottom: 0; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 22px; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet-wrap.closing .sheet { opacity: 0; transform: translateY(24px) scale(.98); }
}

/* ---------- today ---------- */
.today-card { position: relative; overflow: hidden; }
.today-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; border: 1px solid var(--line); pointer-events: none; }
.today-card .btn-block { margin-top: 16px; }
.focus { text-transform: capitalize; margin: 0; }
.thumbs { list-style: none; padding: 0; margin: 14px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 60px; height: 60px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.thumb > div { width: 60px; height: 60px; display: grid; place-items: center; }
.thumb svg { max-width: 100%; max-height: 100%; }
.thumb-more { font-size: .85rem; color: var(--muted); font-weight: 600; }
.done-row { display: flex; gap: 16px; align-items: center; }
.done-row p:last-child { margin: 0; }
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.resume-card p { margin: 0; }
.resume-card .btn-row { margin: 0; flex: none; }
.resume-card .btn-row .btn { min-width: 0; }

.streak-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.streak-main { display: flex; gap: 14px; align-items: center; }
.streak-seal { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; border: 1.5px solid var(--line-strong); color: var(--ink-muted); flex: none; }
.streak-seal.lit { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--on-accent); box-shadow: 0 6px 16px -8px var(--accent); }
.streak-num { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.streak-num .big { font-size: 1.9rem; line-height: 1; }
.streak-main .small { margin: 0; }
.week-dots { display: flex; gap: 5px; margin-top: 7px; }
.week-dots .dot { width: 18px; height: 6px; border-radius: 3px; background: var(--line); }
.week-dots .dot.on { background: var(--accent); }
.streak-side { display: flex; gap: 16px; }
.mini-stat { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.mini-num { font: 700 1.2rem/1.2 var(--serif); display: inline-flex; align-items: center; gap: 4px; }
.mini-num small { font-size: .75rem; color: var(--muted); font-weight: 500; }
.mini-lab { font-size: .72rem; color: var(--muted); }

.week-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 7px; border-radius: 12px; }
.ws-today { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ws-dow { font-size: .72rem; color: var(--muted); font-weight: 600; }
.ws-date { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ws-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.ws-done .ws-mark { background: var(--btn-bg); color: var(--on-accent); }
.ws-planned .ws-mark { border: 1.5px solid var(--accent); }
.ws-missed .ws-mark { border: 1.5px dashed var(--line-strong); }
.ws-pre { opacity: .45; }
.ws-pre .ws-mark { border: 1.5px dotted var(--line-strong); }
.ws-rest .ws-mark::before { content: ""; width: 10px; height: 1.5px; background: var(--line-strong); }
.early-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ok); margin: 10px 0 0; }
.ws-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; }
.ws-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-done { background: var(--btn-bg); }
.lg-planned { border: 1.5px solid var(--accent); }
.lg-rest { height: 1.5px; background: var(--line-strong); }
.ws-light .ws-mark { background: var(--accent-soft); color: var(--accent); border: 0; }
.ws-light .ws-mark::before { content: none; }
.lg-light { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.tick-light { background: var(--accent-soft); color: var(--accent); }
.light-note { display: flex; align-items: flex-start; gap: 6px; margin: 12px 4px 0; }
.light-note .ico { color: var(--accent); flex: none; margin-top: 3px; }
.help { margin-top: 22px; padding: 4px 18px; }
.help summary { min-height: 48px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.help p { margin: 0 0 14px; }

/* ---------- plan ---------- */
.fresh { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fresh .eyebrow { color: var(--accent); font-size: .85rem; }
.plan-days { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-day { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px 6px 6px; box-shadow: var(--shadow); }
.plan-day.is-rest { background: transparent; box-shadow: none; border-style: dashed; }
.plan-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.pd-date { width: 52px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-right: 1px solid var(--line); }
.pd-dow { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pd-num { font: 700 1.2rem/1.1 var(--serif); }
.pd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; border: 0; background: none; padding: 10px 0; min-height: 56px; justify-content: center; }
.pd-name { font-weight: 650; }
.pd-status { color: var(--muted); flex: none; }
.tick { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--btn-bg); color: var(--on-accent); }
.why-list { margin: 0; padding-left: 0; list-style: none; }
.why-list li { position: relative; padding: 8px 0 8px 22px; border-bottom: 1px solid var(--line); font-size: .94rem; }
.why-list li:last-child { border-bottom: 0; }
.why-list li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.pv-block { margin-top: 14px; }
.pv-title { font-size: .8rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }
.pv-list { list-style: none; padding: 0; margin: 0; }
.pv-item { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pv-item { position: relative; }
.pv-grouped { padding-left: 34px; }
.pv-grouped::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; border-left: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.pv-gfirst::before { top: 50%; }
.pv-glast::before { bottom: 50%; }
.pv-glabel { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 1; min-width: 26px; padding: 2px 0; text-align: center; font: 700 .72rem/1.2 var(--serif); color: var(--accent); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 6px; }
.pl-group { color: var(--accent); }
.pv-anim { width: 64px; height: 64px; flex: none; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.pv-text { display: flex; flex-direction: column; min-width: 0; }
.pv-name { font-weight: 600; color: var(--ink); text-decoration: none; padding: 4px 0; }
.pv-name:hover { color: var(--accent); }
.pv-note { color: var(--muted); font-style: italic; }

/* ---------- workout player ---------- */
.player { display: flex; flex-direction: column; }
.pl-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; margin: 0 calc(-1 * var(--gut)); padding: 6px var(--gut) 6px 8px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); }
.pl-prog { flex: 1; display: flex; gap: 3px; }
.pl-prog span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.pl-prog .seg-done { background: var(--accent); }
.pl-prog .seg-cur { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pl-prog .seg-skip { background: var(--line-strong); }
.pl-time { font-variant-numeric: tabular-nums; font-size: .88rem; color: var(--muted); min-width: 44px; text-align: right; }
/* Wind down: the player runs dark (workout.js darkPlayerOn) with a slightly dimmer stage. */
.dark-player .pl-stage { filter: brightness(.88); }
.pl-stage { display: block; margin: 4px calc(-1 * var(--gut) + 8px) 0; border-radius: 24px; background: radial-gradient(60% 55% at 50% 55%, var(--surface), transparent); }
.pl-stage svg, .pl-stage .kt-sk { display: block; width: 100% !important; max-width: none !important; height: clamp(300px, 44vh, 520px) !important; margin: 0 auto; }
@media (min-width: 720px) { .pl-stage svg, .pl-stage .kt-sk { height: clamp(380px, 52vh, 600px) !important; } }
.pl-muscles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.mchip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; padding: 3px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.mchip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.mchip-p::before { background: var(--muscle-primary); }
.mchip-s { color: var(--muted); }
.mchip-s::before { background: var(--muscle-secondary); }
.pl-block { text-align: center; margin-top: 6px; }
.pl-name { text-align: center; font-size: 1.75rem; }
.pl-target { text-align: center; font: 600 1.1rem var(--serif); color: var(--accent); margin: 4px 0 8px; }
.pl-note { text-align: center; color: var(--muted); font-style: italic; }
.pl-cues { list-style: none; padding: 0; margin: 0 auto 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 460px; }
.pl-cues li { font-size: .82rem; padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.pl-sets { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.set-pill { font-size: .8rem; padding: 5px 12px; border-radius: 99px; border: 1px dashed var(--line-strong); color: var(--muted); font-variant-numeric: tabular-nums; }
.set-pill.cur { border-style: solid; border-color: var(--ink); color: var(--ink); }
.set-pill.done { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.pl-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.logger { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logger .btn-row { width: 100%; margin-top: 4px; }
.logger .btn-block { margin-top: 4px; }
.logger p { margin: 0; }
.pl-actions { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin: 12px 0 4px; }
.pl-details { margin-top: 10px; border-top: 1px solid var(--line); }
.pl-details summary { min-height: 48px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; font-weight: 600; font-size: .9rem; }
.pl-body, .detail-muscles { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; padding-bottom: 12px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.key-p { background: var(--muscle-primary); }
.key-s { background: var(--muscle-secondary); }
.bodymap svg { display: block; max-width: 100%; height: auto; }

.ring { position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 5; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.rest-ring .ring-fill { stroke: var(--accent-2); }
.ring-label { position: relative; display: flex; flex-direction: column; align-items: center; }
.ring-main { font: 700 2.6rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.ring-main small { font-size: 1rem; color: var(--muted); margin-left: 2px; }
.ring-sub { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.ring.running .ring-fill { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 50%, transparent)); }

.rate-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.rate-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; min-height: 72px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; }
.rate-k { font: 700 1.3rem/1 var(--serif); color: var(--muted); }
.rate-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rate-btn[aria-pressed="true"] .rate-k { color: var(--accent-2); }
.pain { width: 100%; }
.pain label { display: flex; justify-content: space-between; gap: 8px; }
.pain output { font-weight: 700; font-variant-numeric: tabular-nums; }
.pain input[type=range] { width: 100%; accent-color: var(--accent); min-height: 44px; }
.pain-scale { display: flex; justify-content: space-between; margin-top: -6px; }
.pain .note { margin: 10px 0 0; }

.finish { padding-top: 20px; }
.feel { border: 0; padding: 0; margin: 20px 0; }
.feel-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.feel-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; min-height: 72px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); }
.feel-n { font: 700 1.4rem/1 var(--serif); }
.feel-t { font-size: .68rem; color: var(--muted); text-align: center; line-height: 1.15; }
.feel-btn[aria-pressed="true"] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--on-accent); }
.feel-btn[aria-pressed="true"] .feel-t { color: var(--on-accent); }
.finish .btn-block { margin-top: 10px; }

.celebrate { text-align: center; padding: 34px 0 10px; display: flex; flex-direction: column; align-items: center; }
.stamp-wrap { position: relative; margin: 10px 0 22px; }
.stamp-wrap .stamp { animation-duration: .8s; animation-delay: .1s; filter: drop-shadow(0 12px 24px color-mix(in srgb, var(--accent) 38%, transparent)); }
.ink-ring { position: absolute; inset: -18px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ripple 1.1s .55s var(--ease) both; }
@keyframes ripple { from { opacity: .6; transform: scale(.6); } to { opacity: 0; transform: scale(1.5); } }
.cele-stats { display: flex; gap: 10px; margin: 16px 0 20px; flex-wrap: wrap; justify-content: center; }
.cnum small { font-size: 1rem; color: var(--muted); }
.cnum-jp { color: var(--accent); }
.cstat { min-width: 96px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.cstat.up { border-color: var(--accent); }
.cnum { font: 700 2rem/1.1 var(--serif); }
.cstat.up .cnum { color: var(--accent); animation: bump .6s .9s var(--ease) both; }
@keyframes bump { 40% { transform: scale(1.25); } }
.clab { font-size: .8rem; color: var(--muted); }
.levelups { width: 100%; text-align: left; }
.levelups ul { list-style: none; margin: 0; padding: 0; }
.lv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); animation: fadeUp .4s 1s var(--ease) both; }
.lv:last-child { border-bottom: 0; }
.lv-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.lv.down .lv-tag { background: var(--gold-soft); color: color-mix(in srgb, var(--accent-2) 55%, var(--ink)); }
.lv-why { width: 100%; }
.celebrate > .btn { margin-top: 12px; }

/* ---------- progress ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
.stat { display: flex; align-items: center; gap: 10px; }
.stat-num { font: 700 2rem/1 var(--serif); min-width: 44px; font-variant-numeric: tabular-nums; }
.stat-num small { font-size: 1rem; }
.stat-hero .stat-num { color: var(--accent); }
.stat-wide { grid-column: 1 / -1; }
.stat-lab { font-size: .8rem; line-height: 1.3; }
.stat-foot { display: flex; align-items: flex-start; gap: 6px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hm-card { padding: 16px 14px; }
.heatmap { width: 100%; height: auto; display: block; }
.hm-lab { font-size: 9px; fill: var(--muted); font-family: var(--sans); }
.hm { stroke: none; }
.hm-0 { fill: var(--hm-0); } .hm-1 { fill: var(--hm-1); } .hm-2 { fill: var(--hm-2); } .hm-3 { fill: var(--hm-3); } .hm-4 { fill: var(--hm-4); }
.hm-today { stroke: var(--ink); stroke-width: 1.2; }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 8px; }
.hm-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.hm-legend .hm-0 { background: var(--hm-0); } .hm-legend .hm-1 { background: var(--hm-1); } .hm-legend .hm-2 { background: var(--hm-2); } .hm-legend .hm-3 { background: var(--hm-3); } .hm-legend .hm-4 { background: var(--hm-4); }
.bars { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: grid; grid-template-columns: 112px 1fr 34px; align-items: center; gap: 10px; font-size: .85rem; }
.bar-lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: var(--hm-0); border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.bar-fill.region-core { background: var(--accent-2); }
.bar-fill.region-lower { background: color-mix(in srgb, var(--accent) 60%, var(--ink)); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.ladders { list-style: none; margin: 0; padding: 0; }
.ladder { border-bottom: 1px solid var(--line); }
.ladder:last-child { border-bottom: 0; }
.ladder summary { list-style: none; cursor: pointer; padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; min-height: 44px; }
.ladder summary::-webkit-details-marker { display: none; }
.ld-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ld-fam { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.ld-cur { font-weight: 650; text-align: right; }
.ld-dots { position: relative; display: flex; justify-content: space-between; align-items: center; height: 18px; margin: 0 2px; }
.ld-dots::before, .ld-dots::after { content: ""; position: absolute; left: 5px; right: 5px; top: 50%; height: 2px; transform: translateY(-50%); background: var(--line); }
.ld-dots::after { right: auto; width: calc((100% - 10px) * var(--pf, 0)); background: var(--accent); }
.ld-dots i { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-strong); }
.ld-dots i.past { background: var(--accent); border-color: var(--accent); }
.ld-dots i.cur { width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); background: var(--btn-bg); border-color: var(--btn-bg); box-shadow: 0 0 0 4px var(--accent-soft); }
.ld-list { margin: 0; padding: 0 18px 14px 40px; font-size: .9rem; }
.ld-list li { padding: 4px 0; }
.ld-list li.past a { color: var(--muted); }
.ld-list li.cur a { font-weight: 700; }
.ld-list li.na a { color: var(--ink-muted); }
.ld-list a { color: var(--ink); text-decoration: none; display: inline-block; min-height: 32px; padding: 4px 0; }
.ld-list a:hover { color: var(--accent); }
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 52px; }
.list > li:last-child .list-item, .list > .list-item:last-child { border-bottom: 0; }
.list-item a { color: var(--ink); text-decoration: none; font-weight: 600; flex: 1; }
.list-item a:hover { color: var(--accent); }
.list-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--ink); }
.list-btn > span { display: flex; flex-direction: column; }
.list-btn:hover { background: var(--surface-2); }
.history li:last-child .list-btn { border-bottom: 0; }
.pb-val { font: 700 1.15rem var(--serif); font-variant-numeric: tabular-nums; }
.pb-val small { font: 500 .75rem var(--sans); color: var(--muted); }
.detail-item > span:first-child { display: flex; flex-direction: column; }
.detail-item { padding: 12px 0; }
.wchart { width: 100%; height: auto; display: block; margin-bottom: 10px; }
.wchart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.wline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wdot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.8; }
.bw-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.bw-form .num-field input { width: 70px; }
.bw-form .input { flex: 1; min-width: 130px; width: auto; }
.bw-list { margin-top: 10px; }
.bw-list .list-item { padding: 4px 0; min-height: 44px; }
.bw-list .list-item span:first-child { flex: 1; }

/* ---------- library ---------- */
.lib-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; border-radius: 999px; }
.filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lib-grid { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lib-card { display: flex; flex-direction: column; height: 100%; padding: 10px 12px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; position: relative; }
.lib-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.lib-card.na { opacity: .66; }
.lib-thumb { height: 108px; display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.lib-thumb svg { max-width: 100%; max-height: 100%; }
.lib-name { font-weight: 650; font-size: .92rem; line-height: 1.25; }
.lib-meta { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.lib-na { position: absolute; top: 14px; right: 16px; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface); padding: 2px 6px; border-radius: 99px; border: 1px solid var(--line); }
.empty { text-align: center; padding: 40px 0; }
.detail-stage { display: grid; place-items: center; min-height: 200px; background: radial-gradient(closest-side, var(--surface-2), transparent); border-radius: 20px; margin-bottom: 6px; }
.detail-stage svg { max-width: 100%; height: auto; }
.detail-muscles { justify-content: flex-start; margin: 10px 0; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.detail-muscles .h3 { margin-top: 0; }
.cues, .mistakes { margin: 0; padding-left: 20px; }
.cues li, .mistakes li { padding: 3px 0; }
.mistakes li::marker { content: "✕  "; color: var(--accent); font-size: .8em; }
.ladder-v { list-style: none; padding: 0; margin: 0; border-left: 1.5px solid var(--line-strong); margin-left: 6px; }
.ladder-v li { display: flex; justify-content: space-between; align-items: center; padding: 2px 0 2px 16px; position: relative; min-height: 40px; }
.ladder-v li::before { content: ""; position: absolute; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-strong); }
.ladder-v li.cur::before { background: var(--accent); border-color: var(--accent); width: 10px; height: 10px; left: -6px; }
.ladder-v li.cur span:first-child { font-weight: 700; color: var(--accent); }
.ladder-v a { color: var(--ink); text-decoration: none; padding: 8px 0; }
.ladder-v a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- v1.2 world movement: native names ---------- */
/* System fonts per script. lang= on .native picks the right fallback and glyph shapes (e.g. 势 马 锦 are simplified-only
   and missing from Noto Serif JP, so zh-Hans never starts with the Japanese face). */
.native { font-family: var(--serif); font-weight: 600; }
.native:lang(ja) { font-family: var(--serif); }
.native:lang(zh-Hans), .native:lang(zh-CN) { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, "Noto Serif CJK SC", "PingFang SC", "Microsoft YaHei", serif; }
.native:lang(zh-Hant), .native:lang(zh-TW) { font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", PMingLiU, MingLiU, "Noto Serif CJK TC", "PingFang TC", "Microsoft JhengHei", serif; }
.native:lang(hi), .native:lang(mr), .native:lang(sa) { font-family: "Noto Serif Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", Mangal, "Noto Sans Devanagari", serif; font-weight: 500; }
.native:lang(ur) { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", serif; font-weight: 400; }
.native-name { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 .45em; }
.roman { font-family: var(--sans); font-weight: 500; color: var(--muted); font-size: .86em; letter-spacing: .01em; }
.sheet-title .native-name { display: flex; font-size: 1.05rem; }
.sheet-title .title-native .native { color: var(--accent); font-size: 1.25rem; }
.sheet-title .title-en { display: block; }
.lib-native { display: block; font-size: .8rem; color: var(--accent); line-height: 1.3; }
.pl-native { display: flex; justify-content: center; font-size: 1.05rem; margin-top: 4px; }
.pl-native .native { color: var(--accent); }
.origin-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 4px 0 2px; font-size: .92rem; }
.origin-line .link { padding-left: 0; }
.cc-attr .label, .cc-sources .label { display: inline; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 6px 0 0; }

/* ---------- culture cards ---------- */
/* The disciplines wrap into a grid: every one stays visible at 360 px and up (it used to scroll off-screen with no hint). */
.cc-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cc-chip { min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); text-align: left; }
.cc-chip:hover { border-color: var(--ink); }
.cc-chip-native { min-width: 40px; justify-content: center; }
.cc-chip-native .native { font-size: 1.15rem; color: var(--accent); }
.cc-chip-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cc-chip-name { font-weight: 650; font-size: .92rem; }
.cc-row .cc-chip { gap: 8px; padding: 8px 10px 8px 8px; }
.cc-row .cc-chip-native { min-width: 34px; }
.cc-row .cc-chip-native .native { font-size: 1.05rem; }
.cc-chip-explainer { border-style: dashed; }
.cc-chip-mark { color: var(--muted); width: 40px; display: grid; place-items: center; }
.culture { padding-bottom: 8px; }
.cc-head { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin: 2px 0 14px; }
.cc-native .native { font-size: 2rem; line-height: 1.2; color: var(--ink); }
.cc-native .roman { font-size: 1rem; }
.cc-title { font-size: 1.15rem; margin: 2px 0 0; }
.cc-where { margin: 2px 0 0; }
.cc-copy { font-size: 1rem; line-height: 1.65; }
.cc-trains { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 16px; }
.cc-trains li { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; min-height: 30px; border-bottom: 1px solid var(--line); }
.cc-dots { display: inline-flex; gap: 4px; }
.cc-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.cc-dots i.on { background: var(--ink); border-color: var(--ink); }
.cc-evidence { list-style: none; padding: 0; margin: 0; }
.cc-evidence li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.cc-grade { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; font: 700 .85rem var(--serif); color: var(--on-accent); background: var(--accent); }
.cc-attr { margin-top: 14px; }
.cc-items { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-link { display: inline-flex; align-items: center; text-decoration: none; min-height: 40px; }
.cc-sources { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.7; overflow-wrap: anywhere; }
.cc-sources a { color: var(--ink); }
/* The rotation explainer is not a tradition: no seal-red rule, no native name, a plain dashed frame. */
.culture-explainer { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 16px; background: var(--surface-2); }
.culture-explainer .cc-title { font-size: 1.3rem; margin-bottom: 8px; }
.culture-explainer .cc-grade { background: var(--ink); color: var(--bg); }

/* ---------- flow player ---------- */
.logger.flow { gap: 10px; }
/* Flows: a shorter stage, the step count beside its ring right under the name, so stage, step, count and ring all fit
   on a 375×812 screen without scrolling (the cues and the step list follow). */
.is-flow .pl-stage svg, .is-flow .pl-stage .kt-sk { height: clamp(220px, 31vh, 420px) !important; }
@media (min-width: 720px) { .is-flow .pl-stage svg, .is-flow .pl-stage .kt-sk { height: clamp(300px, 42vh, 520px) !important; } }
.is-flow .pl-muscles { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; margin: 2px 0; }
.is-flow .pl-muscles::-webkit-scrollbar { display: none; }
.is-flow .pl-muscles .mchip { flex: none; }
.is-flow .pl-name { font-size: 1.45rem; margin-bottom: 4px; }
.is-flow .pl-block { margin-bottom: 0; }
.logger.flow { display: grid; grid-template-columns: 112px 1fr; align-items: center; column-gap: 14px; }
.logger.flow > .fl-now { grid-column: 2; grid-row: 1; min-height: 112px; align-items: flex-start; text-align: left; }
.logger.flow > .ring { grid-column: 1; grid-row: 1; }
.logger.flow > :not(.fl-now):not(.ring) { grid-column: 1 / -1; }
.logger.flow .fl-count, .logger.flow .fl-beads { justify-content: flex-start; }
.fl-now { text-align: center; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.fl-now-name { font: 700 1.25rem var(--serif); }
.fl-now-cue { color: var(--muted); font-size: .95rem; }
.fl-native { justify-content: center; font-size: .95rem; }
.fl-native .native { color: var(--accent); }
.fl-count { display: flex; align-items: baseline; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 4px !important; }
.fl-count-n { font: 700 2.6rem/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--accent); min-width: 1.2em; }
.fl-count-of { color: var(--muted); font-size: .95rem; }
.fl-count-side { flex-basis: 100%; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fl-beads { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 260px; margin-top: 6px; }
.fl-beads i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line-strong); transition: background .2s, border-color .2s, transform .2s; }
.fl-beads i.done { background: var(--ink); border-color: var(--ink); }
.fl-beads i.cur { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.fl-adapt { color: color-mix(in srgb, var(--accent-2) 55%, var(--ink)); }
.fl-steps { list-style: none; padding: 0; margin: 14px 0 0; }
.fl-step { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; transition: background .2s; }
.fl-step:last-child { border-bottom: 0; }
.fl-n { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-strong); font: 600 .8rem var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.fl-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fl-body .badge { align-self: flex-start; margin-top: 3px; }
.fl-name { font-weight: 650; }
.fl-step.cur { background: var(--accent-soft); border-radius: 10px; }
.fl-step.cur .fl-n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fl-step.done .fl-n { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.fl-step.done .fl-name { color: var(--muted); }
.fl-skipped .fl-name { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.fl-skipped .fl-n { border-style: dashed; }
.fl-steps-static { margin-top: 0; }

/* ---------- options & Morning Taisō ---------- */
.options { margin-top: 12px; border-top: 1px solid var(--line); }
.opt-swap { padding: 8px 0; border-bottom: 1px solid var(--line); }
.opt-swap > span { display: flex; flex-direction: column; }
.taiso-card { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
.taiso-card .card-title { margin-top: 0; }
.taiso-native { font-size: .95rem; }
.taiso-native .native { color: var(--accent); }
.taiso-card .btn-block { margin-top: 8px; }

/* ---------- me ---------- */
.kv { margin: 0 0 14px; }
.kv > div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: 2px; }
.kv dd { margin: 0; }
.settings { padding: 6px 18px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 56px; }
.set-row:last-child { border-bottom: 0; }
.about-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.about-head p { margin: 0; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.version-row p { margin: 0; }

/* ---------- desktop ---------- */
@media (min-width: 720px) {
  :root { --gut: 28px; }
  .title { font-size: 2rem; }
  .card { padding: 22px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- sideways-scrolling chip rows: a fade says there is more ---------- */
.scroll-x { position: relative; }
.scroll-x::after { content: ""; position: absolute; top: 0; bottom: 2px; right: calc(-1 * var(--gut)); width: 44px; pointer-events: none;
  background: linear-gradient(to right, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 85%); transition: opacity .2s; }
.scroll-x.at-end::after { opacity: 0; }

/* ---------- make a workout (Library pools; reusable sheet) ---------- */
.mk-open { width: 100%; font: inherit; text-align: left; cursor: pointer; margin: 0; }
.mk-open .opt-name { font-weight: 650; }
.mk-open > .ico { color: var(--muted); flex: none; }
.lib-make { margin: -4px 0 16px; }
.mk-in-card { margin: 4px 0 18px; }
.mk-eyebrow { display: block; font: 600 .72rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mk-lead { margin: 0 0 12px; }
.mk-times { margin-bottom: 14px; }
.mk-sum { margin: 0 0 6px; }
.mk-note { margin: 8px 0 10px; }
.mk-list { list-style: none; padding: 0; margin: 0; }
.mk-block { margin-top: 10px; }
.mk-block-t { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.mk-block ul { list-style: none; padding: 0; margin: 0; }
.mk-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mk-name { font-weight: 600; min-width: 0; }
.mk-item .muted { text-align: right; flex: none; max-width: 55%; }
.mk-cta { padding: 12px 0 calc(4px + var(--safe-b)); background: linear-gradient(to bottom, transparent, var(--surface) 30%); }

/* ---------- v1.3: today's kit, level, shuffle, swap, reasons ---------- */
.kit-chips { gap: 6px; }
.kit-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .86rem; }
.kit-chip svg { flex: none; color: var(--muted); }
.kit-chip[aria-pressed="true"] svg { color: var(--accent-2); }
.kit-help { margin: 8px 0 0; }
.kit-help .link { padding: 0 4px; min-height: 0; }
.qkit .switch-row { margin-top: 12px; }
.kit-box { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; background: var(--surface); }
.kit-box > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; cursor: pointer; }
.kit-box > summary::-webkit-details-marker { display: none; }
.kit-box[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.kit-box[open] { padding-bottom: 10px; }
.kit-sum { min-width: 0; font-size: .9rem; }
.kit-sum .label { display: inline; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 6px 0 0; }
.link-like { color: var(--accent); font-weight: 600; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; flex: none; }
.lvl-seg .chip { min-width: 48px; font-variant-numeric: tabular-nums; }
.lvl-help { margin: 8px 0 0; }
.mk-level { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.mk-level .label { margin: 0; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lvl-note { margin: 6px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.lvl-note .badge { flex: none; font-variant-numeric: tabular-nums; }
.shuffle-note { margin: 4px 0 8px; }
.mk-cta.btn-row { display: flex; gap: 8px; }
.mk-cta.btn-row .btn-primary { flex: 1; }
.na-note { align-items: flex-start; }
.na-note strong { font-weight: 650; }
.similar { list-style: none; padding: 0; margin: 0; }
.similar li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.similar a { font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; }
.swap-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.swap-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.swap-opt:hover { border-color: var(--ink); }
.swap-opt > .ico { color: var(--muted); flex: none; margin-left: auto; }
.swap-thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; background: var(--bg); overflow: hidden; }
.swap-thumb svg { width: 100%; height: 100%; }
.swap-text { display: flex; flex-direction: column; min-width: 0; }
/* the motion trail in the workout player: the Library's path, fainter so it never competes with the figure */
/* v1.3: the reason label ("not with your knee", "needs a pull-up bar") is longer than "needs kit": a quiet pill that wraps */
.lib-na { left: 14px; right: auto; width: max-content; max-width: calc(100% - 28px); text-transform: none; letter-spacing: 0; font-size: .72rem; line-height: 1.3; border-radius: 10px; padding: 2px 8px; }
.pl-stage .kt-pl .pl-trail { opacity: .5; }
.pl-stage .kt-pl .pl-comet { opacity: .55; }

/* ---------- terms of use and safety (js/ui/terms.js) ---------- */
.terms { max-width: 640px; margin: 0 auto; padding: 8px 0 32px; }
.terms .note { margin: 16px 0 8px; }
.terms .note p { margin: 0 0 8px; }
.terms-screen { margin: 4px 0 0; padding-left: 1.2em; font-size: .92em; }
.terms-screen li { margin: 2px 0; }
.terms-sec { margin: 20px 0 0; }
.terms-sec p { margin: 6px 0 0; line-height: 1.55; }
.terms-accept { margin-top: 28px; display: grid; gap: 14px; }
.terms-check { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; cursor: pointer; }
.terms-check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.terms-accepted { margin-top: 24px; display: flex; gap: 6px; align-items: center; }

/* ---------- anim v3: the human body (js/anim/v3/body-player.js) ---------- */
/* big player: a div (canvas + breath ring) sized like the v2 plate's svg on the workout stage */
.kt-v3 { display: block; }
.pl-stage .kt-v3 { width: 100% !important; max-width: none !important; height: clamp(300px, 44vh, 520px) !important; margin: 0 auto; }
@media (min-width: 720px) { .pl-stage .kt-v3 { height: clamp(380px, 52vh, 600px) !important; } }
.is-flow .pl-stage .kt-v3 { height: clamp(220px, 31vh, 420px) !important; }
@media (min-width: 720px) { .is-flow .pl-stage .kt-v3 { height: clamp(300px, 42vh, 520px) !important; } }
/* thumbnails: a small 2D canvas painted by the shared renderer, fitted inside the thumbnail box */
canvas.kt-v3.lod { width: 100% !important; height: 100% !important; max-height: 100%; object-fit: contain; }
.lib-thumb canvas.kt-v3.lod { height: 104px !important; }
