/* PrintMargin3D — V4 Warm Editorial Craft Studio Design System
 * Inspired by calm, photo-led industrial design (Apple × Bambu × Etsy Studio)
 * with fluid micro-animations and optional Warm Espresso Dark Mode.
 */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-warm: #efe8df;
  --surface-muted: #f3efe9;
  --surface-subtle: #faf8f5;
  --ink: #141311;
  --ink-secondary: #4a4741;
  --ink-muted: #78736a;
  --border: #e6e0d8;
  --border-strong: #d4ccc0;
  --accent: #e85d1a;
  --accent-bright: #f26d2b;
  --accent-hover: #c94b10;
  --accent-soft: #fdf0e8;
  --accent-border: #f5cbb0;
  --accent-glow: rgba(232, 93, 26, 0.14);
  --profit-card-bg: #e3efe1;
  --profit-card-border: #cde2ca;
  --profit: #146c2e;
  --profit-bright: #1b8a3b;
  --profit-soft: #e3efe1;
  --profit-border: #bedbb9;
  --warn-card-bg: #fcf3d9;
  --warn-card-border: #f2dc9b;
  --warn: #a16207;
  --warn-soft: #fef9e7;
  --warn-border: #f3da8a;
  --danger-card-bg: #fce8e6;
  --danger-card-border: #f5c2bc;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --info: #1d4ed8;
  --info-soft: #eff6ff;
  --header-bg: rgba(250, 248, 245, 0.92);
  --btn-dark: #1c1b19;
  --btn-dark-hover: #0a0a09;
  --code-bg: #181715;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(20, 19, 17, 0.04);
  --shadow-sm: 0 2px 10px rgba(20, 19, 17, 0.04), 0 1px 2px rgba(20, 19, 17, 0.03);
  --shadow-md: 0 10px 28px rgba(20, 19, 17, 0.07);
  --shadow-lg: 0 22px 48px rgba(20, 19, 17, 0.16);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Warm Espresso Dark Mode */
[data-theme="dark"] {
  --bg: #121110;
  --surface: #1b1917;
  --surface-elevated: #22201d;
  --surface-warm: #26221e;
  --surface-muted: #262320;
  --surface-subtle: #181614;
  --ink: #faf8f5;
  --ink-secondary: #d6d1c9;
  --ink-muted: #9e978e;
  --border: #2e2a26;
  --border-strong: #423c36;
  --accent: #f97316;
  --accent-bright: #fb923c;
  --accent-hover: #ea580c;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --accent-border: rgba(249, 115, 22, 0.34);
  --accent-glow: rgba(249, 115, 22, 0.22);
  --profit-card-bg: #14291b;
  --profit-card-border: #214a2f;
  --profit: #4ade80;
  --profit-bright: #4ade80;
  --profit-soft: rgba(74, 222, 128, 0.12);
  --profit-border: rgba(74, 222, 128, 0.30);
  --warn-card-bg: #2c2411;
  --warn-card-border: #52401a;
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --warn-border: rgba(251, 191, 36, 0.30);
  --danger-card-bg: #2d1616;
  --danger-card-border: #5c2626;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger-border: rgba(248, 113, 113, 0.32);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --header-bg: rgba(18, 17, 16, 0.88);
  --btn-dark: #f5f2ed;
  --btn-dark-hover: #ffffff;
  --code-bg: #0c0b0a;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.22s ease, color 0.22s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-muted);
  padding: 2px 6px;
  border-radius: 5px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Minimalist Airy Header (Matches Reference) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.03em;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Calm Underline Top Nav + Clean "More tools" Dropdown */
.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.top-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 64px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
  border-bottom: 2.5px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
  padding: 0;
}

.top-nav-item:hover {
  color: var(--ink);
  text-decoration: none;
}

