@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&display=swap');

/* =========================================================================
   Lifting Assistant — shared stylesheet
   Athletic / high-contrast / warm-amber on refined warm-dark.
   Class names are preserved verbatim from the original templates so the
   backend keeps rendering against them; only the look has changed.
   ========================================================================= */

:root {
  /* core (names preserved from v1, values reworked warm) */
  --bg: #141110;
  --card: #1d1916;
  --card-2: #282320;
  --text: #f5f0e8;
  --muted: #a59b8d;
  --accent: #ff8a3d;     /* amber-orange hero */
  --accent-2: #5fcf86;   /* gains / positive green */
  --danger: #f2603c;     /* down / failure / remove */
  --warn: #e7b948;       /* off-target gold */
  --radius: 16px;

  /* additions */
  --bg-2: #0d0b0a;
  --line: #322d28;
  --line-2: #443d35;
  --faint: #71685d;
  --accent-ink: #1c0f05;
  --accent-dim: rgba(255, 138, 61, 0.12);
  --accent-line: rgba(255, 138, 61, 0.4);
  --pos-dim: rgba(95, 207, 134, 0.14);
  --neg-dim: rgba(242, 96, 60, 0.14);
  --warn-dim: rgba(231, 185, 72, 0.14);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  --font: 'Archivo', -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Belt-and-braces: nothing inside the page should ever produce a horizontal
     scrollbar. Real layout overflow is fixed below at the source, but this is
     the safety net for anything that slips through. */
  overflow-x: hidden;
}
body { font-feature-settings: "ss01"; width: 100%; }

/* Long exercise / template / set names shouldn't push the row wider than the
   viewport — break them at the column edge instead of forcing horizontal scroll. */
.card-title, .card-sub, .row-link, .recent-link,
.ex-name, .lifting-hint, .summary-md, .breakdown-card .card-title,
.assistant-notes .note {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Media defaults — no content image should ever exceed its container. */
img, svg, video, lifting-loader { max-width: 100%; }

/* ---- offline degradation ------------------------------------------ */
/* Until chunk 2 wires the workout screen through the outbox, the actions
   below truly need the network. Mark them with `.requires-online`; CSS
   here visibly disables them so the user isn't tapping a dead button. */
body[data-connectivity="offline"] .requires-online {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.4);
  cursor: not-allowed;
}
.offline-banner {
  display: none;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
}
.offline-banner strong { color: var(--accent); font-weight: 700; }
body[data-connectivity="offline"] .offline-banner { display: block; }

/* shown when the page is on plain http (not a secure context) — offline off */
.insecure-banner {
  background: var(--neg-dim); border: 1px solid var(--danger); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 0.82rem;
  color: var(--text); line-height: 1.4;
}
.insecure-banner[hidden] { display: none; }
.insecure-banner strong { color: var(--danger); font-weight: 700; }
.insecure-banner code {
  background: var(--bg-2); padding: 1px 5px; border-radius: 5px;
  font-size: 0.92em;
}

.shell {
  max-width: 540px; margin: 0 auto;
  padding: 16px 16px calc(80px + env(safe-area-inset-bottom));
}

/* ---- icons ---------------------------------------------------------- */
.icon {
  width: 1.15em; height: 1.15em;
  display: inline-block; vertical-align: -0.22em;
  flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
#__icons { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- type ----------------------------------------------------------- */
.page-title {
  font-size: 1.9rem; font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.05; margin: 6px 0 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.section-title {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin: 26px 0 10px;
}
.muted { color: var(--muted); }
.pos { color: var(--accent-2); }
.neg { color: var(--danger); }

/* brand lockup */
.brand {
  display: flex; align-items: center; gap: 11px;
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.025em;
  margin: 6px 0 20px;
}
.brand .icon {
  width: 1.3em; height: 1.3em; color: var(--accent-ink);
  background: var(--accent); border-radius: 11px;
  padding: 7px; box-sizing: content-box; stroke-width: 2.6;
}
.icon-spark { fill: currentColor; stroke: none; }

/* ---- account strip -------------------------------------------------- */
.account-strip {
  position: fixed; top: 0; right: 0; padding: 8px 14px;
  display: flex; gap: 12px; align-items: center;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.account-strip a { color: var(--muted); text-decoration: none; }
.account-strip a:hover { color: var(--text); }
.account-strip form { margin: 0; }
.linkish {
  background: none; border: none; padding: 0; color: var(--muted);
  font: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit;
}
.linkish:hover { color: var(--text); }

/* ---- sync pill (lives inside account-strip) ------------------------ */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  cursor: default;
}
.sync-pill .sync-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px var(--pos-dim);
  transition: background 220ms ease, box-shadow 220ms ease;
}
.sync-pill[data-status="slow"] .sync-dot {
  background: var(--warn);
  box-shadow: 0 0 0 2px var(--warn-dim);
}
.sync-pill[data-status="offline"] .sync-dot {
  background: var(--faint);
  box-shadow: 0 0 0 2px rgba(113, 104, 93, 0.22);
}
.sync-pill[data-status="failed"] .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--neg-dim);
}
.sync-pill[data-status="failed"] { color: var(--danger); }
.sync-pill .sync-pending {
  color: var(--accent);
  font-weight: 700;
  margin-left: 2px;
}
.sync-pill[data-status="failed"] .sync-pending { color: var(--danger); }

