/* =========================================================
   CHASSIS DEVIS — Redesign Prototype
   Clean & tech SaaS 2026
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  /* Base palette — gris bleutés, esprit SaaS */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #f1f3f9;
  --border: #e5e8f0;
  --border-strong: #d5d9e4;
  --text: #0b1220;
  --text-2: #4a5167;
  --text-3: #7a8197;
  --text-4: #a8afc2;

  /* Accent — bleu nuit / indigo profond */
  --accent: #3a5bff;
  --accent-2: #6b85ff;
  --accent-soft: #eef1ff;
  --accent-softer: #f6f8ff;
  --accent-ink: #1b2a6b;

  --ok: #10b981;
  --ok-soft: #dcfce7;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --err: #dc2626;
  --err-soft: #fee2e2;

  --glass: #e7f0fb;
  --glass-2: #f3f7fd;

  /* Density (compact | comfort | spacious) */
  --pad-card: 20px;
  --pad-choice: 22px 18px;
  --gap-grid: 12px;
  --radius: 14px;
  --radius-lg: 20px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-display: var(--font-sans);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ===== Density variants ===== */
[data-density="compact"] {
  --pad-card: 14px;
  --pad-choice: 14px 12px;
  --gap-grid: 8px;
  --radius: 10px;
}
[data-density="comfort"] {
  --pad-card: 20px;
  --pad-choice: 22px 18px;
  --gap-grid: 12px;
  --radius: 14px;
}
[data-density="spacious"] {
  --pad-card: 28px;
  --pad-choice: 30px 24px;
  --gap-grid: 18px;
  --radius: 18px;
}

[data-typo="serif"] {
  --font-display: 'Instrument Serif', Georgia, serif;
}
[data-typo="mono"] {
  --font-display: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: -0.01em;
}

/* ===== Prototype shell ===== */
.proto {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.proto-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.proto-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.proto-brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid; place-items: center;
  color: white;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(58, 91, 255, 0.3);
}
.proto-brand-sub {
  color: var(--text-3);
  font-weight: 400;
  font-size: 13px;
  margin-left: 2px;
}
.proto-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-3);
  padding: 3px;
  border-radius: 10px;
}
.proto-tab {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-family: inherit;
}
.proto-tab:hover { color: var(--text); }
.proto-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.05);
}
.proto-bar-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.proto-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.proto-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* ===== Canvas area ===== */
.canvas {
  padding: 24px;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(58, 91, 255, 0.05), transparent 50%),
    var(--bg);
}

/* ===== Widget frame (the actual designed product) ===== */
.widget {
  width: 100%;
  max-width: 1160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow:
    0 1px 2px rgba(11, 18, 32, 0.04),
    0 20px 60px -20px rgba(11, 18, 32, 0.12);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 720px;
  position: relative;
}
@media (max-width: 900px) {
  .widget { grid-template-columns: 1fr; min-height: auto; }
}

.widget-frame-label {
  position: absolute;
  top: -14px;
  left: 24px;
  background: var(--text);
  color: white;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  z-index: 5;
  text-transform: uppercase;
}

/* Main area */
.stage {
  padding: 40px 44px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  position: relative;
}
@media (max-width: 640px) {
  .stage { padding: 28px 20px; }
}

.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  min-height: 36px;
}
.company {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
.company-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--text);
  color: white;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.company-name { letter-spacing: -0.01em; }
.company-name small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; letter-spacing: 0; }

.lang-switch {
  display: flex;
  gap: 1px;
  background: var(--surface-3);
  padding: 3px;
  border-radius: 8px;
}
.lang-switch button {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
}
.lang-switch button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(11,18,32,0.08); }

/* Back button */
.back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px 6px 6px;
  margin-left: -6px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
  font-family: inherit;
  width: fit-content;
}
.back:hover { background: var(--surface-3); color: var(--text); }
.back svg { width: 16px; height: 16px; }