.top-nav-item.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-dropdown-wrap {
  position: relative;
  height: 64px;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown {
  position: absolute;
  top: 58px;
  left: -16px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 80;
  animation: fadeSlideDown 0.16s ease;
}

.nav-dropdown-wrap:hover .nav-dropdown,
.nav-dropdown-wrap.open .nav-dropdown {
  display: block;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-link {
  display: flex;
  flex-direction: column;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
  transition: background 0.12s;
}

.dropdown-link:hover {
  background: var(--surface-muted);
  text-decoration: none;
}

.dropdown-link strong {
  font-size: 13.5px;
  font-weight: 700;
}

.dropdown-link span {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.currency-select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 7px 28px 7px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2378736a' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.theme-btn {
  width: 35px;
  height: 35px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-tool-bar {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 16px;
  overflow-x: auto;
  gap: 8px;
  white-space: nowrap;
}

.mobile-tool-bar a {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface-muted);
}

.mobile-tool-bar a.active {
  background: var(--accent);
  color: #fff;
}

/* Confident Editorial Hero */
.hero {
  padding: 28px 0 22px;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.038em;
  color: var(--ink);
}

.hero-subtitle {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 17px;
  font-weight: 400;
  max-width: 720px;
}

/* Main 2-Column Studio Grid */
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
}

.sticky-results {
  position: sticky;
  top: 80px;
}

/* Left Top: Editorial Studio Photo Showcase Card */
.showcase-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 222px;
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.showcase-card:hover {
  box-shadow: var(--shadow-md);
}

.showcase-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  transition: opacity 0.35s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.showcase-card:hover .showcase-img {
  transform: scale(1.03);
}

/* Subtle left readability veil so text is always razor-sharp over studio backdrop */
.showcase-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(239, 232, 223, 0.94) 0%, rgba(239, 232, 223, 0.78) 44%, rgba(239, 232, 223, 0.0) 68%);
  pointer-events: none;
}

[data-theme="dark"] .showcase-veil {
  background: linear-gradient(90deg, rgba(27, 25, 23, 0.95) 0%, rgba(27, 25, 23, 0.80) 46%, rgba(27, 25, 23, 0.12) 72%);
}

.showcase-content {
  position: relative;
  z-index: 2;
  padding: 24px 26px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 58%;
}

.showcase-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.showcase-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.5vw, 31px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.showcase-meta {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 14px;
}

.sample-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sample-pill {
  border: 1px solid rgba(20, 19, 17, 0.14);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  color: #1c1b19;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

[data-theme="dark"] .sample-pill {
  background: rgba(20, 19, 17, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
  color: #faf8f5;
}

.sample-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.sample-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Minimalist Dropzone Bar */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 15px 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: 18px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.dropzone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dropzone-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dropzone-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-2px);
  background: var(--surface);
  color: var(--accent);
}

.dropzone-title {
  font-weight: 750;
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 2px;
}

.dropzone-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.demo-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.demo-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.dropzone-status {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  display: none;
}

.dropzone-status.show { display: block; }
.dropzone-status.ok { background: var(--profit-soft); color: var(--profit); border: 1px solid var(--profit-border); }
.dropzone-status.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.dropzone-status.err { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }

