/* ============================================================================
   Styles.html — DaklaPack Product Finder
   Modern, professional CSS for the multi-step form UI.
   Design direction: clean, minimal SaaS aesthetic.
   ============================================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Form controls don't inherit font-family by default — force Inter everywhere. */
button, input, select, textarea {
  font-family: inherit;
}

:root {
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --white: #ffffff;
  --surface: #ffffff;        /* card / input / header background — flips in dark theme */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 6px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 28px -8px rgba(16, 24, 40, 0.16), 0 4px 10px -4px rgba(16, 24, 40, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
  --font-sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
  /* App-shell sidebar palette (dark slate; stays dark in both themes) */
  --side-bg: #0f1729;
  --side-bg-2: #172033;
  --side-line: #1f293d;
  --side-tx: #9aa6bd;
  --side-tx-2: #e7ecf5;
  --side-muted: #828ea8;   /* muted sidebar text — lightened for WCAG-AA contrast on --side-bg */
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  /* Soft layered backdrop — a faint brand-red glow at the top over a cool grey
     gradient. Keeps the page from reading as a flat sheet of white and lets the
     white cards and option chips sit with clear separation. */
  background:
    radial-gradient(1000px 380px at 50% -140px, rgba(220, 38, 38, 0.045), rgba(220, 38, 38, 0) 70%),
    linear-gradient(180deg, #fafbfd 0%, #f1f4f9 100%);
  background-repeat: no-repeat;
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -moz-osx-font-smoothing: grayscale;
}

.header-logo {
  display: flex;
  align-items: center;
  height: 48px;
  flex-shrink: 0;
}

.header-logo img {
  height: 100%;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

/* Text wordmark shown until the real logo image loads (or if none is set).
   Reads cleanly on the white header regardless of the configured logo. */
.header-wordmark {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.header-wordmark-accent {
  color: var(--primary);
}

/* ============================================================================
   APP SHELL (Option 2) — persistent sidebar + topbar + content column
   The page is a 2-column grid: a dark navigation rail and a main column that
   holds the sticky topbar, the routed content (#app) and the footer.
   ============================================================================ */
.shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* --- Sidebar --- */
.sidebar {
  background: var(--side-bg);
  border-right: 1px solid var(--side-line);
  padding: 1.1rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  z-index: 60;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 0.3rem 0.55rem 1.1rem;
  min-height: 52px;
}
.sidebar-brand .header-logo { height: 40px; display: flex; align-items: center; }
.sidebar-brand .header-logo img { height: 100%; width: auto; max-width: 190px; object-fit: contain; }
.sidebar-brand .header-wordmark { color: #fff; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; font-family: var(--font-display); }
.sidebar-brand .header-wordmark-accent { color: var(--primary); }

.sidebar-section {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--side-muted); padding: 0.9rem 0.65rem 0.35rem;
}
.sidenav {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.65rem; border-radius: 10px;
  color: var(--side-tx); font-weight: 600; font-size: 0.9rem; font-family: var(--font-display);
  cursor: pointer; position: relative; transition: background 0.15s, color 0.15s;
  text-decoration: none; outline: none;
}
.sidenav svg { width: 18px; height: 18px; flex: 0 0 auto; }
.sidenav:hover, .sidenav:focus-visible { background: var(--side-bg-2); color: var(--side-tx-2); }
.sidenav.active { background: linear-gradient(90deg, rgba(220,38,38,0.20), rgba(220,38,38,0.04)); color: #fff; }
.sidenav.active::before {
  content: ''; position: absolute; left: -0.85rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.sidebar-foot {
  margin-top: auto; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 0.6rem 0.3rem; border-top: 1px solid var(--side-line);
}
.sidebar-user-ava {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary), #f5694a);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.8rem; font-family: var(--font-display);
}
.sidebar-user-who strong { display: block; font-size: 0.82rem; color: var(--side-tx-2); font-weight: 600; }
.sidebar-user-who span { font-size: 0.7rem; color: var(--side-muted); }

.shell-scrim { display: none; }

/* --- Main column --- */
.shell-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1.6rem;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 40;
}
.topbar-burger {
  display: none; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--gray-200); background: var(--surface); color: var(--gray-600);
  cursor: pointer; align-items: center; justify-content: center;
}
.topbar-burger svg { width: 20px; height: 20px; }
.topbar-title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--gray-900); }
.topbar-contact { margin-left: auto; display: flex; gap: 1.4rem; font-size: 0.8rem; color: var(--gray-500); }
.topbar-contact span { display: inline-flex; align-items: center; gap: 0.4rem; }
.topbar-contact svg { width: 15px; height: 15px; color: var(--primary); }

/* --- Main Container (routed content) --- */
.main {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2.5rem;
  width: 100%;
  flex: 1 0 auto;          /* grow so the footer is pushed to the bottom */
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   HOME (bento launcher) — welcome banner + process tiles
   ============================================================================ */
#landing-section { display: block; }
.home-welcome {
  background: linear-gradient(120deg, #0f1729, #1c2740);
  border-radius: 18px; padding: 2rem 2.25rem; color: #fff;
  position: relative; overflow: hidden; margin-bottom: 1.5rem;
}
.home-welcome::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px;
  border-radius: 50%; background: radial-gradient(circle, rgba(220,38,38,0.42), transparent 65%);
}
.home-welcome-body { position: relative; }
.home-eyebrow {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: #ff8a6e; margin-bottom: 0.6rem;
}
.home-welcome-title { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.home-welcome-sub { color: #c2cbdd; font-size: 0.98rem; max-width: 60rem; line-height: 1.6; }

.home-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.home-tile {
  position: relative; background: var(--surface); border: 1px solid var(--gray-200);
  border-radius: 16px; padding: 1.5rem 1.4rem; cursor: pointer; outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; overflow: hidden;
}
.home-tile:hover, .home-tile:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gray-300); }
/* PO Tracking sits alone on row 2, aligned to the left (first column). */
.home-tile-row2 { grid-column: 1 / 2; }
.home-tile-icon {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center;
  background: var(--primary-light); color: var(--primary); margin-bottom: 1rem; transition: background 0.2s ease, color 0.2s ease;
}
.home-tile:hover .home-tile-icon, .home-tile:focus-visible .home-tile-icon { background: var(--primary); color: #fff; }
.home-tile-icon svg { width: 23px; height: 23px; }
.home-tile-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--gray-900); margin-bottom: 0.35rem; }
.home-tile-desc { font-size: 0.88rem; color: var(--gray-500); line-height: 1.55; }
.home-tile-cta {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: var(--primary);
}
.home-tile-cta svg { width: 15px; height: 15px; transition: transform 0.2s ease; }
.home-tile:hover .home-tile-cta svg, .home-tile:focus-visible .home-tile-cta svg { transform: translateX(4px); }
.home-tile-badge {
  position: absolute; top: 1rem; right: 1rem; font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500);
  background: var(--gray-100); border: 1px solid var(--gray-200); padding: 0.18rem 0.5rem; border-radius: 999px;
}

