/* Fit & Calm — screen-specific styles. Each later phase adds its section here. */

/* ---------- More ---------- */
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 600px) { .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.more-item { display: flex; align-items: flex-start; gap: var(--s-4); }
.more-item .more-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--primary-strong); }
.more-item strong { display: block; font-size: var(--fs-md); font-weight: 600; }
.more-item small { display: block; margin-top: 1px; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.35; }

/* ---------- "coming soon" section placeholder ---------- */
.soon { display: grid; gap: var(--s-3); }
.soon-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- shared bits for detail screens ---------- */
.back-link { display: inline-flex; align-items: center; gap: 2px; margin-bottom: var(--s-3); color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.back-link:hover { color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row-tight { gap: 4px; margin-top: var(--s-2); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.toolbar .chip-row { flex: 1 1 100%; }
@media (min-width: 860px) { .toolbar .chip-row { flex: 1 1 auto; } }
.toolbar > select.input { width: auto; flex: 1 1 160px; max-width: 220px; }
.input-sm { height: 32px; font-size: var(--fs-sm); }
.search-wrap { position: relative; flex: 2 1 200px; }
.search-wrap .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-wrap .input { padding-left: 32px; }
.mini-title { margin: var(--s-6) 0 var(--s-2); font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.form-stack { display: grid; gap: var(--s-5); }
.form-error { font-size: var(--fs-sm); color: var(--danger); }
.form-error:empty { display: none; }
.eyebrow-sm { display: block; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-strong); }
.chip-row > .chip[aria-pressed] { height: 28px; padding: 0 var(--s-5); border: 1px solid var(--line); background: var(--surface); }
.chip-row > .chip[aria-pressed="true"] { background: var(--button-bg); border-color: var(--button-bg); color: var(--on-button); }

/* ---------- exercise library ---------- */
.ex-list { display: grid; padding: 4px var(--card-pad); }
.ex-list.card { padding-top: 2px; padding-bottom: 2px; }
.ex-row {
  display: flex; align-items: center; gap: var(--s-4); width: 100%; min-height: 50px; padding: 6px 0;
  border: 0; border-top: 1px solid var(--line); background: none; color: inherit; text-align: left; text-decoration: none;
}
.ex-list > .ex-row:first-child { border-top: 0; }
@media (hover: hover) { a.ex-row:hover .ex-text strong, button.ex-row:hover .ex-text strong { color: var(--link); } }
.ex-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--primary-strong); }
.ex-ico-lg { width: 52px; height: 52px; border-radius: 14px; }
.ex-ico-lg .icon { width: 28px; height: 28px; }
.ex-text { flex: 1; min-width: 0; }
.ex-text strong { display: block; font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-text small { display: block; font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-5); margin-bottom: var(--s-6); }
.ex-head > div:nth-child(2) { flex: 1; min-width: 200px; }
.steps { display: grid; gap: var(--s-3); margin: var(--s-4) 0 0; padding-left: 0; counter-reset: step; list-style: none; }
.steps li { position: relative; padding-left: 32px; font-size: var(--fs-md); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--link); font-size: var(--fs-xs); font-weight: 700; }
.tip { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-3); font-size: var(--fs-sm); }
.tip strong { display: block; margin-bottom: 2px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.tip-mistake { background: #FFF3DD; }
.tip-mistake strong { color: var(--gold-ink); }
.tip-pair { gap: var(--s-3); }
.tip-pair .tip { margin-top: var(--s-3); }
.best-set { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-3) 0 var(--s-4); }
.best-set strong { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; }
.used-in { margin-top: var(--s-5); }

/* ---------- plans ---------- */
.plan-grid { display: grid; gap: var(--gap); }
@media (min-width: 600px) { .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan-card { display: flex !important; flex-direction: column; gap: 4px; }
.plan-card.is-active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.plan-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.plan-card h3 { font-size: var(--fs-lg); font-weight: 600; }
.plan-blurb { font-size: var(--fs-sm); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-kit { margin-top: auto; padding-top: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); }
.plan-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.plan-head .plan-kit { padding-top: 0; }
.plan-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-6); }
.plan-days { display: grid; gap: var(--gap); margin-top: var(--gap); }
@media (min-width: 1000px) { .plan-days { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.plan-days .ex-list { padding: 0; }
.active-plan { margin-bottom: var(--s-5); }
.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday-picker .chip { justify-content: center; height: 36px; padding: 0; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-sm); }
.weekday-picker .chip[aria-pressed="true"] { background: var(--button-bg); border-color: var(--button-bg); color: var(--on-button); }
.start-preview { padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.picker-list { max-height: 50dvh; overflow-y: auto; padding: 0; }

/* ---------- plan builder ---------- */
.editor-details { display: grid; gap: var(--s-5); margin: var(--s-5) 0 var(--gap); }
.editor-nums { display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); }
.editor-days { display: grid; gap: var(--gap); }
.editor-day { display: grid; gap: var(--s-3); }
.editor-day-head { display: flex; align-items: center; gap: var(--s-3); }
.editor-day-head .day-name { flex: 1; font-weight: 600; }
.editor-items { display: grid; list-style: none; }
.editor-item { display: flex; align-items: center; gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--line); background: var(--surface); touch-action: auto; }
.editor-item:first-child { border-top: 0; }
.editor-item.is-dragging { position: relative; z-index: 2; border-radius: var(--r-sm); box-shadow: var(--shadow-lift); opacity: .95; }
.editor-item-main { flex: 1; min-width: 0; }
.editor-item-main strong { display: block; font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-item-nums { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: 4px; }
.mini-field { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); }
.input-num { width: 64px; height: 32px; padding: 0 6px; text-align: center; }
.drag-handle { flex: none; display: grid; place-items: center; width: 30px; height: 40px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-muted); cursor: grab; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.editor-empty { padding: var(--s-3) 0; }
.save-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 5;
  display: flex; justify-content: flex-end; gap: var(--s-3); margin-top: var(--s-6); padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-pill); background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow-lift);
}
@media (min-width: 860px) { .save-bar { bottom: 16px; } }

