:root {
  --ink: #191b17;
  --muted: #687067;
  --paper: #f4f1e9;
  --card: #fffef9;
  --line: #d9ddd3;
  --brand: #171915;
  --sage: #3d5b49;
  --sage-soft: #e7eee8;
  --gold: #b99050;
  --danger: #9e2e24;
  --shadow: 0 18px 50px rgba(27, 36, 29, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 12px max(20px, calc((100vw - 1240px) / 2)); color: #fff; background: rgba(23,25,21,.96); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.65); color: #fff; font-family: Georgia, serif; font-size: 23px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-link { color: #fff; font-size: 14px; font-weight: 750; text-underline-offset: 4px; }
.unit-switch { display: flex; padding: 3px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; }
.unit-switch button { min-width: 42px; padding: 7px 10px; border: 0; border-radius: 999px; color: rgba(255,255,255,.7); background: transparent; cursor: pointer; font-weight: 800; }
.unit-switch button[aria-pressed="true"] { color: var(--ink); background: #fff; }

main { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: clamp(54px, 8vw, 105px) 0 52px; max-width: 920px; }
.eyebrow { margin: 0 0 9px; color: var(--gold); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.035em; }
h1 { max-width: 880px; margin: 0; font-size: clamp(38px, 6.5vw, 76px); line-height: .99; }
h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); }
.hero-copy { max-width: 690px; margin: 24px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }

.section-heading, .preview-heading, .card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading > div, .preview-heading > div, .panel-title { display: flex; align-items: center; gap: 13px; }
.section-heading > p { color: var(--muted); font-size: 14px; }
.step { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--sage); font-size: 13px; font-weight: 900; }