/* Progress */
.progress {
  margin-bottom: 28px;
}
.progress-track {
  display: flex;
  gap: 3px;
  margin-bottom: 10px;
}
.progress-seg {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress-seg-fill {
  position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out);
}
.progress-seg.done .progress-seg-fill { transform: scaleX(1); }
.progress-seg.active .progress-seg-fill {
  transform: scaleX(0.5);
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.progress-labels span {
  flex: 1;
  text-align: center;
  padding: 0 4px;
  transition: color 0.2s;
}
.progress-labels span:first-child { text-align: left; }
.progress-labels span:last-child { text-align: right; }
.progress-labels span.active { color: var(--text); font-weight: 600; }
.progress-labels span.done { color: var(--accent); }

@media (max-width: 640px) {
  .progress-labels span:not(.active) { display: none; }
}

/* Headline */
.headline { margin-bottom: 28px; }
.headline-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.headline-eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--accent);
}
.headline-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 10px 0;
  color: var(--text);
  text-wrap: balance;
}
[data-typo="serif"] .headline-title { font-weight: 400; font-size: 40px; letter-spacing: -0.02em; }
[data-typo="mono"] .headline-title { font-size: 28px; letter-spacing: -0.03em; }
.headline-sub {
  font-size: 15px;
  color: var(--text-2);
  margin: 0;
  max-width: 560px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ===== Choice grid ===== */
.grid {
  display: grid;
  gap: var(--gap-grid);
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 680px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2 { grid-template-columns: 1fr; }
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: var(--pad-choice);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.25s var(--ease-out);
  overflow: hidden;
  min-height: 180px;
}
.choice::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(58, 91, 255, 0.07), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  pointer-events: none;
}
.choice:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(11, 18, 32, 0.03),
    0 12px 32px -8px rgba(58, 91, 255, 0.2);
}
.choice:hover::before { opacity: 1; }
.choice.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-softer) 0%, var(--surface) 100%);
}
.choice.selected::before { opacity: 1; }

.choice-illus {
  width: 100%;
  aspect-ratio: 1.6;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.choice:hover .choice-illus,
.choice.selected .choice-illus {
  background: var(--surface);
  border-color: var(--border-strong);
}
.choice-illus svg {
  width: 70%;
  height: 70%;
  max-width: 140px;
  max-height: 100px;
}
.choice-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.choice-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  flex: 1;
}
.choice-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.choice-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--surface-3);
  border-radius: 4px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.choice-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: grid; place-items: center;
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}
.choice-check svg { width: 12px; height: 12px; color: white; opacity: 0; transform: scale(0.4); transition: all 0.2s var(--ease-out); }
.choice.selected .choice-check {
  background: var(--accent);
  border-color: var(--accent);
}
.choice.selected .choice-check svg { opacity: 1; transform: scale(1); }