/* ---------- calendar ---------- */
.cal-layout { display: grid; gap: var(--gap); }
@media (min-width: 1000px) { .cal-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.cal-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4); }
.cal-title { flex: 1; text-align: center; font-size: var(--fs-lg); }
.cal-grid { display: grid; gap: 3px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow span { padding-bottom: 2px; text-align: center; font-size: var(--fs-2xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.cal-day {
  position: relative; display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 2px;
  min-height: 46px; padding: 5px 0 4px; border: 1px solid transparent; border-radius: var(--r-sm);
  border-color: var(--line); background: var(--surface); color: var(--text); font-size: var(--fs-sm);
}
.cal-day.is-out { opacity: .4; }
.cal-day.is-rest { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.cal-day.is-done { background: var(--primary-soft); border-color: var(--primary-soft); }
.cal-day.is-today .cal-num { display: grid; place-items: center; width: 22px; height: 22px; margin-top: -2px; border-radius: 50%; background: var(--button-bg); color: var(--on-button); font-weight: 700; }
.cal-day.is-selected { border-color: var(--primary-strong); box-shadow: 0 0 0 1px var(--primary-strong); }
.cal-num { font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.cal-marks { display: flex; gap: 3px; align-items: center; }
.mk { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.mk-done { background: var(--primary-strong); }
.mk-plan { border: 1.5px solid var(--primary-strong); background: var(--surface); }
.mk-plan.mk-missed { border-color: var(--text-muted); border-style: dotted; }
.mk-cardio { background: var(--gold); }
.mk-rest { border: 1.5px dashed var(--line-strong); }
.cal-legend { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin-top: var(--s-5); font-size: var(--fs-xs); color: var(--text-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

.day-panel { display: grid; gap: var(--s-4); align-content: start; }
.rest-note { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); color: var(--link); }
.day-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.day-item .ex-text strong, .day-item .ex-text small { white-space: normal; }
.day-planned.is-missed .ex-ico { background: var(--surface-3); color: var(--text-muted); }
.ex-ico-plan { background: transparent; border: 1.5px dashed var(--primary); }
.ex-ico-done { background: var(--button-bg); color: var(--on-button); }
.day-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-left: auto; }
.day-session { display: grid; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-3); }
.day-session-head { display: flex; align-items: center; gap: var(--s-4); }
.set-table { display: grid; gap: var(--s-3); padding: 0; list-style: none; }
.set-table li > strong { display: block; margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 600; }
.set-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.set-chips .chip { background: var(--surface); }
.set-edit { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); color: var(--text-muted); }
.set-edit .input-num { width: 56px; }
.day-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); }

.heat-card { margin-top: var(--gap); }
.heat-scroll { overflow-x: auto; padding-bottom: 4px; margin-top: var(--s-4); }
.heat { --cell: 11px; display: grid; grid-template-columns: 14px auto; grid-template-rows: auto auto; gap: 3px 4px; width: max-content; }
.heat-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--weeks), var(--cell)); gap: 3px; height: 14px; font-size: 9.5px; color: var(--text-muted); }
.heat-months span { grid-row: 1; white-space: nowrap; }
.heat-days { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: 3px; font-size: 9px; line-height: var(--cell); color: var(--text-muted); }
.heat-grid { display: grid; grid-template-rows: repeat(7, var(--cell)); grid-auto-flow: column; grid-auto-columns: var(--cell); gap: 3px; }
.heat-cell { display: block; width: var(--cell, 11px); height: var(--cell, 11px); border-radius: 3px; background: var(--heat-0); }
.heat-cell.is-pad { background: transparent; }
.heat-cell.l1 { background: var(--heat-1); }
.heat-cell.l2 { background: var(--heat-2); }
.heat-cell.l3 { background: var(--heat-3); }
.heat-cell.l4 { background: var(--heat-4); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: var(--s-3); font-size: var(--fs-2xs); color: var(--text-muted); }
.heat-legend .heat-cell { width: 11px; height: 11px; }