/* Print Settings Area */
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Segmented Controls */
.seg-tabs {
  display: inline-flex;
  background: var(--surface);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn:hover { color: var(--ink); }

.seg-btn.active {
  background: var(--accent-soft);
  color: var(--ink);
}

/* Calm Right-Hand Etsy Order Receipt Card (Matches Reference!) */
.receipt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.receipt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.receipt-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.region-mini-select {
  width: auto !important;
  padding: 6px 26px 6px 11px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
}

.selling-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.selling-price-label {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.shipping-sub-toggle {
  display: inline-block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 1px dashed var(--border-strong);
}

.shipping-sub-toggle:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.price-hero-input-wrap {
  width: 176px;
  position: relative;
  display: flex;
  align-items: center;
}

.price-hero-input-wrap .input-prefix {
  left: 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.price-hero-input {
  padding: 10px 14px 10px 30px !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  border-radius: 11px !important;
  font-family: var(--font-sans) !important;
  letter-spacing: -0.02em;
}

/* Signature Sage Green Profit Card */
.profit-hero-box {
  background: var(--profit-card-bg);
  border: 1px solid var(--profit-card-border);
  border-radius: 15px;
  padding: 18px 20px;
  margin-bottom: 18px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.profit-hero-box.is-thin {
  background: var(--warn-card-bg);
  border-color: var(--warn-card-border);
}

.profit-hero-box.is-loss {
  background: var(--danger-card-bg);
  border-color: var(--danger-card-border);
}

.profit-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.profit-giant {
  font-size: clamp(40px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--profit);
  margin: 4px 0 6px;
  transition: color 0.2s ease;
}

.profit-hero-box.is-thin .profit-giant { color: var(--warn); }
.profit-hero-box.is-loss .profit-giant { color: var(--danger); }

.profit-submetrics {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.profit-offsite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 19, 17, 0.10);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

[data-theme="dark"] .profit-offsite-row {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.profit-offsite-val {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Crisp 3-Line Receipt Summary */
.receipt-lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 14.5px;
}

.receipt-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-secondary);
}

.receipt-line strong {
  color: var(--ink);
  font-weight: 650;
}

/* Primary Action Row (Charcoal Save SKU + Outlined Export Quote) */
.receipt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.btn-dark {
  background: var(--btn-dark);
  color: var(--bg);
}

.btn-dark:hover {
  background: var(--btn-dark-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface-muted);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  padding: 6px 10px;
  font-size: 13px;
}

.btn-ghost:hover { background: var(--surface-muted); color: var(--ink); }

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none !important;
}

/* Collapsible Accordions (Left Column & Full-Width Bottom Channel Bar) */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

details.section-fold {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  margin-top: 12px;
  background: var(--surface);
  transition: border-color 0.15s;
}

details.section-fold:hover {
  border-color: var(--border-strong);
}

details.section-fold summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.section-fold summary::-webkit-details-marker { display: none; }

details.section-fold summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 4px;
}

details.section-fold[open] summary::after {
  transform: rotate(-135deg);
}

details.section-fold[open] summary {
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

/* Full-width "Compare sales channels" Expandable Drawer (Matches Reference Bottom Bar!) */
details.compare-drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

details.compare-drawer > summary {
  padding: 16px 22px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}

details.compare-drawer > summary:hover {
  background: var(--surface-subtle);
}

details.compare-drawer > summary::-webkit-details-marker { display: none; }

.drawer-summary-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}

.drawer-chevron {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-secondary);
  border-bottom: 2px solid var(--ink-secondary);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

details.compare-drawer[open] .drawer-chevron {
  transform: rotate(45deg);
}

.compare-drawer-body {
  padding: 6px 22px 22px;
  border-top: 1px solid var(--border);
}

.drawer-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 22px;
  align-items: start;
  margin-top: 14px;
}

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hint { font-weight: 500; color: var(--ink-muted); font-size: 11.5px; }

.input-wrap { position: relative; display: flex; align-items: center; }

.input-prefix, .input-suffix {
  position: absolute;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.input-prefix { left: 11px; }
.input-suffix { right: 11px; }

input[type="number"], input[type="text"], select, textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-elevated);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input.has-prefix { padding-left: 28px; }
input.has-suffix { padding-right: 44px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Tactile Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 6px rgba(232, 93, 26, 0.42);
  transition: transform 0.12s;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }

/* Mode Bar */
.mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 9px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
}

/* Source Badges */
.src-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.src-badge.src-file { background: var(--profit-soft); color: var(--profit); }
.src-badge.src-est { background: var(--info-soft); color: var(--info); }
.src-badge.src-miss { background: var(--danger-soft); color: var(--danger); }

.reality-callout {
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 14px;
}

