/* Chubby Operations Platform — stylesheet
   Extracted from pricing_calculator.html's inline <style> block in v2.216
   (file-splitting effort — see CLAUDE_BRIEF.md "Splitting the monolith").
   Served by server.py at GET /styles.css.

   (v2.268) FULL "Chubbyfy" redesign — dark AI command-centre theme,
   ported from the AU app (AU v2.287–v2.292) per CHUBBYFY_PORTING_GUIDE.md.
   Warm charcoal-brown surfaces, glowing Chubby-orange accents, cream
   text, 'Baloo 2' chubby display font for headings/nav. Every colour
   below was re-derived from the brand assets in AlexWorms/ (caramel
   wordmark gradient #F1880D→#E07505, rust outline #8A3B29, cream
   #FFF1DC, gold coin #FFD34D). The old light values are in
   .backups/pre-chubbyfy-2026-07-23/styles.css if a rollback is needed. */

:root {
  --bg: #16110d;            /* deep warm near-black */
  --surface: #201914;       /* card / table surface */
  --surface2: #2a211a;      /* raised surface / th / hover */
  --border: rgba(255,222,180,0.09);
  --border2: rgba(255,222,180,0.17);
  --text: #f4e9d8;          /* cream */
  --text2: #c9b8a2;
  --text3: #94836f;
  --accent: #F1880D;
  /* Chubby brand palette — dark-theme derivatives. --brand-dark was the
     rust used as text-on-cream in the light theme; on dark it flips to a
     light caramel so chips stay readable (every read site pairs it with
     --brand-bg, which is now a translucent orange). */
  --brand: #F1880D;
  --brand-dark: #FFB45E;
  --brand-bg: rgba(241,136,13,0.14);
  --brand-bg2: rgba(241,136,13,0.24);
  --brand-glow: rgba(241,136,13,0.35);
  --gold: #FFD34D;
  --sidebar-bg: #120d09;
  --green: #4ade80; --green-bg: rgba(34,197,94,0.14); --green-text: #86efac;
  --amber: #fbbf24; --amber-bg: rgba(245,158,11,0.15); --amber-text: #fcd34d;
  --red: #f87171; --red-bg: rgba(239,68,68,0.16); --red-text: #fca5a5;
  --blue: #6ea8fe; --blue-bg: rgba(59,130,246,0.16); --blue-text: #a5c8ff;
  --purple: #b7a5f7; --purple-bg: rgba(139,92,246,0.18); --purple-text: #d6ccfb;
  --sidebar-w: 200px;
  --radius: 8px;
  --radius-lg: 12px;
  --font-display: 'Baloo 2', 'DM Sans', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  background: var(--bg);
  /* faint warm ambient glow, top-left — keeps big empty areas from
     feeling flat black */
  background-image: radial-gradient(1100px 600px at 8% -10%, rgba(241,136,13,0.07), transparent 60%),
                    radial-gradient(900px 500px at 110% 110%, rgba(241,136,13,0.05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
/* Chubby display font for headings across every tab. Data stays in
   DM Sans/DM Mono for legibility. */
h1, h2, h3, .topbar-title, .sec-title, .dash-card-label, .nav-section,
.targets-header h3, .modal-head h2 { font-family: var(--font-display); }
/* ---- LAYOUT ---- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #17110c 60%, #1a1209 100%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-right: 1px solid rgba(241,136,13,0.12);
}
.sidebar-logo {
  padding: 14px 12px 12px;
  border-bottom: 1px solid rgba(241,136,13,0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.sidebar-logo-img {
  /* (v2.268 UK) Site-header wordmark (brand-header.png, the current
     chubbymealworms.co.uk header logo — transparent PNG). Sits directly
     on the dark sidebar — no cream card, just a soft warm glow behind
     it via drop-shadow so the caramel wordmark lifts off the background. */
  width: 100%;
  height: 82px;
  background-image: url('/brand-header.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 14px rgba(241,136,13,0.35)) drop-shadow(0 2px 5px rgba(0,0,0,0.6));
}
.sidebar-logo span {
  font-size: 10.5px;
  color: rgba(244,233,216,0.55);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* (v2.287, UK: United Kingdom) country identity chip — always visible,
   right under the logo. Class name kept as .sidebar-au-chip so the CSS
   stays diffable against the AU original. */
.sidebar-au-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0,132,61,0.28), rgba(255,205,0,0.20));
  border: 1px solid rgba(255,205,0,0.35);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ffe08a;
  text-transform: uppercase;
}
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  font-size: 12.5px;
  font-family: var(--font-display);
  color: rgba(244,233,216,0.55);
  cursor: pointer;
  transition: all 0.12s;
  border-left: 2px solid transparent;
  font-weight: 500;
}
.nav-item:hover { color: rgba(244,233,216,0.92); background: rgba(241,136,13,0.07); }
.nav-item.active {
  color: #ffd9a8;
  background: linear-gradient(90deg, rgba(241,136,13,0.20), rgba(241,136,13,0.04));
  border-left-color: var(--brand);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(241,136,13,0.5);
}
.nav-icon { width: 15px; height: 15px; opacity: 0.7; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; filter: drop-shadow(0 0 4px rgba(241,136,13,0.8)); }
/* (v2.181) Promotions right-hand submenu — see #tab-promotions. */
.promo-menu-btn:hover { background: var(--surface2) !important; }
.promo-menu-btn.active { background: var(--blue-bg) !important; color: var(--blue-text) !important; border-color: var(--blue) !important; font-weight: 600; }
.nav-section { padding: 14px 18px 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: rgba(255,255,255,0.25); text-transform: uppercase; }
/* (v2.82) Dashboard cards. Grid auto-fits at min 240px so we get 2-up on
   smaller screens and 4-up wide. Each card has a stat slot + label slot
   + optional trend / status footer. Pending cards get a dashed border
   to make it obvious they're not live yet. */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 132px;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dash-card:hover { border-color: rgba(241,136,13,0.45); box-shadow: 0 0 20px rgba(241,136,13,0.10), 0 4px 14px rgba(0,0,0,0.4); }