/* Compact variant for admin-like lists */
.choice-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.choice-row:hover { border-color: var(--accent); background: var(--accent-softer); }
.choice-row-icon {
  width: 44px; height: 44px;
  background: var(--surface-3);
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.choice-row-icon svg { width: 28px; height: 28px; }
.choice-row-body { flex: 1; min-width: 0; }
.choice-row-title { font-size: 14px; font-weight: 600; }
.choice-row-desc { font-size: 12px; color: var(--text-3); }

/* ===== Sidebar (récap) ===== */
.aside {
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  padding: 32px 28px 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
@media (max-width: 900px) {
  .aside { border-left: none; border-top: 1px solid var(--border); padding: 24px 20px 100px; }
}

.aside-h {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.aside-count {
  background: var(--text);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.aside-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
}
.aside-empty-icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  background: var(--surface-3);
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--text-3);
}
.aside-empty-icon svg { width: 24px; height: 24px; }

/* Item card (in aside) */
.item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: flex-start;
  transition: border-color 0.15s;
  position: relative;
}
.item:hover { border-color: var(--border-strong); }
.item-thumb {
  width: 48px; height: 48px;
  background: var(--surface-3);
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.item-thumb svg { width: 32px; height: 32px; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.item-detail { font-size: 11px; color: var(--text-3); line-height: 1.4; font-family: var(--font-mono); }
.item-qty {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.item-actions {
  display: flex;
  gap: 2px;
  margin-top: 8px;
}
.item-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.item-btn:hover { background: var(--surface-3); color: var(--text); }
.item-btn.danger:hover { background: var(--err-soft); color: var(--err); }

/* Aside CTA */
.aside-cta {
  position: sticky;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

/* Aside stats */
.aside-stats {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.aside-stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.aside-stat-value { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn.lg { padding: 15px 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent) 0%, #2d4de8 100%);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 12px rgba(58, 91, 255, 0.3);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 8px 20px rgba(58, 91, 255, 0.4); }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--border); }
.btn.outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.outline:hover { background: var(--accent-softer); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }

/* ===== Home hero ===== */
.hero {
  padding: 8px 0 0;
}
.hero.hero-centered {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 0;
}
.hero.hero-centered .hero-sub { margin-left: auto; margin-right: auto; }
.hero.hero-centered .hero-cta-row { justify-content: center; }
.hero.hero-centered .hero-trust { justify-content: center; width: 100%; max-width: 680px; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--accent-soft);
  border-radius: 999px;
}
.hero-eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(58, 91, 255, 0.15);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(58, 91, 255, 0); } }

.hero-title {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin: 0 0 16px 0;
  text-wrap: balance;
}
[data-typo="serif"] .hero-title { font-weight: 400; font-size: 64px; }
[data-typo="mono"] .hero-title { font-size: 42px; letter-spacing: -0.04em; }

.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.hero-title .underline {
  position: relative;
  display: inline-block;
}
.hero-title .underline::after {
  content: '';
  position: absolute;
  left: -2%; right: -2%;
  bottom: 0.08em;
  height: 0.35em;
  background: var(--accent-soft);
  z-index: -1;
  border-radius: 4px;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.55;
  margin: 0 0 32px 0;
  text-wrap: pretty;
}

.hero-cta-row { display: flex; gap: 10px; align-items: center; margin-bottom: 40px; }
.hero-trust {
  display: flex;
  gap: 22px;
  color: var(--text-3);
  font-size: 12px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.hero-trust-item {
  display: flex; align-items: center; gap: 7px;
}
.hero-trust-item svg { width: 14px; height: 14px; color: var(--ok); }

.hero-visual {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 32px;
}
.hero-card {
  aspect-ratio: 1.4;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}
.hero-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -8px rgba(58, 91, 255, 0.2);
}
.hero-card-label {
  position: absolute;
  bottom: 12px; left: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
.hero-card-num {
  position: absolute;
  top: 12px; right: 14px;
  font-size: 10px;
  color: var(--text-4);
  font-family: var(--font-mono);
}
.hero-card svg {
  width: 58%;
  height: 58%;
  max-width: 130px;
  max-height: 100px;
  color: var(--text-2);
  transition: color 0.3s;
}
.hero-card:hover svg { color: var(--accent); }

/* ===== Dimensions screen ===== */
.dim-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 520px) { .dim-group { grid-template-columns: 1fr; } }
.dim {
  position: relative;
  padding: 18px 20px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s var(--ease-out);
}
.dim:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(58, 91, 255, 0.12); }
.dim-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.dim-label svg { width: 12px; height: 12px; }
.dim-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
  padding: 0;
  color: var(--text);
  font-family: var(--font-display);
}
.dim-input:focus { outline: none; }
.dim-input::placeholder { color: var(--text-4); }
.dim-input::-webkit-inner-spin-button, .dim-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dim-input[type=number] { -moz-appearance: textfield; }
.dim-unit {
  position: absolute;
  right: 20px; bottom: 18px;
  font-size: 13px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.dim-preview {
  padding: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
.dim-preview-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
}
.dim-preview-window {
  background: var(--glass-2);
  border: 2px solid var(--accent);
  border-radius: 4px;
  position: relative;
  box-shadow: 0 8px 24px -6px rgba(58, 91, 255, 0.3);
  transition: all 0.4s var(--ease-out);
  display: grid;
  place-items: center;
}
.dim-preview-window::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--accent);
  opacity: 0.3;
  border-radius: 2px;
}
.dim-preview-w, .dim-preview-h {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}
.dim-preview-w { bottom: -10px; left: 50%; transform: translateX(-50%); }
.dim-preview-h { top: 50%; left: -10px; transform: translate(-100%, -50%); }

.hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-3);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.5;
}
.hint svg { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; margin-top: 1px; }

.qty-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.qty-row-label { font-size: 14px; font-weight: 500; }
.qty-stepper {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.qty-stepper button {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.qty-stepper button:hover:not(:disabled) { background: var(--accent-softer); color: var(--accent); }
.qty-stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.qty-stepper .val { width: 40px; text-align: center; font-size: 14px; font-weight: 600; font-family: var(--font-mono); }

/* Form */
.form-grid { display: grid; gap: 14px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
}
.field-label .req { color: var(--text-4); font-size: 11px; }
.field-input, .field-textarea {
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s;
}
.field-input:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 91, 255, 0.12);
}
.field-textarea { resize: vertical; min-height: 90px; }
.field-input.err, .field-textarea.err { border-color: var(--err); }
.field-error { font-size: 11px; color: var(--err); font-family: var(--font-mono); }
.field-hint { font-size: 11px; color: var(--text-3); font-family: var(--font-sans); }

.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .radio-group { grid-template-columns: 1fr; } }
.radio-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.radio-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.radio-card.active { border-color: var(--accent); background: var(--accent-softer); }
.radio-card input { display: none; }
.radio-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 2px;
  display: grid; place-items: center;
  transition: all 0.15s;
}
.radio-card.active .radio-dot { border-color: var(--accent); }
.radio-card.active .radio-dot::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.radio-body { flex: 1; }
.radio-title { font-size: 13px; font-weight: 600; }
.radio-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}
.check:hover { background: var(--surface-3); }
.check input {
  margin: 0;
  margin-top: 2px;
  accent-color: var(--accent);
  width: 16px; height: 16px;
}