/* per-set "not synced yet" dot */
.sync-dot-row {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn); flex: none;
  box-shadow: 0 0 0 2px var(--warn-dim);
}

/* ---- toasts -------------------------------------------------------- */
#toast-region {
  position: fixed; left: 0; right: 0;
  bottom: calc(72px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 60; pointer-events: none; padding: 0 12px;
}
.toast {
  max-width: 520px; width: fit-content;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 16px; font-size: 0.84rem; font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { border-color: var(--accent-line); }
.toast-warn { border-color: var(--warn); color: var(--warn); }
.toast-error { border-color: var(--danger); color: var(--danger); }

/* ---- tab bar -------------------------------------------------------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: rgba(20, 17, 16, 0.9); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.tab {
  color: var(--muted); text-decoration: none; text-align: center;
  font-size: 1.1rem; min-width: 64px; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tab span { display: block; font-size: 0.62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; }
.tab.active { color: var(--accent); }

/* ---- cards ---------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; display: block;
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
a.card:active { transform: scale(0.992); }
a.card:hover { border-color: var(--line-2); }

.live-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-dim), transparent 60%),
    var(--card);
  box-shadow: 0 0 0 1px var(--accent-line) inset, 0 14px 34px -24px var(--accent);
}
.live-card::after {
  content: ""; position: absolute; top: 50%; right: 18px;
  width: 11px; height: 11px; transform: translateY(-50%) rotate(45deg);
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent);
}
.card-tag {
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase; font-size: 0.66rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.12em;
}
.live-card .card-tag .icon { color: var(--accent); }
.card-title { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; margin: 5px 0 2px; }
.card-sub { font-size: 0.85rem; margin-top: 3px; color: var(--text); }
.card-sub.muted { color: var(--muted); }
.card-actions { margin-top: 13px; display: flex; gap: 8px; }
.form-card label { display: block; margin-bottom: 10px; font-size: 0.9rem; }
.form-card input, .form-card select { width: 100%; margin-top: 4px; }

/* ---- buttons & inputs ----------------------------------------------- */
.btn {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 11px;
  padding: 10px 16px; font-size: 0.92rem; font-weight: 600;
  font-family: var(--font);
  min-height: 44px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: filter 0.12s ease, transform 0.08s ease, background 0.12s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn .icon { width: 1.05em; height: 1.05em; }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: transparent; font-weight: 800;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-big {
  width: 100%; font-size: 1rem; min-height: 56px; border-radius: 14px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800;
}
.btn-sm { padding: 7px 13px; min-height: 36px; font-size: 0.82rem; border-radius: 9px; }
input, select {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 11px; font-size: 1rem; font-family: var(--font);
  min-height: 44px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.link-row {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--accent); padding: 14px 2px; text-decoration: none;
  font-weight: 600; font-size: 0.92rem;
}
.row-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 500;
}
.row-link:hover { color: var(--accent); }

/* ---- recent session row (link + delete button as siblings) -------- */
/* Heading row holds the section title and the small pencil that toggles
   edit mode. The trash buttons on each row stay hidden until that toggle
   is on (Alpine `editing` state, see home.html). */
.section-title-row {
  display: flex; align-items: center; gap: 6px;
}
.section-title-row .section-title { margin: 26px 0 10px; }
.edit-toggle {
  background: none; border: none; color: var(--faint);
  cursor: pointer; padding: 4px 8px;
  min-width: 32px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 14px;  /* aligns with .section-title's vertical centre */
}
.edit-toggle:hover { color: var(--muted); }
.edit-toggle.editing { color: var(--accent); }
.edit-toggle .icon { width: 15px; height: 15px; }

.recent-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.recent-row .recent-link {
  flex: 1; border-bottom: none;
}
.recent-row.is-editing { background: var(--card-2); }
.del-recent {
  background: none; border: none; color: var(--faint);
  padding: 0 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px;
}
.del-recent:hover { color: var(--danger); }
.del-recent .icon { width: 18px; height: 18px; }

/* ---- chips ---------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card-2); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 6px 13px; font-size: 0.78rem; font-weight: 600;
  color: var(--text); cursor: pointer; white-space: nowrap;
  font-family: var(--font);
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.chip:hover { border-color: var(--line-2); filter: brightness(1.1); }
.chip input[type=radio] { width: auto; min-height: 0; margin: 0; }
.chip-active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.chip-sm { padding: 4px 10px; font-size: 0.7rem; min-height: 0; }
.chip-warn { border-color: transparent; color: var(--warn); background: var(--warn-dim); }
.tpl-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; }
.tpl-strip::-webkit-scrollbar { display: none; }

/* ---- planning ------------------------------------------------------- */
.plan-row {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 9px; padding: 4px 12px;
  transition: border-color 0.15s ease;
}
.plan-row[open] { border-color: var(--line-2); }
.plan-row summary {
  display: flex; align-items: center; gap: 12px; min-height: 52px;
  cursor: pointer; list-style: none;
}
.plan-row summary::-webkit-details-marker { display: none; }
.reorder { display: flex; flex-direction: column; gap: 1px; }
.reorder button {
  background: none; border: none; color: var(--faint);
  font-size: 0.7rem; padding: 2px 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.reorder button:hover { color: var(--accent); }
.reorder .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.plan-name { font-weight: 700; flex: 1; letter-spacing: -0.01em; }
.plan-meta { font-size: 0.74rem; color: var(--muted); text-align: right;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.plan-edit { display: flex; flex-wrap: wrap; gap: 12px; padding: 6px 0 12px; font-size: 0.85rem; }
.plan-edit input[type=number] { width: 64px; }
.plan-edit label { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.add-ex { display: flex; gap: 8px; margin: 14px 0; }
.add-ex select { flex: 1; }
.empty-plan { padding: 28px 0; text-align: center; color: var(--muted); }
.assistant-strip {
  position: sticky; bottom: calc(64px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 22%); padding: 14px 0 8px;
}
.assistant-strip form { display: flex; gap: 8px; }
.assistant-strip input[name=prompt] { flex: 1; }
.quick-chips { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.quick-chips::-webkit-scrollbar { display: none; }
.assistant-notes {
  background: var(--accent-dim); border: 1px solid var(--accent-line);
  border-radius: var(--radius); padding: 12px 13px; margin-bottom: 11px;
  font-size: 0.85rem; display: flex; align-items: center; gap: 10px;
}
.assistant-notes .note { margin-bottom: 0; flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.assistant-notes .note .icon { color: var(--accent); }
.proposal {
  background: var(--card-2); border: 1px dashed var(--accent-line);
  border-radius: var(--radius); padding: 12px 13px; margin-bottom: 10px;
  font-size: 0.85rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.proposal b { font-weight: 700; }
.action-bar { display: flex; gap: 8px; margin-top: 16px; }
.saved-note { color: var(--accent-2); font-size: 0.85rem; font-weight: 600; }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash {
  0% { box-shadow: 0 0 0 2px var(--accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---- workout -------------------------------------------------------- */
.workout-shell { overscroll-behavior: contain; }
.workout-nav { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.workout-nav.nav-locked { opacity: 0.4; pointer-events: none; }   /* mid-lift */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dot-active { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.dot-skipped { background: transparent; border: 1.5px solid var(--faint); }

.exercise-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.timer { text-align: center; margin-bottom: 14px; }
.timer-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.timer-label.near { color: var(--accent-2); }
.timer-label.over { color: var(--warn); }
.timer-label.lifting { color: var(--accent); }
.set-hint { font-size: 0.76rem; text-align: center; margin-top: 10px; line-height: 1.45; color: var(--muted); }

.timer-display {
  font-size: 4rem; font-variant-numeric: tabular-nums; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1; margin: 2px 0;
}
.timer-display.near { color: var(--accent-2); }
.timer-display.over { color: var(--warn); }
.timer-display.lifting {
  color: var(--accent); letter-spacing: 0.16em; font-size: 3rem;
}
.timer-target { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }

.btn-stop {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
}

.pulse-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); animation: pulse 1.2s ease-in-out infinite; margin-right: 7px;
}
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }

.ex-header { display: flex; align-items: center; gap: 10px; position: relative; }
.ex-name {
  background: none; border: none; color: var(--text);
  font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em;
  padding: 6px 0; cursor: pointer; text-align: left;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font);
}
.ex-name .icon { width: 18px; height: 18px; color: var(--muted); }
.ex-name:hover .icon { color: var(--accent); }
.ex-pos {
  margin-left: auto; color: var(--muted); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px; white-space: nowrap;
}
.ex-target { font-size: 0.78rem; margin-bottom: 10px; color: var(--muted); }
.ex-name-static { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em; }
.offline-started-note {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--faint); margin-bottom: 12px;
}
.sheet {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 6px;
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.sheet h3 { margin: 0 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.sheet-form { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 0.85rem; }
.sheet-form label { display: flex; flex-direction: column; gap: 5px; flex: 1; color: var(--muted); }
.reason-chips { display: flex; gap: 7px; flex-wrap: wrap; width: 100%; }

/* ---- set rows ------------------------------------------------------- */
.sets { margin: 10px 0; }
.set-row {
  display: flex; align-items: center; gap: 7px; padding: 9px 0;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.set-idx { width: 18px; color: var(--faint); font-size: 0.8rem; font-weight: 700; }
.num {
  /* flex children default to `min-width: auto` which pins them to intrinsic
     content width and prevents shrinking. 74 px is preferred; 56 is the floor
     below which the digits + chevrons get unreadable. Pair of inputs + Failure
     button now wrap or shrink instead of forcing horizontal scroll. */
  flex: 0 1 74px; min-width: 56px;
  text-align: center; padding: 9px 4px;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.02rem;
}
.x { color: var(--faint); font-weight: 600; }
.type-chip {
  border-radius: 999px; font-size: 0.66rem; font-weight: 700; padding: 5px 8px;
  min-height: 0; width: auto; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line-2); background: var(--card-2);
}
.type-warmup { color: var(--muted); }
.type-working { color: var(--text); }
.type-drop { color: var(--warn); border-color: var(--warn); }
.type-amrap { color: var(--danger); border-color: var(--danger); }
.failure-chip { font-weight: 800; min-width: 34px; justify-content: center; color: var(--muted); }
.failure-chip.failure-on { background: var(--neg-dim); border-color: var(--danger); color: var(--danger); }
.failure-tag { color: var(--danger); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.active-row {
  /* No negative margin: extending the row's box outside its parent broke
     flex-wrap on tight rows and risked horizontal scroll. The accent stripe
     plus tinted background mark the row clearly without bleeding. */
  background: var(--accent-dim); border-left: 3px solid var(--accent);
  padding-left: 8px; border-radius: 6px; border-bottom-color: transparent;
}
.drop-indent { padding-left: 22px; }
.ghost-row { opacity: 0.5; font-size: 0.82rem; border-bottom: none; padding: 1px 0 9px; }
.ghost-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--faint); }
.delta-chip {
  display: inline-flex; align-items: center; vertical-align: middle;
  background: var(--pos-dim); color: var(--accent-2);
  border-radius: 999px; padding: 3px 9px; font-size: 0.68rem; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.del-set {
  background: none; border: none; color: var(--faint); margin-left: auto; cursor: pointer;
  min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center;
}
.del-set:hover { color: var(--danger); }
.del-set .icon { width: 17px; height: 17px; }
.set-done { margin-top: 0; }
.ex-footer { display: flex; margin-top: 14px; }

/* ---- lifting takeover ---------------------------------------------- */
/* The <lifting-loader> custom element pulls its stroke from `currentColor`,
   so setting color on the stage drives the animation tint. */
.lifting-stage {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 24px 0 8px;
  text-align: center;
  color: var(--accent);
}
.lifting-hint {
  font-size: 0.86rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700;
}
.lifting-stage .btn-stop { width: 100%; }

/* ---- side-by-side Save / Start set --------------------------------- */
/* Both buttons inherit .btn-big which sets `width: 100%`; we override here
   so flex can actually split the row. `min-width: 0` lets the buttons
   shrink below their intrinsic content width on narrow phones. */
.set-actions {
  display: flex; flex-direction: row; flex-wrap: nowrap;
  gap: 10px; margin-top: 14px;
}
.set-actions > .btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}
.set-actions > .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line-2);
}
.btn-secondary:hover:not(:disabled) { background: var(--card); border-color: var(--accent-line); }

/* ---- summary -------------------------------------------------------- */
.summary-md { line-height: 1.55; font-size: 0.95rem; }
.breakdown-card .card-title { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spark { width: 100%; height: 48px; margin-top: 8px; }
.spark polyline { stroke: var(--accent); }
.hist-set { padding: 5px 0; font-size: 0.9rem; display: flex; gap: 8px; align-items: center;
  font-variant-numeric: tabular-nums; }

/* ---- ask ------------------------------------------------------------ */
.ask-form { display: flex; gap: 8px; margin-top: 14px; }
.ask-form input { flex: 1; }
.ask-pair { margin-bottom: 16px; }
.ask-q {
  color: var(--accent); font-size: 0.8rem; font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 7px;
}
.ask-a { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; white-space: pre-wrap; font-size: 0.92rem; line-height: 1.5; }
.htmx-indicator { display: none; padding: 6px 0; color: var(--muted); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
.search-form input { width: 100%; margin-bottom: 10px; }

[x-cloak] { display: none; }
