:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0e1c2e;
  --panel-2: #14263c;
  --ink: #f4f7fb;
  --muted: #94a6ba;
  --line: #263b53;
  --lime: #d8ff3e;
  --lime-ink: #122000;
  --blue: #59b8ff;
  --danger: #ff6b6b;
  --glow: #163757;
  --strong-line: #2c435d;
  --hero-start: #142a42;
  --hero-end: #0b1828;
  --shadow: #02091477;
  --input-bg: #081422;
  --body-copy: #d4deea;
  --accent-shadow: #b8e61a22;
  --danger-bg: #3b1920;
  --error-copy: #ffb2b2;
  --danger-line: #75323d;
  --item-bg: #0b1828cc;
  --nav-bg: #07111fee;
  --rest-bg: #17314e;
  --warning-copy: #ffcf80;
  --selected-bg: #172b29;
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: radial-gradient(circle at 80% 0%, var(--glow) 0, var(--bg) 30rem); color: var(--ink); min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
button { cursor: pointer; }
.app-shell { width: min(100%, 520px); min-height: 100dvh; margin: 0 auto; padding: env(safe-area-inset-top) 18px calc(92px + env(safe-area-inset-bottom)); }
.topbar { height: 84px; display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 1px 0 0; font-size: 1.25rem; letter-spacing: .03em; }
.eyebrow { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .15em; color: var(--lime); }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; background: var(--lime); display: grid; grid-template-columns: 8px 1fr 8px; align-items: center; gap: 3px; padding: 9px 7px; transform: rotate(-5deg); }
.brand-mark span { height: 17px; border-radius: 3px; background: var(--lime-ink); }
.brand-mark i { height: 6px; background: var(--lime-ink); }
.icon-button { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 800; }
.hero { padding: 23px; border: 1px solid var(--strong-line); border-radius: 28px; background: linear-gradient(150deg, var(--hero-start), var(--hero-end)); box-shadow: 0 20px 50px var(--shadow); }
.kicker { color: var(--lime); font-weight: 800; font-size: .78rem; letter-spacing: .11em; margin: 0 0 8px; }
.hero-row { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.menu-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.menu-picker button { min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); font-weight: 800; }
.menu-picker button[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.menu-picker button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.hero h2 { font-size: 2.15rem; line-height: 1.08; margin: 0; letter-spacing: -.04em; }
.session-letter { flex: 0 0 auto; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: var(--lime); color: var(--lime-ink); font-size: 2rem; font-weight: 900; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 18px; }
.metric { border-left: 1px solid var(--line); padding-left: 10px; }
.metric:first-child { border: 0; padding-left: 0; }
.metric strong { display: block; font-size: 1.05rem; }
.metric span { color: var(--muted); font-size: .72rem; }
.checkline { display: flex; gap: 10px; align-items: center; background: var(--input-bg); padding: 12px 13px; border-radius: 14px; color: var(--body-copy); font-size: .9rem; }
.checkline input { width: 21px; height: 21px; accent-color: var(--lime); }
.primary, .secondary, .danger { border: 0; border-radius: 15px; padding: 15px 17px; font-weight: 850; min-height: 52px; }
.primary { background: var(--lime); color: var(--lime-ink); box-shadow: 0 8px 24px var(--accent-shadow); }
.primary:disabled { opacity: .35; box-shadow: none; cursor: not-allowed; }
.secondary { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.danger { background: var(--danger-bg); color: var(--error-copy); border: 1px solid var(--danger-line); }
.full { width: 100%; margin-top: 15px; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin: 28px 2px 13px; }
.section-title h2 { margin: 0; font-size: 1.1rem; }
.section-title span { color: var(--muted); font-size: .78rem; }
.plan-list, .history-list { display: grid; gap: 9px; }
.plan-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line); background: var(--item-bg); border-radius: 16px; }
.plan-index { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--panel-2); color: var(--lime); font-weight: 850; }
.plan-item strong { display: block; }
.plan-item small, .muted { color: var(--muted); }
.pill { border: 1px solid var(--strong-line); border-radius: 999px; padding: 5px 8px; color: var(--body-copy); font-size: .72rem; white-space: nowrap; }
.bottom-nav { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 520px); height: calc(72px + env(safe-area-inset-bottom)); padding: 7px 18px env(safe-area-inset-bottom); background: var(--nav-bg); backdrop-filter: blur(20px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.bottom-nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-content: center; gap: 3px; font-size: .72rem; }
.bottom-nav button span { font-size: 1.05rem; }
.bottom-nav button.active { color: var(--lime); }
.workout-head { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 16px; }
.workout-head h2 { margin: 0; font-size: 1.45rem; }
.progress-track { height: 7px; background: var(--panel-2); border-radius: 10px; overflow: hidden; margin: 0 0 22px; }
.progress-track i { display: block; height: 100%; background: var(--lime); transition: width .25s ease; }
.exercise-card { background: linear-gradient(160deg, var(--hero-start), var(--hero-end)); border: 1px solid var(--strong-line); border-radius: 26px; padding: 21px; }
.exercise-no { color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.exercise-card h2 { font-size: 1.85rem; margin: 8px 0 5px; }
.cue { color: var(--body-copy); margin: 0; min-height: 48px; line-height: 1.55; }
.set-dots { display: flex; gap: 7px; margin: 18px 0; }
.set-dots i { width: 30px; height: 6px; border-radius: 10px; background: var(--strong-line); }
.set-dots i.done { background: var(--lime); }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field, .field-wrap { min-width: 0; }
.bodyweight-display { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px 0; }
.bodyweight-display strong { font-size: 1.3rem; color: var(--ink); }
.bodyweight-display small { font-size: .875rem; color: var(--muted); }
.field label { color: var(--muted); font-size: .78rem; display: block; margin: 0 0 6px; }
.field-wrap { display: flex; align-items: center; background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; padding: 0 11px; }
.field input, .field select { width: 100%; min-width: 0; flex: 1 1 0%; min-height: 52px; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 1.15rem; font-weight: 800; }
.field-wrap span { flex: 0 0 auto; margin-left: 6px; color: var(--muted); font-size: .78rem; }
.field-wrap:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
input, textarea, select { scroll-margin-block: 100px; }
input[readonly] { color: var(--muted); }
.rir-row { margin-top: 11px; }
.rir-row select { font-size: 1rem; }
.rest-bar { position: sticky; bottom: 83px; margin-top: 12px; background: var(--rest-bg); border: 1px solid var(--strong-line); border-radius: 17px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; }
.rest-bar strong { font-variant-numeric: tabular-nums; font-size: 1.35rem; color: var(--lime); }
.rest-bar button { color: var(--ink); background: transparent; border: 0; text-decoration: underline; }
.summary-card, .empty-card, .settings-card, .history-item { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 17px; }
.summary-card h3, .history-item h3 { margin: 0 0 5px; }
.suggestion { margin-top: 10px; border-left: 3px solid var(--lime); padding-left: 10px; color: var(--body-copy); }
.history-item { display: flex; justify-content: space-between; gap: 14px; }
.history-item time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.settings-card h2 { margin-top: 0; }
.settings-card + .settings-card { margin-top: 12px; }
.settings-card p { color: var(--muted); line-height: 1.65; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
dialog { width: min(calc(100% - 28px), 470px); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 21px; }
dialog::backdrop { background: #020813cc; backdrop-filter: blur(5px); }
dialog h2 { margin: 0; }
.safety-list { padding-left: 1.25rem; line-height: 1.65; color: var(--body-copy); }
.safety-list li + li { margin-top: 10px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 95px; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; background: var(--lime); color: var(--lime-ink); padding: 11px 16px; border-radius: 999px; font-weight: 800; transition: .2s; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.finish-mark { width: 74px; height: 74px; border-radius: 23px; display: grid; place-items: center; margin: 18px auto; background: var(--lime); color: var(--lime-ink); font-size: 2rem; font-weight: 900; transform: rotate(-4deg); }
.center { text-align: center; }
.nutrition-hero { padding: 21px; border: 1px solid var(--strong-line); border-radius: 25px; background: linear-gradient(150deg, var(--hero-start), var(--hero-end)); }
.nutrition-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.nutrition-head h2 { margin: 0; font-size: 1.35rem; }
.nutrition-head > strong { color: var(--lime); font-size: 2rem; white-space: nowrap; }
.nutrition-head small { color: var(--muted); font-size: .85rem; }
.nutrition-hero > p { color: var(--body-copy); margin: 13px 0 0; line-height: 1.55; }
.protein-track { height: 11px; margin-top: 18px; background: var(--input-bg); border-radius: 99px; overflow: hidden; }
.protein-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--lime)); border-radius: inherit; transition: width .25s ease; }
.food-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.food-preset { min-height: 92px; padding: 13px; color: var(--ink); text-align: left; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); display: grid; grid-template-columns: 1fr auto; align-items: center; }
.food-preset span { font-weight: 850; }
.quick-preset { grid-template-columns: minmax(0,1fr); gap: 6px; }
.quick-preset small, .usual-row small { display: block; line-height: 1.5; }
.usual-food, #quickBasket, #quickPortion { margin-top: 14px; }
.quick-items { padding: 0; list-style: none; }
.quick-items li, .usual-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.quick-items li > span, .usual-row > button:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quick-items small { display: block; color: var(--muted); line-height: 1.5; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.quick-total { line-height: 1.7; }
.storage-info, .storage-notice { margin: 16px 0; }
.storage-info { scroll-margin-top: 20px; }
.storage-diagram { margin: 20px 0; }
.storage-diagram figcaption { margin-bottom: 14px; font-weight: 800; }
.storage-node { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); text-align: center; overflow-wrap: anywhere; }
.storage-node span { color: var(--body-copy); font-size: .875rem; line-height: 1.6; }
.storage-device { padding: 14px; border: 2px solid var(--blue); border-radius: 18px; display: grid; gap: 12px; text-align: center; }
.storage-arrow { padding: 10px 0; text-align: center; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.food-preset small { color: var(--muted); grid-column: 1; }
.food-preset strong { color: var(--lime); grid-column: 2; grid-row: 1 / 3; }
.custom-food { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.custom-food[hidden] { display: none; }
.custom-food .full { grid-column: 1 / -1; }
.meal-list { display: grid; gap: 8px; }
.meal-item { display: grid; grid-template-columns: 1fr auto 34px; gap: 10px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--item-bg); }
.meal-item small { display: block; color: var(--muted); margin-top: 3px; }
.meal-item > span { color: var(--lime); font-weight: 850; }
.meal-item button { width: 32px; height: 32px; border-radius: 50%; border: 0; color: var(--muted); background: var(--panel-2); }
.meal-tip, .recovery-card { margin-top: 18px; padding: 17px; border: 1px solid var(--strong-line); border-radius: 18px; background: var(--rest-bg); }
.meal-tip strong, .recovery-card > span { color: var(--blue); font-size: .8rem; font-weight: 850; }
.meal-tip p, .recovery-card p { color: var(--body-copy); line-height: 1.55; margin-bottom: 0; }
.recovery-card > strong { display: block; margin-top: 6px; font-size: 1.15rem; }
@media (min-width: 760px) { .app-shell { padding-left: 24px; padding-right: 24px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.shake-card { margin-top: 18px; padding: 18px; border: 1px solid var(--strong-line); border-radius: 20px; background: var(--panel); }
.shake-card h2 { margin: 0; font-size: 1.2rem; }
.shake-card p { color: var(--body-copy); line-height: 1.6; }
.shake-card .shake-note { font-size: .875rem; margin-bottom: 0; }
.shake-card label { font-size: .875rem; }
.shake-card .field, .shake-card input, .shake-card select { min-width: 0; }
.shake-card .field-wrap:focus-within { border-color: var(--lime); }
@media (max-width: 360px) { .shake-card .input-grid { grid-template-columns: 1fr; } }

.import-card { margin-top: 18px; padding: 18px; background: var(--panel); border: 1px solid var(--strong-line); border-radius: 20px; }
.import-card h2 { font-size: 1.2rem; margin: 0; }
.import-card p, .import-card li { line-height: 1.6; color: var(--body-copy); overflow-wrap: anywhere; }
.import-card label { display: block; margin: 16px 0 8px; font-size: .875rem; color: var(--body-copy); }
.import-card textarea { display: block; width: 100%; min-width: 0; resize: vertical; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); color: var(--ink); padding: 12px; font: inherit; line-height: 1.6; }
.import-card textarea:focus, .import-card .field-wrap:focus-within { outline: 2px solid var(--lime); outline-offset: 2px; }
.import-card input { min-width: 0; }
.import-card details { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.import-card summary { cursor: pointer; font-size: .875rem; }
.import-card ol { padding-left: 20px; }
.import-card li + li { margin-top: 8px; }
.import-card #importError { color: var(--error-copy); }
.import-card #importReview { margin-top: 20px; border-top: 1px solid var(--line); }
.import-card #foodPrompt { font-size: .875rem; }
.date-card { padding: 16px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.date-card p, .calendar-legend { font-size: .875rem; line-height: 1.6; color: var(--body-copy); }
.date-card label { font-size: .875rem; }
.date-card .field, .date-card input { min-width: 0; }
.date-card input { font-size: 1rem; }
.calendar-card { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 12px; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.calendar-heading h3 { font-size: 1.15rem; }
.calendar-heading button { min-width: 44px; font-size: 1.3rem; padding: 8px 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekday { text-align: center; font-size: .875rem; padding: 6px 0; color: var(--muted); }
.calendar-day { min-width: 0; min-height: 56px; padding: 6px 0; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; background: var(--input-bg); color: var(--ink); font-size: 1rem; }
.calendar-day small { font-size: .75rem; min-height: 1em; color: var(--blue); }
.calendar-day.is-today { border-color: var(--blue); }
.calendar-day[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.calendar-day[aria-pressed="true"] small { color: var(--lime-ink); }
.calendar-day:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.calendar-meals { margin-top: 16px; }
@media (max-width: 380px) { .date-card .input-grid { grid-template-columns: 1fr; } }
.extra-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; grid-column: 1 / -1; }
.extra-fields .field, .extra-fields input { min-width: 0; }
.extra-fields label { font-size: .875rem; }
.extra-fields .field-wrap { padding: 0 8px; }
.extra-fields input { font-size: 1rem; }
.macro-summary { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.macro-stat { min-width: 0; padding: 12px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 7px; }
.macro-stat > span { font-size: .875rem; }
.macro-stat strong { font-size: 1.2rem; color: var(--lime); overflow-wrap: anywhere; }
.macro-stat small { font-size: .875rem; color: var(--body-copy); }
.macro-stat .missing { color: var(--warning-copy); font-size: .8rem; line-height: 1.5; }
.macro-summary > p { grid-column: 1 / -1; font-size: .875rem; color: var(--body-copy); line-height: 1.6; margin: 0; }
.meal-item > div { min-width: 0; overflow-wrap: anywhere; }
.meal-item small { line-height: 1.5; font-size: .8rem; }
@media (max-width: 380px) { .extra-fields { grid-template-columns: 1fr; } .macro-summary { grid-template-columns: 1fr; } }
.goal-card { margin: 18px 0; padding: 18px; border: 1px solid var(--strong-line); border-radius: 20px; background: var(--panel); }
.goal-card h2 { font-size: 1.2rem; margin: 0; }
.goal-card p { color: var(--body-copy); line-height: 1.6; overflow-wrap: anywhere; }
.goal-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.goal-heading button { flex-shrink: 0; }
.goal-score { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 8px; }
.goal-score span { font-size: .95rem; }
.goal-score strong { color: var(--lime); font-size: 1.6rem; }
.goal-card progress { width: 100%; height: 12px; border: 0; border-radius: 10px; overflow: hidden; background: var(--input-bg); accent-color: var(--lime); }
.goal-card progress::-webkit-progress-bar { background: var(--input-bg); }
.goal-card progress::-webkit-progress-value { background: var(--lime); }
.goal-card progress::-moz-progress-bar { background: var(--lime); }
.goal-card .goal-note { font-size: .875rem; }
.goal-card .field { margin-top: 15px; min-width: 0; }
.goal-card .field label { font-size: .875rem; line-height: 1.5; }
.goal-card input, .goal-card select { min-width: 0; font-size: 1rem; }
.goal-card select { text-overflow: ellipsis; }
.goal-card .field-wrap:focus-within { outline: 2px solid var(--lime); }
.goal-card #goalError { color: var(--error-copy); }
.goal-card a { color: var(--blue); }
.target-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.target-tiles > div { background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-width: 0; }
.target-tiles span { display: block; font-size: .875rem; color: var(--body-copy); }
.target-tiles strong { display: block; font-size: 1.4rem; color: var(--lime); margin-top: 6px; overflow-wrap: anywhere; }
.target-tiles small { font-size: .875rem; }
.target-estimator details { margin-top: 16px; }
.target-estimator summary { cursor: pointer; line-height: 1.6; }
#estimateError { color: var(--error-copy); }
#estimateResult { margin-top: 18px; border-top: 1px solid var(--line); }
#bodyGoalFields[hidden] { display: none; }
#goalPlanPreview { border-left: 2px solid var(--blue); padding-left: 14px; font-size: .875rem; }
@media (max-width: 380px) { .goal-card .input-grid { grid-template-columns: 1fr; } .goal-score { flex-wrap: wrap; } }
.studio-card { padding: 18px; margin: 0 0 18px; background: var(--panel); border: 1px solid var(--strong-line); border-radius: 20px; }
.studio-card h2 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.studio-card p { color: var(--body-copy); line-height: 1.6; }
.studio-card input { min-width: 0; width: 100%; font-size: 1rem; }
.studio-card form .primary { margin-top: 12px; }
.studio-result { display: block; text-align: left; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); color: var(--ink); margin-top: 10px; }
.studio-result span, .studio-result small { display: block; margin-top: 8px; color: var(--body-copy); font-size: .875rem; }
.studio-result strong { font-size: 1rem; }
.studio-result small { color: var(--lime); }
.studio-equipment { padding-left: 20px; line-height: 1.9; }
.studio-links { display: flex; flex-wrap: wrap; gap: 20px; margin: 16px 0; }
.studio-links a { color: var(--blue); }
.studio-saved button { margin-top: 12px; }
.studio-saved [aria-pressed=true] { border-color: var(--lime); color: var(--lime); }
.studio-card .goal-heading { flex-wrap: wrap; }
.studio-name { margin: 20px 0 24px; }
.equipment-group { margin: 20px 0; padding: 0; border: 0; min-width: 0; }
.equipment-group legend { font-weight: 700; color: var(--lime); margin-bottom: 10px; }
.equipment-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.equipment-choice { display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 12px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.equipment-choice:has(input:checked) { border-color: var(--lime); background: var(--selected-bg); }
.equipment-choice:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.equipment-choice input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--lime); }
.equipment-choice strong { display: block; font-size: 1rem; overflow-wrap: anywhere; }
.equipment-choice small { display: block; margin-top: 5px; font-size: .875rem; color: var(--body-copy); }
.equipment-tip { padding: 12px; background: var(--input-bg); border-radius: 10px; font-size: .875rem; }
.saved-studio-row { display: flex; gap: 8px; }
.saved-studio-row button:first-child { flex: 1; overflow-wrap: anywhere; }
#studioError { color: var(--error-copy); }
@media(max-width:390px) { .equipment-grid { grid-template-columns: 1fr; } }
.workout-options { margin: 12px 0 18px; padding: 18px; border: 1px solid var(--blue); border-radius: 18px; background: var(--panel); }
.workout-options[hidden] { display: none; }
.workout-options h3 { margin: 0; font-size: 1.15rem; }
.workout-options p { line-height: 1.6; color: var(--body-copy); }
.workout-options h4 { font-size: 1rem; margin: 22px 0 12px; }
.workout-options button { margin: 8px 0; white-space: normal; }
.workout-options small { display: block; font-size: .875rem; margin-top: 5px; font-weight: 400; }
#busyMachine { margin-bottom: 12px; }

.resume-card { border:1px solid var(--lime); border-radius:var(--radius); padding:20px; background:var(--panel-2); margin-bottom:18px; }
.resume-card h2 { margin:8px 0; font-size:1.3rem; }
.resume-card p,.previous-record p { font-size:.9rem; line-height:1.65; overflow-wrap:anywhere; }
.previous-record { background:var(--bg); border:1px solid var(--line); border-radius:14px; padding:14px; margin:16px 0; }
.previous-record summary { color:var(--blue); cursor:pointer; font-size:.95rem; font-weight:700; }
.previous-record p { margin:8px 0 0; }
#workoutSaveStatus { font-size:.875rem; }
.growth-chart svg { display:block; width:100%; height:auto; margin:20px 0; overflow:visible; }
.growth-chart text { fill:var(--muted); font-size:12px; }
.growth-table { overflow-x:auto; }
.growth-table table { width:100%; border-collapse:collapse; font-size:.95rem; }
.growth-table th,.growth-table td { padding:12px 6px; border-bottom:1px solid var(--line); text-align:left; }
.growth-table caption { text-align:left; padding:8px 0; color:var(--muted); }
.backup-label { display:block; margin:20px 0 8px; font-weight:700; }
.backup-actions { margin: 20px 0; }
.backup-actions p { font-size: 1rem; line-height: 1.7; }
.restore-entry { min-height: 76px; font-size: 1.15rem; border: 2px solid var(--blue); }
.restore-entry span { display: block; margin-top: 5px; font-size: 1rem; font-weight: 400; }
.storage-warning { padding: 14px; border-left: 4px solid var(--blue); background: var(--panel-2); }
.restore-review { padding: 16px; margin-top: 16px; border: 2px solid var(--blue); border-radius: 16px; }
.restore-review h3 { font-size: 1.15rem; margin-top: 0; }
.restore-review li { margin: 8px 0; }
.restore-filename { overflow-wrap: anywhere; }
.tutorial-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.tutorial-heading .kicker { margin:0; }
.tutorial-heading button { flex-shrink:0; }
.tutorial-progress { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin:20px 0; }
.tutorial-progress span { height:5px; background:var(--line); border-radius:4px; }
.tutorial-progress .done { background:var(--blue); }
.tutorial h2 { font-size:1.45rem; }
.tutorial figure { margin:16px 0; }
.tutorial img { display:block; width:100%; max-width:400px; height:auto; margin:auto; border-radius:18px; }
.tutorial figcaption { font-size:.875rem; color:var(--muted); margin-top:8px; text-align:center; }
.tutorial-copy { font-size:1rem; line-height:1.8; }
.tutorial-controls { display:flex; gap:10px; margin:18px 0; }
.tutorial-controls button { flex:1; min-width:0; }
.feature-hint { padding:16px; margin:16px 0; border-left:4px solid var(--blue); background:var(--panel-2); }
.feature-hint p { font-size:1rem; line-height:1.7; }
#importBackup { width:100%; min-width:0; font-size:.9rem; }
#backupStatus,#readinessError { overflow-wrap:anywhere; color:var(--blue); }
#backupPreview:empty { display:none; }
#growthStore,#growthExercise,#growthMetric,#fatigueLevel { min-width:0; font-size:1rem; }
.field label { font-size:.875rem; }
#readinessHelp { line-height:1.7; }
.machine-guide { margin:16px 0; padding:16px; background:var(--panel-2); border:1px solid var(--line); border-radius:14px; }
.machine-guide summary { color:var(--lime); font-weight:700; cursor:pointer; font-size:1rem; }
.machine-guide h3 { font-size:1rem; margin:20px 0 6px; }
.machine-guide p { line-height:1.7; font-size:.95rem; overflow-wrap:anywhere; }
.machine-guide label { display:block; margin:20px 0 8px; font-size:.9rem; }
.machine-guide textarea { display:block; width:100%; resize:vertical; padding:12px; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:10px; font:inherit; }
.machine-guide textarea:focus { outline:2px solid var(--blue); }
.machine-guide a { color:var(--blue); }
.report-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:20px 0; }
.report-metrics div { display:flex; flex-direction:column; gap:8px; }
.report-metrics strong { color:var(--lime); font-size:1.8rem; }
.report-metrics span { font-size:.875rem; color:var(--muted); }
.body-set-row { display:grid; grid-template-columns:3em minmax(0,1fr) 6em; align-items:center; gap:10px; margin:16px 0; font-size:.95rem; }
.body-set-track { height:8px; border-radius:8px; background:var(--line); overflow:hidden; }
.body-set-track i { display:block; height:100%; background:var(--blue); }
.body-set-row strong { text-align:right; }
.month-comparison { padding:14px 0; border-top:1px solid var(--line); }
.month-comparison h4 { margin:10px 0; font-size:1rem; }
.month-comparison strong { color:var(--blue); }
.calendar-heading h3 { overflow-wrap:anywhere; min-width:0; font-size:1rem; }
#guideMachine { min-width:0; font-size:1rem; }
.editable-set { padding:16px 0; border-bottom:1px solid var(--line); }
.editable-set strong { font-size:1rem; }
.set-edit-actions { display:flex; gap:12px; flex-wrap:wrap; }
.set-edit-actions button { min-height:44px; flex:1; }
.record-help { font-size:.875rem; line-height:1.6; }
#recordEditStatus { color:var(--blue); overflow-wrap:anywhere; }
#setEditForm .field { margin:12px 0; }
.nutrition-graph .calendar-heading { margin:20px 0; }
.nutrition-graph .calendar-heading h3 { text-align:center; line-height:1.6; }
.nutrition-chart-scroll { overflow-x:auto; margin:16px 0; border:1px solid var(--line); border-radius:12px; }
.nutrition-chart-scroll:focus-visible { outline:2px solid var(--blue); }
.nutrition-chart-scroll svg { display:block; }
.nutrition-chart-scroll text { fill:var(--muted); font-size:14px; }
.nutrition-graph select { min-width:0; width:100%; }
.nutrition-graph summary { cursor:pointer; padding:12px 0; font-size:1rem; color:var(--blue); }
#openNutritionGraph,#openNutritionHistory { margin-bottom:16px; }
.micro-fields { margin:16px 0; }
.micro-fields summary { font-size:1rem; color:var(--blue); cursor:pointer; padding:12px 0; }
.micro-fields p { font-size:.875rem; line-height:1.7; }
.micro-fields .extra-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
.micro-fields .field-wrap span { font-size:.875rem; }
.daily-nutrition h3 { margin:28px 0 8px; font-size:1.1rem; }
.daily-nutrient-row { padding:14px 0; border-bottom:1px solid var(--line); }
.daily-nutrient-label { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:1rem; }
.daily-nutrient-label span { font-variant-numeric:tabular-nums; }
.daily-nutrient-track { position:relative; height:14px; margin:10px 0 8px; background:var(--line); border-radius:4px; }
.daily-nutrient-track i { display:block; height:100%; border-radius:4px; }
.daily-nutrient-track b { position:absolute; top:-3px; width:2px; height:20px; background:var(--lime); }
.daily-nutrient-track.is-unknown { background:transparent; border:1px dashed var(--line); }
.daily-nutrient-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; font-size:.875rem; line-height:1.6; color:var(--muted); }
#dailyToTrend,#dailyToSettings { margin-top:16px; }
@media(max-width:360px) { .micro-fields .extra-fields { grid-template-columns:1fr; } }

/* Keep daily actions in front; advanced controls stay available on demand. */
.disclosure { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.disclosure > summary { cursor: pointer; font-size: 1rem; font-weight: 700; line-height: 1.6; min-height: 28px; }
.disclosure[open] > summary { margin-bottom: 16px; }
.disclosure .settings-card, .disclosure .goal-card, .disclosure .shake-card { box-shadow: none; }
.home-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.home-links button { font-size: .875rem; min-height: 48px; padding: 12px 8px; }
.home-context { color: var(--muted); font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.hero h2 { font-size: 1.85rem; line-height: 1.25; letter-spacing: 0; }
.disclosure button { overflow-wrap: anywhere; }
summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
@media(max-width:360px) { .hero { padding: 18px; } .hero h2 { font-size: 1.55rem; } .home-links { grid-template-columns: 1fr; } }

/* Four core nutrients; micronutrients are available on demand. */
.macro-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.macro-stat { min-width: 0; overflow-wrap: anywhere; }
.meal-micro { margin-top: 10px; font-size: .875rem; color: var(--muted); }
.meal-micro summary { cursor: pointer; padding: 6px 0; }
.meal-micro p { line-height: 1.7; }
:root[data-theme="light"] {
  color-scheme:light;
  --bg:#f3f6fa; --panel:#ffffff; --panel-2:#e8eef6; --ink:#182b40; --muted:#50627a;
  --line:#cad5e2; --lime:#075bb5; --lime-ink:#ffffff; --blue:#087466; --danger:#b42336;
  --glow:#dceafa; --strong-line:#b3c6da; --hero-start:#e4effc; --hero-end:#ffffff;
  --shadow:#1c487514; --input-bg:#f3f6fa; --body-copy:#344d68; --accent-shadow:#075bb51a;
  --danger-bg:#fff0f1; --error-copy:#a91d31; --danger-line:#dc9aa5; --item-bg:#ffffff;
  --nav-bg:#f3f6faf2; --rest-bg:#e7f0fb; --warning-copy:#87510b; --selected-bg:#e4effc;
}
:root[data-theme="charcoal"] {
  color-scheme:dark;
  --bg:#191817; --panel:#242220; --panel-2:#302d2a; --ink:#faf5ef; --muted:#b9afa4;
  --line:#49423b; --lime:#ffba80; --lime-ink:#2b1705; --blue:#a8c9ff; --danger:#ff9696;
  --glow:#3d3026; --strong-line:#605143; --hero-start:#382e26; --hero-end:#242220;
  --shadow:#00000044; --input-bg:#1d1b19; --body-copy:#ded1c4; --accent-shadow:#ffba801a;
  --danger-bg:#3c2223; --error-copy:#ffb6b6; --danger-line:#895052; --item-bg:#242220;
  --nav-bg:#191817f2; --rest-bg:#372d24; --warning-copy:#ffcf80; --selected-bg:#443122;
}
.theme-settings { margin-bottom:18px; }
.theme-options { display:grid; gap:10px; }
.theme-option { display:flex; align-items:center; gap:12px; width:100%; min-height:80px; padding:12px; border:2px solid var(--line); border-radius:14px; text-align:left; background:var(--bg); color:var(--ink); }
.theme-option[aria-pressed="true"] { border-color:var(--lime); background:var(--selected-bg); }
.theme-option:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
.theme-swatches { display:flex; flex-shrink:0; }
.theme-swatches i { width:18px; height:32px; border:1px solid #88888866; }
.theme-swatches i:first-child { border-radius:6px 0 0 6px; }
.theme-swatches i:last-child { border-radius:0 6px 6px 0; }
.theme-description { flex:1; min-width:0; }
.theme-description strong { display:block; font-size:1rem; line-height:1.5; }
.theme-description small { display:block; font-size:.875rem; line-height:1.6; color:var(--muted); }
.theme-selected { visibility:hidden; font-size:1.2rem; color:var(--lime); }
.theme-option[aria-pressed="true"] .theme-selected { visibility:visible; }
.theme-status:empty { display:none; }
:root[data-theme="choco"] {
  color-scheme:light;
  --bg:#fafaf7; --panel:#ffffff; --panel-2:#f0f0e9; --ink:#202020; --muted:#606052;
  --line:#d5d5c6; --lime:#715500; --lime-ink:#ffffff; --blue:#075f75; --danger:#b42336;
  --glow:#fff4a3; --strong-line:#bdbda9; --hero-start:#fff5b3; --hero-end:#ffffff;
  --shadow:#29290014; --input-bg:#f7f7f1; --body-copy:#454536; --accent-shadow:#baa60022;
  --danger-bg:#fff0f1; --error-copy:#a91d31; --danger-line:#dc9aa5; --item-bg:#ffffff;
  --nav-bg:#fafaf7f2; --rest-bg:#fff5b3; --warning-copy:#795300; --selected-bg:#fff5b3;
}
:root[data-theme="choco"] :is(.primary,.brand-mark,.session-letter,.finish-mark,#toast,.menu-picker button[aria-pressed="true"]) { background:#ffe100; color:#202020; border-color:#b8a000; }
:root[data-theme="choco"] .brand-mark :is(span,i) { background:#202020; }
:root[data-theme="choco"] .bottom-nav button.active { color:#202020; background:#ffe100; border-radius:10px; }
:root[data-theme="purple"] {
  color-scheme:dark;
  --bg:#181329; --panel:#241d39; --panel-2:#322749; --ink:#f7f3ff; --muted:#b8accd;
  --line:#4a3d61; --lime:#c5b2ff; --lime-ink:#23153f; --blue:#7ee3ce; --danger:#ff969e;
  --glow:#3c2a60; --strong-line:#64527f; --hero-start:#37294e; --hero-end:#241d39;
  --shadow:#09051566; --input-bg:#1c162e; --body-copy:#ddd2ee; --accent-shadow:#c5b2ff22;
  --danger-bg:#412435; --error-copy:#ffb8c5; --danger-line:#945165; --item-bg:#241d39;
  --nav-bg:#181329f2; --rest-bg:#35284b; --warning-copy:#ffd38d; --selected-bg:#3b2e57;
}
.guide-link { display:block; margin:0 0 12px auto; padding:10px 4px; min-height:44px; border:0; background:transparent; color:var(--blue); text-decoration:underline; text-underline-offset:4px; font-size:.875rem; }
.guide-settings-link { margin:0 0 16px; }
.user-guide-start h3 { font-size:1.2rem; margin:8px 0 16px; }
.user-guide-start ol,.user-guide-sections ol { padding-left:1.5rem; }
.user-guide-start li,.user-guide-sections li { margin:12px 0; line-height:1.8; }
.user-guide-start li p { margin:4px 0 16px; }
.user-guide-sections p,.user-guide-sections dd { font-size:1rem; line-height:1.8; color:var(--muted); }
.user-guide-sections dt { font-weight:700; margin:20px 0 6px; }
.user-guide-sections dd { margin:0 0 16px; }
.user-guide-sections summary { line-height:1.6; }
.guide-link:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
.app-disclaimer { font-size:.875rem; color:var(--muted); line-height:1.6; margin:12px 0; }
.install-guide ol { padding-left:1.5rem; }
.install-guide li { margin:16px 0; line-height:1.8; }
.install-guide p { line-height:1.8; color:var(--muted); }
.install-guide a { color:var(--blue); }

/* Optional support page: follows all existing color themes. */
.referral-banner { display:block; width:100%; margin:0 0 16px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:var(--panel); color:var(--ink); text-align:left; line-height:1.5; overflow-wrap:anywhere; }
.referral-banner:focus-visible { outline:2px solid var(--lime); outline-offset:3px; }
.referral-banner-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; color:var(--muted); font-size:.75rem; }
.referral-banner .referral-badge { padding:2px 6px; }
.referral-banner-main { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:7px; font-size:.95rem; }
.referral-banner-main > span { font-size:1.5rem; line-height:1; }
.referral-banner-caption,.referral-banner-note { display:block; color:var(--muted); font-size:.75rem; margin-top:3px; }
.referral-heading { align-items:flex-start; gap:12px; }
.referral-heading h2 { line-height:1.5; overflow-wrap:anywhere; }
.referral-heading button { flex-shrink:0; }
.referral-intro p,.referral-offer p { font-size:1rem; line-height:1.8; }
.referral-intro h2,.referral-offer h2 { font-size:1.2rem; line-height:1.6; }
.referral-intro .referral-status { font-size:.875rem; color:var(--lime); margin:0 0 12px; }
.referral-labels { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:.875rem; color:var(--muted); }
.referral-badge { border:1px solid var(--line); color:var(--ink); border-radius:6px; padding:4px 8px; }
.referral-product { font-weight:700; }
.referral-offer .referral-pending { padding:12px; background:var(--panel-2); color:var(--muted); border-radius:12px; text-align:center; font-size:.875rem; }
.referral-offer summary { line-height:1.7; }