/* ---------- walks & cardio ---------- */
/* cardio log rows: shrink and wrap on small phones instead of pushing the page wider (Library/Calendar rows stay one line) */
.cardio-log { grid-template-columns: minmax(0, 1fr); }
.ex-row.cardio-row { min-width: 0; }
.cardio-row .ex-text strong, .cardio-row .ex-text small { white-space: normal; overflow-wrap: anywhere; }
.cardio-row .row-meta { flex: 0 0 auto; margin-left: auto; text-align: right; }
.cardio-grid { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
@media (min-width: 1000px) { .cardio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.steps-row { display: flex; align-items: center; gap: var(--s-6); }
.steps-form { flex: 1; display: grid; gap: var(--s-3); min-width: 0; }
.steps-form .row .input { flex: 1; min-width: 0; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--link); font-weight: 600; cursor: pointer; }
.week-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
.pace-out { padding: var(--s-3) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); font-weight: 500; }

/* ---------- body ---------- */
.body-grid { display: grid; gap: var(--gap); }
@media (min-width: 1000px) { .body-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } }
.weigh-form { display: grid; gap: var(--s-3); }
.weigh-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.weigh-input { width: 110px; height: 48px; font-size: 22px; font-weight: 600; text-align: center; }
.weigh-unit { font-weight: 600; color: var(--text-muted); }
.weigh-row input[type="date"] { width: auto; flex: 1 1 140px; }
.weigh-card .hint { margin-top: var(--s-4); }
.weight-summary { display: grid; gap: var(--s-5); }
.wsum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.wsum-grid .stat-value { font-size: var(--fs-xl); }
.wsum-line { font-size: var(--fs-md); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s-6); margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--primary-strong); }
.lg-trend { border-top: 2px dashed var(--accent-2); }
.lg-goal { border-top: 2px dashed var(--gold); }
.next-ms { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: #FFF3DD; color: var(--gold-ink); font-size: var(--fs-sm); }
.next-ms .icon { color: var(--gold); }
.ms-list { display: grid; gap: var(--s-2); margin-top: var(--s-4); padding: 0; list-style: none; }
.ms-list li { display: flex; align-items: center; gap: var(--s-4); font-size: var(--fs-sm); }
.ms-list strong { flex: 1; }
.w-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.pace-note { display: grid; gap: var(--s-3); justify-items: start; padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.pace-note.is-gentle { background: #FFF3DD; color: var(--gold-ink); }
.measure-rows li { gap: var(--s-4); }
.change-chip { min-width: 64px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-3); font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); text-align: center; }
.change-chip.is-down { background: var(--surface-2); color: var(--link); }
.change-chip.is-up { background: var(--surface-3); color: var(--text-muted); }
.hist-values { display: block; font-size: var(--fs-xs); color: var(--text-muted); white-space: normal; }

/* photos */
.photo-privacy { display: inline-flex; align-items: center; gap: 6px; }
.compare-card { margin-bottom: var(--gap); }
.cmp { display: grid; gap: var(--s-4); }
.cmp-stage {
  position: relative; overflow: hidden; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 3 / 4;
  border-radius: var(--r-md); background: var(--surface-3); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.cmp-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp-after { position: absolute; inset: 0; }
.cmp-handle { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #FFFFFF; box-shadow: 0 0 6px rgba(0, 0, 0, .35); pointer-events: none; }
.cmp-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #FFFFFF; color: var(--primary-strong); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lift); }
.cmp-tag { position: absolute; top: 10px; padding: 3px 9px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .45); color: #FFFFFF; font-size: var(--fs-xs); font-weight: 600; pointer-events: none; }
.cmp-tag-l { left: 10px; }
.cmp-tag-r { right: 10px; }
.cmp-range { width: 100%; max-width: 520px; margin: 0 auto; accent-color: var(--primary-strong); height: 28px; }
.compare-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-5); margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--text-muted); }
.compare-picks select { display: inline-block; width: auto; }
.timeline { display: grid; gap: var(--s-5); }
.tl-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s-3); }
.tl-thumb { position: relative; padding: 0; border: 0; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface-3); }
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-thumb span { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .45); color: #FFFFFF; font-size: var(--fs-2xs); font-weight: 600; }
.photo-full { width: 100%; max-height: 65dvh; object-fit: contain; border-radius: var(--r-md); background: var(--surface-3); }

