/* Stocking Planner V2 (private preview). Self-contained: does not load or
   override styles.css, so nothing here can change the production calculator. */

:root {
  --bg: #f3f6f7;
  --panel: #ffffff;
  --ink: #0c1e2b;
  --ink-2: #33475a;
  --muted: #647787;
  --line: #e1e8ec;
  --line-2: #eef3f5;
  --accent: #0b6b80;
  --accent-ink: #075263;
  --accent-soft: #e4f2f5;
  --ok: #1d7a53;
  --ok-soft: #e5f4ec;
  --warn: #a8641a;
  --warn-soft: #fbf1e3;
  --bad: #b83a33;
  --bad-soft: #fbe9e7;
  --water-1: #e8f5f7;
  --water-2: #cfe7ec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(12, 30, 43, 0.04), 0 8px 24px -12px rgba(12, 30, 43, 0.12);
  --sans: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
  --bar-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sp {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  font-feature-settings: "tnum" 1;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── App bar ─────────────────────────────────────────── */
.sp-bar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.sp-brand { font: 700 1.15rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.sp-brand span { color: var(--accent); }
.sp-bar-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  padding-left: 14px; border-left: 1px solid var(--line);
}
.sp-bar-badge { font-size: 0.68rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 8px; }
.sp-bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sp-units { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 3px; }
.sp-unit { border: 0; background: transparent; font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 999px; }
.sp-unit[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.sp-cta { background: var(--ink); color: #fff; text-decoration: none; font-size: 0.82rem; font-weight: 700; padding: 9px 16px; border-radius: 999px; white-space: nowrap; }
.sp-cta:hover { background: var(--accent-ink); }

/* ── Layout ──────────────────────────────────────────── */
.sp-main { max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px) 64px; }
.sp-intro { padding: 30px 0 22px; }
.sp-intro h1 { font: 700 clamp(1.7rem, 3vw, 2.3rem)/1.1 var(--serif); letter-spacing: -0.02em; margin: 0 0 6px; }
.sp-intro p { margin: 0; color: var(--muted); font-size: 1.02rem; }

.sp-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 38fr) minmax(0, 62fr);
  gap: 20px;
  align-items: start;
}
.sp-builder { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sp-result {
  position: sticky; top: calc(var(--bar-h) + 16px);
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}

.sp-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.sp-label { margin: 0 0 10px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sp-sublabel { margin: 18px 0 8px; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); }
.sp-hint, .sp-small { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.sp-count { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink-2); margin-left: 6px; font-size: 0.8rem; }

/* ── Controls ────────────────────────────────────────── */
.sp-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 14px; font-size: 0.84rem; font-weight: 600; }
.sp-btn-quiet { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; white-space: nowrap; }
.sp-btn-quiet:hover { background: #d6ebf0; }
.sp-btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); margin-top: 12px; }
.sp-link { border: 0; background: none; color: var(--accent-ink); font-size: 0.8rem; font-weight: 600; padding: 4px 2px; }
.sp-link:hover { text-decoration: underline; }

.sp-seg { display: inline-flex; flex-wrap: nowrap; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; }
.sp-seg-wrap { flex-wrap: wrap; }
.sp-seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 10px; font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sp-seg button.is-on, .sp-seg button[aria-checked="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.sp-seg-sm { margin-bottom: 12px; }

.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.sp-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; font-size: 0.76rem; font-weight: 600; color: var(--ink-2); }
.sp-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Tank card ───────────────────────────────────────── */
.sp-tank-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sp-tank-name { margin: 0; font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em; }
.sp-tank-meta { margin: 3px 0 0; color: var(--muted); font-size: 0.88rem; }
.sp-dot { margin: 0 6px; }
.sp-tank-empty .sp-tank-meta { margin-bottom: 14px; }
.sp-tank-picker { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.sp-tank-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.sp-tank-list button { width: 100%; display: flex; justify-content: space-between; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 12px; font-size: 0.86rem; border-bottom: 1px solid var(--line-2); }
.sp-tank-list li:last-child button { border-bottom: 0; }
.sp-tank-list button:hover, .sp-tank-list [aria-selected="true"] button { background: var(--accent-soft); }
.sp-tl-name { color: var(--ink-2); }
.sp-tl-name strong { color: var(--ink); font-weight: 650; }
.sp-tl-vol { color: var(--muted); font-weight: 600; white-space: nowrap; }
.sp-empty, .sp-stock-empty, .sp-panel-empty { color: var(--muted); font-size: 0.88rem; padding: 12px; list-style: none; }
.sp-custom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sp-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.76rem; font-weight: 600; color: var(--ink-2); }
.sp-field input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 0.95rem; background: #fff; }