.dash-card.pending { border-style: dashed; border-color: var(--border2); background: var(--surface2); }
.dash-card.pending .dash-card-value { color: var(--text3); }
.dash-card.brand-accent { border-left: 3px solid var(--brand); }
.dash-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash-card-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dash-card-sub {
  font-size: 11.5px;
  color: var(--text3);
  margin-top: 2px;
}
.dash-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  color: var(--text2);
}
/* (v2.289/290) Draggable/hideable card shells — see _dashApplyLayout().
   .slotted switches the grid from auto-fit flow to an explicit cell grid
   (--dash-cols set by the layout) so cards can occupy any cell with real
   gaps in between; .dash-slot cells are the invisible drop targets that
   light up while a drag is in flight. */
/* (v2.292) The dashboard content layer is click-through by default so the
   globe underneath is grabbable in EVERY empty spot (gaps between cards,
   empty cells, the space beside/below the grid). Only real, visible,
   interactive things get the pointer back. */
.dash-content { pointer-events: none; }
.dash-content .dash-card-wrap,
.dash-content .dash-slot.drop-hint,
.dash-content .targets-card,
.dash-content button,
.dash-content a,
.dash-content input,
.dash-content select { pointer-events: auto; }
.dash-grid.slotted { grid-template-columns: repeat(var(--dash-cols, 5), minmax(0, 1fr)); }
.dash-slot { border: 2px dashed transparent; border-radius: var(--radius-lg); min-height: 132px;
  /* (v2.291) Invisible placeholders must NOT eat the pointer — they sit
     above the globe canvas and were blocking grab/flex in the gaps. Only
     mid-drag do they become real drop targets. */
  pointer-events: none; }