/* ===== Success screen ===== */
.success {
  text-align: center;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.success-mark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ok) 0%, #059669 100%);
  display: grid; place-items: center;
  margin-bottom: 24px;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px -6px rgba(16, 185, 129, 0.4);
  position: relative;
}
.success-mark::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 2px solid var(--ok);
  border-radius: 50%;
  opacity: 0.25;
  animation: ring 1.5s ease-out 0.3s 1;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }
@keyframes ring { to { transform: scale(1.4); opacity: 0; } }
.success-mark svg { width: 36px; height: 36px; color: white; }

.success-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 10px 0;
}
[data-typo="serif"] .success-title { font-weight: 400; font-size: 40px; }
.success-sub {
  font-size: 15px;
  color: var(--text-2);
  max-width: 480px;
  margin: 0 0 28px 0;
}

.price-box {
  width: 100%;
  max-width: 500px;
  padding: 26px 28px;
  background:
    linear-gradient(135deg, var(--accent-softer) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.price-box::before {
  content: '';
  position: absolute;
  top: -60%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(58, 91, 255, 0.12) 0%, transparent 65%);
  pointer-events: none;
}
.price-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px; justify-content: center;
}
.price-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: var(--accent-ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}
[data-typo="serif"] .price-value { font-weight: 400; font-size: 44px; }
.price-value .dash { color: var(--text-3); margin: 0 10px; font-weight: 400; }
.price-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.budget-q {
  width: 100%;
  max-width: 500px;
  padding: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.budget-q-label {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.budget-q-hint { font-size: 12px; color: var(--text-3); margin-bottom: 18px; }
.budget-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .budget-btns { grid-template-columns: 1fr; } }
.budget-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.budget-btn .icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px;
}
.budget-btn.yes:hover { border-color: var(--ok); background: var(--ok-soft); }
.budget-btn.yes .icon { background: var(--ok-soft); color: var(--ok); }
.budget-btn.no:hover { border-color: var(--err); background: var(--err-soft); }
.budget-btn.no .icon { background: var(--err-soft); color: var(--err); }

.budget-ack {
  width: 100%;
  max-width: 500px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  text-align: center;
  animation: slideUp 0.35s var(--ease-out);
}
.budget-ack.yes { background: var(--ok-soft); border-color: #bbf7d0; }
.budget-ack.no { background: var(--surface-3); }
.budget-ack-t { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.budget-ack.yes .budget-ack-t { color: #15803d; }
.budget-ack.no .budget-ack-t { color: var(--text-2); }
.budget-ack-m { font-size: 13px; color: var(--text-2); line-height: 1.55; }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Screen transition ===== */
.screen {
  animation: enter 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
}
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Animation controls ===== */
[data-anim="off"] .cd-animated { animation: none !important; }
[data-anim="subtle"] .cd-animated { animation-duration: 9s !important; animation-timing-function: ease-in-out; }

/* ===== Tweaks panel ===== */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px -10px rgba(11, 18, 32, 0.25);
  z-index: 100;
  overflow: hidden;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease-out);
}
.tweaks.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.tweaks-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tweaks-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tweaks-title .badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 5px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.tweaks-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}
.tweaks-close:hover { background: var(--surface-3); color: var(--text); }
.tweaks-close svg { width: 16px; height: 16px; }

.tweaks-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 60vh;
  overflow-y: auto;
}

.tweak {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tweak-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tweak-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  background: var(--surface-3);
  padding: 3px;
  border-radius: 8px;
}
.tweak-options.two { grid-template-columns: 1fr 1fr; }
.tweak-opt {
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: center;
}
.tweak-opt:hover { color: var(--text); }
.tweak-opt.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(11,18,32,0.08); }

.tweak-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}
.tweak-swatches {
  display: flex;
  gap: 6px;
}
.tweak-swatch {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.tweak-swatch.active { border-color: var(--text); transform: scale(1.1); }

.tweaks-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px -6px rgba(11, 18, 32, 0.4);
  z-index: 99;
  transition: all 0.25s var(--ease-out);
}
.tweaks-fab:hover { transform: scale(1.08) rotate(45deg); }
.tweaks-fab svg { width: 22px; height: 22px; }