/* Cohesive display font on primary headings across every module */
.home-welcome-title, .home-tile-title, .topbar-title, .sidenav, .sidebar-brand .header-wordmark,
.step-title, .stat-value, .results-header h2, .trk-title, .lead-form-title {
  font-family: var(--font-display);
}

/* --- Responsive: sidebar collapses to a slide-in drawer --- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 264px;
    transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow-lg);
  }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .shell-scrim { position: fixed; inset: 0; background: rgba(8, 11, 20, 0.5); z-index: 55; }
  .shell.nav-open .shell-scrim { display: block; }
  .topbar-burger { display: inline-flex; }
  .topbar-contact { display: none; }
  .home-bento { grid-template-columns: 1fr 1fr; }
  .home-tile-row2 { grid-column: auto; }
}
@media (max-width: 560px) {
  .home-bento { grid-template-columns: 1fr; }
}

.back-to-home {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color var(--transition);
}

.back-to-home:hover {
  color: var(--primary);
}

.back-to-home svg {
  width: 16px;
  height: 16px;
}

/* --- Tab Navigation --- */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.tab-btn:hover {
  border-color: var(--gray-300);
  color: var(--gray-800);
}

.tab-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* --- Progress Indicator (slim labelled bar) ---
   A dots-and-lines stepper doesn't scale past a handful of steps; the Laminated
   flow can run 10+ screens. A single bar + "Step X of Y" label communicates
   position cleanly at any length and never wraps. */
.progress {
  margin-bottom: 2rem;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.progress-step-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
}

.progress-pct {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Card / Step Container --- */
.card {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  margin-bottom: 1.5rem;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
}

.step-subtitle {
  font-size: 0.9375rem;
  color: var(--gray-500);
  margin-bottom: 1.75rem;
}

/* --- Radio Options --- */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.radio-group.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.radio-group.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.625rem;
}

.radio-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-100);
}

.radio-option:hover {
  border-color: var(--gray-400);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Keyboard focus ring — the native radio is visually replaced, so without this
   keyboard users get no visible focus indicator on the option itself. */
.radio-option:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.radio-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.radio-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
  /* Sit above the full-box label overlay so the dot itself stays clickable. */
  z-index: 2;
}

.radio-option input[type="radio"]:checked {
  border-color: var(--primary);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%);
}

.radio-option label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  flex: 1;
}

/* Make the ENTIRE option box clickable, not just the radio dot or the label
   text. The label stretches an invisible overlay across the whole box (incl.
   its padding) so a click anywhere on the box hits the label and toggles the
   radio. The radio input sits above the overlay (higher z-index) so it stays
   directly clickable too. Disabled options opt out (no overlay). */
.radio-option:not(.disabled) label::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* Disabled radio option — used when a previous answer locks this choice
   (e.g. paperkraft outer forces recyclable to No). Greyed out, not clickable,
   and the inner dot is suppressed. The currently-selected lock target keeps
   normal styling so the AM can see what was forced. */
.radio-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gray-50);
}

.radio-option.disabled label {
  cursor: not-allowed;
  color: var(--gray-500);
}

.radio-option.disabled input[type="radio"] {
  cursor: not-allowed;
}

/* Inline note shown next to a locked radio group explaining the constraint. */
.conflict-note {
  margin-top: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  color: var(--gray-700);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Inline sub-question rendered below a parent radio group (e.g. zipper Y/N
   under Stand up pouch on the type step). Visually nested but still clearly
   part of the same screen. */
.subquestion {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--gray-200);
}

/* --- Text Inputs --- */
.input-group {
  max-width: 400px;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--gray-800);
  background: var(--surface);
  transition: border-color var(--transition);
  outline: none;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-field::placeholder {
  color: var(--gray-400);
}

/* --- Section Divider (for multi-question steps) --- */
.section-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 1.75rem 0;
}

.section-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

/* --- Navigation Buttons --- */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--gray-600);
  border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  color: var(--gray-800);
  border-color: var(--gray-400);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* --- Results Screen --- */
.results-card {
  background: var(--blue-50);
  border: 2px solid var(--blue-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}

.results-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-800);
}

.results-subtitle {
  font-size: 0.875rem;
  color: var(--blue-600);
  margin-bottom: 2rem;
}

.results-section {
  margin-bottom: 1.75rem;
}

.results-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.results-subheader {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.25rem 0 0.5rem;
}

.results-subheader:first-of-type {
  margin-top: 0.5rem;
}