/* Donut Chart + Breakdown */
.donut-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.donut-wrap {
  position: relative;
  width: 136px;
  height: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-svg { width: 136px; height: 136px; transform: rotate(-90deg); }

.donut-center { position: absolute; text-align: center; pointer-events: none; }
.donut-center-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.donut-center-val { font-size: 18px; font-weight: 800; color: var(--ink); }

.stack-bar { height: 8px; width: 100%; border-radius: 999px; overflow: hidden; display: flex; background: var(--surface-muted); margin-bottom: 10px; }
.stack-seg { height: 100%; transition: width 0.28s ease; }
.seg-mat { background: #e85d1a; }
.seg-purge { background: #f59e0b; }
.seg-elec { background: #3b82f6; }
.seg-wear { background: #8b5cf6; }
.seg-fail { background: #ef4444; }
.seg-labor { background: #146c2e; }
.seg-extra { background: #78736a; }

.breakdown-list { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; font-size: 12.5px; }
.breakdown-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.breakdown-label { display: inline-flex; align-items: center; color: var(--ink-secondary); }
.breakdown-val { font-weight: 700; color: var(--ink); }

/* Batch Box */
.batch-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 13px;
  padding: 14px 16px;
  margin-top: 14px;
}

.batch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.batch-title { font-size: 13px; font-weight: 750; color: var(--accent-hover); }
.batch-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.batch-stat { background: var(--surface); border: 1px solid var(--accent-border); border-radius: 9px; padding: 8px 10px; }
.batch-stat-label { font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.batch-stat-val { font-size: 15px; font-weight: 800; color: var(--ink); }
.batch-stat-val.saved { color: var(--profit); }

/* Channel Matrix Table */
.channel-table-wrap { overflow-x: auto; }
.channel-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.channel-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.channel-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.channel-table tr:last-child td { border-bottom: none; }
.channel-table tr.featured-row { background: var(--accent-soft); }
.channel-name { font-weight: 700; color: var(--ink); }
.channel-fee-badge { display: inline-block; font-size: 10.5px; color: var(--ink-muted); background: var(--surface-muted); padding: 2px 6px; border-radius: 5px; margin-top: 2px; }
.price-pill { font-weight: 800; font-size: 14.5px; color: var(--ink); }
.net-profit { font-weight: 700; color: var(--profit); }
.net-loss { font-weight: 700; color: var(--danger); }

.micro-bar-track { height: 4px; width: 80px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.micro-bar-fill { height: 100%; border-radius: 999px; background: var(--profit-bright); transition: width 0.25s ease; }
.micro-bar-fill.loss { background: var(--danger); }

/* Standalone Subtool KPI Hero */
.kpi-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi-box { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.kpi-box.highlight { background: var(--profit-card-bg); border-color: var(--profit-card-border); }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); font-weight: 700; }
.kpi-value { font-size: 25px; font-weight: 800; margin-top: 4px; color: var(--ink); }
.kpi-value.profit-val { color: var(--profit); }
.kpi-sub { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

/* Editorial & Directory Sections */
.editorial-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
}

.editorial-section h2 { margin: 0 0 12px; font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }
.editorial-section h3 { margin: 18px 0 8px; font-size: 16px; }
.editorial-section p, .editorial-section li { color: var(--ink-secondary); }

.formula-box {
  background: var(--code-bg);
  color: #f3efe9;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.75;
  margin: 14px 0;
}

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface-subtle); }
.faq-item summary { font-weight: 700; cursor: pointer; color: var(--ink); }
.faq-item p { margin: 10px 0 0; font-size: 14px; color: var(--ink-secondary); }

.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.link-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; color: var(--ink);
  transition: all 0.18s ease;
}
.link-card:hover { background: var(--surface); border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.link-card-title { font-weight: 750; font-size: 15px; color: var(--ink); }
.link-card-desc { font-size: 13px; color: var(--ink-muted); margin: 0; }
.link-card-meta { margin-top: auto; padding-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--accent); }

.spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0; }
.spec-table th, .spec-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.spec-table th { background: var(--surface-subtle); font-weight: 700; color: var(--ink-secondary); font-size: 12px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-secondary); }
.pill-accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.pill-profit { background: var(--profit-soft); border-color: var(--profit-border); color: var(--profit); }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 19, 17, 0.56); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal-backdrop.open { display: flex; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); max-width: 740px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); padding: 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.quote-sheet { border: 1px solid #d4ccc0; border-radius: 12px; padding: 24px; background: #ffffff; color: #141311; margin: 16px 0; }
.quote-sheet th { background: #faf8f5; color: #4a4741; }
.quote-sheet td { color: #141311; border-bottom-color: #e6e0d8; }
.quote-sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #141311; padding-bottom: 14px; margin-bottom: 16px; }
.code-block { background: var(--code-bg); color: #faf8f5; font-family: var(--font-mono); font-size: 12.5px; padding: 14px; border-radius: 10px; overflow-x: auto; word-break: break-all; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1c1b19; color: #faf8f5; padding: 11px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.2s; z-index: 120; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 38px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 24px; }
.footer-col h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.footer-col a { color: var(--ink-muted); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-muted); }

/* Responsive */
@media (max-width: 960px) {
  .calc-grid, .drawer-two-col { grid-template-columns: 1fr; }
  .sticky-results { position: static; }
  .main-nav { display: none; }
  .mobile-tool-bar { display: flex; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .form-grid, .kpi-grid, .batch-compare, .breakdown-list, .cards-grid, .footer-grid { grid-template-columns: 1fr; }
  .showcase-content { max-width: 72%; padding: 18px; }
  .selling-price-row { flex-direction: column; align-items: stretch; }
  .price-hero-input-wrap { width: 100%; }
  .editorial-section, .receipt-card { padding: 18px; }
}

@media print {
  body * { visibility: hidden; }
  #quote-printable-sheet, #quote-printable-sheet * { visibility: visible; }
  #quote-printable-sheet { position: fixed; left: 0; top: 0; width: 100%; border: none !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; }
}