/* ===== SVG icon animations ===== */
@keyframes cd-battant-l {
  0%, 12% { transform: perspective(220px) rotateY(0deg); }
  45%, 72% { transform: perspective(220px) rotateY(-58deg); }
  92%, 100% { transform: perspective(220px) rotateY(0deg); }
}
@keyframes cd-battant-r {
  0%, 12% { transform: perspective(220px) rotateY(0deg); }
  45%, 72% { transform: perspective(220px) rotateY(58deg); }
  92%, 100% { transform: perspective(220px) rotateY(0deg); }
}
@keyframes cd-soufflet {
  0%, 12% { transform: perspective(200px) rotateX(0deg); }
  45%, 72% { transform: perspective(200px) rotateX(-32deg); }
  92%, 100% { transform: perspective(200px) rotateX(0deg); }
}
@keyframes cd-oscillo-in {
  0%, 8% { transform: perspective(200px) rotateX(0deg); }
  18%, 38% { transform: perspective(200px) rotateX(-32deg); }
  48%, 100% { transform: perspective(200px) rotateX(0deg); }
}
@keyframes cd-oscillo-out {
  0%, 55% { transform: perspective(220px) rotateY(0deg); }
  65%, 85% { transform: perspective(220px) rotateY(-58deg); }
  95%, 100% { transform: perspective(220px) rotateY(0deg); }
}
@keyframes cd-slide-l {
  0%, 12% { transform: translateX(0); }
  35%, 72% { transform: translateX(-18%); }
  92%, 100% { transform: translateX(0); }
}
@keyframes cd-slide-r {
  0%, 12% { transform: translateX(0); }
  35%, 72% { transform: translateX(18%); }
  92%, 100% { transform: translateX(0); }
}
@keyframes cd-door-open {
  0%, 12% { transform: perspective(240px) rotateY(0deg); }
  45%, 72% { transform: perspective(240px) rotateY(-45deg); }
  92%, 100% { transform: perspective(240px) rotateY(0deg); }
}
@keyframes cd-garage-up {
  0%, 12% { transform: translateY(0); opacity: 1; }
  45%, 72% { transform: translateY(-80%); opacity: 0.3; }
  92%, 100% { transform: translateY(0); opacity: 1; }
}
@keyframes cd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes cd-motor-spin {
  to { transform: rotate(360deg); }
}
@keyframes cd-shine {
  0%, 15% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(220%); }
}