/* ---------- habits ---------- */
.habits-grid, .nutrition-grid { display: grid; gap: var(--gap); }
@media (min-width: 1000px) { .habits-grid, .nutrition-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.habit-list { display: grid; padding: 0; list-style: none; margin-bottom: var(--s-3); }
.habit-row { display: flex; align-items: center; gap: var(--s-4); min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); }
.habit-row:first-child { border-top: 0; }
.habit-name { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; color: inherit; }
.habit-name strong { display: block; font-size: var(--fs-md); font-weight: 600; }
.habit-name small { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.habit-row.is-done .ex-ico { background: var(--button-bg); color: var(--on-button); }
.habit-row .tick { min-height: 44px; padding: 0 6px; }
.habit-row .tick-box { width: 28px; height: 28px; border-radius: 9px; }
.habit-count { display: flex; align-items: center; gap: 2px; }
.count-btn { width: 40px; height: 40px; font-size: 20px; color: var(--link); border: 1px solid var(--line-strong); }
.count-plus { background: var(--surface-2); }
.count-val { min-width: 64px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.count-val small { font-weight: 400; color: var(--text-muted); }
.count-val.is-done { color: var(--link); }
.week-grid { display: grid; gap: 4px; margin-top: var(--s-3); }
.wg-row { display: grid; grid-template-columns: minmax(70px, 1.4fr) repeat(var(--cols), minmax(0, 1fr)); gap: 4px; align-items: center; }
.wg-head span { text-align: center; font-size: var(--fs-2xs); font-weight: 600; color: var(--text-muted); }
.wg-head span.is-today { color: var(--primary-strong); }
.wg-name { font-size: var(--fs-xs); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-cell { display: grid; place-items: center; aspect-ratio: 1; min-height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--on-button); font-weight: 700; }
.wg-cell .icon { stroke-width: 2.6; }
.st-done { background: var(--button-bg); border-color: var(--button-bg); }
.st-rest { background: var(--surface-2); border-style: dashed; border-color: var(--line-strong); color: var(--text-muted); }
.st-missed { background: var(--surface-3); }
.st-open { background: var(--surface); border-style: dotted; }
.st-before { opacity: .35; }
.wg-key { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 4px; }
.month-grid { display: grid; gap: 3px; margin-top: var(--s-4); }
.mg-cell { display: grid; place-items: center; aspect-ratio: 1; max-height: 40px; border-radius: 8px; background: var(--heat-0); font-size: var(--fs-xs); color: var(--text); }
.mg-cell.l1 { background: var(--heat-1); } .mg-cell.l2 { background: var(--heat-2); } .mg-cell.l3 { background: var(--heat-3); color: #FFFFFF; } .mg-cell.l4 { background: var(--heat-4); color: #FFFFFF; }
.mg-cell.st-done { color: var(--on-button); }
.mg-cell.is-out { opacity: .4; }
.mg-cell.is-future { background: transparent; color: var(--text-muted); }
.preset-row { margin-top: var(--s-3); }

/* ---------- nutrition ---------- */
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); padding: 4px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); }
.day-nav strong { font-size: var(--fs-sm); }
.glasses { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s-3) 0; }
.glass { display: grid; place-items: center; width: 40px; height: 50px; padding: 4px; border: 0; border-radius: 10px; background: var(--surface-3); color: var(--primary-strong); }
.glass svg { width: 24px; height: 32px; }
.glass .g-line { fill: none; stroke: var(--primary-strong); stroke-width: 1.6; stroke-linejoin: round; }
.glass .g-fill { fill: transparent; transition: fill var(--t-fast); }
.glass.is-full .g-fill { fill: var(--accent-2); }
.glass.is-full { background: var(--surface-2); }
.glass-add { border: 1.5px dashed var(--line-strong); background: transparent; }
.fav-row { display: grid; gap: 4px; margin-bottom: var(--s-4); }
.meal + .meal { margin-top: var(--s-2); }
.meal .mini-title { display: flex; justify-content: space-between; }
.meal-sum { font-weight: 500; }
.fav-manage summary { cursor: pointer; font-size: var(--fs-sm); color: var(--link); }