.laminate-string {
  font-size: 0.9375rem;
  color: var(--blue-600);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* --- Layer Cards --- */
.layer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.layer-material {
  font-weight: 600;
  color: var(--gray-800);
}

.layer-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue {
  background: var(--blue-100);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
}

.layer-supplier {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* --- Requirements Grid --- */
.req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.req-item {
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.req-label {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.req-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--blue-600);
}

/* --- Supplier Box --- */
.supplier-box {
  padding: 0.875rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-800);
}

/* --- Note/Warning --- */
.note-box {
  padding: 1rem 1.25rem;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  color: #92400e;
  font-size: 0.875rem;
}

/* --- Engine warnings (severity-styled) --- */
.warnings-block .warning-card {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  border-left: 4px solid transparent;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
}
.warnings-block .warning-card:last-child {
  margin-bottom: 0;
}
.warnings-block .warning-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.warnings-block .warning-body {
  line-height: 1.45;
  opacity: 0.9;
}
.warning-blocker {
  background: #fef2f2;
  border-left-color: #dc2626;
  color: #7f1d1d;
}
.warning-warning {
  background: #fffbeb;
  border-left-color: #d97706;
  color: #78350f;
}
.warning-info {
  background: #eff6ff;
  border-left-color: #2563eb;
  color: #1e3a8a;
}

/* --- Acknowledgement gate --- */
.ack-gate {
  border: 2px solid #fcd34d;
  background: #fffbeb;
}
.ack-intro {
  font-size: 0.9rem;
  color: #78350f;
  margin: 0 0 1rem;
}
.ack-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 0.625rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ack-item:last-child { margin-bottom: 0; }
.ack-item:hover { border-color: #f59e0b; }
.ack-item.checked {
  border-color: #16a34a;
  background: #f0fdf4;
}
.ack-item input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  cursor: pointer;
}
.ack-item .ack-text {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--gray-700, #374151);
}

/* --- My Requests (per-user request history) --- */
.myreq-list { display: flex; flex-direction: column; gap: 0.625rem; }
.myreq-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.myreq-row:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.myreq-main { flex: 1; min-width: 0; }
.myreq-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.myreq-id { font-weight: 700; font-size: 0.8125rem; color: var(--gray-700); font-family: 'SF Mono', 'Consolas', monospace; }
.myreq-what { font-size: 0.9375rem; color: var(--gray-800); font-weight: 500; }
.myreq-summary {
  font-size: 0.8125rem; color: var(--green-600);
  font-family: 'SF Mono', 'Consolas', monospace; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.myreq-date { font-size: 0.8125rem; color: var(--gray-400); white-space: nowrap; }
.myreq-badge {
  display: inline-block; padding: 0.12rem 0.5rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
}
.myreq-status-completed { background: rgba(34,197,94,0.12); color: var(--green-600); }
.myreq-status-pending   { background: var(--amber-100); color: var(--amber-800); }
.myreq-status-resolved  { background: var(--blue-100); color: var(--blue-700); }
.myreq-kind { background: var(--gray-200); color: var(--gray-600); }
.myreq-po   { background: #ede9fe; color: #6d28d9; }

/* --- Manual laminate entry (PM-review override) --- */
.manual-layer-row {
  display: grid;
  grid-template-columns: 70px 1.6fr 0.7fr 1.2fr 32px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.manual-layer-pos {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.manual-layer-row .input-field {
  margin: 0;
}
.manual-layer-remove {
  border: none;
  background: #fef2f2;
  color: #dc2626;
  border-radius: var(--radius);
  font-size: 1.1rem;
  line-height: 1;
  height: 2.25rem;
  cursor: pointer;
}
.manual-layer-remove:hover { background: #fee2e2; }

/* --- Portfolio Matches (separate green card) --- */
.portfolio-card {
  background: var(--green-50);
  border: 2px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 1.5rem;
}

.portfolio-card .results-header h2 {
  color: var(--green-600);
}

.portfolio-subtitle {
  font-size: 0.875rem;
  color: var(--green-600);
  margin-bottom: 1rem;
}

.portfolio-item {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  margin-bottom: 0.5rem;
}

.portfolio-item:last-child {
  margin-bottom: 0;
}

.portfolio-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.portfolio-article {
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
}

.portfolio-desc {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.portfolio-laminate {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--green-600);
}

.portfolio-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--gray-400);
  font-size: 0.875rem;
}

/* --- Actions --- */
.results-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* --- Dashboard Stats --- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
  margin-bottom: 0.375rem;
}

.stat-detail {
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.dashboard-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-400);
}

/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
  gap: 1rem;
}

.loading-overlay .spinner {
  width: 40px;
  height: 40px;
}

.loading-text {
  font-size: 0.9375rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* --- Footer --- */
.footer {
  background: var(--gray-800);
  color: var(--gray-400);
  text-align: center;
  padding: 1.5rem;
  margin-top: 0;
  flex-shrink: 0;       /* sits flush at the bottom; .main grows to fill above */
  font-size: 0.8125rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .card { padding: 1.5rem; }
  .radio-group.grid-2 { grid-template-columns: 1fr; }
  .radio-group.grid-3 { grid-template-columns: 1fr; }
  .req-grid { grid-template-columns: 1fr; }
  .main { margin: 1.5rem auto; }
  .stat-grid { grid-template-columns: 1fr; }
  .quote-buttons { flex-direction: column; }
  .dimensions-row { flex-direction: column; gap: 0; }
  .dimensions-separator { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .quote-form-actions { flex-direction: column; }
  .quote-result-actions { flex-direction: column; }
}

/* ============================================================================
   Quote Request Feature — Amber/Orange accent
   ============================================================================ */

/* --- Quote Card --- */
.quote-card {
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.quote-card .results-header {
  color: var(--amber-800);
}

.quote-card .results-header h2 {
  color: var(--amber-800);
}

.quote-subtitle {
  color: var(--gray-600);
  margin: 0.5rem 0 1.25rem 0;
  font-size: 0.95rem;
}

/* --- Quote Buttons --- */
.quote-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-quote-approx,
.btn-quote-precise {
  flex: 1;
  min-width: 220px;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  transition: all 0.2s ease;
  border: none;
}

.btn-quote-approx {
  background: var(--amber-600);
  color: white;
}

.btn-quote-approx:hover {
  background: var(--amber-700);
  box-shadow: var(--shadow-md);
}

.btn-quote-precise {
  background: white;
  color: var(--amber-700);
  border: 2px solid var(--amber-600);
}

.btn-quote-precise:hover {
  background: var(--amber-50);
  box-shadow: var(--shadow-md);
}

/* --- Quote Form --- */
.quote-form {
  margin-top: 1rem;
}

.quote-form .section-label {
  color: var(--amber-800);
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.quote-form .section-label:first-child {
  margin-top: 0;
}

.dimensions-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.dimensions-row .input-group {
  flex: 1;
}

.dimensions-separator {
  padding-bottom: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  font-size: 1.1rem;
}

.quote-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--amber-200);
}

.btn-generate {
  background: var(--amber-600);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-generate:hover {
  background: var(--amber-700);
  box-shadow: var(--shadow-md);
}

.btn-cancel {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: var(--gray-100);
}

/* --- Pricing Result Card --- */
.pricing-card {
  background: white;
  border: 1px solid var(--amber-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
}

.pricing-card h3 {
  color: var(--amber-800);
  margin: 0 0 1rem 0;
  font-size: 1.05rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.pricing-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pricing-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.pricing-value {
  font-size: 1rem;
  color: var(--gray-900);
  font-weight: 600;
}

.pricing-total {
  grid-column: 1 / -1;
  background: var(--amber-50);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pricing-total .pricing-label {
  font-size: 0.9rem;
}

.pricing-total .pricing-value {
  font-size: 1.4rem;
  color: var(--amber-800);
}

.pricing-note {
  background: var(--amber-100);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--amber-800);
}

.pricing-disclaimer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--amber-200);
  font-size: 0.8rem;
  color: var(--gray-500);
  font-style: italic;
}

.pricing-unavailable {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  color: var(--gray-600);
  margin-top: 1rem;
}

.pricing-unavailable p {
  margin: 0.25rem 0;
}

/* --- Material Selection Cards --- */
.material-section {
  margin-bottom: 1.5rem;
}

.material-section-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--amber-800);
  margin-bottom: 0.75rem;
}

.material-cards {
  display: grid;
  gap: 0.75rem;
}

.material-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.material-card:hover {
  border-color: var(--amber-400);
  box-shadow: var(--shadow-sm);
}

.material-card.selected {
  border-color: var(--amber-600);
  background: var(--amber-50);
}

.material-card-laminate {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.material-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.material-card-selected-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber-700);
  background: var(--amber-100);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.material-card-match-note {
  font-size: 0.78rem;
  color: var(--amber-700);
  font-style: italic;
  margin-top: 0.375rem;
}

.loading-materials {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
}

.loading-materials .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--amber-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

.section-description {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin: 0 0 1rem;
}

/* --- Pricing Calculator (Markup & Margin) --- */
.pricing-calculator {
  background: white;
  border-radius: var(--radius);
}

.pricing-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.pricing-section:last-child {
  border-bottom: none;
}

.pricing-comparison {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}

.pricing-comparison-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.85rem;
}

.pricing-comparison-label {
  font-weight: 600;
  color: var(--gray-500);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pricing-comparison-value {
  font-weight: 600;
  color: var(--gray-800);
}

.pricing-cost-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.pricing-cost-display .pricing-label {
  font-weight: 600;
  color: var(--gray-700);
}

.pricing-cost-display .pricing-value {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gray-800);
}

.pricing-note-small {
  font-size: 0.8rem;
  color: var(--amber-700);
  font-style: italic;
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}

.pricing-preview {
  margin-top: 1rem;
  background: var(--amber-50);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--amber-200);
}