.cd-battant-l {
  animation: cd-battant-l 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 0% 50%;
}
.cd-battant-r {
  animation: cd-battant-r 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 100% 50%;
}
.cd-soufflet {
  animation: cd-soufflet 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.cd-oscillo-in {
  animation: cd-oscillo-in 7.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.cd-oscillo-out {
  animation: cd-oscillo-out 7.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 0% 50%;
}
.cd-slide-l { animation: cd-slide-l 4s ease-in-out infinite; transform-box: fill-box; }
.cd-slide-r { animation: cd-slide-r 4s ease-in-out infinite; transform-box: fill-box; }
.cd-door-open { animation: cd-door-open 5s ease-in-out infinite; transform-box: fill-box; transform-origin: 0% 50%; }
.cd-garage-up { animation: cd-garage-up 5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.cd-pulse { animation: cd-pulse 2.4s ease-in-out infinite; }
.cd-motor-spin { animation: cd-motor-spin 4s linear infinite; transform-box: fill-box; transform-origin: 50% 50%; }

@media (prefers-reduced-motion: reduce) {
  .cd-battant-l, .cd-battant-r, .cd-soufflet, .cd-oscillo-in, .cd-oscillo-out,
  .cd-slide-l, .cd-slide-r, .cd-door-open, .cd-garage-up, .cd-pulse, .cd-motor-spin {
    animation: none !important;
  }
}

/* ====== Admin (back-office) ====== */
.admin {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 720px;
  background: var(--surface);
  border-radius: 0;
}
@media (max-width: 800px) {
  .admin { grid-template-columns: 1fr; }
}
.admin-nav {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 10px;
  margin-bottom: 8px;
  margin-top: 14px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  text-align: left;
  transition: all 0.15s;
}
.admin-nav-link:hover { background: var(--surface-3); color: var(--text); }
.admin-nav-link.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(11,18,32,0.05); }
.admin-nav-link svg { width: 16px; height: 16px; color: var(--text-3); }
.admin-nav-link.active svg { color: var(--accent); }

.admin-content { padding: 32px 36px; }
.admin-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.admin-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.admin-sub { font-size: 13px; color: var(--text-3); margin: 4px 0 0 0; }

.admin-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 700px) { .admin-kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.kpi-l { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; }
.kpi-d { font-size: 11px; color: var(--ok); margin-top: 2px; font-family: var(--font-mono); }
.kpi-d.down { color: var(--err); }

.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.tag.ok { background: var(--ok-soft); color: #15803d; }
.tag.warn { background: var(--warn-soft); color: #92400e; }
.tag.neutral { background: var(--surface-3); color: var(--text-2); }
.tag.err { background: var(--err-soft); color: #991b1b; }

/* 3-column KPI override */
.admin-kpis.kpis-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .admin-kpis.kpis-3 { grid-template-columns: repeat(2, 1fr); } }

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.status-pill .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px color-mix(in oklab, currentColor 10%, transparent);
}
.status-pill.hot {
  background: color-mix(in oklab, #e11d48 8%, var(--surface));
  border-color: color-mix(in oklab, #e11d48 25%, var(--border));
  color: #9f1239;
}
.status-pill.standard {
  background: color-mix(in oklab, #3a5bff 8%, var(--surface));
  border-color: color-mix(in oklab, #3a5bff 25%, var(--border));
  color: #1e40af;
}
.status-pill.closed {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-3);
}

/* Leads table — expandable rows */
.leads-tbl .lead-row td { transition: background 0.15s ease; }
.leads-tbl .lead-row.open td { background: var(--accent-softer); border-bottom-color: transparent; }
.leads-tbl .lead-row:hover td { background: var(--surface-2); }
.leads-tbl .lead-row.open:hover td { background: var(--accent-softer); }

.lead-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.lead-name:hover .lead-name-txt {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.lead-name-caret {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-2);
  transition: transform 0.2s ease, background 0.15s;
  font-size: 11px;
  line-height: 1;
}
.lead-row.open .lead-name-caret {
  background: var(--accent);
  color: white;
}

.lead-expand td {
  padding: 0 !important;
  background: var(--accent-softer);
  border-bottom: 1px solid var(--border);
}
.lead-expand-inner {
  padding: 18px 22px 20px;
  border-top: 1px dashed var(--border-strong);
  background: linear-gradient(180deg, var(--accent-softer) 0%, var(--surface-2) 100%);
}
.lead-contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 20px;
}
@media (max-width: 900px) { .lead-contact-grid { grid-template-columns: repeat(2, 1fr); } }
.lead-contact-cell { min-width: 0; }
.lead-contact-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.lead-contact-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-contact-val a { color: var(--accent); text-decoration: none; }
.lead-contact-val a:hover { text-decoration: underline; }
.lead-msg {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.lead-msg-txt {
  font-size: 13px;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.55;
  margin-top: 2px;
}
.lead-expand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* Icon button */
.btn.icon-btn {
  padding: 6px 8px;
  display: inline-grid;
  place-items: center;
  min-width: 0;
}

.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 800px) { .admin-row { grid-template-columns: 1fr; } }
.panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.panel-h {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.swatches { display: flex; gap: 10px; align-items: center; }
.swatches-label { font-size: 12px; color: var(--text-3); }
.swatch-big {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.swatch-big:hover { transform: scale(1.06); }
.swatch-big.active { border-color: var(--text); }
.swatch-big.active::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 1px solid var(--text);
  border-radius: 10px;
}

.swatches { flex-wrap: wrap; }
.swatch-custom-wrap {
  position: relative;
  display: inline-block;
}
.swatch-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  border: 2px solid var(--surface);
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.swatch-custom-wrap:hover .swatch-remove { display: flex; }
.swatch-add {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 2px dashed var(--border-strong);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.swatch-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-softer);
  transform: scale(1.06);
}

.swatch-picker {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.swatch-picker-preview {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.swatch-picker-native {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.swatch-picker-hex {
  width: 110px !important;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ===== Misc: sticky bottom bar on mobile for items count ===== */
.sticky-bar {
  display: none;
}
@media (max-width: 900px) {
  .sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    gap: 10px;
    z-index: 10;
  }
}

/* Scrollbar polish */
.aside::-webkit-scrollbar, .tweaks-body::-webkit-scrollbar { width: 8px; }
.aside::-webkit-scrollbar-thumb, .tweaks-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.aside::-webkit-scrollbar-thumb:hover, .tweaks-body::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }


/* ===== Admin back-office — catalog editor, pricing rules ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 18, 32, 0.52);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 80;
  padding: 40px 20px;
  animation: adminFadeIn 0.18s ease;
}
@keyframes adminFadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: min(820px, 100%);
  max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(11,18,32,0.35), 0 0 0 1px var(--border);
  animation: adminSlideUp 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes adminSlideUp { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
.modal-h {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  background: var(--surface-2);
}
.modal-f {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* Switch */
.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 38px; height: 22px;
  background: var(--border-strong);
  border-radius: 22px;
  position: relative;
  transition: background 0.18s;
}
.switch-dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(16px); }
.switch.small .switch-track { width: 32px; height: 18px; }
.switch.small .switch-dot { width: 14px; height: 14px; }
.switch.small input:checked + .switch-track .switch-dot { transform: translateX(14px); }

/* Variant row */
.variant-row {
  display: grid;
  grid-template-columns: 32px 1fr auto 32px;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.variant-label {
  font-size: 13px; color: var(--text); font-weight: 500;
}
.variant-delta {
  display: flex; align-items: center; gap: 8px;
}

/* Input with suffix */
.input-suffix {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border 0.15s, box-shadow 0.15s;
}
.input-suffix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-suffix input {
  border: 0; outline: 0;
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font-mono);
  width: 90px;
  background: transparent;
  color: var(--text);
}
.input-suffix span {
  padding: 0 10px;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 12px;
  border-left: 1px solid var(--border);
}
.input-suffix.wide { display: flex; }
.input-suffix.wide input { width: 100%; }

/* Promo panel */
.promo-panel {
  background: linear-gradient(135deg, var(--accent-softer), var(--surface));
  border: 1px solid var(--accent-soft);
}
.promo-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: promoPulse 1.8s ease-in-out infinite;
}
@keyframes promoPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft) }
  50%      { box-shadow: 0 0 0 7px rgba(58,91,255,0.08) }
}
.promo-preview {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--accent-ink);
  color: #eef1ff;
  border-radius: 10px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}