.sp-tank-options { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.sp-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-opt-label { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.sp-opt-sub { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.sp-filtration summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.sp-filtration summary::-webkit-details-marker { display: none; }
.sp-filtration summary::after { content: "›"; transform: rotate(90deg); color: var(--muted); margin-left: 8px; transition: transform .15s; }
.sp-filtration[open] summary::after { transform: rotate(-90deg); }
.sp-filt-sum { margin-left: auto; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.sp-filtration[open] { display: flex; flex-direction: column; gap: 10px; }

/* ── Search ──────────────────────────────────────────── */
.sp-search { position: relative; display: flex; align-items: center; }
.sp-search svg { position: absolute; left: 14px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.sp-search input {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px;
  padding: 13px 44px 13px 42px; font-size: 1rem; transition: border-color .15s, background .15s, box-shadow .15s;
}
.sp-search input:focus { outline: 0; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sp-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sp-search-sm input { padding: 10px 12px 10px 40px; font-size: 0.9rem; }
.sp-kbd { position: absolute; right: 12px; font: 600 0.72rem var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; background: #fff; }
.sp-results-head { margin: 14px 0 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sp-results { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.sp-r { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; cursor: pointer; }
.sp-r + .sp-r { margin-top: 2px; }
.sp-r:hover, .sp-r.is-active { background: var(--accent-soft); }
.sp-thumb { flex: none; width: 52px; height: 36px; border-radius: 8px; background: linear-gradient(180deg, var(--water-1), var(--water-2)); display: grid; place-items: center; overflow: hidden; }
.sp-thumb img { width: 92%; height: 92%; object-fit: contain; }
.sp-r-main, .sp-s-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sp-r-name, .sp-s-name { font-weight: 650; font-size: 0.93rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.sp-s-name { text-decoration: none; }
a.sp-s-name:hover { text-decoration: underline; }
.sp-r-sci { font-style: italic; font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-r-meta, .sp-s-meta { font-size: 0.78rem; color: var(--ink-2); margin-top: 1px; }
.sp-fit { display: inline-block; font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.sp-fit-ok { color: var(--ok); background: var(--ok-soft); }
.sp-fit-warn { color: var(--warn); background: var(--warn-soft); }
.sp-fit-bad { color: var(--bad); background: var(--bad-soft); }
.sp-fx { display: inline-block; font-size: 0.7rem; font-weight: 700; margin-left: 4px; color: var(--muted); white-space: nowrap; }
.sp-fx-warn { color: var(--warn); }
.sp-fx-bad { color: var(--bad); }
.sp-add-btn { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; font-weight: 700; color: var(--accent-ink); }
.sp-r:hover .sp-add-btn, .sp-r.is-active .sp-add-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.sp-add-btn.is-in { color: var(--ok); }

/* ── Stock ───────────────────────────────────────────── */
.sp-stock-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.sp-stock-head .sp-label { margin: 0; }
.sp-stock-actions { display: flex; flex-wrap: wrap; gap: 0 10px; }
.sp-stock-actions .sp-link { white-space: nowrap; }
.sp-stock-list { list-style: none; margin: 10px 0 0; padding: 0; }
.sp-s { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.sp-s:first-child { border-top: 0; }
.sp-s.is-new { animation: sp-in .45s ease-out; }
.sp-s.is-hl { background: linear-gradient(90deg, var(--accent-soft), transparent); border-radius: 10px; }
@keyframes sp-in { from { background: var(--accent-soft); } to { background: transparent; } }
.sp-stepper { flex: none; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sp-stepper button { border: 0; background: #fff; width: 30px; height: 32px; font-size: 1.05rem; color: var(--ink-2); }
.sp-stepper button:hover { background: var(--line-2); }
.sp-stepper input { width: 38px; height: 32px; border: 0; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: center; font-weight: 700; font-size: 0.92rem; -moz-appearance: textfield; }
.sp-stepper input::-webkit-outer-spin-button, .sp-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-s-more { flex: none; display: flex; gap: 4px; }
.sp-juv { border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 0.68rem; font-weight: 700; color: var(--muted); padding: 5px 6px; }
.sp-juv.is-on { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.sp-x { border: 0; background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; width: 26px; height: 30px; border-radius: 8px; }
.sp-x:hover { background: var(--bad-soft); color: var(--bad); }
.sp-setup-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sp-setup { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.sp-setup:hover { border-color: var(--accent); background: var(--accent-soft); }
.sp-setup-name { font-weight: 700; font-size: 0.86rem; }
.sp-setup-tag { font-size: 0.72rem; color: var(--accent-ink); font-weight: 600; }
.sp-setup-fish { font-size: 0.74rem; color: var(--muted); line-height: 1.35; }

/* ── Verdict ─────────────────────────────────────────── */
.sp-verdict { padding: 22px 24px; }
.sp-v-top { display: flex; align-items: center; gap: 24px; }
.sp-v-gauge { position: relative; flex: none; width: 150px; height: 150px; }
.sp-ring { width: 100%; height: 100%; }
.sp-ring-bg { fill: none; stroke: var(--line-2); stroke-width: 10; }
.sp-ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.2, .8, .2, 1), stroke .3s; }
.sp-ring-ok .sp-ring-fg { stroke: var(--accent); }
.sp-ring-warn .sp-ring-fg { stroke: var(--warn); }
.sp-ring-bad .sp-ring-fg { stroke: var(--bad); }
.sp-ring-limit { stroke: var(--ink); stroke-width: 2; opacity: .35; }
.sp-v-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sp-v-pct { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.sp-v-pct small { font-size: 1rem; font-weight: 700; margin-left: 1px; color: var(--muted); }
.sp-v-cap { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.sp-v-text { min-width: 0; }
.sp-v-text .sp-label { margin-bottom: 4px; }
.sp-v-title { margin: 0; font: 700 clamp(1.4rem, 2.4vw, 1.85rem)/1.15 var(--serif); letter-spacing: -0.015em; }
.sp-v-good { color: var(--ok); }
.sp-v-warn { color: var(--warn); }
.sp-v-bad { color: var(--bad); }
.sp-v-meta { margin: 6px 0 0; font-weight: 600; color: var(--ink-2); }
.sp-v-sub { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; max-width: 34em; }
.sp-v-empty .sp-v-title { color: var(--ink); }
.sp-checks { list-style: none; margin: 18px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.sp-check { width: 100%; display: flex; align-items: flex-start; gap: 10px; border: 0; background: none; text-align: left; padding: 8px 6px; border-radius: 10px; }
.sp-check:hover { background: var(--line-2); }
.sp-check-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; margin-top: 1px; }
.sp-check-ok .sp-check-icon { background: var(--ok-soft); color: var(--ok); }
.sp-check-warn .sp-check-icon { background: var(--warn-soft); color: var(--warn); }
.sp-check-bad .sp-check-icon { background: var(--bad-soft); color: var(--bad); }
.sp-check-idle .sp-check-icon { background: var(--line-2); color: var(--muted); }
.sp-check-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-check-title { font-weight: 650; font-size: 0.88rem; }
.sp-check-detail { font-size: 0.78rem; color: var(--muted); }
.sp-check-go { color: var(--muted); opacity: 0; transition: opacity .15s; }
.sp-check:hover .sp-check-go { opacity: 1; }

/* ── Tank view ───────────────────────────────────────── */
.sp-viz-card { padding: 16px 18px 14px; }
.sp-viz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.sp-viz-head .sp-label { margin: 0; }
.sp-viz-meta { margin: 0; font-size: 0.76rem; color: var(--muted); flex-basis: 100%; }
.sp-growth button { padding: 4px 10px; font-size: 0.76rem; }
.sp-viz {
  position: relative; margin-top: 10px; aspect-ratio: 2.1; max-height: 340px; width: 100%;
  border-radius: 12px; overflow: hidden;
  border: 1px solid #c9dfe4;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.55);
}
.sp-zone { position: absolute; left: 10px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 2px rgba(12, 30, 43, 0.35); z-index: 5; }
.sp-zone-top { top: 8%; }
.sp-zone-mid { top: 44%; }
.sp-zone-bottom { top: 74%; }
.sp-tank-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }
.sp-tank-tip { position: absolute; z-index: 6; transform: translate(-50%, calc(-100% - 12px)); background: rgba(12, 30, 43, 0.86); color: #fff; font-size: 0.74rem; font-weight: 600; padding: 4px 9px; border-radius: 8px; pointer-events: none; white-space: nowrap; }
.sp-tank-hint { position: absolute; z-index: 5; top: 12%; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, 0.82); color: var(--ink-2); font-size: 0.72rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; pointer-events: none; white-space: nowrap; box-shadow: 0 2px 10px -4px rgba(12, 30, 43, 0.3); animation: sp-hint 3.2s ease-in-out infinite; }
@keyframes sp-hint { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.sp-tank-cap { position: absolute; z-index: 5; right: 8px; bottom: 6px; margin: 0; max-width: calc(100% - 16px); font-size: 0.68rem; font-weight: 600; color: var(--ink-2); background: rgba(255, 255, 255, 0.78); padding: 3px 9px; border-radius: 999px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-tank-cap:empty { display: none; }
.sp-tank-cap span { color: var(--ok); margin-left: 4px; }
.sp-tank-cap span.is-warn { color: var(--warn); }
.sp-zone { pointer-events: none; }
.sp-viz-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.9rem; font-weight: 600; background: linear-gradient(180deg, var(--water-1), var(--water-2)); }
.sp-viz-empty-over { background: none; z-index: 5; pointer-events: none; color: #fff; text-shadow: 0 1px 3px rgba(12, 30, 43, 0.4); }
.sp-viz-empty[hidden] { display: none; }
.sp-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ── Analysis ────────────────────────────────────────── */
.sp-analyse { margin-top: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: calc(var(--bar-h) + 12px); }
.sp-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tabs [role=tab] { border: 0; background: none; padding: 12px 14px; font-size: 0.9rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.sp-tabs [role=tab][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.sp-tabs [role=tab]:hover { color: var(--ink); }
.sp-panel { padding: 22px 24px 26px; }
.sp-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 32px; }
.sp-h3 { margin: 0 0 10px; font-size: 0.95rem; font-weight: 700; }
.sp-cols > div > .sp-h3:not(:first-child), .sp-cols .sp-limit + .sp-h3 { margin-top: 22px; }
.sp-limit { border-radius: 12px; padding: 14px 16px; background: var(--line-2); }
.sp-limit p { margin: 0; font-size: 0.9rem; color: var(--ink-2); }
.sp-limit .sp-label { margin-bottom: 2px; }
.sp-limit-title { font-weight: 700; font-size: 1.05rem !important; color: var(--ink) !important; margin-bottom: 4px !important; }
.sp-limit-ok { background: var(--ok-soft); }
.sp-limit-warn { background: var(--warn-soft); }
.sp-limit-bad { background: var(--bad-soft); }
.sp-notes { list-style: none; margin: 0; padding: 0; }
.sp-note { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 0.88rem; color: var(--ink-2); line-height: 1.5; }
.sp-note:first-child { border-top: 0; }
.sp-note-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.66rem; font-weight: 800; margin-top: 1px; }
.sp-note-ok .sp-note-icon { background: var(--ok-soft); color: var(--ok); }
.sp-note-warn .sp-note-icon { background: var(--warn-soft); color: var(--warn); }
.sp-note-bad .sp-note-icon { background: var(--bad-soft); color: var(--bad); }
.sp-note strong { color: var(--ink); }
.sp-fix { display: block; margin-top: 4px; color: var(--accent-ink); font-weight: 600; font-size: 0.84rem; }
.sp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.sp-stats div { background: var(--line-2); border-radius: 10px; padding: 10px 12px; }
.sp-stats dt { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.sp-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 0.98rem; }
.sp-facts { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 0.88rem; }
.sp-facts li + li { margin-top: 6px; }
.sp-rules { margin-top: 20px; font-size: 0.85rem; }
.sp-rules summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }
.sp-rules h4 { display: none; }
.sp-rules .rule-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.sp-rules .rule-table td { padding: 7px 0; border-top: 1px solid var(--line-2); }
.sp-rules .rule-table td:last-child { text-align: right; }
.sp-rules .rag { font-size: 0.74rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.sp-rules .rag-green { background: var(--ok-soft); color: var(--ok); }
.sp-rules .rag-amber { background: var(--warn-soft); color: var(--warn); }
.sp-rules .rag-red { background: var(--bad-soft); color: var(--bad); }
.sp-rules .summary-meta { color: var(--muted); font-size: 0.8rem; }

.sp-matrix { display: grid; grid-template-columns: minmax(90px, 140px) repeat(var(--n), minmax(30px, 1fr)); gap: 3px; align-items: end; max-width: 560px; }
.sp-mx-col { font-size: 0.72rem; font-weight: 600; color: var(--muted); height: 92px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.sp-mx-col span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 90px; overflow: hidden; text-overflow: ellipsis; }
.sp-mx-row { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.sp-mx { height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 0.78rem; font-weight: 800; }
.sp-mx-ok { background: var(--ok-soft); color: var(--ok); }
.sp-mx-warn { background: var(--warn-soft); color: var(--warn); }
.sp-mx-bad { background: var(--bad-soft); color: var(--bad); }
.sp-mx-self { background: var(--line-2); color: var(--muted); }
.sp-legend-note { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.sp-legend-note .sp-mx { width: 22px; height: 22px; display: inline-grid; margin-left: 6px; }
.sp-allgood { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }

.sp-care-hero { border-radius: 12px; padding: 16px 18px; background: var(--line-2); }
.sp-care-hero p { margin: 0; color: var(--ink-2); }
.sp-care-hero .sp-label { margin-bottom: 2px; }
.sp-care-freq { font: 700 1.6rem/1.2 var(--serif) !important; color: var(--ink) !important; }
.sp-care-ok { background: var(--ok-soft); }
.sp-care-warn { background: var(--warn-soft); }
.sp-care-bad { background: var(--bad-soft); }
.sp-factors { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; color: var(--ink-2); }
.sp-factors li { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-2); }
.sp-factors li:first-child { border-top: 0; }
.sp-factor-up span { color: var(--bad); font-weight: 800; }
.sp-factor-down span { color: var(--ok); font-weight: 800; }
.sp-badge-line { margin: 0; font-size: 0.88rem; color: var(--ink-2); }
.sp-pill { display: inline-block; font-size: 0.74rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; margin-right: 6px; }
.sp-pill-ok, .sp-pill-green { background: var(--ok-soft); color: var(--ok); }
.sp-pill-warn, .sp-pill-amber { background: var(--warn-soft); color: var(--warn); }
.sp-pill-bad, .sp-pill-red { background: var(--bad-soft); color: var(--bad); }
.sp-callout { margin: 22px 0 0; font-size: 0.84rem; color: var(--ink-2); background: #fbf8ec; border-radius: 10px; padding: 10px 12px; }

.sp-regions { list-style: none; margin: 0; padding: 0; }
.sp-regions li + li { margin-top: 14px; }
.sp-region-head { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 650; }
.sp-region-head span:last-child { color: var(--muted); font-weight: 600; }
.sp-meter { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.sp-meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.sp-regions .sp-small { margin-top: 4px; }
.sp-meter-warn span { background: var(--warn); }
.sp-meter-bad span { background: var(--bad); }

/* Why this number */
.sp-why-bar { position: relative; display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.sp-why-bar span { display: block; height: 100%; min-width: 2px; box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.7); }
.sp-why-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.sp-why { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.sp-why li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; font-size: 0.88rem; }
.sp-why-sw { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.sp-why-name { font-weight: 600; }
.sp-why-calc { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.sp-why-pct { font-weight: 700; color: var(--ink-2); }
.sp-why + .sp-small { margin-top: 12px; }

/* Timeline */
.sp-tl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.sp-tl-head .sp-h3 { margin-top: 0; }
.sp-tl-head .sp-small { margin: 0; max-width: 46em; }
.sp-tl-start { display: grid; gap: 4px; }
.sp-tl-start input { font: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; background: var(--panel); color: var(--ink); }
.sp-tl-over { margin: 16px 0 0; list-style: none; }
.sp-tl { list-style: none; margin: 20px 0 0; padding: 0; position: relative; }
.sp-tl-step { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 16px; padding: 0 0 18px; position: relative; }
.sp-tl-step::before { content: ""; position: absolute; left: calc(7.5em + 7px); top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sp-tl-step:not(:last-child)::after { content: ""; position: absolute; left: calc(7.5em + 11px); top: 18px; bottom: 0; width: 2px; background: var(--line); }
.sp-tl-cycle::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.sp-tl-date { margin: 0; font-weight: 700; font-size: 0.86rem; color: var(--ink-2); text-align: right; }
.sp-tl-body { padding-left: 22px; }
.sp-tl-what { margin: 0; font-weight: 700; }
.sp-tl-body .sp-small { margin-top: 2px; }
.sp-tl-load { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.sp-tl-load .sp-meter { flex: 0 0 120px; margin: 0; }
.sp-tl-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.sp-tl-actions .sp-small { margin: 0; }
@media (max-width: 560px) {
  .sp-tl-step { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-left: 26px; }
  .sp-tl-step::before { left: 0; }
  .sp-tl-step:not(:last-child)::after { left: 4px; }
  .sp-tl-date { text-align: left; }
  .sp-tl-body { padding-left: 0; }
}

.sp-plants-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.sp-plants-head .sp-small { margin: 0; max-width: 46em; }
.sp-plant-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sp-plant-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; }
.sp-plant-card img, .sp-plant-ph { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--line-2); }
.sp-plant-card > span { display: flex; flex-direction: column; min-width: 0; }
.sp-pc-name { font-weight: 650; font-size: 0.9rem; }
.sp-pc-sci { font-style: italic; font-size: 0.76rem; color: var(--muted); }
.sp-pc-meta { font-size: 0.74rem; color: var(--ink-2); margin-top: 2px; }

/* ── App strip, toast, dock ──────────────────────────── */
.sp-appstrip { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--radius); background: var(--ink); color: #dfe8ee; }
.sp-appstrip h2 { margin: 0 0 4px; color: #fff; font: 700 1.25rem/1.2 var(--serif); }
.sp-appstrip p { margin: 0; font-size: 0.9rem; max-width: 40em; }
.sp-appstrip-badges { display: flex; gap: 10px; align-items: center; }
.sp-appstrip-badges img { height: 42px; width: auto; display: block; }

.sp-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 80;
  background: var(--ink); color: #fff; font-size: 0.86rem; font-weight: 600; padding: 10px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.sp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.sp-dock { display: none; }
.sp-steps { display: none; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1080px) {
  .sp-v-gauge { width: 124px; height: 124px; }
  .sp-v-pct { font-size: 1.9rem; }
  .sp-checks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sp-workspace { grid-template-columns: minmax(0, 1fr); }
  .sp-result { position: static; }
  .sp-cols, .sp-cols-compat { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sp-bar-title { display: none; }
  .sp-dock {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 60;
    display: flex; align-items: center; gap: 10px; border: 0; border-radius: 14px; padding: 10px 14px;
    background: var(--ink); color: #fff; box-shadow: 0 10px 30px -8px rgba(12, 30, 43, 0.5); text-align: left;
  }
  .sp-dock[hidden] { display: none !important; }
  .sp-dock-pct { font-weight: 800; font-size: 1.05rem; padding: 3px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); }
  .sp-dock-good .sp-dock-pct { background: var(--ok); }
  .sp-dock-warn .sp-dock-pct { background: var(--warn); }
  .sp-dock-bad .sp-dock-pct { background: var(--bad); }
  .sp-dock-t { font-weight: 700; flex: 1; }
  .sp-dock-n { font-size: 0.8rem; opacity: .75; }
  .sp-main { padding-bottom: 96px; }
  .sp-toast { bottom: 84px; }

  /* Progress strip, pinned under the app bar */
  .sp-steps {
    position: sticky; top: var(--bar-h); z-index: 45;
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    padding: 8px clamp(16px, 3vw, 32px);
    background: rgba(243, 246, 247, 0.94); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .sp-steps::-webkit-scrollbar { display: none; }
  .sp-step {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px 5px 5px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--panel); color: var(--ink-2); font-size: 0.8rem; font-weight: 650; text-decoration: none;
  }
  .sp-step-mark {
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
    font-size: 0.68rem; font-weight: 800; background: var(--line-2); color: var(--muted);
  }
  .sp-step.is-done .sp-step-mark { background: var(--ok-soft); color: var(--ok); }
  .sp-step.is-todo .sp-step-mark { background: var(--bad-soft); color: var(--bad); }
  .sp-step.is-good .sp-step-mark { background: var(--ok); color: #fff; }
  .sp-step.is-warn .sp-step-mark { background: var(--warn); color: #fff; }
  .sp-step.is-bad .sp-step-mark { background: var(--bad); color: #fff; }
  .sp-step.is-here { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
  #sp-tank, #sp-add, #sp-result, #sp-analyse { scroll-margin-top: calc(var(--bar-h) + 56px); }
}
@media (max-width: 560px) {
  body.sp { font-size: 14.5px; }
  .sp-bar { gap: 10px; }
  .sp-units { display: none; }
  .sp-card { padding: 16px; border-radius: 14px; }
  .sp-v-top { gap: 16px; }
  .sp-v-gauge { width: 104px; height: 104px; }
  .sp-v-pct { font-size: 1.55rem; }
  .sp-v-cap { font-size: 0.6rem; }
  .sp-verdict { padding: 18px 16px; }
  .sp-setup-list { grid-template-columns: minmax(0, 1fr); }
  .sp-panel { padding: 18px 16px 20px; }
  .sp-stats { grid-template-columns: minmax(0, 1fr); }
  .sp-thumb { width: 44px; height: 32px; }
  .sp-juv { display: none; }
  .sp-viz { aspect-ratio: 1.7 !important; }
  .sp-kbd { display: none; }
  .sp-dims { display: none; }
  /* Segmented controls take the full row and share it, so four options never
     push past the card edge on a narrow phone. */
  .sp-opt { flex-direction: column; align-items: stretch; gap: 6px; }
  .sp-opt .sp-seg { width: 100%; }
  .sp-opt .sp-seg:not(.sp-seg-wrap) button { flex: 1; padding: 7px 4px; }
  .sp-filtration summary { flex-direction: row; }
  .sp-bar-badge { display: none; }
  .sp-cta { padding: 8px 13px; }
  .sp-tank-name { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-tank-hint { animation: none; }
  .sp-ring-fg, .sp-toast { transition: none; }
}

/* ── Setup finder ────────────────────────────────────── */
.sp-finder-cta {
  width: 100%; margin-top: 14px; text-align: left; display: flex; flex-direction: column; gap: 3px;
  border: 1px solid transparent; border-radius: 14px; padding: 16px 18px;
  background: linear-gradient(135deg, #0c1e2b 0%, #0b4a58 100%); color: #e6f1f4;
  box-shadow: 0 10px 24px -14px rgba(11, 74, 88, 0.8);
}
.sp-finder-cta:hover { filter: brightness(1.08); }
.sp-finder-cta-k { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #9fd4de; }
.sp-finder-cta-t { font: 700 1.25rem/1.2 var(--serif); color: #fff; }
.sp-finder-cta-t::after { content: " →"; font-family: var(--sans); font-weight: 600; }
.sp-finder-cta-s { font-size: 0.84rem; color: #c9dde3; }

.sp-finder {
  width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: 20px; background: var(--bg); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(12, 30, 43, 0.45);
}
.sp-finder::backdrop { background: rgba(12, 30, 43, 0.45); backdrop-filter: blur(3px); }
.sp-finder-inner { padding: 22px 26px 26px; }
.sp-finder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.sp-finder-head .sp-label { margin-bottom: 4px; }
.sp-finder-head h2 { margin: 0; font: 700 clamp(1.3rem, 2.4vw, 1.7rem)/1.2 var(--serif); letter-spacing: -0.01em; }
.sp-finder-x { font-size: 1.6rem; width: 36px; height: 36px; background: var(--panel); border: 1px solid var(--line); }
.sp-finder-q { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 14px; }
.sp-finder-say { margin: 0; font: 600 1.02rem var(--serif); font-style: italic; color: var(--muted); white-space: nowrap; }
.sp-finder-chips { margin: 0; }
.sp-finder-chips .sp-chip { font-size: 0.84rem; padding: 6px 12px; }
.sp-finder-note { font-size: 0.8rem; color: var(--muted); margin: 12px 2px 16px; line-height: 1.5; }
.sp-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sp-plan { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sp-plan-thumbs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.sp-plan-thumbs .sp-thumb { width: 46px; height: 32px; }
.sp-plan-title { margin: 0 0 8px; font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.sp-plan-stock { list-style: none; margin: 0 0 12px; padding: 0; font-size: 0.88rem; color: var(--ink-2); }
.sp-plan-stock li { padding: 3px 0; display: flex; gap: 8px; }
.sp-plan-q { min-width: 26px; font-weight: 800; color: var(--ink); text-align: right; }
.sp-plan-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; }
.sp-plan-facts div { background: var(--line-2); border-radius: 9px; padding: 7px 9px; }
.sp-plan-facts dt { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sp-plan-facts dd { margin: 1px 0 0; font-weight: 700; font-size: 0.86rem; }
.sp-t-ok { color: var(--ok); }
.sp-t-warn { color: var(--warn); }
.sp-t-bad { color: var(--bad); }
.sp-plan-meta { margin: auto 0 0; font-size: 0.78rem; color: var(--muted); padding-top: 4px; }
.sp-plan-use { margin-top: 0; flex: 1; }
.sp-plan-btns { display: flex; gap: 8px; margin-top: 10px; }
.sp-plan-pin { white-space: nowrap; }
.sp-plan-pin.is-on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.sp-finder-more { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.sp-finder-more .sp-small { margin: 0; }
.sp-finder-none { grid-column: 1 / -1; background: var(--panel); border-radius: 14px; padding: 18px; }
@media (max-width: 900px) {
  .sp-plans { grid-template-columns: minmax(0, 1fr); }
  .sp-finder { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .sp-finder-inner { padding: 16px; }
  .sp-finder-q { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .sp-finder-say { font-size: 0.92rem; }
}

/* Finder: expanded inputs */
.sp-finder-size { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sp-finder-custom { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 4px; background: #fff; }
.sp-finder-custom.is-on { border-color: var(--ink); color: var(--ink); }
.sp-finder-custom input { width: 64px; border: 0; background: transparent; padding: 4px 6px; font-size: 0.84rem; font-weight: 700; }
.sp-finder-custom input:focus { outline: 0; }
.sp-must { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-must-search { position: relative; width: min(340px, 100%); }
.sp-must-search input { width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 0.84rem; background: #fff; }
.sp-must-search input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-must-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; list-style: none; margin: 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.sp-must-results button { width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; font-size: 0.85rem; }
.sp-must-results button:hover { background: var(--accent-soft); }
.sp-must-results em { color: var(--muted); font-size: 0.78rem; }
.sp-must-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 0.84rem; font-weight: 600; }
.sp-must-chip button { border: 0; background: rgba(255, 255, 255, 0.18); color: #fff; width: 22px; height: 22px; border-radius: 50%; line-height: 1; }
.sp-plan-stock li.is-kept { color: var(--muted); }
.sp-plan-kept { font-size: 0.7rem; font-weight: 600; color: var(--muted); background: var(--line-2); border-radius: 999px; padding: 1px 7px; }
.sp-thumb.is-kept { opacity: 0.45; }
.sp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sp-quick .sp-chip { font-size: 0.76rem; }

/* Shop card */
.sp-shop { width: min(620px, calc(100vw - 32px)); }
.sp-shop-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.sp-shop-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.sp-shop-brand { margin: 0; font: 700 1.05rem/1.2 var(--serif); }
.sp-shop-meta { margin: 0; text-align: right; font-size: 0.82rem; color: var(--ink-2); }
.sp-shop-warn { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 0.86rem; }
.sp-shop-list { list-style: none; margin: 8px 0 0; padding: 0; }
.sp-shop-list li { display: grid; grid-template-columns: 18px 2.2em minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.sp-shop-box { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; align-self: center; }
.sp-shop-qty { font-weight: 800; font-size: 1.1rem; text-align: right; }
.sp-shop-name { font-weight: 600; }
.sp-shop-name em { font-weight: 400; color: var(--muted); font-size: 0.86rem; }
.sp-shop-size { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.sp-shop-when { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.sp-shop-when.is-first { color: var(--ok); font-weight: 700; }
.sp-shop-h { margin: 16px 0 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sp-shop-qs { margin: 0; padding-left: 18px; font-size: 0.86rem; color: var(--ink-2); display: grid; gap: 4px; }
.sp-shop-foot { margin: 14px 0 0; font-size: 0.76rem; color: var(--muted); }
.sp-shop-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sp-shop-actions .sp-btn-primary { margin-top: 0; }
.sp-shop-app { margin-top: 12px; }
.sp-print { display: none; }
@media (max-width: 560px) {
  .sp-shop-list li { grid-template-columns: 18px 2em minmax(0, 1fr); row-gap: 2px; }
  .sp-shop-when { grid-column: 3; }
}
@media print {
  body.sp-printing > :not(.sp-print) { display: none !important; }
  body.sp-printing { background: #fff; }
  body.sp-printing .sp-print { display: block; }
  .sp-print .sp-shop-card { border: 0; padding: 0; }
  .sp-print .sp-shop-list li { break-inside: avoid; }
}

/* Compare plans */
.sp-cmp-tray { position: sticky; bottom: 0; margin: 16px -26px -26px; padding: 12px 26px; display: flex; align-items: center; gap: 14px; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -8px 20px -14px rgba(12, 30, 43, 0.3); font-weight: 600; font-size: 0.9rem; }
.sp-cmp-tray > span { margin-right: auto; }
.sp-cmp-tray .sp-btn-primary { margin-top: 0; }
.sp-cmp-tray .sp-btn-primary:disabled { opacity: 0.45; }
.sp-cmp-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.sp-cmp-bar .sp-small { margin: 0 0 0 auto; }
.sp-cmp-scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.sp-cmp-table { width: 100%; min-width: calc(8.5em + var(--cols) * 13em); border-collapse: collapse; font-size: 0.86rem; }
.sp-cmp-table th, .sp-cmp-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.sp-cmp-table tbody tr:last-child th, .sp-cmp-table tbody tr:last-child td { border-bottom: 0; }
.sp-cmp-table tbody th { width: 8.5em; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sp-cmp-table thead th { position: relative; padding-right: 34px; background: var(--line-2); }
.sp-cmp-table thead .sp-x { position: absolute; top: 6px; right: 4px; }
.sp-cmp-title { display: block; font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.sp-cmp-sub { font-size: 0.76rem; color: var(--muted); font-weight: 500; }
.sp-cmp-letter { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 6px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 0.72rem; vertical-align: 1px; }
.sp-cmp-table td.is-best { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.sp-cmp-stock { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sp-cmp-stock b { display: inline-block; min-width: 1.6em; }
.sp-cmp-table .sp-btn-primary { margin-top: 0; }
@media (max-width: 900px) {
  .sp-cmp-tray { margin: 16px -16px -16px; padding: 12px 16px; flex-wrap: wrap; }
  .sp-cmp-bar .sp-small { margin-left: 0; }
}