.dash-grid.drag-active .dash-slot { border-color: rgba(241,136,13,0.30); background: rgba(241,136,13,0.05); pointer-events: auto; }
.dash-slot.drop-hint, .dash-grid.drag-active .dash-card-wrap.drop-hint .dash-card { border-color: var(--brand); box-shadow: 0 0 14px rgba(241,136,13,0.35); }
.dash-card-wrap { position: relative; cursor: grab; }
.dash-card-wrap:active { cursor: grabbing; }
.dash-card-wrap .dash-card { height: 100%; }
.dash-card-wrap.dragging { opacity: 0.45; }
.dash-card-hide {
  position: absolute;
  top: 6px; right: 6px;
  z-index: 2;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text3);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, border-color 0.12s;
}
.dash-card-wrap:hover .dash-card-hide { opacity: 1; }
.dash-card-hide:hover { color: var(--red); border-color: var(--red); }
.dash-card-pill {
  display: inline-block;
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-bg);
  color: var(--brand-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash-card.pending .dash-card-pill { background: var(--surface); color: var(--text3); border: 1px solid var(--border2); }

/* (v2.110) Monthly sales targets widget. Sits above the dash-grid and
   shows progress bars per channel + total with a vertical pace marker
   at "where we should be today" (linear pro-rata across the month). */
.targets-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.targets-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.targets-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.targets-header .targets-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.targets-edit-btn {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--brand-bg);
  color: var(--brand-dark);
  border: 1px solid var(--brand);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.targets-edit-btn:hover { background: var(--brand); color: #fff; }
/* (v2.176) Back/forward month nav arrows next to the targets heading. */
.targets-nav {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.targets-nav-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.targets-nav-btn:hover:not(:disabled) { background: var(--brand-bg); color: var(--brand-dark); border-color: var(--brand); }
.targets-nav-btn:disabled { opacity: 0.35; cursor: default; }
.targets-row {
  display: grid;
  grid-template-columns: 110px 1fr 160px;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.targets-row:last-child { border-bottom: none; }
.targets-row.total { padding-top: 14px; padding-bottom: 14px; font-weight: 600; }
.targets-row.total .targets-label { color: var(--brand-dark); }
.targets-row.muted { opacity: 0.55; }
.targets-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.targets-label-meta {
  display: block;
  font-size: 10.5px;
  color: var(--text3);
  font-weight: 400;
  margin-top: 1px;
  text-transform: none;
  letter-spacing: 0;
}
.targets-bar-wrap {
  position: relative;
}
.targets-bar-track {
  position: relative;
  height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
}
.targets-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #F1880D 0%, #E07505 100%);
  border-radius: 11px;
  transition: width 0.4s ease;
}
.targets-bar-fill.behind { background: linear-gradient(90deg, #d97706 0%, #92400e 100%); }
.targets-bar-fill.ahead  { background: linear-gradient(90deg, #16a34a 0%, #166534 100%); }
.targets-bar-pace {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--text);
  z-index: 2;
  border-radius: 1px;
}
.targets-bar-pace::after {
  content: 'TODAY';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text2);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* (v2.344) Hover tooltip for a targets bar's channel breakdown — e.g.
   FBA/FBM for Amazon, Regular site/Wholesale for Shopify. Only rendered
   (see _targetsRow() in pricing_calculator.html) when there are 2+
   non-zero sub-totals to show. */
.targets-bar-tooltip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}
.targets-bar-tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; }
.targets-bar-tooltip .tt-row + .tt-row { margin-top: 3px; }
.targets-bar-wrap.has-tooltip { cursor: default; }
.targets-bar-wrap.has-tooltip:hover .targets-bar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.targets-status {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.targets-status-amount {
  font-weight: 600;
  color: var(--text);
}
.targets-status-line {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.targets-status-line.behind { color: #b45309; }
.targets-status-line.ahead  { color: #166534; }
.targets-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}
.targets-empty a {
  color: var(--brand-dark);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 720px) {
  .targets-row { grid-template-columns: 90px 1fr; }
  .targets-status { grid-column: 1 / -1; text-align: left; padding-left: 90px; }
  .targets-bar-pace::after { display: none; }
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(241,136,13,0.14);
  font-size: 11px;
  color: rgba(244,233,216,0.35);
}
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar {
  background: rgba(26,20,15,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(241,136,13,0.16);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  /* (v2.290) Lift the whole topbar above the page content — without this
     the world-clock dropdown paints BEHIND the dashboard's z-index:1
     content wrapper (backdrop-filter makes the topbar its own stacking
     context, so no child z-index can escape it). */
  position: relative;
  z-index: 300;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }
/* (v2.287) Sydney clock — a proper feature, not a timestamp. Glassy gold
   pill, pulsing "live" dot, big tabular digits, AEST/AEDT + date line.
   Populated by _updateAuClock() in pricing_calculator.html. */
.au-clock-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 10px;
  margin-left: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(241,136,13,0.16), rgba(255,211,77,0.08));
  border: 1px solid rgba(255,211,77,0.35);
  box-shadow: 0 0 14px rgba(241,136,13,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
}
.au-clock-flag { font-size: 17px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.au-clock-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px 1px rgba(255,211,77,0.8);
  animation: au-pulse 2.2s ease-in-out infinite;
}
@keyframes au-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px 1px rgba(255,211,77,0.8); }
  50%      { opacity: 0.45; box-shadow: 0 0 2px 0 rgba(255,211,77,0.4); }
}
.au-clock-time {
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #ffe1b0;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(241,136,13,0.45);
  line-height: 1.1;
}
.au-clock-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.au-clock-city {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
}
.au-clock-date { font-size: 9.5px; color: var(--text2); white-space: nowrap; }
/* (v2.289) World-clock dropdown — hover the Sydney pill to reveal the UK
   and US & Canada pills (same styling), each linking to that country's
   operations app. Pure CSS :hover; the invisible bridge (::before) stops
   the dropdown closing while the mouse crosses the 6px gap. */
.clock-stack { position: relative; display: inline-flex; }
.au-clock-chev { font-size: 10px; color: var(--gold); opacity: 0.7; margin-left: 2px; }
.clock-stack:hover .au-clock-chev { transform: translateY(1px); opacity: 1; }
.clock-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 500;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid rgba(241,136,13,0.30);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 16px rgba(241,136,13,0.10);
}
.clock-dropdown::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.clock-stack:hover .clock-dropdown, .clock-stack.open .clock-dropdown { display: flex; }
/* clicking the pill pins the dropdown open (hover alone was fragile) */
.clock-stack > .au-clock-pill { cursor: pointer; }
.clock-drop-item { text-decoration: none; cursor: pointer; margin-left: 0; transition: box-shadow 0.12s, border-color 0.12s; }
.clock-drop-item:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(241,136,13,0.35); }
body.theme-light .clock-dropdown { box-shadow: 0 12px 32px rgba(0,0,0,0.18); }
/* (v2.287) Globe mounts — canvas containers for chubby-globe.js. */
.globe-mount { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
.panel { display: none; }
.panel.active { display: block; }

/* ---- COMPONENTS ---- */
.btn {
  padding: 7px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface2); border-color: rgba(241,136,13,0.4); }
.btn-primary {
  background: linear-gradient(135deg, #F1880D 0%, #E07505 100%);
  color: #1c1108;
  border-color: rgba(241,136,13,0.7);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(241,136,13,0.25);
}
.btn-primary:hover { box-shadow: 0 0 18px rgba(241,136,13,0.45); opacity: 1; filter: brightness(1.08); }
.btn-sm { padding: 4px 10px; font-size: 11.5px; }
.btn-danger { color: var(--red); border-color: rgba(153,27,27,0.25); }
.btn-danger:hover { background: var(--red-bg); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
.badge-good { background: var(--green-bg); color: var(--green-text); }
.badge-warn { background: var(--amber-bg); color: var(--amber-text); }
.badge-bad { background: var(--red-bg); color: var(--red-text); }
.badge-info { background: var(--blue-bg); color: var(--blue-text); }
.badge-neutral { background: var(--surface2); color: var(--text2); }
.badge-kit { background: var(--purple-bg); color: var(--purple-text); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

/* ---- METRICS ROW ---- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.metric-label { font-size: 11px; color: var(--text2); margin-bottom: 4px; font-weight: 500; letter-spacing: 0.02em; }
.metric-value { font-size: 24px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -0.02em; }
.metric-value.good { color: var(--green); }
.metric-value.warn { color: var(--amber); }
.metric-value.bad { color: var(--red); }

/* ---- TABLE ---- */
.tbl-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.tbl-wrap table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl-wrap th { background: var(--surface2); padding: 9px 12px; text-align: left; font-weight: 500; font-size: 11px; color: var(--text2); border-bottom: 1px solid var(--border); white-space: nowrap; letter-spacing: 0.02em; }
.tbl-wrap td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tbl-wrap tr:last-child td { border-bottom: none; }
.tbl-wrap tr:hover td { background: var(--surface2); }
.tbl-wrap .alert-row td:first-child { border-left: 3px solid #f59e0b; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ff { display: flex; flex-direction: column; gap: 4px; }
.ff.full { grid-column: 1/-1; }
.ff label { font-size: 11px; font-weight: 500; color: var(--text2); letter-spacing: 0.02em; }
input, select, textarea {
  padding: 8px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  transition: border-color 0.12s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(241,136,13,0.18); }
::placeholder { color: var(--text3); opacity: 1; }
/* Native pickers/dropdowns render for a dark page (flipped by
   body.theme-light — see THEME: LIGHT block at the end of this file) */
body { color-scheme: dark; }
input[type="number"] { font-family: 'DM Mono', monospace; }
/* (v2.261) The width:100% above was meant for text/number/select fields
   but was also matching checkboxes and radios — their invisible clickable
   LAYOUT box inherited width:100% of whatever flex/grid cell it sat in,
   shoving adjacent label text far right and making checkbox lists look
   ragged. Restore their natural intrinsic size everywhere. (UK-only rule,
   re-applied on top of the AU Chubbyfy port.) */
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; flex: 0 0 auto; }

/* ---- MODAL ---- */
/* v2.35 — Edit product is now a FULL PAGE (was a modal popup). The
   modal-overlay div is repurposed as a viewport-filling container that
   leaves the sidebar visible. Open/close still toggles the .open class
   on this element, so all existing openModal/closeModal JS keeps working
   unchanged. */
/* (v2.51) The "modal" is no longer a modal — it lives inline inside the
   Price Calculator tab as the channel-aware Product Data editor. The
   .modal-overlay wrapper survives only because dozens of selectors and
   handlers reference its DOM; we strip every overlay property so it
   renders as a regular block element. JS moves it into #tab-calculator
   at init. The `.open` class is kept set permanently while a product is
   loaded so all the original show/hide JS keeps working. */
.modal-overlay {
  display: none;
  background: transparent;
  margin-top: 0;
  /* (v2.335) The 140px reserve (see .foot-visible below) only applies
     while the Save bar is actually showing — Ben found it was blocking
     the bottom of the form even when there was nothing to save. Default
     to 0; _syncModalFootVisibility() toggles the .foot-visible class in
     lockstep with the bar itself. */
  padding-bottom: 0;
}
.modal-overlay.open { display: block; }
/* (v2.52, retargeted v2.335) Generous bottom padding so the sticky Save
   bar at the bottom of the viewport doesn't cover the last fields
   (Shopify collections picker, image grid, etc.) — only reserved while
   the bar is actually visible (dirty state). 140px clears the ~50px
   sticky bar plus a comfortable scroll margin. */
.modal-overlay.foot-visible { padding-bottom: 140px; }
.modal {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 20px; font-weight: 600; margin: 0; }
/* Sticky action bar at the bottom of the calculator tab — Save / Delete
   always reachable without scrolling to the end of long product forms.
   Sits below the channel form, above the page bottom. Still sticky-fixed
   so it floats at the bottom of the viewport while the user scrolls
   through fields. */
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  background: var(--surface);
  padding: 12px 36px;
  border-top: 1px solid var(--border);
  z-index: 60;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
/* Modal-ch-tabs row inside the embedded editor is now redundant — the
   Price Calc's calc-ch-tabs drive panel visibility instead. Hide. */
.modal-ch-tabs-wrap { display: none !important; }
@media (max-width: 768px) {
  .modal-foot { left: 48px; padding: 10px 16px; }
}

/* ---- COST BOX ---- */
.cost-box { background: var(--surface2); border-radius: var(--radius); padding: 12px 14px; }
.cost-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.cost-row:last-child { border-bottom: none; font-weight: 600; padding-top: 8px; }
.cost-row span:last-child { font-family: 'DM Mono', monospace; }

/* ---- CHANNEL CARDS ---- */
.channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.ch-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
/* Lists tab: collapsible section accordion */
.list-section { border:1px solid var(--border); border-radius:var(--radius); margin-bottom:12px; background:var(--bg); }
.list-section-header { display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer; user-select:none; background:var(--surface); border-radius:var(--radius) var(--radius) 0 0; border-bottom:1px solid var(--border); }
.list-section.collapsed .list-section-header { border-bottom:none; border-radius:var(--radius); }
.list-section-header:hover { background:var(--surface2); }
.list-section-chevron { display:inline-block; font-size:10px; color:var(--text2); transition:transform 0.15s; width:12px; text-align:center; }
.list-section.collapsed .list-section-chevron { transform:rotate(-90deg); }
.list-section-title { font-size:13px; font-weight:600; color:var(--text); flex:1; }
.list-section-count { font-size:11px; color:var(--text3); font-weight:400; }
.list-section-action { margin-left:auto; }
.list-section-body { padding:14px; }
.list-section.collapsed .list-section-body { display:none; }
/* Edit-modal channel sections (Website / eBay / Amazon) — collapsible by
   default to keep the modal tidy. Click the header to expand. Header
   action buttons (✨ Optimise, Generate with Claude, Open in calculator)
   are kept in the header so they're always one click away. */
.ch-section { margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ch-section-header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; border-radius: var(--radius); transition: background-color .15s ease; }
.ch-section-header:hover { background: var(--surface2); }
.ch-section-chevron { display: inline-block; font-size: 10px; color: var(--text2); transition: transform .18s ease; width: 12px; text-align: center; flex-shrink: 0; }
.ch-section:not(.collapsed) .ch-section-chevron { transform: rotate(90deg); }
.ch-section-title { font-size: 11.5px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; flex: 1; margin: 0; }
.ch-section-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ch-section-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.ch-section-body > .ff:first-child { margin-top: 6px; }
.ch-section.collapsed .ch-section-body { display: none; }
.ch-section.collapsed .ch-section-header { border-bottom: none; }
/* (v2.333) #calc-editor-section ("Product details" accordion on the Price
   Calc tab) wraps the whole inline product editor, including its sticky
   .modal-foot Save/Delete bar. The generic rule above uses display:none on
   the whole body when collapsed — that also nukes .modal-foot even though
   it's position:fixed, because a display:none ancestor removes its entire
   descendant subtree from rendering regardless of position. Bug: Ben found
   the Save product bar disappeared whenever this section was collapsed.
   Fix: for this specific section, don't display:none the body — just hide
   its .form-grid (the actual field content; .modal-foot is a sibling of
   .form-grid inside .modal, not a descendant of it) so .modal-foot keeps
   rendering regardless of the accordion's collapsed state. The ID selector
   here is more specific than the generic class rule above, so it wins
   without touching any other .ch-section instance. */
#calc-editor-section.collapsed .ch-section-body { display: block; padding: 0; border-top: none; }
#calc-editor-section.collapsed .ch-section-body .form-grid { display: none; }
/* (v2.334, superseded v2.335) Used to force .modal-overlay's padding-bottom
   to 0 while collapsed, to stop a blank gap under the collapsed box. No
   longer needed — v2.335 made that padding conditional on .foot-visible
   (see .modal-overlay rules above) instead of always-on, so it's already
   0 by default whether collapsed or not. Left as a no-op comment marker
   rather than deleted, in case a future session goes looking for why this
   selector isn't here any more. */
/* Edit-modal channel tabs (Website / eBay / Amazon) — v2.33 replaces the
   v2.32 collapsibles with a proper tab UI to mirror the Price Calculator's
   channel tabs. Active tab is remembered per-browser via localStorage. */
.modal-ch-tabs { display: flex !important; flex-wrap: wrap !important; gap: 4px !important; border-bottom: 2px solid var(--border); margin: 12px 0 0; overflow: visible !important; align-items: stretch !important; }
.modal-ch-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 18px !important;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -2px;
  transition: color .15s ease, border-color .15s ease;
  /* Force visibility on every tab regardless of position. The flex
     `auto` basis + min-width 0 default were collapsing the first and
     last children to zero width on some browsers — these !important
     rules guarantee each button keeps its content width. */
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  width: auto !important;
  height: auto !important;
  min-width: 60px !important;
  min-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  box-sizing: content-box !important;
}
.modal-ch-tab:hover { color: var(--text); }
.modal-ch-tab.active { color: var(--text); border-bottom-color: var(--blue); font-weight: 600; }
.modal-ch-panel { padding: 16px 0 8px; }
.modal-ch-panel.hidden { display: none; }
.modal-ch-panel-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 10px; }
/* v2.34 — tab system extended: tabs sit at the very TOP of the modal, with
   a "Product" tab covering all general/shared/logistics fields. Setting a
   non-product tab applies .tab-hidden to those general fields. */
.tab-hidden { display: none !important; }
.modal-ch-tabs-wrap { padding: 0 0 6px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.modal-ch-tabs-wrap .modal-ch-tabs { margin: 0; flex: 1 1 auto; }
#force-export-current-tab:hover { background: var(--surface2) !important; }
/* Image drop zone (v2.27) — used inside Edit modal for product images */
.img-dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; transition: background 0.15s, border-color 0.15s; background: var(--surface); }
.img-dropzone:hover { background: var(--surface2); }
.img-dropzone.dz-hover { background: var(--surface2); border-color: var(--blue); border-style: solid; }
.img-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.img-card img { display: block; width: 100%; height: 110px; object-fit: contain; background: #fff; }
.img-card .img-card-foot { display:flex; gap:4px; padding:4px; background:var(--surface2); border-top:1px solid var(--border); }
.img-card .img-card-foot button { flex: 1; font-size: 10.5px; padding: 3px 4px; }
.img-card .img-slot { position:absolute; top:4px; left:4px; background: rgba(0,0,0,0.55); color:#fff; font-size: 10px; font-family:'DM Mono',monospace; padding: 1px 5px; border-radius: 3px; }
.img-card.uploading { opacity: 0.55; }
.img-card.uploading::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,0.05) 8px 16px); animation: img-stripe 1s linear infinite; pointer-events: none; }
@keyframes img-stripe { from { background-position: 0 0 } to { background-position: 22px 0 } }
/* eBay optimisation result dialog (v2.30) */
.ebay-opt-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 10000; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 30px 16px; }
.ebay-opt-panel { background: var(--bg); color: var(--text); border-radius: var(--radius); max-width: 920px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.ebay-opt-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; z-index: 2; }
.ebay-opt-head h2 { margin: 0; font-size: 16px; }
.ebay-opt-body { padding: 14px 18px; }
.ebay-opt-section { margin-bottom: 18px; }
.ebay-opt-section h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text2); }
.ebay-opt-section h3 .badge { font-size: 11px; padding: 2px 7px; border-radius: 9px; background: var(--surface2); color: var(--text2); font-weight: 600; letter-spacing: 0; text-transform: none; }
.ebay-opt-section h3 .badge.ok { background: var(--green-bg); color: var(--green-text); }
.ebay-opt-section h3 .badge.warn { background: var(--amber-bg); color: var(--amber-text); }
.ebay-opt-section h3 .badge.err { background: var(--red-bg); color: var(--red-text); }
.ebay-opt-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-size: 12.5px; line-height: 1.5; }
.ebay-opt-box.mono { font-family: 'DM Mono', monospace; white-space: pre-wrap; word-break: break-word; }
.ebay-opt-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ebay-opt-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ebay-opt-tbl th, .ebay-opt-tbl td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.ebay-opt-tbl th { background: var(--surface2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text2); }
.ebay-opt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .ebay-opt-grid2 { grid-template-columns: 1fr } }
.ebay-opt-preview { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; max-height: 420px; overflow: auto; color: #111; }
.ebay-opt-loading { padding: 36px 18px; text-align: center; color: var(--text2); }
.ebay-opt-loading .spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--surface2); border-top-color: var(--blue, #0a6); border-radius: 50%; animation: ebay-opt-spin 0.9s linear infinite; margin-bottom: 12px; }
@keyframes ebay-opt-spin { to { transform: rotate(360deg) } }
@keyframes slideInRight { from { transform: translateX(40px); opacity:0 } to { transform: translateX(0); opacity:1 } }
/* eBay description preview — give block elements visible spacing so the
   user can see paragraphs/sections without inspecting the raw HTML.
   Mirrors what eBay's mobile/desktop listing rendering does. */
#f-ebaydescription-preview h3 { margin: 16px 0 6px; font-size: 14px; color: #F1880D; }
#f-ebaydescription-preview h3:first-child { margin-top: 4px; }
#f-ebaydescription-preview p { margin: 0 0 10px; }
#f-ebaydescription-preview ul, #f-ebaydescription-preview ol { margin: 0 0 10px 0; padding-left: 20px; }
#f-ebaydescription-preview li { margin: 3px 0; }
#f-ebaydescription-preview:focus { box-shadow: inset 0 0 0 2px var(--blue, #6c8fff); }
.calc-ch-tabs { display:flex; gap:0; margin: 4px 0 18px; border-bottom: 1px solid var(--border); }
.calc-ch-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 8px 18px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; font-family: inherit; }
.calc-ch-tab:hover { color: var(--text); }
.calc-ch-tab.active { color: var(--text); border-bottom-color: var(--blue); }
.ch-name { font-size: 10px; font-weight: 600; color: var(--text2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.ch-price { font-size: 22px; font-weight: 300; font-family: 'DM Mono', monospace; margin-bottom: 4px; letter-spacing: -0.02em; }
.ch-detail { font-size: 11px; color: var(--text2); margin-top: 3px; }
.ch-card.highlight { border-color: #16a34a; }

/* ---- SECTION HEADER ---- */
.sec-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-title { font-size: 13px; font-weight: 500; }

/* ---- TARGET BAR ---- */
.target-bar { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; flex-wrap: wrap; }
.target-bar label { font-size: 12px; color: var(--text2); white-space: nowrap; }
.target-bar input { width: 60px; }

/* ---- SEARCH ROW ---- */
.search-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-row select { min-width: 130px; }
/* Prominent search input — bigger, bolder border, magnifier icon, accent
   glow on focus. Used on the products screen so the search box is the
   first thing the eye lands on. */
.search-box {
  flex: 2;
  min-width: 240px;
  position: relative;
}
.search-box::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* Inline magnifier SVG — colour matches --brand (#F1880D, URL-encoded). */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F1880D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-4.35-4.35'/></svg>");
  opacity: 0.85;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 11px 12px 11px 38px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid rgba(241,136,13,0.65);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(241,136,13,0.10);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.search-box input::placeholder {
  color: var(--text2);
  font-weight: 400;
}
.search-box input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(241,136,13,0.25), 0 0 18px rgba(241,136,13,0.20);
}

/* ---- FEE SECTIONS ---- */
.fee-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 14px; }
.fee-card h3 { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.fee-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }

/* ---- MISC ---- */
.empty { text-align: center; padding: 40px; color: var(--text3); font-size: 13px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.mono { font-family: 'DM Mono', monospace; }
.text2 { color: var(--text2); }
.section-label { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px; }

/* ---- CALCULATOR ---- */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.calc-col { min-width: 0; }
.calc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--surface2); border-radius: var(--radius); padding: 10px 12px; }
.kpi-label { font-size: 10px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.kpi-value { font-size: 20px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -0.02em; }
.kpi-value.good { color: var(--green); }
.kpi-value.warn { color: var(--amber); }
.kpi-value.bad { color: var(--red); }
.cost-section-title { font-size: 10px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 6px; padding-top: 8px; border-top: 1px dashed var(--border2); }
.cost-section-title:first-child, .cost-box > .cost-section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.cost-row.sub { color: var(--text3); font-size: 11.5px; padding: 2px 0; }
.cost-row.sub:last-child { font-weight: normal; padding-top: 2px; }
.cost-row.emph { font-weight: 600; font-size: 13px; }
.cost-row.bordered-top { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.discount-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.discount-tbl th, .discount-tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.discount-tbl th { font-size: 10px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface2); }
.discount-tbl tr:hover td { background: var(--surface2); }
.discount-tbl td.mono, .discount-tbl th.mono { font-family: 'DM Mono', monospace; }
.calc-pill { display:inline-block; background: var(--blue-bg); color: var(--blue-text); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 500; }
.calc-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.calc-section-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; gap:14px; flex-wrap:wrap; }
.calc-section-bar .section-label { margin-bottom: 0; }
.calc-section-bar .qty-picker { display:flex; align-items:center; gap:8px; }
.calc-section-bar .qty-picker label { font-size: 11.5px; color: var(--text2); }
.calc-section-bar .qty-picker select { width: auto; min-width: 90px; font-size: 12px; padding: 4px 8px; }
.mini-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-tbl th, .mini-tbl td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mini-tbl th:first-child, .mini-tbl td:first-child { text-align: left; }
.mini-tbl th { font-size: 9.5px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; background: transparent; }
.mini-tbl tbody tr:last-child td { border-bottom: none; }
.mini-tbl tr.qty-free td { background: var(--green-bg); }
.mini-tbl tr.qty-free td:first-child { font-weight: 600; }
.discount-tbl tr.d-row { cursor: pointer; }
.discount-tbl tr.d-row:hover td { background: var(--surface2); }
.discount-tbl tr.d-detail td { background: var(--bg); padding: 0; }
.discount-tbl tr.d-detail .d-detail-inner { padding: 8px 14px 12px 36px; }
.d-chevron { display: inline-block; width: 14px; text-align: center; color: var(--text3); transition: transform 0.15s; user-select: none; }
.d-chevron.open { transform: rotate(90deg); color: var(--text); }

/* ---- PURCHASE ORDERS (v2.269 — visual polish pass ported from AU) ----
   Previously this tab injected its own bespoke <style> block with
   .po-table/.po-totals/.po-header-fields (built before the shared design
   system existed). That's gone now — the list/editor use .tbl-wrap/.card/
   .form-grid/.ff like every other tab. Only two genuinely PO-specific
   things remain, kept here rather than injected via JS: the single-pill
   totals bar (deliberately ONE flex container, not a grid of separate
   .metric tiles — see PURCHASE_ORDERS_POLISH_HANDOFF_FOR_UK.md §3 for why
   that distinction matters) and a tighter input size for the dense
   per-line data-entry table. */
.po-stats { display:flex; justify-content:space-around; align-items:center; gap:10px; flex-wrap:wrap;
  background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-lg); padding:14px; margin-top:16px; }