.promo-preview .promo-dot {
  background: #6b85ff;
  box-shadow: 0 0 0 4px rgba(107,133,255,0.25);
}

/* Sim cards */
.sim-card {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.sim-base {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sim-final {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.sim-diff {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.sim-diff.up { color: var(--warn); }
.sim-diff.down { color: var(--ok); }
.sim-notes {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 8px;
}
.sim-notes span {
  font-size: 10px;
  padding: 3px 7px;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 20px;
  font-family: var(--font-mono);
}


/* =========================================================
   PDF preview overlay — print-ready quote document
   ========================================================= */

.pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: pdfFade 0.18s var(--ease-out);
}
@keyframes pdfFade { from { opacity: 0; } to { opacity: 1; } }

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(11, 18, 32, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #e9edf6;
  flex-shrink: 0;
}
.pdf-toolbar-l { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.pdf-toolbar-r { display: flex; gap: 8px; }
.pdf-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 9px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pdf-toolbar-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.15); }
.pdf-toolbar-meta { color: rgba(255,255,255,0.7); font-family: var(--font-mono); font-size: 12px; }
.pdf-overlay .btn.ghost { color: rgba(255,255,255,0.85); }
.pdf-overlay .btn.ghost:hover { background: rgba(255,255,255,0.1); color: white; }

.pdf-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 40px 20px 60px;
  display: flex;
  justify-content: center;
}

/* A4-ish sheet: 794 × 1123px @96dpi */
.pdf-doc {
  width: 794px;
  min-height: 1123px;
  background: #ffffff;
  color: #0b1220;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  padding: 56px 56px 40px;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: relative;
}

/* === Header === */
.pdf-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  padding-bottom: 22px;
  border-bottom: 2px solid #0b1220;
}
.pdf-header-l { display: flex; align-items: center; }
.pdf-logo { display: flex; align-items: center; gap: 14px; }
.pdf-logo svg { flex-shrink: 0; }
.pdf-logo-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #0b1220;
}
.pdf-logo-sub {
  margin-top: 4px;
  font-size: 10px;
  color: #7a8197;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pdf-header-r { text-align: right; }
.pdf-doc-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #0b1220;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.pdf-doc-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.pdf-doc-meta > div {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  justify-content: end;
}
.pdf-doc-meta span {
  color: #7a8197;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pdf-doc-meta strong {
  color: #0b1220;
  font-weight: 600;
  min-width: 110px;
  text-align: right;
}

