:root {
  color-scheme: light;
  --ink:        #221d1a;
  --muted:      #6d625b;
  --paper:      #fbf7ef;
  --porcelain:  #fffdf8;
  --line:       rgba(54,43,36,.14);
  --gold:       #cfa85b;
  --gold-deep:  #9b7132;
  --wine:       #6b2f3a;
  --teal:       #2d766f;
  --moss:       #597d43;
  --clay:       #b9674f;
  --shadow:     0 24px 70px rgba(37,27,22,.14);
  --radius:     10px;
  --font-body:  "Segoe UI", system-ui, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(207,168,91,.1), transparent 28%),
    linear-gradient(315deg, rgba(45,118,111,.1),  transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

body::before {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; content: "";
  background-image:
    linear-gradient(90deg, rgba(34,29,26,.025) 1px, transparent 1px),
    linear-gradient(rgba(34,29,26,.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.05rem; height: 1.05rem;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto;
}

/* ── TOAST ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(4rem);
  z-index: 100; padding: .7rem 1.4rem;
  background: var(--ink); color: #fff8ea;
  border-radius: 999px; font-size: .86rem; font-weight: 700;
  box-shadow: 0 8px 28px rgba(34,29,26,.28);
  opacity: 0; transition: transform .24s ease, opacity .24s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── HEADER ─────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1rem,4vw,3rem);
  background: rgba(251,247,239,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px);
}
.brand {
  display: inline-flex; align-items: center; gap: .75rem;
  min-width: 0; font-weight: 760;
}
.brand-mark {
  position: relative; display: grid; width: 2.4rem; height: 2.4rem;
  place-items: center;
  border: 1px solid rgba(207,168,91,.5); border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff6d9 0 9%, transparent 10%),
    conic-gradient(from 40deg, var(--wine), var(--gold), var(--teal), var(--wine));
  box-shadow: 0 8px 20px rgba(107,47,58,.18);
}
.brand-mark span {
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--porcelain);
  box-shadow: inset 0 0 0 3px rgba(34,29,26,.08);
}
.brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.site-nav {
  display: flex; align-items: center; gap: clamp(.4rem,2vw,1.3rem);
  color: var(--muted); font-size: .9rem; font-weight: 680;
}
.site-nav a { padding: .4rem .1rem; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a:focus-visible { border-color: var(--gold); color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .42rem .85rem; font-size: .8rem; font-weight: 800;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fffaf1; color: var(--ink);
  transition: box-shadow .15s, border-color .15s;
}
.header-btn:hover { border-color: var(--gold); box-shadow: 0 4px 14px rgba(207,168,91,.2); }
.header-btn.icon-btn { padding: .42rem .6rem; }

/* ── LAYOUT ─────────────────────────────────────────────────────────────────── */
.section-inner {
  width: min(1220px, calc(100% - 2rem)); margin: 0 auto;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 520; }
h1 { max-width: 10ch; margin-bottom: .9rem; font-size: clamp(2.8rem,5vw,4.6rem); line-height: .94; }
h2 { margin-bottom: 0; font-size: clamp(1.9rem,3.5vw,3.2rem); line-height: 1; }
h3 { margin-bottom: .5rem; font-size: 1.05rem; }
.eyebrow {
  margin: 0 0 .55rem;
  color: var(--gold-deep); font-size: .7rem; font-weight: 860;
  letter-spacing: .14em; text-transform: uppercase;
}
.intro-copy, .section-copy {
  max-width: 42rem; color: var(--muted); font-size: .97rem; line-height: 1.7;
}

/* ── CALCULATOR SECTION ──────────────────────────────────────────────────────── */
.calculator-section {
  min-height: calc(100vh - 70px);
  padding: clamp(1.4rem,4vw,4rem) 0 clamp(2.5rem,6vw,5rem);
}
.calculator-grid {
  display: grid;
  grid-template-columns: minmax(290px,.88fr) minmax(320px,1.08fr) minmax(300px,.94fr);
  gap: 1rem; align-items: stretch;
}

/* ── INTRO PANEL ─────────────────────────────────────────────────────────────── */
.intro-panel {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 1.2rem; padding: clamp(1rem,2vw,1.5rem) 0;
}

/* ── ESTIMATE CARD ───────────────────────────────────────────────────────────── */
.estimate-card {
  border: 1px solid rgba(107,47,58,.5);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: linear-gradient(140deg, #5a2530 0%, #221d1a 100%);
  color: #fff8ea;
  box-shadow: 0 20px 60px rgba(107,47,58,.45), 0 4px 16px rgba(0,0,0,.3);
}
.estimate-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.estimate-label { color: rgba(255,248,234,.75); font-size: .78rem; font-weight: 760; letter-spacing: .04em; }
.budget-tier {
  font-size: .68rem; font-weight: 880; letter-spacing: .1em; text-transform: uppercase;
  padding: .22rem .7rem; border-radius: 999px;
  background: rgba(255,248,234,.18); color: #fff8ea;
  border: 1px solid rgba(255,248,234,.2);
}
.budget-tier.tier-luxury    { background: var(--gold); color: var(--ink); border-color: var(--gold-deep); }
.budget-tier.tier-premium   { background: var(--teal); color: #fff; border-color: #1f5550; }
.budget-tier.tier-midrange  { background: var(--clay); color: #fff; border-color: #9a5642; }
.budget-tier.tier-budget    { background: rgba(255,248,234,.18); color: #fff8ea; }

#heroTotal {
  display: block;
  font-family: var(--font-display); font-size: clamp(2.4rem,4.5vw,3.6rem); font-weight: 520; line-height: 1;
  margin-bottom: .35rem;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
#heroMeta { color: rgba(255,248,234,.75); font-size: .82rem; font-weight: 750; }

.estimate-metrics {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: .5rem; margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid rgba(255,248,234,.2);
}
.estimate-metrics div {
  padding: .5rem .4rem;
  background: rgba(255,248,234,.07);
  border-radius: 6px;
  border: 1px solid rgba(255,248,234,.1);
}
.estimate-metrics span { display: block; color: rgba(255,248,234,.65); font-size: .68rem; font-weight: 780; margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .06em; }
.estimate-metrics strong { display: block; color: #ffffff; font-size: .94rem; font-variant-numeric: tabular-nums; font-weight: 760; }
.estimate-note { color: rgba(255,248,234,.45); font-size: .68rem; margin: .6rem 0 0; }

/* ── SMART TIPS ──────────────────────────────────────────────────────────────── */
.quick-tips {
  padding: .95rem; border: 1px dashed rgba(207,168,91,.4); border-radius: var(--radius);
  background: rgba(255,253,248,.74);
}
.quick-tips p:last-child { margin-bottom: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; }

/* ── PANELS (estimate-card excluded — has own dark style above) ───────────────── */
.calculator-panel,
.visual-panel,
.breakdown-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,253,248,.9); box-shadow: var(--shadow);
}
.calculator-panel, .visual-panel {
  display: flex; flex-direction: column; min-width: 0;
  padding: clamp(.95rem,2vw,1.3rem);
}
.panel-heading, .section-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.panel-heading h2, .section-heading h2 { font-size: clamp(1.6rem,2.8vw,2.2rem); }
.icon-button {
  display: inline-grid; width: 2.5rem; height: 2.5rem;
  place-items: center; flex: 0 0 auto;
  color: var(--ink); border: 1px solid var(--line); border-radius: 50%; background: #fffaf1;
}
.icon-button:hover { color: var(--wine); border-color: rgba(207,168,91,.72); box-shadow: 0 6px 18px rgba(207,168,91,.22); }

/* ── FORM ────────────────────────────────────────────────────────────────────── */
.calculator-form { display: grid; gap: .9rem; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: .6rem; color: var(--muted); font-size: .76rem; font-weight: 820; }

/* ── MATERIAL SELECTOR ───────────────────────────────────────────────────────── */
.material-selector {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .4rem;
}
.material-option {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.85rem; padding: .42rem;
  color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius);
  background: #fffaf1; font-size: .74rem; font-weight: 820;
  transition: all .14s ease;
}
.material-option.is-active {
  color: var(--ink); border-color: rgba(207,168,91,.84);
  background: linear-gradient(180deg,#fffdf7,#f5ead5);
  box-shadow: inset 0 0 0 1px rgba(207,168,91,.22), 0 4px 12px rgba(207,168,91,.18);
}

/* ── SWATCHES ────────────────────────────────────────────────────────────────── */
.swatch, .compare-swatch, .large-swatch {
  border: 1px solid rgba(34,29,26,.16); border-radius: 50%;
}
.swatch { width: .95rem; height: .95rem; flex: 0 0 auto; }
.large-swatch { display: block; height: 7rem; border-radius: var(--radius); }
.compare-swatch { width: 100%; height: 4.5rem; border-radius: var(--radius) var(--radius) 0 0; }

.wool    { background: radial-gradient(circle at 30% 20%,rgba(255,248,220,.9),transparent 16%), repeating-linear-gradient(35deg,#8f5f4b 0 5px,#b98962 5px 10px,#f0d38a 10px 12px); }
.nylon   { background: linear-gradient(135deg,rgba(255,255,255,.42),transparent 35%), repeating-linear-gradient(90deg,#394f61 0 6px,#55758a 6px 12px,#c6d2d0 12px 14px); }
.polyester { background: linear-gradient(135deg,#e8c4b8,#d4a0a8 40%,#b87f8e); }
.sisal   { background: repeating-linear-gradient(45deg,#b9925e 0 4px,#e3cc96 4px 8px,#8c7448 8px 10px),#d5ba7c; }
.velvet  { background: radial-gradient(circle at 30% 20%,rgba(255,210,214,.3),transparent 20%),linear-gradient(135deg,#39192b,#6b2f3a 50%,#b9674f); }
.berber  { background: repeating-linear-gradient(90deg,#c4b49a 0 3px,#e8dcc8 3px 8px,#a89070 8px 11px),#d4c4aa; }
.frieze  { background: radial-gradient(ellipse at 30% 40%,#a0c4a8,transparent 50%),repeating-linear-gradient(110deg,#587060 0 4px,#8aac92 4px 8px); }
.olefin  { background: linear-gradient(135deg,#8fa0b8,#6080a0 50%,#405070); }

/* ── SELECT CONTROLS ─────────────────────────────────────────────────────────── */
.select-control {
  display: grid; gap: .5rem;
}
.ctrl-label { color: var(--muted); font-size: .78rem; font-weight: 820; }
select {
  width: 100%; min-height: 2.4rem;
  padding: .44rem .6rem; color: var(--ink);
  border: 1px solid rgba(54,43,36,.18); border-radius: var(--radius);
  background: var(--porcelain); font-weight: 760;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d625b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 1rem;
  padding-right: 2rem;
}

/* ── INPUT GRID ──────────────────────────────────────────────────────────────── */
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

.metric-control, .rate-grid label, .stepper-row, .select-control {
  display: grid; gap: .5rem; min-width: 0;
  padding: .82rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: rgba(255,250,241,.74);
}
.metric-control.compact { align-content: start; }

.label-row {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  color: var(--muted); font-size: .78rem; font-weight: 820;
}
output { color: var(--wine); font-variant-numeric: tabular-nums; font-weight: 800; }

input[type="number"] {
  width: 100%; min-height: 2.38rem;
  padding: .44rem .6rem; color: var(--ink);
  border: 1px solid rgba(54,43,36,.18); border-radius: var(--radius);
  background: var(--porcelain); font-weight: 760;
}
input[type="number"]:focus, input[type="range"]:focus-visible,
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 3px solid rgba(45,118,111,.28); outline-offset: 2px;
}
input[type="range"] { width: 100%; accent-color: var(--wine); }

/* ── RATE GRID ───────────────────────────────────────────────────────────────── */
.rate-grid {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .6rem;
}
.rate-grid label { font-size: .78rem; }
.rate-grid label > span { color: var(--muted); font-weight: 820; display: block; margin-bottom: .4rem; }

/* ── SERVICE GRID ────────────────────────────────────────────────────────────── */
.service-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
.toggle-row {
  display: flex; align-items: center; gap: .65rem; min-width: 0;
  padding: .74rem .82rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,250,241,.74); font-size: .8rem; font-weight: 800; cursor: pointer;
}
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui {
  position: relative; width: 2.35rem; height: 1.28rem;
  border-radius: 999px; background: rgba(34,29,26,.18);
  flex: 0 0 auto; transition: background .16s ease;
}
.toggle-ui::after {
  position: absolute; top: .17rem; left: .19rem;
  width: .94rem; height: .94rem; content: "";
  border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(34,29,26,.25); transition: transform .16s ease;
}
.toggle-row input:checked + .toggle-ui { background: var(--teal); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(.98rem); }

/* ── DISCOUNT ────────────────────────────────────────────────────────────────── */
.discount-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .82rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: rgba(255,250,241,.74);
}
.discount-label { display: grid; gap: .4rem; flex: 1; font-size: .78rem; font-weight: 820; color: var(--muted); }
.discount-input-wrap { position: relative; }
.discount-input-wrap input { padding-right: 1.8rem; width: 6rem; }
.discount-unit {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .82rem;
}
.discount-saved { color: var(--moss); font-size: .82rem; font-weight: 800; }

/* ── VISUAL PANEL ────────────────────────────────────────────────────────────── */
.visual-panel {
  background: linear-gradient(160deg,rgba(255,253,248,.92),rgba(246,235,213,.88)),var(--porcelain);
}
.visual-heading { align-items: center; }
.diagram-chip {
  padding: .46rem .68rem; color: #fff8ea; border-radius: 999px;
  background: var(--wine); font-size: .72rem; font-weight: 850; white-space: nowrap;
}

.room-stage {
  position: relative; display: grid; min-height: 310px;
  place-items: center; overflow: hidden;
  border: 1px solid rgba(54,43,36,.12); border-radius: var(--radius);
  background: radial-gradient(circle at 20% 10%,rgba(207,168,91,.22),transparent 30%),
              radial-gradient(circle at 82% 72%,rgba(45,118,111,.16),transparent 32%),
              #fffaf1;
  flex: 1;
}
#roomSvg { display: block; width: 100%; max-width: 560px; height: auto; }
.svg-backdrop { fill: rgba(255,253,248,.6); stroke: rgba(54,43,36,.08); }
#roomRect { fill: url(#wovenPattern); stroke: rgba(255,248,234,.94); stroke-width: 3; }
.roll-visual path { fill: url(#floorGlow); opacity: .34; }
.roll-visual ellipse:first-of-type { fill: #f8efe1; stroke: rgba(107,47,58,.24); }
.roll-visual ellipse:last-of-type  { fill: rgba(107,47,58,.15); stroke: rgba(107,47,58,.25); }
.seam-line { stroke: rgba(255,248,234,.9); stroke-width: 2; stroke-dasharray: 6 6; }
.waste-strip { fill: rgba(255,248,234,.32); stroke: rgba(255,248,234,.5); stroke-width: 1.5; }
.nap-arrow { fill: none; stroke: rgba(255,248,234,.76); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dimension-layer line { stroke: rgba(34,29,26,.32); stroke-width: 1.4; stroke-dasharray: 5 5; }
.dimension-layer text, .diagram-labels text { fill: rgba(34,29,26,.74); font-size: 13px; font-weight: 800; }
.diagram-labels text { fill: #fff8ea; paint-order: stroke; stroke: rgba(34,29,26,.4); stroke-width: 3px; }

.diagram-stats {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr));
  gap: .6rem; margin-top: .7rem;
}
.diagram-stats div {
  min-width: 0; padding: .76rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,253,248,.74);
}
.diagram-stats span, .diagram-stats strong { display: block; }
.diagram-stats span { color: var(--muted); font-size: .7rem; font-weight: 820; }
.diagram-stats strong { margin-top: .2rem; color: var(--ink); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── EFFICIENCY METER ────────────────────────────────────────────────────────── */
.efficiency-meter { margin-top: .7rem; }
.eff-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .76rem; font-weight: 820; color: var(--muted); margin-bottom: .38rem;
}
.eff-label strong { color: var(--ink); font-size: .88rem; }
.eff-bar {
  height: .55rem; background: var(--line); border-radius: 999px; overflow: hidden;
}
.eff-fill { height: 100%; border-radius: 999px; transition: width .3s ease, background .3s ease; }

/* ── MULTI-ROOM ───────────────────────────────────────────────────────────────── */
.rooms-section { padding: clamp(2.5rem,5vw,4.5rem) 0; background: #fffdf8; }
.rooms-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem;
}
.add-room-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.3rem; color: #fff8ea; font-weight: 850; font-size: .88rem;
  border: none; border-radius: var(--radius); background: var(--teal);
  box-shadow: 0 6px 18px rgba(45,118,111,.28);
}
.add-room-btn:hover { background: #256258; }

.rooms-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: .9rem;
}
.room-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--porcelain); padding: 1rem; display: grid; gap: .7rem;
  box-shadow: 0 8px 24px rgba(34,29,26,.08);
}
.room-card-header { display: flex; align-items: center; gap: .5rem; }
.room-name-input {
  flex: 1; border: none; background: none; font-weight: 760; font-size: .96rem;
  color: var(--ink); padding: 0;
}
.room-name-input:focus { outline: none; border-bottom: 1px solid var(--gold); }
.room-delete {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted);
}
.room-delete:hover { color: var(--wine); border-color: var(--wine); }
.room-dims { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.room-dims label { display: grid; gap: .3rem; }
.room-dims label > span { font-size: .72rem; color: var(--muted); font-weight: 820; }
.room-card-stats { display: flex; align-items: center; justify-content: space-between; }
.room-card-stats span { color: var(--muted); font-size: .82rem; }
.room-card-stats strong { color: var(--ink); font-weight: 800; }

.rooms-total-bar {
  display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem;
  padding: 1rem 1.3rem; border-radius: var(--radius);
  background: var(--ink); color: #fff8ea;
}
.rooms-total-bar span { color: rgba(255,248,234,.7); font-size: .88rem; }
.rooms-total-bar strong { font-family: var(--font-display); font-size: 1.5rem; margin-left: auto; }

/* ── COMPARE ──────────────────────────────────────────────────────────────────── */
.compare-section { padding: clamp(2.5rem,5vw,4.5rem) 0; }
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: .9rem; margin-top: 1.4rem;
}
.compare-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--porcelain); overflow: hidden;
  box-shadow: 0 8px 24px rgba(34,29,26,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.compare-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(34,29,26,.14); }
.compare-card.is-selected {
  border-color: var(--gold); box-shadow: 0 12px 36px rgba(207,168,91,.24);
}
.compare-body { padding: .9rem; }
.compare-body h3 { font-size: .9rem; margin-bottom: .3rem; }
.compare-price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 520; color: var(--ink); }
.compare-per { color: var(--muted); font-size: .72rem; font-weight: 760; margin-bottom: .7rem; }
.compare-ratings { display: grid; gap: .32rem; margin-bottom: .75rem; }
.compare-ratings div {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; color: var(--muted); font-weight: 760;
}
.stars { color: var(--gold-deep); letter-spacing: 1px; }
.compare-pick {
  width: 100%; padding: .6rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--porcelain); color: var(--ink);
  font-size: .8rem; font-weight: 850; transition: all .15s ease;
}
.compare-pick:hover { background: var(--ink); color: #fff8ea; border-color: transparent; }
.compare-pick.active { background: var(--wine); color: #fff8ea; border-color: transparent; }

/* ── SUMMARY BAND ────────────────────────────────────────────────────────────── */
.summary-band {
  padding: clamp(3rem,6vw,5.6rem) 0;
  background: linear-gradient(180deg,rgba(34,29,26,.96),rgba(70,47,42,.96));
  color: #fff8ea;
}
.summary-grid {
  display: grid;
  grid-template-columns: minmax(220px,.65fr) minmax(300px,1.2fr) minmax(260px,.8fr);
  gap: 1rem; align-items: stretch;
}
.summary-band .eyebrow { color: #f3d88d; }
.summary-band .section-copy { color: rgba(255,248,234,.72); }

.action-cluster { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.outline-action {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .64rem 1.1rem; border-radius: var(--radius);
  border: 1px solid rgba(255,248,234,.3); background: rgba(255,248,234,.08);
  color: #fff8ea; font-size: .82rem; font-weight: 820;
  transition: background .15s;
}
.outline-action:hover { background: rgba(255,248,234,.16); }

/* ── COST RIVER ──────────────────────────────────────────────────────────────── */
.cost-river {
  display: flex; min-height: 15rem; overflow: hidden;
  border: 1px solid rgba(255,248,234,.16); border-radius: var(--radius);
  background: rgba(255,248,234,.07);
}
.cost-stream {
  position: relative; display: flex; min-width: 4.5rem;
  flex: 1 1 25%; flex-direction: column; justify-content: flex-end;
  gap: .3rem; padding: .9rem .7rem; overflow: hidden; color: #fff8ea;
  transition: flex-basis .22s ease;
}
.cost-stream::before { position: absolute; inset: 0; content: ""; opacity: .92; }
.cost-stream.carpet::before  { background: linear-gradient(180deg,#cfa85b,#8f5f4b); }
.cost-stream.padding::before { background: linear-gradient(180deg,#77aaa5,#2d766f); }
.cost-stream.install::before { background: linear-gradient(180deg,#d18f77,#b9674f); }
.cost-stream.services::before{ background: linear-gradient(180deg,#a6707b,#6b2f3a); }
.cost-stream span, .cost-stream strong {
  position: relative; z-index: 1; overflow-wrap: anywhere;
  text-shadow: 0 1px 10px rgba(34,29,26,.25);
}
.cost-stream span { font-size: .7rem; font-weight: 860; text-transform: uppercase; }
.cost-stream strong { font-family: var(--font-display); font-size: clamp(1.2rem,2.2vw,2rem); font-weight: 520; }

/* ── BREAKDOWN CARD ──────────────────────────────────────────────────────────── */
.breakdown-card {
  display: grid; align-content: center; gap: 0;
  padding: 1rem; background: rgba(255,248,234,.08); box-shadow: none;
}
.breakdown-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .78rem 0; color: rgba(255,248,234,.74);
  border-bottom: 1px solid rgba(255,248,234,.12); font-size: .88rem;
}
.breakdown-row strong { color: #fff8ea; font-variant-numeric: tabular-nums; }
.breakdown-row.sub { padding: .92rem 0; }
.breakdown-row.sub strong { font-weight: 880; }
.breakdown-row.total { color: #fff8ea; border-bottom: none; font-size: 1.02rem; }
.breakdown-row.total strong {
  color: #f3d88d; font-family: var(--font-display);
  font-size: 2.1rem; font-weight: 520;
}
.savings { color: #7dd1a0; }

/* ── MATERIAL CARDS ──────────────────────────────────────────────────────────── */
.materials-section { padding: clamp(2.5rem,5vw,4.5rem) 0; background: #fffdf8; }
.material-cards {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 1rem; margin-top: 1.4rem;
}
.material-card {
  display: grid; min-width: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--porcelain);
  box-shadow: 0 10px 30px rgba(34,29,26,.08); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.material-card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(34,29,26,.14); }
.material-card.is-selected { border-color: rgba(207,168,91,.9); box-shadow: 0 18px 48px rgba(207,168,91,.22); }
.mat-card-body { padding: .9rem; display: grid; gap: .55rem; }
.mat-pros { list-style: none; padding: 0; margin: 0; display: grid; gap: .24rem; }
.mat-pros li { font-size: .8rem; color: var(--muted); }
.mat-pros li::before { content: "✓ "; color: var(--teal); font-weight: 880; }
.material-card p { min-height: 3.5rem; color: var(--muted); font-size: .88rem; line-height: 1.5; margin: 0; }
.material-card button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.6rem; padding: .68rem .9rem;
  border-radius: var(--radius); font-weight: 860;
  color: #fff8ea; border: 1px solid transparent; background: var(--ink);
}
.material-card.is-selected button { background: var(--wine); }
.material-card button:hover { background: var(--wine); }

/* ── PROCESS ─────────────────────────────────────────────────────────────────── */
.process-section {
  padding: clamp(3rem,6vw,5.6rem) 0;
  background:
    linear-gradient(135deg,rgba(45,118,111,.38),transparent 38%),
    linear-gradient(180deg,rgba(34,29,26,.96),rgba(70,47,42,.98));
  color: #fff8ea;
}
.process-section .eyebrow { color: #f3d88d; }
.process-section p { color: rgba(255,248,234,.72); margin-bottom: 0; }
.process-grid { display: grid; grid-template-columns: minmax(220px,.68fr) minmax(320px,1.32fr); gap: 1.5rem; }
.process-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .9rem; }
.process-steps article {
  padding: 1rem; border: 1px solid rgba(255,248,234,.15); border-radius: var(--radius);
  background: rgba(255,248,234,.07);
}
.step-icon {
  display: inline-grid; width: 2.4rem; height: 2.4rem; margin-bottom: 1.1rem;
  place-items: center; color: var(--ink); border-radius: 50%; background: #f3d88d;
}

/* ── QUOTE ───────────────────────────────────────────────────────────────────── */
.quote-section { padding: clamp(2rem,4vw,3.5rem) 0; background: #fffdf8; }
.quote-grid {
  display: grid; grid-template-columns: minmax(240px,1fr) auto;
  gap: 1rem; align-items: center; padding: clamp(1.2rem,2.5vw,1.8rem);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.quote-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: flex-end; }
.primary-action {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.2rem; min-height: 2.8rem; border-radius: var(--radius);
  color: #fff8ea; background: var(--wine); font-weight: 860;
}
.secondary-action {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.2rem; min-height: 2.8rem; border-radius: var(--radius);
  color: var(--ink); border: 1px solid var(--line); background: transparent; font-weight: 860;
}
.text-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--wine); font-size: .86rem; font-weight: 860;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────────── */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.2rem clamp(1rem,4vw,3rem);
  color: rgba(255,248,234,.7); background: var(--ink); font-size: .83rem;
}

/* ── PRINT ───────────────────────────────────────────────────────────────────── */
.print-only { display: none; }
@media print {
  body > *:not(.print-only) { display: none !important; }
  .print-only { display: block; padding: 2rem; }
  .print-header { margin-bottom: 1.5rem; }
  .print-header h1 { font-size: 1.5rem; margin-bottom: .3rem; }
  .print-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
  .print-table th, .print-table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid #ddd; }
  .print-table th { color: #666; font-weight: 600; width: 45%; }
  .print-total { font-weight: 800; background: #f5f5f5; font-size: 1.1rem; }
  .print-note { margin-top: 1.5rem; color: #888; font-size: .8rem; }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 1160px) {
  .calculator-grid, .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .intro-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(240px,1fr) minmax(240px,.7fr) minmax(240px,.55fr);
    align-items: end; min-height: auto;
  }
  .summary-grid > div:first-child { grid-column: 1 / -1; }
  .material-cards { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .process-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 860px) {
  .material-selector { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .rate-grid { grid-template-columns: 1fr 1fr; }
  .material-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compare-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .site-header { position: static; align-items: flex-start; flex-direction: column; gap: .7rem; }
  .site-nav { width: 100%; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .2rem; overflow-x: auto; }
  .site-nav a { text-align: center; font-size: .8rem; }
  .header-actions { align-self: flex-end; }
  .calculator-grid, .summary-grid, .process-grid, .quote-grid { grid-template-columns: 1fr; }
  .intro-panel { grid-column: auto; grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.8rem,12vw,3.8rem); }
  .input-grid, .two-col, .rate-grid, .service-grid, .diagram-stats { grid-template-columns: 1fr 1fr; }
  .material-selector { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .cost-river { flex-direction: column; min-height: 18rem; }
  .cost-stream { min-height: 4.5rem; }
  .rooms-header { flex-direction: column; align-items: flex-start; }
  .compare-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .material-cards { grid-template-columns: 1fr 1fr; }
  .process-steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .section-inner { width: min(100% - 1rem, 1220px); }
  .calculator-panel, .visual-panel { padding: .85rem; }
  .input-grid, .two-col, .diagram-stats { grid-template-columns: 1fr; }
  .rate-grid { grid-template-columns: 1fr; }
  .material-selector { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compare-grid { grid-template-columns: 1fr; }
  .material-cards { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr; }
  .primary-action, .secondary-action { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   SHAPE CALCULATOR + UNIT DROPDOWNS
═══════════════════════════════════════════════════════════════════════════════ */

/* Shape fieldset */
.shape-fieldset {
  min-width: 0; margin: 0; padding: 0; border: 0;
}
.shape-fieldset legend {
  display: block; width: 100%; margin-bottom: .65rem;
  color: var(--muted); font-size: .76rem; font-weight: 820;
}

/* Shape selector row */
.shape-select-row {
  display: grid; gap: .4rem;
  padding: .82rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: rgba(255,250,241,.74);
  margin-bottom: .65rem;
}
.shape-select-label {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: .78rem; font-weight: 820;
}
.info-dots {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; line-height: 1;
  padding: 0 .2rem;
}
.info-dots:hover { color: var(--wine); }

/* Dimension input with unit dropdown */
.dim-field {
  display: grid; gap: .4rem;
  padding: .82rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: rgba(255,250,241,.74);
  margin-bottom: .65rem;
}
.dim-field-label {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: .78rem; font-weight: 820;
}
.dim-input-row {
  display: flex; gap: 0; border: 1px solid rgba(54,43,36,.18); border-radius: var(--radius);
  overflow: hidden; background: var(--porcelain);
}
.dim-input-row input {
  flex: 1; min-height: 2.38rem; padding: .44rem .6rem;
  border: none; border-right: 1px solid rgba(54,43,36,.18);
  border-radius: 0; background: transparent;
  color: var(--ink); font-weight: 760; font-size: .95rem;
}
.dim-input-row input:focus { outline: none; background: rgba(255,253,248,.9); }
.dim-input-row input:read-only { background: rgba(207,168,91,.06); color: var(--ink); }
.unit-dropdown {
  min-height: 2.38rem; padding: .4rem .3rem .4rem .5rem;
  border: none; border-radius: 0;
  background: rgba(255,250,241,.9); color: var(--muted);
  font-size: .76rem; font-weight: 760;
  cursor: pointer; white-space: nowrap;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d625b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .3rem center;
  padding-right: 1.4rem; min-width: 3.6rem;
}
.unit-dropdown:focus { outline: 2px solid rgba(45,118,111,.3); }

/* Area field (read-only output) */
.area-display-field {
  display: grid; gap: .4rem;
  padding: .82rem; border: 1px dashed rgba(207,168,91,.5);
  border-radius: var(--radius); background: rgba(207,168,91,.06);
  margin-bottom: .65rem;
}
.area-display-field .dim-field-label { color: var(--gold-deep); }
.area-display-field input { background: transparent; font-weight: 800; color: var(--wine); }
.area-display-field .unit-dropdown { background: rgba(207,168,91,.12); color: var(--gold-deep); font-weight: 800; }

/* Apply button */
.apply-area-btn {
  width: 100%; padding: .64rem 1rem;
  background: rgba(45,118,111,.12); color: var(--teal);
  border: 1px dashed rgba(45,118,111,.4); border-radius: var(--radius);
  font-size: .82rem; font-weight: 840; cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-bottom: .3rem;
}
.apply-area-btn:hover { background: rgba(45,118,111,.2); border-style: solid; }
.apply-area-btn:active { transform: scale(.99); }

/* Shape section separator */
.shape-section-divider {
  display: flex; align-items: center; gap: .6rem;
  margin: .4rem 0 .7rem; color: var(--muted); font-size: .7rem; font-weight: 820;
  text-transform: uppercase; letter-spacing: .08em;
}
.shape-section-divider::before, .shape-section-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ══════════════════════════════════════════════════════════════════════════════
   CURRENCY SELECTOR
═══════════════════════════════════════════════════════════════════════════════ */
.currency-selector-row {
  display: grid; gap: .4rem;
  padding: .82rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: rgba(255,250,241,.74);
  margin-bottom: .65rem;
}
.currency-selector-row label {
  color: var(--muted); font-size: .78rem; font-weight: 820;
}
.currency-flag {
  margin-right: .3rem;
}
.price-per-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .82rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: rgba(255,250,241,.74);
  font-size: .78rem; color: var(--muted); font-weight: 820;
}
.price-per-row .dim-input-row { flex: 1; }
.per-divider { font-weight: 880; color: var(--muted); flex: 0 0 auto; }

/* ══════════════════════════════════════════════════════════════════════════════
   TABLE OF CONTENTS + CONTENT SECTIONS
═══════════════════════════════════════════════════════════════════════════════ */
.toc-section {
  padding: clamp(2rem,4vw,3.5rem) 0;
  background: #fffdf8;
  border-top: 1px solid rgba(54,43,36,.1);
}
.toc-inner { width: min(860px,calc(100% - 2rem)); margin: 0 auto; }
.toc-box {
  padding: 1.4rem 1.6rem; border: 1px solid rgba(54,43,36,.14);
  border-radius: 10px; background: #fff;
  box-shadow: 0 4px 20px rgba(34,29,26,.06);
  margin-bottom: 2.5rem;
}
.toc-box h3 {
  font-family: Georgia,serif; font-weight: 520;
  font-size: 1.15rem; margin-bottom: .9rem;
  color: var(--ink);
}
.toc-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .4rem;
}
.toc-list li::before { content: "○  "; color: var(--gold-deep); font-size: .8rem; }
.toc-list a {
  color: var(--teal); font-size: .92rem; font-weight: 760;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(45,118,111,.3);
}
.toc-list a:hover { color: var(--wine); text-decoration-color: var(--wine); }

/* Content sections */
.content-section {
  padding: clamp(2rem,4vw,3.5rem) 0;
  border-top: 1px solid rgba(54,43,36,.1);
}
.content-section:nth-child(even) { background: rgba(207,168,91,.04); }
.content-inner { width: min(860px,calc(100% - 2rem)); margin: 0 auto; }
.content-inner h2 {
  font-family: Georgia,serif; font-weight: 520;
  font-size: clamp(1.5rem,3vw,2rem);
  margin-bottom: 1rem; color: var(--ink);
  scroll-margin-top: 5rem;
}
.content-inner h3 { font-size: 1.05rem; margin-top: 1.4rem; margin-bottom: .6rem; color: var(--ink); }
.content-inner p { color: var(--muted); line-height: 1.8; font-size: .96rem; margin-bottom: .9rem; }
.content-inner ul, .content-inner ol {
  color: var(--muted); padding-left: 1.3rem; margin-bottom: .9rem; line-height: 1.8;
}
.content-inner li { margin-bottom: .35rem; font-size: .96rem; }
.content-inner strong { color: var(--ink); }
.content-inner a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }

.formula-box {
  padding: 1rem 1.3rem; border-radius: 8px;
  background: rgba(45,118,111,.07); border: 1px solid rgba(45,118,111,.2);
  font-family: "Courier New", monospace; font-size: .9rem; color: var(--ink);
  margin: 1rem 0; line-height: 1.7;
}
.formula-box strong { color: var(--teal); }

.example-calc {
  padding: 1.1rem 1.3rem; border-radius: 8px;
  background: rgba(207,168,91,.08); border: 1px solid rgba(207,168,91,.3);
  margin: 1rem 0;
}
.example-calc h4 { margin: 0 0 .6rem; font-size: .88rem; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .08em; }
.example-calc p { margin: 0; font-size: .9rem; color: var(--ink); }

.content-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.3rem; margin-top: .5rem;
  border-radius: 8px; background: var(--wine);
  color: #fff8ea; font-weight: 860; font-size: .88rem;
  text-decoration: none; transition: background .15s;
}
.content-cta:hover { background: #842039; }

.material-quick-table {
  width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .88rem;
}
.material-quick-table th {
  background: linear-gradient(180deg,rgba(107,47,58,.9),rgba(34,29,26,.9));
  color: #fff8ea; text-align: left; padding: .6rem .8rem;
  font-weight: 760; font-size: .78rem;
}
.material-quick-table td {
  padding: .58rem .8rem; border-bottom: 1px solid rgba(54,43,36,.1); color: var(--muted);
}
.material-quick-table tr:nth-child(even) td { background: rgba(207,168,91,.04); }
.material-quick-table td:first-child { font-weight: 760; color: var(--ink); }

@media (max-width: 560px) {
  .dim-field, .area-display-field { padding: .65rem; }
  .material-quick-table { font-size: .8rem; }
  .material-quick-table th, .material-quick-table td { padding: .5rem .5rem; }
}