/* ---------- calculators ---------- */
.calc-grid { display: grid; gap: var(--gap); }
@media (min-width: 760px) { .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.calc-card { display: grid; gap: var(--s-3); }
.calc-out { display: grid; gap: var(--s-3); }
.calc-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-3); }
.calc-big strong { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.calc-big span { color: var(--text-muted); font-size: var(--fs-sm); }
.calc-options { display: grid; gap: var(--s-3); padding: 0; list-style: none; }
.calc-options li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-3); }
.calc-options strong { font-size: var(--fs-lg); }
.calc-options small { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.pct-table { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); padding: 0; list-style: none; }
.pct-table li { display: grid; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-3); text-align: center; font-size: var(--fs-sm); }
.pct-table span { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- challenges ---------- */
.section-head { margin: var(--s-6) 0 var(--s-4); }
.run-grid { display: grid; gap: var(--gap); }
@media (min-width: 900px) { .run-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.run-card { display: grid; gap: var(--s-4); }
.run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); color: inherit; text-decoration: none; }
.run-day { font-size: var(--fs-xl); }
.miss-banner { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: #FFF3DD; color: var(--gold-ink); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.ch-list { display: grid; padding: 0; list-style: none; }
.ch-list li { border-top: 1px solid var(--line); }
.ch-list li:first-child { border-top: 0; }
.ch-list .tick { align-items: flex-start; padding: 10px 0; min-height: 48px; }
.ch-list .tick-box { width: 26px; height: 26px; margin-top: 1px; }
.ch-list .tick-text small { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.ch-list.is-compact .tick { padding: 6px 0; min-height: 40px; }
.ch-list li.is-done .tick-text > span { color: var(--text-muted); }
.run-hero { display: grid; gap: var(--s-5); margin-bottom: var(--gap); }
.run-hero-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.run-hero h1 { font-size: 28px; }
.run-ring { flex: none; display: grid; place-content: center; width: 84px; height: 84px; border-radius: 50%; border: 7px solid var(--primary); background: var(--surface); text-align: center; line-height: 1.05; }
.run-ring strong { font-family: var(--font-display); font-size: 26px; }
.run-ring small { font-size: var(--fs-2xs); color: var(--text-muted); }
.miss-card { display: grid; gap: var(--s-3); border-color: var(--gold); background: #FFFBF3; }
.miss-card .plan-actions { margin: var(--s-3) 0 0; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.dg-cell { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.dg-done { background: var(--button-bg); border-color: var(--button-bg); color: var(--on-button); }
.dg-grace { background: var(--surface-2); border-style: dashed; border-color: var(--primary); color: var(--link); }
.dg-missed { background: #FFF3DD; border-color: var(--gold); color: var(--gold-ink); }
.dg-today { border: 2px solid var(--primary-strong); color: var(--primary-strong); }
.dg-future { background: transparent; border-style: dotted; opacity: .7; }
.dg-key { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 4px; }
.why-card blockquote { margin: 0; padding: var(--s-4) var(--s-5); border-left: 3px solid var(--primary); background: var(--surface-3); font-family: var(--font-display); font-style: italic; font-size: var(--fs-lg); }
.ph-slots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); max-width: 340px; margin: 0 auto; }
.ph-slot { display: grid; gap: var(--s-2); justify-items: center; }
.ph-slot img, .ph-empty { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-md); background: var(--surface-3); }
.ph-empty { display: grid; place-items: center; color: var(--text-muted); border: 1.5px dashed var(--line-strong); }
.ph-slot > span { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.rule-edit { display: grid; gap: var(--s-3); padding: 0; list-style: none; }
.rule-edit li { display: flex; align-items: center; gap: var(--s-3); }
.rule-edit .input { flex: 1; }
.cert-wrap { display: grid; justify-items: center; gap: var(--s-6); }
.cert-img { width: 100%; max-width: 440px; border-radius: var(--r-lg); box-shadow: var(--shadow-lift); }
.cert-actions { justify-content: center; }

/* ---------- today ---------- */
.today-head p { font-family: var(--font-display); font-style: italic; font-size: var(--fs-md); color: var(--link); }
.today-grid { display: grid; gap: var(--gap); }
@media (min-width: 1000px) { .today-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.today-workout { display: grid; gap: var(--s-3); background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); }
.today-workout.is-done { background: var(--surface-2); }
.today-workout.is-rest { background: var(--surface-3); }
.tw-title { display: flex; align-items: center; gap: 6px; font-size: 24px; }
.tw-title .icon { width: 22px; height: 22px; color: var(--primary-strong); stroke-width: 2.4; }
.rings-row { display: flex; justify-content: space-around; gap: var(--s-3); margin: var(--s-2) 0 var(--s-4); }
.ring-link { color: inherit; text-decoration: none; }
.ci-row { display: flex; align-items: center; gap: var(--s-4); padding: 4px 0; }
.ci-label { width: 56px; font-size: var(--fs-sm); font-weight: 500; }
.ci-scale { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ci-btn { height: 38px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 600; color: var(--text-muted); }
.ci-btn[aria-checked="true"] { background: var(--button-bg); border-color: var(--button-bg); color: var(--on-button); }
.checkin-out { margin-top: var(--s-4); }
.suggest { padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); }
.suggest strong { display: block; color: var(--link); }
.suggest p { font-size: var(--fs-sm); }
.suggest-lighter { background: var(--surface-3); }
.suggest-push { background: #FFF3DD; }
.suggest-push strong { color: var(--gold-ink); }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-3); }
.quick-btn { display: grid; justify-items: center; gap: 4px; padding: var(--s-4) 2px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-3); color: var(--link); font-size: var(--fs-xs); font-weight: 600; }
.quick-btn .icon { width: 22px; height: 22px; }
.next-badge { display: flex; align-items: center; gap: var(--s-5); }
.next-badge > div { flex: 1; display: grid; gap: 4px; }
.next-badge small { font-size: var(--fs-xs); color: var(--text-muted); }
.badge-mini { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #FFF3DD; color: var(--gold-ink); border: 2px solid var(--gold); }
.review-teaser { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); text-decoration: none; }
.review-teaser .icon { color: var(--gold); }

/* ---------- progress & badges ---------- */
.review-card { margin-bottom: var(--gap); background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); }
.review-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: var(--s-4); margin: var(--s-3) 0 var(--s-4); }
.review-line { font-size: var(--fs-sm); }
.progress-grid { display: grid; gap: var(--gap); }
@media (min-width: 900px) { .progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.yr-head { margin-bottom: var(--s-4); }
.yr-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-5); margin-bottom: var(--gap); background: linear-gradient(135deg, var(--card-a), var(--card-b)); border: 0; }
.yr-stat { display: grid; }
.yr-stat strong { font-family: var(--font-display); font-size: 34px; font-weight: 600; color: var(--card-ink); line-height: 1.1; }
.yr-stat span { font-size: var(--fs-sm); color: var(--card-ink); opacity: .8; }
.share-layout { display: grid; gap: var(--gap); }
@media (min-width: 900px) { .share-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.share-preview { display: grid; justify-items: center; }
.share-opts { display: grid; gap: var(--s-6); align-content: start; }
.badge-count { margin-bottom: var(--s-4); }
.badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 700px) { .badge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.badge-card { display: grid; gap: var(--s-3); justify-items: center; text-align: center; align-content: start; }
.badge-card h2 { font-size: var(--fs-md); }
.badge-card .bar { width: 100%; }
.badge-medal { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-3); color: var(--text-muted); border: 2px dashed var(--line-strong); }
.badge-card.is-earned .badge-medal { background: radial-gradient(circle at 35% 30%, #FFF6E5, #F3D7A2); color: var(--gold-ink); border: 3px solid var(--gold); box-shadow: 0 6px 16px -6px rgba(224, 179, 110, .7); }
.badge-card:not(.is-earned) h2 { color: var(--text-muted); }

/* ---------- resume pill (a workout is in progress) ---------- */
.resume-pill {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 35;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  display: inline-flex; align-items: center; gap: var(--s-3); padding: 8px 16px 8px 12px;
  border-radius: var(--r-pill); background: var(--button-bg); color: var(--on-button);
  font-size: var(--fs-sm); text-decoration: none; box-shadow: var(--shadow-lift); white-space: nowrap;
}
.resume-pill strong { text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 860px) { .resume-pill { bottom: 20px; left: calc(50% + var(--sidebar-w) / 2); } }

/* ---------- live workout (full screen) ---------- */
body.is-live { overflow: hidden; }
body.is-live .tabbar, body.is-live .resume-pill { display: none; }
.live {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-t);
}
.live-top { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--gutter); }
.live-icon { width: 44px; height: 44px; }
.live-icon .icon { width: 22px; height: 22px; }
.live-title { flex: 1; min-width: 0; text-align: center; line-height: 1.2; }
.live-title strong { display: block; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-count { font-size: var(--fs-xs); color: var(--text-muted); }
.live-top-right { display: flex; align-items: center; gap: 2px; }
.live-clock { min-width: 44px; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); text-align: right; }
.live-bar { height: 4px; margin: 0 var(--gutter); border-radius: 2px; background: var(--primary-soft); overflow: hidden; }
.live-bar > span { display: block; height: 100%; width: 0; background: var(--primary-strong); transition: width var(--t-med) var(--ease); }
.live-strip { display: flex; gap: 6px; padding: var(--s-4) var(--gutter) 0; overflow-x: auto; scrollbar-width: none; }
.live-strip::-webkit-scrollbar { display: none; }
.live-dot {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface);
  color: var(--text-muted); font-size: var(--fs-xs); font-weight: 600;
}
.live-dot.is-done { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary-strong); }
.live-dot.is-skipped { border-style: dashed; opacity: .6; }
.live-dot.is-current { border-color: var(--primary-strong); color: var(--primary-strong); box-shadow: 0 0 0 2px var(--primary-soft); }
.live-body { flex: 1; overflow-y: auto; padding: var(--s-6) var(--gutter) var(--s-8); -webkit-overflow-scrolling: touch; }
.live-body > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.live-ex-head { display: flex; align-items: center; gap: var(--s-5); margin-bottom: var(--s-4); }
.live-ex-head h1 { font-size: 24px; }
.live-target { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-muted); }
.live-last { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: var(--s-4); font-size: var(--fs-sm); color: var(--text-muted); }
.live-hint { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: #FFF3DD; color: var(--gold-ink); font-size: var(--fs-sm); }
.live-hint .icon { flex: none; color: var(--gold); width: 20px; height: 20px; }
.live-hint p { flex: 1; }
.live-sets { display: grid; gap: var(--s-3); margin: 0 0 var(--s-5); padding: 0; list-style: none; }
.live-set {
  display: flex; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow);
}
.live-set.is-done { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.live-set-n { flex: none; width: 44px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.live-set-fields { flex: 1; display: flex; gap: var(--s-4); min-width: 0; }
.live-num { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.live-num .input { width: 68px; height: 48px; padding: 0 6px; font-size: 20px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.live-set.is-done .live-num .input { background: transparent; border-color: transparent; }
.live-set-del { flex: none; width: 32px; height: 32px; opacity: .7; }
.live-tick {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 0;
  border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--text-muted);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-bounce);
}
.live-tick .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.live-tick:active { transform: scale(.92); }
.live-tick.is-done { background: var(--button-bg); border-color: var(--button-bg); color: var(--on-button); }
.live-tools { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.live-note { margin-top: var(--s-4); padding: var(--s-4) var(--s-5); border-left: 3px solid var(--primary); background: var(--surface-3); font-size: var(--fs-sm); }
.live-foot {
  display: grid; grid-template-columns: 1fr 2fr; gap: var(--s-4);
  padding: var(--s-4) var(--gutter) calc(var(--s-4) + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--surface);
}
.live-foot .btn { min-height: 56px; font-size: var(--fs-lg); }
@media (min-width: 860px) { .live-foot { grid-template-columns: 200px 320px; justify-content: center; } }

/* rest timer panel: sits above the footer, so Next stays reachable */
.live-rest {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4);
  margin: 0 var(--gutter) var(--s-4); padding: var(--s-5) var(--s-6);
  border-radius: var(--r-lg); background: var(--text); color: var(--surface); box-shadow: var(--shadow-lift);
  animation: toast-in var(--t-med) var(--ease);
}
.rest-main { display: grid; }
.rest-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.rest-time { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.rest-next { margin-top: 4px; font-size: var(--fs-xs); opacity: .8; }
.rest-actions { display: flex; gap: var(--s-3); }
.live-rest .btn:not(.btn-primary) { background: transparent; border-color: rgba(255, 255, 255, .35); color: inherit; }

/* hold timer */
.hold { display: grid; justify-items: center; gap: var(--s-5); padding: var(--s-4) 0; }
.hold-ring { display: grid; place-items: center; width: 180px; height: 180px; border-radius: 50%; border: 10px solid var(--primary-soft); background: var(--surface-2); }
.hold-time { font-family: var(--font-display); font-size: 48px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* interval timer */
.iv-layer {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-content: center; justify-items: center; gap: var(--s-5);
  background: var(--surface-2); text-align: center;
}
.iv-layer[data-kind="rest"] { background: var(--surface-3); }
.iv-kind { font-size: var(--fs-xl); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-strong); }
.iv-time { font-family: var(--font-display); font-size: 96px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.iv-round { font-size: var(--fs-md); color: var(--text-muted); }
.menu-list { display: grid; gap: var(--s-3); }

/* finish screen */
.done-wrap { display: grid; place-items: start center; }
.done-card { display: grid; gap: var(--s-5); width: 100%; max-width: 460px; padding: var(--s-8) var(--s-7); text-align: center; }
.done-badge { justify-self: center; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--button-bg); }
.done-badge svg { width: 34px; height: 34px; fill: none; stroke: var(--on-button); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); padding: var(--s-5) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pr-list { display: grid; gap: var(--s-3); padding: 0; list-style: none; text-align: left; }
.pr-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: #FFF3DD; }
.pr-list strong { flex: 1; }
.feel-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.feel-btn { display: grid; gap: 2px; padding: var(--s-3) 2px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.feel-btn strong { font-size: var(--fs-lg); }
.feel-btn small { font-size: var(--fs-2xs); color: var(--text-muted); }
.feel-btn[aria-checked="true"] { background: var(--button-bg); border-color: var(--button-bg); color: var(--on-button); }
.feel-btn[aria-checked="true"] small { color: inherit; }

/* ---------- Welcome (first run) ---------- */
.welcome { display: grid; place-items: center; min-height: 100dvh; padding: calc(var(--s-6) + var(--safe-t)) var(--gutter) calc(var(--s-6) + var(--safe-b)); }
.welcome-card { display: grid; gap: var(--s-6); width: 100%; max-width: 420px; padding: var(--s-8) var(--s-7); }
.welcome-card h1 { font-size: 24px; }
.welcome-logo { width: 56px; height: 56px; border-radius: 14px; }
.welcome-card .segmented button { font-size: var(--fs-sm); }
.welcome-foot { font-size: var(--fs-sm); color: var(--text-muted); text-align: center; }
.link-btn { padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; gap: var(--gap); }
@media (min-width: 1000px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.settings-section h2 { margin-bottom: var(--s-2); font-family: var(--font-body); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0; }
.settings-section > .hint { margin-bottom: var(--s-3); }
.settings-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }
.backup-status { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.backup-status.is-due { background: #FFF3DD; color: var(--gold-ink); }
.csv-list > li { cursor: default; }

/* ---------- component sampler (Settings → Look, used to check the kit in each theme) ---------- */
.kit-rings { display: flex; flex-wrap: wrap; gap: var(--s-7); }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

/* ---------- demo & guide ---------- */
.demo-note { display: flex; gap: var(--s-3); align-items: flex-start; margin-bottom: var(--s-4); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.demo-note .icon { margin-top: 2px; color: var(--primary-strong); }
.guide { display: grid; gap: var(--gap); }
@media (min-width: 900px) { .guide { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.guide h2 { margin-bottom: var(--s-3); }
.guide ol, .guide ul { display: grid; gap: var(--s-3); margin: 0; padding-left: 1.3em; font-size: var(--fs-md); }
.guide li::marker { color: var(--primary-strong); font-weight: 600; }
.guide .faq dt { margin-top: var(--s-4); font-weight: 600; }
.guide .faq dd { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.guide .care { grid-column: 1 / -1; text-align: center; }
.install-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-4); }
.os-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-strong); }