.po-stat { text-align:center; }
.po-stat-label { font-size:10.5px; color:var(--text3); text-transform:uppercase; letter-spacing:0.04em; }
.po-stat-value { font-size:17px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }
.po-stat-value.bad { color:var(--red); }
.po-stats .ff { margin-bottom:0; min-width:110px; text-align:left; }
.po-lines-tbl input, .po-lines-tbl select { padding:4px 6px; font-size:12px; border-radius:6px; }
.po-hint { color:var(--text3); }
.po-row-clickable { cursor:pointer; }
.po-row-clickable:hover td { background:var(--surface2); }
/* (v2.271) Supplier/Status/Payment/Currency row — evenly spaced, full
   width (column count set inline per import/domestic). Shipment/Payments
   cards sit side by side at half width each, not stacked full-width. */
.po-fields-row { display:grid; gap:12px; margin-bottom:16px; }
.po-two-col { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }
@media (max-width: 900px) {
  .po-fields-row { grid-template-columns: 1fr 1fr !important; }
  .po-two-col { grid-template-columns: 1fr; }
}
/* (v2.285) PO tab sits over an INTERACTIVE globe (same pattern as
   .dash-content, see purchase-orders.js's _poContentEl): the wrapper
   passes the pointer through to the globe canvas, every top-level
   content block re-enables it — so tables/cards/buttons all work
   exactly as before and the globe is grabbable/zoomable in the gaps
   around them. */