.mode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 20px; }
.mode-card { position: relative; min-height: 180px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; text-align: left; color: var(--ink); background: var(--card); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mode-card[aria-pressed="true"] { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(61,91,73,.12); }
.mode-card[aria-pressed="true"]::after { content: "Selected"; position: absolute; top: 12px; right: 12px; padding: 4px 8px; border-radius: 999px; color: #fff; background: var(--sage); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.mode-icon { display: grid; place-items: center; height: 86px; margin-bottom: 14px; border-radius: 10px; background: #ebe7dc; overflow: hidden; }
.mode-icon span { display: block; width: 78%; height: 62%; border: 5px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.mode-card[data-mode="french-step-corner"] .mode-icon span { width: 74%; height: 60%; border-width: 4px; box-shadow: inset 0 0 0 8px #ebe7dc, inset 0 0 0 12px #fff, 0 1px 2px rgba(0,0,0,.12); }
.mode-card[data-mode="board-batten"] .mode-icon span { width: 5px; border: 0; background: #fff; box-shadow: -38px 0 #fff, 38px 0 #fff; }
.mode-card[data-mode="accent-grid"] .mode-icon span { background: linear-gradient(90deg, transparent 31%, #fff 31% 36%, transparent 36% 64%, #fff 64% 69%, transparent 69%), linear-gradient(transparent 46%, #fff 46% 54%, transparent 54%); border: 0; }
.mode-card[data-mode="wainscoting"] .mode-icon span { height: 38%; margin-top: 26px; border-width: 4px; }
.mode-card strong { display: block; font-size: 15px; }
.mode-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.35; }

.workspace { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.65fr); margin-top: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.control-panel { padding: 26px; border-right: 1px solid var(--line); }
.panel-title { align-items: flex-start; }
.panel-title p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 12px; margin-top: 25px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field label { color: #3e483f; font-size: 12px; font-weight: 800; }
.input-wrap { position: relative; }
.input-wrap input[type="number"] { width: 100%; padding: 12px 43px 12px 12px; border: 1px solid #cfd4cb; border-radius: 10px; color: var(--ink); background: #fff; outline: none; font-weight: 750; }
.input-wrap input:focus, .lead-panel input:focus, .lead-panel textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(61,91,73,.12); }
.input-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-weight: 800; }
.checkbox-field { display: flex; align-items: center; gap: 9px; min-height: 45px; padding: 10px 0; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--sage); }
.checkbox-field label { cursor: pointer; }
.form-error { margin-top: 14px; padding: 11px 13px; border-radius: 9px; color: var(--danger); background: #fff0ee; font-size: 13px; line-height: 1.4; }
.control-actions { display: flex; gap: 8px; margin-top: 20px; }
.save-status { min-height: 18px; margin: 8px 0 0; color: var(--sage); font-size: 12px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 15px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 850; }
.button-primary { color: #fff; background: var(--brand); }
.button-primary:hover { background: #2d312a; }
.button-secondary { color: var(--sage); border-color: #aebcaf; background: var(--sage-soft); }
.button-ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.full { width: 100%; margin-top: 9px; }
.text-button { padding: 0; border: 0; color: var(--sage); background: transparent; cursor: pointer; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }

.preview-panel { min-width: 0; padding: 26px; background: linear-gradient(145deg, #f4f6f0, #e9eee7); }
.live-badge { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: var(--sage); background: #fff; font-size: 11px; font-weight: 850; }
.live-badge span { width: 7px; height: 7px; border-radius: 50%; background: #55a469; box-shadow: 0 0 0 3px rgba(85,164,105,.15); }
.wall-stage { display: grid; place-items: center; min-height: 390px; margin-top: 20px; padding: 28px; border-radius: 15px; background: #ccd3c9; overflow: hidden; }
.wall-stage svg { width: 100%; max-height: 390px; filter: drop-shadow(0 18px 15px rgba(29,37,31,.17)); }
.svg-wall { fill: #dfd7c8; stroke: rgba(30,35,31,.28); stroke-width: .35; }
.svg-trim { fill: #fffdf5; filter: drop-shadow(.5px 1px .5px rgba(0,0,0,.2)); }
.svg-frame { fill: none; stroke: #fffdf5; stroke-width: 2.4; vector-effect: non-scaling-stroke; filter: drop-shadow(.6px 1px .5px rgba(0,0,0,.28)); }
.svg-wainscot-fill { fill: rgba(255,255,255,.13); }
.preview-note { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 18px; }
.metric { padding: 13px; border: 1px solid rgba(61,91,73,.15); border-radius: 11px; background: rgba(255,255,255,.78); }
.metric span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 5px; color: var(--sage); font-family: Georgia, serif; font-size: 21px; font-weight: 500; }

.output-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; margin: 20px 0; }
.output-card { padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 12px 35px rgba(31,39,33,.06); }
.table-wrap { margin-top: 17px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
th:nth-child(2), td:nth-child(2) { text-align: center; }
th:last-child, td:last-child { text-align: right; }
.material-total { display: flex; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--sage-soft); font-size: 13px; }
.material-total strong { color: var(--sage); }
.price-card h2 { font-size: 29px; line-height: 1.06; }
.price-card > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.5; }
.price-card .button-primary { width: 100%; margin-top: 10px; }
.trust-list { display: grid; gap: 7px; margin: 17px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; list-style: none; }
.trust-list li::before { content: "✓"; margin-right: 7px; color: var(--sage); font-weight: 900; }

.lead-panel { display: grid; grid-template-columns: .65fr 1.35fr; gap: 28px; margin: 20px 0 38px; padding: 28px; border-radius: 20px; color: #fff; background: var(--brand); }
.lead-copy p:last-child { color: rgba(255,255,255,.67); line-height: 1.5; }
.lead-panel form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.lead-panel label { display: grid; gap: 6px; color: rgba(255,255,255,.78); font-size: 12px; font-weight: 800; }
.lead-panel input:not([type="checkbox"]), .lead-panel textarea { width: 100%; padding: 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; color: #fff; background: rgba(255,255,255,.08); outline: none; }
.lead-panel textarea { resize: vertical; }
.wide { grid-column: 1 / -1; }
.consent { display: flex !important; grid-template-columns: 18px 1fr; align-items: start; gap: 9px !important; font-weight: 500 !important; }
.consent input { margin-top: 2px; accent-color: var(--gold); }
.honeypot { position: absolute !important; left: -9999px !important; }
.lead-actions { display: flex; gap: 9px; }
.lead-panel .button-primary { color: var(--ink); background: #fff; }
.lead-panel .button-ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.lead-status { min-height: 18px; margin: 0; color: #d5c194; font-size: 12px; }

footer { padding: 28px 20px 50px; color: var(--muted); text-align: center; font-size: 12px; }
footer a { color: inherit; text-underline-offset: 3px; }

.collection-section { margin: 20px 0 38px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.collection-grid a { display: grid; gap: 6px; min-height: 104px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.collection-grid a:hover, .collection-grid a:focus-visible { transform: translateY(-2px); border-color: var(--green); box-shadow: 0 10px 24px rgba(28, 43, 34, .08); outline: none; }
.collection-grid strong { font-size: 14px; }
.collection-grid span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.policy-page { max-width: 800px; margin: 0 auto; padding: 72px 5vw; }
.policy-page h1 { margin: 0 0 24px; font-family: var(--serif); font-size: clamp(42px, 7vw, 74px); line-height: .96; }
.policy-page h2 { margin-top: 38px; font-family: var(--serif); font-size: 26px; }
.policy-page p, .policy-page li { color: var(--muted); line-height: 1.75; }
.policy-page a { color: var(--green); }

@media (max-width: 900px) {
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace, .output-grid, .lead-panel { grid-template-columns: 1fr; }
  .collection-grid { grid-template-columns: 1fr 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .wall-stage { min-height: 320px; }
}

@media (max-width: 560px) {
  main { width: min(100% - 20px, 1240px); }
  .site-header { min-height: 62px; padding: 9px 12px; }
  .brand { font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .header-link { display: none; }
  .hero { padding: 42px 6px 36px; }
  .mode-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .mode-card { min-height: 160px; padding: 11px; }
  .mode-card small { font-size: 11px; }
  .mode-icon { height: 75px; }
  .workspace { border-radius: 15px; }
  .control-panel, .preview-panel, .output-card, .lead-panel { padding: 18px; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .wall-stage { min-height: 245px; padding: 14px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .section-heading { align-items: flex-start; }
  .section-heading > p { display: none; }
  .card-heading { align-items: flex-start; }
  .lead-panel form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .lead-actions { flex-direction: column; }
  .collection-grid { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .hero, .mode-section, .control-panel, .price-card, .lead-panel, footer, .text-button { display: none !important; }
  body, main, .workspace, .preview-panel, .output-card { background: #fff; box-shadow: none; }
  main { width: 100%; }
  .workspace, .output-grid { display: block; border: 0; }
  .preview-panel, .output-card { break-inside: avoid; border: 0; }
}

html[data-embed="true"] .site-header,
html[data-embed="true"] .hero,
html[data-embed="true"] .collection-section,
html[data-embed="true"] footer {
  display: none;
}

html[data-embed="true"] main {
  width: 100%;
  max-width: none;
  padding: 0;
}

html[data-embed="true"] .mode-section {
  margin-top: 0;
}