/* === Parties === */
.pdf-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.pdf-party {
  padding: 16px 18px;
  border: 1px solid #e5e8f0;
  border-radius: 6px;
  background: #fafbfd;
}
.pdf-party.customer {
  border-color: #0b1220;
  background: #ffffff;
}
.pdf-party-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #7a8197;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pdf-party-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #0b1220;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.pdf-party-lines {
  font-size: 11px;
  color: #4a5167;
  line-height: 1.6;
}
.pdf-party-lines > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-party-proj {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d5d9e4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}
.pdf-party-proj-l { color: #7a8197; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.pdf-party-proj-v { font-weight: 600; color: #0b1220; }

/* === Summary === */
.pdf-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 18px 20px;
  background: #0b1220;
  color: white;
  border-radius: 8px;
  align-items: center;
}
.pdf-summary-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pdf-summary-big {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.pdf-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pdf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 10px;
}
.pdf-chip-n { font-family: var(--font-mono); font-weight: 600; color: #E9DCC2; }
.pdf-chip-t { color: rgba(255,255,255,0.9); }
.pdf-incl {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 220px;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(255,255,255,0.75);
}
.pdf-incl svg { color: #4ade80; flex-shrink: 0; margin-top: 2px; }

/* === Sections === */
.pdf-section-h {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #0b1220;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #0b1220;
}

/* === Line-item table === */
.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}
.pdf-table thead th {
  text-align: left;
  padding: 8px 10px;
  background: #f1f3f9;
  font-family: var(--font-mono);
  font-size: 9px;
  color: #0b1220;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid #d5d9e4;
}
.pdf-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e8f0;
  vertical-align: top;
}
.pdf-table tbody tr:last-child td { border-bottom: 2px solid #0b1220; }
.pdf-table .c-no { width: 32px; color: #7a8197; font-family: var(--font-mono); font-weight: 600; font-size: 10px; }
.pdf-table .c-dim { width: 100px; font-family: var(--font-mono); color: #4a5167; font-size: 10px; white-space: nowrap; }
.pdf-table .c-qty { width: 36px; text-align: center; font-family: var(--font-mono); }
.pdf-table .c-unit, .pdf-table .c-total { width: 90px; text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.pdf-table .c-total { font-weight: 700; color: #0b1220; }
.pdf-item-name {
  font-weight: 600;
  font-size: 12px;
  color: #0b1220;
  margin-bottom: 4px;
}
.pdf-item-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 10px;
}
.pdf-opt {
  display: inline-flex;
  gap: 4px;
}
.pdf-opt-k { color: #7a8197; text-transform: uppercase; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; }
.pdf-opt-v { color: #0b1220; font-weight: 500; }

/* === Totals === */
.pdf-totals {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: start;
}
.pdf-range-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #eef1ff 0%, #ffffff 100%);
  border: 1px solid #3a5bff;
  border-radius: 8px;
}
.pdf-range-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #1b2a6b;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pdf-range-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: #0b1220;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.2;
}
.pdf-range-sub {
  font-size: 10px;
  color: #4a5167;
  line-height: 1.5;
}
.pdf-totals-r {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pdf-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e8f0;
  font-size: 11px;
}
.pdf-total-row span { color: #4a5167; }
.pdf-total-row strong {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #0b1220;
  font-size: 12px;
}
.pdf-total-row.grand {
  background: #0b1220;
  color: white;
  border-radius: 6px;
  margin-top: 6px;
  padding: 14px 16px;
  border: none;
}
.pdf-total-row.grand span { color: rgba(255,255,255,0.7); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.pdf-total-row.grand strong { color: white; font-size: 18px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }

/* === Conditions === */
.pdf-conditions { }
.pdf-cond-list {
  padding-left: 0;
  margin: 0;
  list-style: none;
  font-size: 10px;
  color: #4a5167;
  line-height: 1.7;
}
.pdf-cond-list li { margin-bottom: 3px; padding-left: 14px; position: relative; }
.pdf-cond-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 1px;
  background: #9aa3bd;
}

/* === Footer === */
.pdf-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #e5e8f0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pdf-thanks {
  font-family: var(--font-display);
  font-size: 16px;
  color: #0b1220;
  letter-spacing: -0.01em;
  font-style: italic;
}
.pdf-foot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  font-size: 9px;
  color: #7a8197;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  align-items: center;
}
.pdf-foot-ref { color: #0b1220; font-weight: 600; }

/* === Print === */
@media print {
  body > *:not(.pdf-overlay) { display: none !important; }
  .pdf-overlay { position: static !important; background: white !important; backdrop-filter: none !important; }
  .pdf-toolbar { display: none !important; }
  .pdf-scroll { padding: 0 !important; overflow: visible !important; }
  .pdf-doc { box-shadow: none !important; width: 100% !important; min-height: auto !important; padding: 18mm 16mm !important; page-break-inside: avoid; }
  @page { size: A4; margin: 0; }
}

/* Responsive: don't scale doc down too much */
@media (max-width: 820px) {
  .pdf-doc { width: 100%; padding: 28px 20px; }
  .pdf-header { grid-template-columns: 1fr; gap: 14px; }
  .pdf-header-r { text-align: left; }
  .pdf-doc-meta > div { justify-content: start; }
  .pdf-parties { grid-template-columns: 1fr; }
  .pdf-totals { grid-template-columns: 1fr; }
}