#po-tab-content { pointer-events: none; }
#po-tab-content > * { pointer-events: auto; }

/* (v2.280) Container-ship passage progress in the import PO list's
   Delivery column — a slim track that fills departure→ETA with a little
   ship riding the leading edge. */
.po-ship-wrap { display:flex; flex-direction:column; gap:2px; min-width:110px; }
.po-ship-track { position:relative; height:8px; background:var(--surface2); border:1px solid var(--border); border-radius:5px; overflow:visible; }
.po-ship-fill { position:absolute; inset:0 auto 0 0; background:linear-gradient(90deg, var(--blue-bg, #1e3a5f), var(--blue-text, #4a9eda)); border-radius:5px; opacity:0.65; }
.po-ship-boat { position:absolute; top:50%; transform:translate(-55%, -58%); font-size:13px; line-height:1; filter:drop-shadow(0 1px 1px rgba(0,0,0,0.35)); }

/* ---- COURIER CARDS (Shipping tab) ---- */
.courier-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 14px; }
.courier-card h3 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.courier-card .courier-tagline { font-size: 11.5px; color: var(--text2); margin-bottom: 10px; }
.courier-card ul.rules { margin: 0 0 12px 18px; font-size: 11.5px; color: var(--text2); padding: 0; }
.courier-card ul.rules li { margin-bottom: 3px; }
.courier-rates { display: grid; gap: 8px; }
.rate-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.rate-line label { font-size: 12px; color: var(--text); flex: 1; }
.rate-line .rate-input { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.rate-line .rate-input span { font-size: 12px; color: var(--text2); min-width: 12px; text-align: right; }
.rate-line input { width: 80px; text-align: right; font-family: 'DM Mono', monospace; font-size: 12px; padding: 4px 8px; }
.formula-box { margin-top: 10px; padding: 10px 12px; background: var(--surface2); border-radius: var(--radius); font-size: 11.5px; color: var(--text2); }
.formula-box code { font-family: 'DM Mono', monospace; color: var(--text); background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 3px; }
.formula-result { margin-top: 6px; font-family: 'DM Mono', monospace; color: var(--text); }
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(241,136,13,0.28); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(241,136,13,0.5); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .fee-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .sidebar { width: 48px; min-width: 48px; }
  .sidebar-logo, .nav-section, .nav-item span, .sidebar-footer { display: none; }
  .nav-item { padding: 12px; justify-content: center; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .channel-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- THEME: LIGHT (v2.288) ----
   Toggled by the sun/moon button in the topbar (toggleChubbyTheme() in
   pricing_calculator.html, persisted in localStorage 'chubbyTheme',
   default = dark). Redeclaring the custom properties re-skins every
   var()-driven component; the handful of rules below the variable block
   override the literal-colour dark styling. The SIDEBAR deliberately
   stays dark in both themes — the brand logo + nav are designed for it,
   and it anchors the app's identity either way. */
/* ---- DIM THEME (v2.281) — the in-between mode Ben asked for: "light
   is a bit too light and dark has too much of a contrast". Same warm
   Chubby family as dark, but lifted from near-black to a coffee/taupe
   base with slightly softened cream text, so the whole page reads
   gentler without becoming a pale page. Only the variables (plus the
   few components with hardcoded dark colours) need overriding — every
   component already reads the vars. ---- */
/* ---- DIM THEME (v2.283 full redesign) — Ben's verdict on the first two
   attempts (a lightened version of dark's warm browns): "horrible... I
   meant do a full re-design in a new colour". This is its own colour
   family entirely: a TWILIGHT SLATE — cool blue-grey base with soft
   cool-white text, sitting naturally between dark (warm near-black,
   high contrast) and light (pale page). The orange Chubby brand accent
   is complementary to slate blue, so buttons/chips/highlights pop
   MORE here than in either other mode while the overall page stays
   gentle. Contrast is deliberately softer than dark in both directions:
   background lifted well off black, text pulled back from bright cream
   to a muted cool white. ---- */
body.theme-dim {
  color-scheme: dark;
  --bg: #262e38;            /* twilight slate */
  --surface: #2f3843;
  --surface2: #3a4451;
  --border: rgba(190,210,235,0.10);
  --border2: rgba(190,210,235,0.20);
  --text: #dde4ee;          /* soft cool white — not bright cream */
  --text2: #a8b4c4;
  --text3: #7e8b9c;
  --sidebar-bg: #1f2630;
  --brand-dark: #ffb45e;
  --brand-bg: rgba(241,136,13,0.15);
  --brand-bg2: rgba(241,136,13,0.25);
  --brand-glow: rgba(241,136,13,0.30);
  /* status colours: dark theme's hues, backgrounds a touch stronger so
     badges still separate from the lighter slate surfaces */
  --green-bg: rgba(34,197,94,0.18); --amber-bg: rgba(245,158,11,0.19);
  --red-bg: rgba(239,68,68,0.20); --blue-bg: rgba(59,130,246,0.22);
  --purple-bg: rgba(139,92,246,0.22);
  /* ambient glows: one cool (top-left, matching the slate) + one faint
     warm (bottom-right, tying the brand orange in) */
  background-image: radial-gradient(1100px 600px at 8% -10%, rgba(120,160,220,0.07), transparent 60%),
                    radial-gradient(900px 500px at 110% 110%, rgba(241,136,13,0.05), transparent 60%);
}
body.theme-dim .sidebar {
  background: linear-gradient(180deg, #1f2630 0%, #242c37 60%, #27303c 100%);
  border-right: 1px solid rgba(140,170,210,0.12);
}
body.theme-dim .topbar {
  background: rgba(38,46,56,0.92);   /* matches --bg, not dark's near-black */
  border-bottom: 1px solid rgba(140,170,210,0.14);
}
/* Globe canvas draws its own dark-palette warm creams/orange — on the
   slate background that's a complementary pairing and reads great. */
body.theme-dim .globe-mount { opacity: 0.85; }

body.theme-light {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface2: #f0f0ee;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.14);
  --text: #1a1a18;
  --text2: #6b6b67;
  --text3: #9b9b97;
  --brand-dark: #8A3B29;
  --brand-bg: #FFF1DC;
  --brand-bg2: #FBE5C5;
  --brand-glow: rgba(241,136,13,0.20);
  --green: #166534; --green-bg: #dcfce7; --green-text: #14532d;
  --amber: #92400e; --amber-bg: #fef3c7; --amber-text: #78350f;
  --red: #991b1b; --red-bg: #fee2e2; --red-text: #7f1d1d;
  --blue: #1e40af; --blue-bg: #dbeafe; --blue-text: #1e3a8a;
  --purple: #6d28d9; --purple-bg: #ede9fe; --purple-text: #4c1d95;
  background-image: none;
}
body.theme-light .topbar {
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
body.theme-light .dash-card:hover { border-color: var(--border2); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
body.theme-light .au-clock-pill {
  background: linear-gradient(135deg, rgba(241,136,13,0.12), rgba(255,211,77,0.10));
  border-color: rgba(200,140,20,0.45);
  box-shadow: none;
}
body.theme-light .au-clock-time { color: #8a4a00; text-shadow: none; }
body.theme-light .au-clock-city { color: #a3610a; }
body.theme-light .au-clock-dot { background: #e8a512; box-shadow: 0 0 5px 1px rgba(232,165,18,0.7); }
body.theme-light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); }
body.theme-light ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.28); }
body.theme-light input:focus, body.theme-light select:focus { box-shadow: 0 0 0 3px rgba(241,136,13,0.15); }
body.theme-light .btn-primary { color: #fff; box-shadow: 0 2px 6px rgba(241,136,13,0.25); }
body.theme-light .search-box input { box-shadow: 0 0 0 4px rgba(241,136,13,0.07); }
body.theme-light .search-box input:focus { box-shadow: 0 0 0 4px rgba(241,136,13,0.18); }
/* Globe canvases render their own warm colours; on the light bg they
   read best a touch fainter. */
body.theme-light .globe-mount { opacity: 0.75; }