.pricing-preview-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.pricing-preview-total {
  display: flex;
  justify-content: space-between;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--amber-300);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--amber-800);
}

/* --- Download Button & Quote Result Actions --- */
.btn-download {
  background: #16a34a;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-download:hover {
  background: #15803d;
  box-shadow: var(--shadow-md);
}

.quote-result-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* --- Checkbox Groups (for Test Requirements & Design Options) --- */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.checkbox-group.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.checkbox-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-100);
}

.checkbox-option:hover {
  border-color: var(--gray-400);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.checkbox-option:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.checkbox-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.checkbox-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
}

.checkbox-option input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.checkbox-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-option label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  flex: 1;
}

/* --- Quote Step Progress --- */
.quote-progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--amber-700);
  margin: 0.25rem 0 1.25rem 0;
  padding: 0.5rem 0.75rem;
  background: var(--amber-100);
  border-radius: var(--radius);
  display: inline-block;
}

/* --- Food Migration Notice --- */
.food-migration-notice {
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  color: #991b1b;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* --- Responsive adjustments for checkbox groups --- */
@media (max-width: 640px) {
  .checkbox-group.grid-2 { grid-template-columns: 1fr; }
}


/* ============================================================================
   PATH SELECTION — Webshop vs Tailor-Made
   ============================================================================ */

.path-selection-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.path-selection-card .results-header {
  color: var(--gray-700);
}

.path-selection-card .results-header h2 {
  color: var(--gray-800);
}

.path-selection {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.path-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}

.path-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.path-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.path-check-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.path-card-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.path-icon-green {
  background: rgba(34, 197, 94, 0.1);
}

.path-icon-blue {
  background: rgba(59, 130, 246, 0.1);
}

.path-card:hover .path-icon-green,
.path-card.selected .path-icon-green {
  background: rgba(34, 197, 94, 0.18);
}

.path-card:hover .path-icon-blue,
.path-card.selected .path-icon-blue {
  background: rgba(59, 130, 246, 0.18);
}

.path-card-icon svg {
  width: 36px;
  height: 36px;
}

.path-icon-green svg {
  color: var(--green-600);
}

.path-icon-blue svg {
  color: #3b82f6;
}

.path-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
}

.path-card-desc {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.4;
}

.path-card-features {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  text-align: left;
  width: 100%;
}

.path-card-features li {
  font-size: 13px;
  color: var(--gray-500);
  padding: 3px 0 3px 22px;
  position: relative;
  line-height: 1.4;
}

.path-card-features li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--green-500);
  border-bottom: 2px solid var(--green-500);
  transform: rotate(-45deg);
}


/* ============================================================================
   CATEGORY PICKER (top-level: Medical / Laminated / Packaging)
   ============================================================================ */

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 22px 22px;
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  min-height: 170px;
}

.category-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.category-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.category-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
}

.category-card-desc {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.45;
  flex: 1;
}

.category-tag {
  align-self: flex-start;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.category-tag-available {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-600);
}

.category-tag-soon {
  background: var(--gray-200);
  color: var(--gray-600);
}


/* ============================================================================
   COMING SOON SCREEN (Medical / Packaging placeholder)
   ============================================================================ */

.coming-soon-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 56px 32px;
  text-align: center;
  border: 1px dashed var(--gray-300);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.coming-soon-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.coming-soon-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}

.coming-soon-text {
  font-size: 14px;
  color: var(--gray-600);
  max-width: 480px;
  line-height: 1.5;
  margin: 0;
}


/* ============================================================================
   WEBSHOP MATCHES
   ============================================================================ */

.webshop-matches-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--green-500);
  border-top: 3px solid var(--green-500);
}

.webshop-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gray-200);
}

.webshop-section-title:first-of-type {
  margin-top: 8px;
}

.webshop-item-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.webshop-item-card:hover {
  border-color: var(--green-500);
  background: var(--green-50);
}

.webshop-item-card.selected {
  border-color: var(--green-500);
  background: var(--green-50);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.webshop-item-card .portfolio-article {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
}

.webshop-item-card .portfolio-desc {
  font-size: 13px;
  color: var(--gray-600);
}

.webshop-item-card .portfolio-laminate {
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  color: var(--green-600);
  margin-top: 2px;
}

.webshop-item-card .portfolio-dims {
  font-size: 12px;
  color: var(--gray-500);
}

.laminate-comparison {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.laminate-layer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

.laminate-layer-match {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-600);
  border-left: 3px solid var(--green-500);
}

.laminate-layer-diff {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border-left: 3px solid #f59e0b;
}

.laminate-layer-missing {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-left: 3px solid #ef4444;
  font-style: italic;
}

.laminate-diff-note {
  font-size: 10px;
  color: var(--gray-400);
  font-style: italic;
}

.webshop-item-card .selected-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--green-500);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.webshop-empty {
  padding: 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
  font-style: italic;
}

.webshop-fallback-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  color: var(--gray-600);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

/* Inline "← Back to recommendation" link shown at the top of webshop and
   tailor-made sub-screens. Lets users retreat without using the navbar. */
.subflow-back-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.subflow-back-link:hover {
  color: var(--primary);
}

.webshop-fallback-btn:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

/* Dimension input step hint */
.webshop-dim-hint {
  color: var(--gray-500);
  font-size: 0.92rem;
  margin: 0 0 16px 0;
}

/* Dimension filter info bar */
.webshop-dim-filter-info {
  background: var(--green-50, #f0fdf4);
  border: 1px solid var(--green-200, #bbf7d0);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: var(--gray-700);
}
.dim-change-link {
  color: var(--green-600);
  text-decoration: underline;
  cursor: pointer;
  margin-left: 8px;
  font-size: 0.88rem;
}

/* Dimension proximity badges */
.dim-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.dim-badge-exact {
  background: var(--green-100, #dcfce7);
  color: var(--green-700, #15803d);
}
.dim-badge-close {
  background: var(--amber-100, #fef3c7);
  color: var(--amber-700, #b45309);
}
.dim-badge-far {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* Other Sizes collapsible section */
.webshop-other-sizes {
  margin-top: 16px;
}
.webshop-other-sizes-toggle {
  width: 100%;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.webshop-other-sizes-toggle:hover {
  background: var(--gray-200);
}
.toggle-arrow {
  float: right;
  font-size: 0.8rem;
}
.webshop-other-sizes-list {
  margin-top: 8px;
}


/* ============================================================================
   WEBSHOP ORDER FORM
   ============================================================================ */

.webshop-order-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.webshop-selected-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--green-50);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  margin-bottom: 16px;
}

.webshop-selected-summary .summary-article {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
}

.webshop-selected-summary .summary-desc {
  font-size: 13px;
  color: var(--gray-600);
  flex: 1;
}

.webshop-order-card .optional-tag {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 12px;
}


/* ============================================================================
   WEBSHOP MARGIN / PRICING
   ============================================================================ */

.shipping-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--gray-700);
  border-top: 1px dashed var(--gray-200);
}

.shipping-line .shipping-label {
  color: var(--gray-500);
}

.shipping-line .shipping-value {
  font-weight: 600;
}

.grand-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  border-top: 2px solid var(--gray-300);
  margin-top: 4px;
}


/* ============================================================================
   WEBSHOP RESPONSIVE
   ============================================================================ */

@media (max-width: 640px) {
  .path-selection {
    flex-direction: column;
  }

  .webshop-selected-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ============================================================================
   PO TRACKING MODULE
   ============================================================================ */

#tracker-root { max-width: 920px; margin: 0 auto; }

.trk-loading { display: flex; justify-content: center; padding: 3rem 0; }
.trk-title { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); margin-bottom: 0.25rem; }
.trk-detail-sub { color: var(--gray-500); font-size: 0.9rem; margin-bottom: 1.25rem; }
.trk-empty, .trk-error {
  background: var(--gray-50); border: 1px dashed var(--gray-300);
  border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--gray-500);
}
.trk-error { background: var(--primary-light); border-color: #fecaca; color: var(--primary-hover); }

/* --- top bar / tabs --- */
.trk-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.5rem;
}
.trk-tabs { display: flex; gap: 0.5rem; }
.trk-tab {
  padding: 0.5rem 1rem; border: 1px solid var(--gray-200); background: var(--surface);
  border-radius: var(--radius); font-weight: 600; font-size: 0.875rem;
  color: var(--gray-600); cursor: pointer; transition: var(--transition);
}
.trk-tab:hover { border-color: var(--gray-300); }
.trk-tab.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.trk-whoami { font-size: 0.8rem; color: var(--gray-500); }
.trk-back {
  background: none; border: none; color: var(--gray-500); font-weight: 600;
  cursor: pointer; padding: 0.25rem 0; margin-bottom: 0.5rem; font-size: 0.875rem;
}
.trk-back:hover { color: var(--primary); }
.trk-detail-head { display: flex; align-items: center; gap: 0.75rem; }

/* --- list table --- */
.trk-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden;
}
.trk-table th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--gray-500); padding: 0.75rem 1rem; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.trk-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: 0.875rem; }
.trk-row { cursor: pointer; transition: background var(--transition); }
.trk-row:hover { background: var(--blue-50); }
.trk-row-overdue { background: var(--primary-light); }
.trk-row-overdue:hover { background: #fee2e2; }
.trk-table tr:last-child td { border-bottom: none; }

/* --- badges --- */
.trk-badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.trk-badge-priority { background: var(--amber-100); color: var(--amber-800); }

.trk-owner-badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
}
/* role → colour mapping (CLAUDE2.md §3) */
.trk-owner-sales        { background: #ffe4e0; color: #c2410c; }   /* coral  */
.trk-owner-qc_china     { background: #ccfbf1; color: #0f766e; }   /* teal   */
.trk-owner-quality_nl   { background: var(--blue-100); color: var(--blue-800); } /* blue */
.trk-owner-supply_chain { background: #ede9fe; color: #6d28d9; }   /* purple */
.trk-owner-supplier     { background: #fce7f3; color: #be185d; }   /* pink   */
.trk-owner-pm,
.trk-owner-neutral      { background: var(--gray-100); color: var(--gray-600); } /* gray */

/* phase dot in the list */
.trk-phase-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 0.5rem; vertical-align: middle;
}
.trk-phase-1 { background: var(--blue-500); }
.trk-phase-2 { background: var(--amber-500); }
.trk-phase-3 { background: #8b5cf6; }
.trk-phase-4 { background: var(--green-500); }

/* --- SLA pills --- */
.trk-sla { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.trk-sla-ok       { background: var(--green-50); color: var(--green-600); }
.trk-sla-reminder { background: var(--amber-100); color: var(--amber-800); }
.trk-sla-overdue  { background: #fee2e2; color: var(--primary-hover); }
.trk-sla-none     { background: var(--gray-100); color: var(--gray-400); }

/* --- horizontal stage stepper --- */
.trk-stepper {
  display: flex; align-items: flex-start; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 1.5rem 1.25rem 1.25rem;
  margin-bottom: 0.5rem; cursor: pointer;
}
.trk-step { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; width: 110px; }
.trk-step-marker {
  width: 38px; height: 38px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 0.95rem;
  border: 2px solid var(--gray-300); background: var(--surface); color: var(--gray-400);
}
.trk-step-label { margin-top: 0.5rem; font-size: 0.78rem; font-weight: 600; text-align: center; color: var(--gray-400); }
.trk-step-link { flex: 1 1 auto; height: 2px; background: var(--gray-200); margin-top: 18px; }

.trk-step-done .trk-step-marker { background: var(--green-500); border-color: var(--green-500); color: var(--white); }
.trk-step-done .trk-step-label { color: var(--gray-600); }
.trk-step-active .trk-step-marker {
  background: var(--primary); border-color: var(--primary); color: var(--white);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.trk-step-active .trk-step-label { color: var(--primary); font-weight: 800; }
.trk-step-link-done { background: var(--green-500); }
.trk-step-link-active { background: var(--green-500); }

.trk-current-caption {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 0.5rem; background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.5rem;
}
.trk-caption-state { font-weight: 700; color: var(--gray-800); }
.trk-history-toggle {
  text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--gray-500);
  cursor: pointer; padding: 0.5rem; margin-bottom: 1rem;
}
.trk-history-toggle:hover { color: var(--primary); }

/* --- history timeline --- */
.trk-history-wrap {
  background: var(--surface); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.trk-timeline { position: relative; padding-left: 0.5rem; }
.trk-tl-row { display: flex; gap: 0.875rem; padding-bottom: 1.1rem; position: relative; }
.trk-tl-row:not(:last-child)::before {
  content: ''; position: absolute; left: 6px; top: 16px; bottom: 0;
  width: 2px; background: var(--gray-200);
}
.trk-tl-dot {
  width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  margin-top: 2px; border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--gray-200);
}
.trk-dot-good { background: var(--green-500); }
.trk-dot-bad { background: var(--primary); }
.trk-dot-warn { background: var(--amber-500); }
.trk-dot-neutral { background: var(--gray-400); }
.trk-tl-body { flex: 1; }
.trk-tl-line1 { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.trk-tl-action { font-weight: 700; color: var(--gray-800); font-size: 0.875rem; }
.trk-tl-time { font-size: 0.75rem; color: var(--gray-400); }
.trk-tl-move { font-size: 0.78rem; color: var(--gray-600); font-family: monospace; margin-top: 1px; }
.trk-tl-meta { font-size: 0.75rem; color: var(--gray-400); margin-top: 1px; }
.trk-tl-reason {
  font-size: 0.8rem; color: var(--gray-600); margin-top: 0.35rem; font-style: italic;
  background: var(--gray-50); padding: 0.35rem 0.6rem; border-radius: 6px;
}

/* --- action panel --- */
.trk-action-panel {
  background: var(--blue-50); border: 1px solid var(--blue-200);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
}
.trk-action-info { background: var(--gray-50); border-color: var(--gray-200); color: var(--gray-600); font-size: 0.875rem; }
.trk-action-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 700; color: var(--gray-500); margin-bottom: 0.75rem;
}
.trk-action-bar { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.trk-btn {
  padding: 0.6rem 1.25rem; border-radius: var(--radius); font-weight: 600;
  font-size: 0.875rem; cursor: pointer; border: 1px solid var(--gray-300);
  background: var(--surface); color: var(--gray-700); transition: var(--transition);
}
.trk-btn:hover { border-color: var(--gray-400); }
.trk-btn-primary { background: var(--primary); border-color: var(--primary); color: var(--white); }
.trk-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.trk-btn-danger { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.trk-btn-danger:hover { background: var(--primary-light); }

/* --- info card --- */
.trk-info-card {
  background: var(--surface); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem;
}
.trk-info-table { width: 100%; border-collapse: collapse; }
.trk-info-table td { padding: 0.45rem 0.5rem; font-size: 0.85rem; border-bottom: 1px solid var(--gray-100); }
.trk-info-table tr:last-child td { border-bottom: none; }
.trk-info-k { color: var(--gray-500); width: 200px; font-weight: 600; }
.trk-info-v { color: var(--gray-800); }

/* --- new PO form --- */
.trk-form {
  background: var(--surface); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.5rem; max-width: 560px;
}
.trk-form-row { margin-bottom: 0.875rem; }
.trk-form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.3rem; }
.trk-input {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 0.9rem; font-family: inherit;
}
.trk-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.trk-form-section {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 700; color: var(--gray-500); margin: 1.25rem 0 0.75rem;
  border-top: 1px solid var(--gray-100); padding-top: 1rem;
}
.trk-form-checks { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0; }
.trk-check { font-size: 0.875rem; color: var(--gray-700); cursor: pointer; }
.trk-check input { margin-right: 0.4rem; }
.trk-form-error {
  margin-top: 0.875rem; padding: 0.6rem 0.875rem; background: var(--primary-light);
  border: 1px solid #fecaca; border-radius: var(--radius);
  color: var(--primary-hover); font-size: 0.85rem; font-weight: 600;
}

@media (max-width: 640px) {
  .trk-step { width: auto; }
  .trk-step-label { font-size: 0.65rem; }
  .trk-table th:nth-child(2), .trk-table td:nth-child(2) { display: none; }
}

/* ============================================================================
   DARK THEME  (scoped to html.theme-dark — remove the class to revert)
   Charcoal surfaces, light text, red accent only. No green: the former
   "success / match" greens are neutralised to grey, and active/selected
   states use the brand red.
   ============================================================================ */
html.theme-dark {
  /* Brand red — slightly brighter so it reads on dark */
  --primary: #f04444;
  --primary-hover: #f87171;
  --primary-light: #2a1618;        /* dark red tint for selected / active backgrounds */

  /* Card / input / header surface, kept distinct from the page */
  --surface: #242c3c;
  /* --white stays pure white: it is used as the foreground on red buttons etc. */

  /* Greys: backgrounds darken, text lightens (the ramp is effectively inverted) */
  --gray-50:  #2c3446;             /* subtle elevated panel */
  --gray-100: #333c50;             /* chips / muted background */
  --gray-200: #3f4a61;             /* borders / dividers / progress track */
  --gray-300: #4b5670;             /* stronger borders / input borders */
  --gray-400: #8b94a8;             /* muted icon / placeholder */
  --gray-500: #a6aec1;             /* muted text */
  --gray-600: #bfc7d8;             /* secondary text */
  --gray-700: #d4dae7;            /* body text / labels */
  --gray-800: #e7ebf3;             /* strong text */
  --gray-900: #f5f7fb;             /* headings */

  /* Blue kept as a restrained "information" accent (recommendation card) */
  --blue-50: #16233b; --blue-100: #1d3050; --blue-200: #27406a;
  --blue-500: #60a5fa; --blue-600: #7cb3fb; --blue-700: #9cc5fc; --blue-800: #c2dbfe;

  /* Green neutralised to grey (per brand direction: red + neutrals only) */
  --green-50: #232b3d; --green-500: #aab3c5; --green-600: #c2cad8;

  /* Amber kept for warnings, darkened */
  --amber-50: #2a2210; --amber-100: #3a2e12; --amber-200: #4a3a16;
  --amber-500: #f59e0b; --amber-600: #fbbf24; --amber-700: #fcd34d; --amber-800: #fde68a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow:    0 1px 3px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px -10px rgba(0, 0, 0, 0.6);
}

/* Page backdrop — charcoal with a faint red glow up top */
html.theme-dark body {
  background:
    radial-gradient(1000px 380px at 50% -160px, rgba(240, 68, 68, 0.10), rgba(240, 68, 68, 0) 70%),
    linear-gradient(180deg, #1a2030 0%, #20283a 100%);
}

/* Surfaces that used hardcoded light values (can't flip via tokens) */
html.theme-dark .footer { background: #141a26; color: var(--gray-500); border-top: 1px solid var(--gray-200); }
html.theme-dark .loading-overlay { background: rgba(20, 26, 38, 0.78); }
html.theme-dark .header { background: var(--surface); border-bottom-color: var(--gray-200); }
/* App-shell topbar uses a translucent light surface in light mode; darken it for the dark theme. */
html.theme-dark .topbar { background: rgba(20, 26, 38, 0.82); border-bottom-color: var(--gray-200); }
html.theme-dark .topbar-burger { background: var(--surface); border-color: var(--gray-300); color: var(--gray-600); }

/* Notes & warnings (hardcoded hex in light theme) */
html.theme-dark .note-box { background: #2a2510; border-color: #4a3a16; color: #fcd34d; }
html.theme-dark .warning-blocker { background: #2a1416; border-left-color: #f04444; color: #fca5a5; }
html.theme-dark .warning-warning { background: #2a2210; border-left-color: #f59e0b; color: #fcd34d; }
html.theme-dark .warning-info    { background: #16233b; border-left-color: #3b82f6; color: #bfdbfe; }
html.theme-dark .ack-gate { background: #2a2210; border-color: #4a3a16; }
html.theme-dark .ack-item { background: var(--surface); border-color: #4a3a16; }
html.theme-dark .ack-item.checked { background: rgba(240, 68, 68, 0.10); border-color: var(--primary); }
html.theme-dark .food-migration-notice { background: #2a1416; border-color: #7f1d1d; color: #fca5a5; }
html.theme-dark .manual-layer-remove { background: #2a1416; color: #fca5a5; }
html.theme-dark .manual-layer-remove:hover { background: #3a1a1d; }

/* Green → neutral / red conversions for hardcoded-green spots */
html.theme-dark .btn-download { background: var(--primary); }
html.theme-dark .btn-download:hover { background: var(--primary-hover); }
html.theme-dark .dim-badge-exact { background: #2a323f; color: #c2cad8; }
html.theme-dark .myreq-status-completed { background: rgba(255, 255, 255, 0.08); color: var(--gray-300); }
html.theme-dark .myreq-po { background: #2a1f3d; color: #c4b5fd; }
html.theme-dark .laminate-layer-match { background: rgba(255, 255, 255, 0.06); color: var(--gray-300); border-left-color: var(--gray-400); }
html.theme-dark .webshop-matches-card { border-color: var(--gray-200); border-top-color: var(--primary); }
html.theme-dark .webshop-item-card:hover { border-color: var(--primary); background: var(--primary-light); }
html.theme-dark .webshop-item-card.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(240, 68, 68, 0.15); }
html.theme-dark .webshop-item-card .selected-badge { background: var(--primary); }
html.theme-dark .webshop-selected-summary { background: var(--gray-50); border-color: var(--gray-200); }
html.theme-dark .portfolio-card { border-color: var(--gray-200); }
html.theme-dark .portfolio-card .results-header h2,
html.theme-dark .portfolio-subtitle,
html.theme-dark .portfolio-laminate,
html.theme-dark .webshop-item-card .portfolio-laminate { color: var(--gray-400); }

/* Tracker: completed/positive greens → neutral; active stays red */
html.theme-dark .trk-step-done .trk-step-marker { background: var(--gray-500); border-color: var(--gray-500); color: #0c0f17; }
html.theme-dark .trk-step-link-done,
html.theme-dark .trk-step-link-active { background: var(--gray-500); }
html.theme-dark .trk-sla-ok { background: var(--gray-100); color: var(--gray-400); }
html.theme-dark .trk-dot-good { background: var(--gray-400); }
html.theme-dark .trk-phase-4 { background: var(--gray-400); }
html.theme-dark .trk-tl-dot { border-color: var(--surface); }
html.theme-dark .trk-row:hover { background: var(--gray-50); }

/* Logo wordmark fallback reads on the dark header */
html.theme-dark .header-wordmark { color: var(--gray-900); }

/* ============================================================================
   LEAD DASHBOARD MODULE
   ============================================================================ */

/* The Lead Dashboard needs more horizontal room than the 780px the other
   modules use, so the table shows every column without scrolling. launchProcess
   adds .main-wide to #app for this module only; goToLanding removes it. */
.main.main-wide { max-width: 1500px; padding-left: 1.25rem; padding-right: 1.25rem; }
#leads-root { max-width: 100%; margin: 0 auto; }

/* --- Open-Leads toolbar --- */
.lead-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.lead-showall {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--gray-600); cursor: pointer;
}
.lead-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem;
}
.lead-filters .input-field { font-size: 0.85rem; padding: 0.5rem 0.7rem; }
.lead-filter-search { flex: 1 1 240px; min-width: 200px; }
.lead-filter-select { flex: 0 1 auto; width: auto; min-width: 130px; }
.lead-filter-date { flex: 0 1 auto; width: auto; min-width: 150px; }
.lead-count { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 0.5rem; }

/* --- Leads table --- */
.lead-table-scroll { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.lead-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.lead-table th {
  text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--gray-500); padding: 0.5rem 0.5rem; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
.lead-table td {
  padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--gray-100);
  font-size: 0.83rem; color: var(--gray-700); vertical-align: middle;
}
.lead-table tr:last-child td { border-bottom: none; }
.lead-name { font-weight: 600; color: var(--gray-800); }
.lead-sub {
  font-size: 0.74rem; color: var(--gray-400);
  max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lead-cell-date { white-space: nowrap; color: var(--gray-500); font-size: 0.8rem; }
.lead-cell-actions { white-space: nowrap; text-align: right; }
.lead-icon-btn {
  border: 1px solid var(--gray-200); background: var(--surface); color: var(--gray-500);
  border-radius: var(--radius); width: 28px; height: 28px; cursor: pointer;
  font-size: 0.85rem; line-height: 1; margin-left: 0.25rem; transition: var(--transition);
}
.lead-icon-btn:hover { border-color: var(--gray-400); color: var(--gray-800); }
.lead-icon-danger:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.lead-actions-left { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lead-name-link { cursor: pointer; }
.lead-name-link:hover { color: var(--primary); text-decoration: underline; }

.lead-inline-select {
  border: 1px solid var(--gray-200); background: var(--surface); color: var(--gray-700);
  border-radius: var(--radius); padding: 0.28rem 0.35rem; font-size: 0.78rem; cursor: pointer;
  max-width: 124px;
}
.lead-inline-select:focus { outline: none; border-color: var(--primary); }

/* --- Badges --- */
.lead-badge {
  display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.lead-src-futy  { background: rgba(34,197,94,0.16);  color: var(--green-600); }
.lead-src-web   { background: rgba(139,92,246,0.16); color: #7c3aed; }
.lead-src-other { background: var(--gray-100); color: var(--gray-600); }
.lead-prio-high   { background: rgba(220,38,38,0.12); color: var(--primary); }
.lead-prio-medium { background: var(--amber-100); color: var(--amber-800); }
.lead-prio-low    { background: var(--gray-100); color: var(--gray-500); }
.lead-tag-medical   { background: rgba(34,197,94,0.16);  color: var(--green-600); }
.lead-tag-packaging { background: var(--amber-100); color: var(--amber-800); }
.lead-tag-laminated { background: rgba(139,92,246,0.16); color: #7c3aed; }
.lead-qual-pending  { background: var(--amber-100); color: var(--amber-800); }
.lead-qual-accepted { background: rgba(34,197,94,0.16); color: var(--green-600); }
.lead-qual-rejected { background: var(--gray-100); color: var(--gray-500); }
.lead-badge-country { background: var(--blue-50); color: var(--blue-700); }

/* --- Add / edit form --- */
.lead-form-card { margin-top: 0; }
.lead-form-head { margin-bottom: 1rem; }
.lead-form-title { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); }
.lead-extract-box { font-family: 'SF Mono', 'Consolas', monospace; font-size: 0.82rem; resize: vertical; }
.lead-extract-hints { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.6rem 0; }
.lead-extract-hints .input-field { font-size: 0.85rem; padding: 0.5rem 0.7rem; }
.lead-extract-note { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.6rem; line-height: 1.45; }
.lead-form-divider { border-top: 1px dashed var(--gray-200); margin: 1.25rem 0; }
.lead-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 0.875rem; row-gap: 0.5rem; }
/* The categorization dropdowns sit below Notes and don't need much room between
   rows — tighten them and shrink their labels so the block stays compact. */
.lead-form-grid-cats { row-gap: 0.35rem; margin-top: 0.75rem; }
.lead-form-grid-cats .input-label { margin-bottom: 0.15rem; font-size: 0.78rem; }
.lead-form-field .input-field { margin: 0; }

/* Stronger box separation on the lead form: the light-grey borders were nearly
   invisible on the white card, so give each field a darker border, a faint fill
   and a subtle shadow so every box reads as distinct. */
.lead-form-card .input-field,
.lead-form-card textarea.input-field,
.lead-form-card select.input-field {
  border: 1px solid var(--gray-300, #cbd0d6);
  background: #f8f9fb;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}
.lead-form-card .input-field:focus {
  background: #ffffff;
  border-color: var(--primary);
}
.lead-form-notes { margin-top: 0.875rem; }
.lead-form-actions {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 1.5rem;
  padding-top: 1.25rem; border-top: 1px solid var(--gray-100);
}
.lead-form-actions-spacer { flex: 1 1 auto; }
.lead-quote-btn { white-space: nowrap; }

/* Lead context banner shown in the finder when opened via "Request a Quote". */
.lead-quote-context:not(:empty) { margin-bottom: 1.25rem; }
.lead-quote-banner {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--blue-50); border: 1px solid var(--blue-200);
  border-radius: var(--radius); padding: 0.6rem 0.9rem; font-size: 0.875rem;
}
.lead-quote-banner-label { font-weight: 700; color: var(--blue-800); }
.lead-quote-banner-info { flex: 1; color: var(--gray-700); }
.lead-quote-banner-x {
  border: none; background: transparent; color: var(--gray-500);
  font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 0.25rem;
}
.lead-quote-banner-x:hover { color: var(--primary); }

/* --- Dashboard tab --- */
.lead-dash-toolbar {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.lead-dash-toolbar-label { font-size: 0.85rem; font-weight: 600; color: var(--gray-600); }
.lead-dash-toolbar .input-field { font-size: 0.85rem; padding: 0.5rem 0.7rem; }
.lead-stat-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 1.5rem; }
.lead-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.lead-chart-card {
  background: var(--surface); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem;
}
.lead-chart-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 1rem; }

/* Pie / donut chart + legend */
.lead-pie-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.lead-pie-svg { width: 150px; height: 150px; flex: 0 0 auto; }
.lead-pie-svg circle { transition: stroke-dasharray 0.4s ease; }
.lead-pie-center { fill: var(--gray-800); }
.lead-legend { display: flex; flex-direction: column; gap: 0.45rem; flex: 1 1 150px; min-width: 140px; }
.lead-legend-row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.lead-legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lead-legend-label { color: var(--gray-700); font-weight: 600; }
.lead-legend-val { color: var(--gray-500); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .lead-charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .lead-form-grid { grid-template-columns: 1fr 1fr; }
  .lead-extract-hints { grid-template-columns: 1fr; }
  .lead-stat-grid { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Quotation scenarios on a narrow screen  (added 2026-09-02)
   ---------------------------------------------------------------------------
   The scenario grid is a wide table: one column per option, ~220px each, with a
   sticky label column. That is right at a desk and unusable on a phone, which
   is the single biggest thing stopping an account manager quoting from the road.

   Below 900px the table is flipped to ONE CARD PER OPTION. Every cell already
   carries data-label (its row name) and data-option (which option it belongs
   to), set in qocScRow_, so no markup rewrite is needed: the cells simply stop
   being table cells and start being labelled rows inside a card.

   Deliberately CSS-only. quoteToOc.js is 3,800+ lines of inline-styled markup
   and a JS rewrite would be a far larger, riskier change for the same result.
   =========================================================================== */
@media (max-width: 900px) {
  /* the scroller must stop scrolling, or the cards inherit the old min-width */
  .qoc-sc-scroller { overflow-x: visible !important; border: none !important; }

  .qoc-sc-table,
  .qoc-sc-table thead,
  .qoc-sc-table tbody,
  .qoc-sc-table tr,
  .qoc-sc-table th,
  .qoc-sc-table td { display: block; }

  /* min-width is set inline as var(--qoc-min); neutralise it here */
  .qoc-sc-table { min-width: 0 !important; width: 100% !important; }

  /* The column headers ("Option 1", the duplicate/remove buttons) would repeat
     above every card, so hide the header row: each cell names its own option. */
  .qoc-sc-table thead { display: none; }

  /* A row becomes a labelled group rather than a horizontal line. */
  .qoc-sc-table tbody tr {
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 8px;
    margin: 0 0 0.6rem;
    overflow: hidden;
    background: #fff;
  }

  /* The sticky row-label becomes the group heading. */
  .qoc-sc-table th[scope="row"] {
    position: static !important;
    min-width: 0 !important;
    border-right: none !important;
    background: var(--gray-50, #f9fafb) !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.02em;
    padding: 0.5rem 0.75rem !important;
    border-bottom: 1px solid var(--gray-200, #e5e7eb) !important;
  }

  /* Each value prints "Option N" beside it, so a card is self-describing. */
  .qoc-sc-table td {
    text-align: left !important;
    padding: 0.5rem 0.75rem !important;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;                      /* comfortable tap target */
  }
  .qoc-sc-table td::before {
    content: "Option " attr(data-option);
    flex: 0 0 5.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500, #6b7280);
  }
  /* The value takes the rest of the width. min-width:0 lets a flex child
     actually shrink; without it the inline widths below win and overflow. */
  .qoc-sc-table td > * { flex: 1 1 auto; min-width: 0; max-width: 100%; }

  /* Inputs need to be finger-sized, not mouse-sized. The !important is load
     bearing: every input carries an inline width (e.g. width:150px) from
     quoteToOc.js, and border-box stops the padding pushing past the card. */
  .qoc-sc-table td input,
  .qoc-sc-table td select,
  .qoc-sc-table td textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 40px;
    font-size: 16px !important;            /* iOS zooms below 16px on focus */
  }

  /* Section dividers span the full width and separate the groups. */
  .qoc-sc-table td[colspan] {
    display: block;
    margin: 1.1rem 0 0.4rem;
    border-radius: 6px;
  }
  .qoc-sc-table td[colspan]::before { content: none; }
}

/* ===========================================================================
   Manager approval on a narrow screen  (added 2026-09-02)
   ---------------------------------------------------------------------------
   Approving from a phone is the most road-relevant action there is, and the
   approval screen had no styling of its own at any width. Pair this with the
   clickable link now sent in the approval email (DpSales:FrontendBaseUrl).
   =========================================================================== */
@media (max-width: 720px) {
  .req-grid { grid-template-columns: 1fr !important; gap: 0.5rem; }

  /* Decide/counter/decline must be reachable with a thumb, not a cursor.
     managerApproval.js renders them in a .nav-buttons row (line 168). */
  .nav-buttons { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .nav-buttons .btn { width: 100%; min-height: 46px; font-size: 1rem; }
  .nav-buttons a { align-self: center !important; margin-left: 0 !important; }

  .card { padding: 0.9rem !important; }
  .input-group input,
  .input-group select,
  .input-group textarea { font-size: 16px; min-height: 42px; }
}
