/* Terasei: warm white surfaces, charcoal type and the gold from the brand mark. */
:root {
  --gold: #ffbd16;
  --ink: #242521;
  --muted: #5f615b;
  --line: #dcdad2;
  --paper: #f6f5f1;
  --forest: #282923;
  --forest2: #45463e;
  --lime2: #fff2c5;
  --shadow: 0 4px 18px rgb(45 38 18 / 4%);
  --radius: 16px;
}
body { color: var(--ink); }
.topbar { height: auto; min-height: 68px; background: #26241f; border-bottom: 3px solid var(--gold); }
.topbar-inner { min-height: 66px; gap: 16px; }
.brand { color: #fff; font-size: 22px; }
.brand-logo-img { width: 46px; height: 46px; }
.top-actions { gap: 12px; }
.top-actions button { min-height: 40px; }
.top-actions .draft-link { color: #fff; padding: 5px 7px; }
.top-actions .top-link { border: 1px solid #918e80; border-radius: 8px; padding: 7px 14px; color: #fff; }
.top-actions button:hover { color: var(--gold); }
.shell { padding-top: clamp(14px, 2.5vw, 34px); }
.intro {
  display: grid;
  grid-template-columns: 1.13fr 1fr;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  background: #efede5;
  border: 1px solid #dedbd1;
  border-radius: var(--radius);
  margin: 0 0 16px;
}
.intro-copy { padding: clamp(22px, 3vw, 40px); align-self: center; }
.intro h1 { margin: 0; max-width: 12ch; color: var(--ink); font-size: clamp(42px, 4.6vw, 66px); line-height: .99; letter-spacing: -.055em; }
.intro p { margin: 13px 0 0; max-width: 43ch; line-height: 1.45; }
.intro-brands { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.intro-brands img { object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; height: 32px; width: auto; }
.intro-photo { position: relative; min-height: 100%; overflow: hidden; }
.intro-photo > img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 50% 47%; display: block; }
.origin { position: absolute; bottom: 14px; right: 14px; display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); padding: 6px 10px; border-radius: 5px; font-size: 13px; font-weight: 750; }
.shell:not([data-stage="0"]) .intro { display: none; }
.progress-wrap { padding: 17px 22px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 12px; }
.progress-top { margin-bottom: 8px; }
.progress-track { height: 4px; background: #e9e7df; }
.progress-fill { background: var(--gold); }
.steps { margin-top: 12px; }
.step-chip { color: #61625d; font-size: 14px; }
.step-chip .num { border-radius: 6px; }
.step-chip.active .num { background: var(--gold); color: var(--ink); }
.step-chip.done .num { background: #33342e; color: white; }
.panel, .preview-card { min-width: 0; border-color: var(--line); }
.step-kicker { color: #67551f; letter-spacing: .07em; }
.step-head h2 { color: var(--ink); font-size: clamp(27px, 3vw, 38px); letter-spacing: -.045em; }
.step-head p { line-height: 1.45; }
.field-label { color: var(--ink); }
.product-spec { display: grid; grid-template-columns: minmax(240px,.77fr) minmax(0,1.23fr); gap: clamp(16px,2.2vw,28px); }
.product-spec > div { min-width: 0; }
.brand-select, .model-grid { gap: 8px; margin-bottom: 24px; }
.brand-select .choice, .model-grid .choice { border-radius: 10px; padding: 12px; min-width: 0; min-height: 123px; }
.brand-logo-wrap { min-height: 54px; margin: 1px 0 8px; }
.product-logo-img-eco { width: 88px; height: 54px; }
.product-logo-img-harddeck { width: 136px; height: 54px; }
.choice:hover, .preset:hover, .option-row:hover { border-color: #a88a38; }
.choice.selected, .option-row:has(input:checked) { background: #fff9e5; border-color: #a7841c; box-shadow: inset 0 0 0 1px #a7841c; }
.choice.selected > .check { top: 5px; right: 5px; border-radius: 50%; width: 18px; height: 18px; display: grid; place-content: center; background: var(--gold); color: #202019; font-size: 12px; }
.art-color-grid, .harddeck-color-grid { grid-template-columns: repeat(7, minmax(0,1fr)); gap: 9px; }
.color-grid .color-choice { border-radius: 10px; padding: 6px; text-align: left; }
.art-color-grid .swatch, .harddeck-color-grid .swatch { height: auto; aspect-ratio: 1.25; border-radius: 6px; }
.color-grid .color-choice .choice-title { padding: 2px 4px 4px; font-size: 14px; line-height: 1.3; }
.color-grid .color-choice[aria-pressed="true"] { background: #29352e; border-color: #29352e; box-shadow: 0 0 0 2px #29352e; color: white; }
.color-grid .color-choice.selected .check { background: #29352e; color: #fff; width: 24px; height: 24px; font-size: 15px; border: 2px solid #fff; }
.actions { border-color: var(--line); }
.btn-primary { background: var(--gold); color: #211e14; border-radius: 9px; }
.btn-primary:hover { background: #efac00; color: #211e14; }
.btn-quiet, .draft-secondary { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 9px; }
:where(button, input, select, a):focus-visible { outline: 3px solid #866300; outline-offset: 3px; }
.preset, .contour-btn { color: var(--ink); }
.editor-wrap { border-color: #cbc8bb; background: white; }
.editor-toolbar, .editor-wrap > .contour-panel { background: #f6f5ee; border-color: var(--line); }
.editor-wrap > .layout-view-controls { background: white; border-color: var(--line); }
.tool-icon, .tool-btn, .board-direction select { border-color: #d0cec2; color: var(--ink); }
.tool-icon:hover, .tool-btn:hover, .tool-icon:focus-visible { background: #fff4ce; color: #292714; border-color: #bda346; }
.tool-icon.active, .tool-btn.active, .contour-btn.active { background: #fff0b8; color: #352e13; border-color: #a4862d; }
.editor-svg, .summary-sketch-canvas { background-color: #fbfaf7; background-image: radial-gradient(#d6d3c8 .8px, transparent .9px); background-size: 14px 14px; }
.editor-svg { height: clamp(300px, 30vw, 405px); }
.measure-chip, .metric, .notice, .info-box { background: #f5f4ee; color: #4b4c45; }
.option-row { border-radius: 10px; }
.option-row input { accent-color: #584814; }
.summary-sketch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 15px; }
.summary-sketch-head, .summary-sketch-caption { grid-column: 1 / -1; }
.summary-overview, .summary-layouts, .summary-layout { min-width: 0; }
.summary-layouts { margin: 0; }
.summary-overview .summary-sketch-canvas, .summary-layout .summary-sketch-canvas { margin-top: 8px; height: 235px; }
.total-card { background: #292a25; border: 0; border-radius: 12px; color: white; padding: clamp(16px, 2.5vw, 26px); }
.total-card .total-price { color: #ffd258; font-size: clamp(29px, 3.6vw, 44px); }
.total-card :is(.total-label,.total-sub,.review-line span) { color: #eeede7; }
.total-card .review-line strong { color: white; }
.total-card :is(.total-lines,.review-line) { border-color: #505149; }
.review-line strong, .total-price, .metric strong { font-variant-numeric: tabular-nums; }
.draft-dialog { border-radius: 16px; border-top: 4px solid var(--gold); }
.footer-note { color: #606159; }

@media (max-width: 950px) {
  .product-spec { display: block; }
  .brand-select .choice { min-height: 96px; }
  .color-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .shell, .topbar-inner { width: min(100% - 24px, 640px); }
  .topbar-inner { gap: 5px; min-height: 60px; }
  .brand { gap: 6px; font-size: 18px; flex-shrink: 0; }
  .brand-logo-img { width: 35px; height: 35px; }
  .top-actions { gap: 5px; }
  .top-actions button { font-size: 12px; line-height: 1.2; min-height: 44px; }
  .top-actions .top-link { padding-inline: 7px; }
  .intro { grid-template-columns: 1.4fr 1fr; margin: 0 0 10px; }
  .intro-copy { padding: 17px 11px 17px 15px; }
  .intro h1 { font-size: clamp(25px,5.6vw,37px); line-height: 1.05; }
  .intro p { font-size: 14px; line-height: 1.35; margin-top: 8px; }
  .intro-brands { margin-top: 10px; gap: 4px; flex-wrap: wrap; }
  .intro-brands img { height: 23px; padding: 2px 3px; }
  .origin { bottom: 7px; right: 6px; gap: 4px; font-size: 11px; padding: 4px 6px; }
  .origin .flag-lv { width: 15px; height: 10px; }
  .progress-wrap { padding: 12px 14px; margin-bottom: 10px; }
  .panel { border-radius: 12px; padding: 20px 14px; }
  .step-head { margin-bottom: 19px; }
  .brand-select .choice, .model-grid .choice { padding: 9px; }
  .model-grid { grid-template-columns: repeat(auto-fit,minmax(min(96px,100%),1fr)); }
  .model-card .choice-sub { font-size: 12px; line-height: 1.4; }
  .color-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .color-grid .color-choice .choice-title { font-size: 13px; }
  .contour-actions { gap: 6px; }
  .tool-btn, .preset, .tool-icon, .board-direction select { min-height: 44px; }
  .contour-actions .tool-icon-labeled { white-space: normal; }
  .editor-wrap .editor-svg { height: clamp(250px, 74vw, 375px); }
  .cutout-size input, .measure-chip input[data-edge-length], .draft-form input { font-size: 16px; }
  .summary-sketch { display: block; }
  .summary-layouts { margin-top: 14px; }
  .review-line > span { min-width: 0; overflow-wrap: anywhere; }
  .review-line strong { text-align: right; }
}
@media (max-width: 375px) {
  .intro { grid-template-columns: 1.48fr 1fr; }
  .color-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .model-grid { grid-template-columns: 1fr; }
  .model-grid .choice { min-height: 72px; display: grid; grid-template-columns: 37% 1fr; align-items: center; gap: 0 12px; }
  .model-card .profile-drawing { grid-row: span 2; margin: 0; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .choice, .btn, .progress-fill { transition: none; }
}
.quote-supplier {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  break-inside: avoid;
}
.quote-supplier h3, .quote-supplier p, .quote-supplier dl, .quote-supplier dd { margin: 0; }
.quote-supplier p { margin: .5rem 0; }
.quote-supplier dl > div { display: flex; flex-wrap: wrap; gap: .1rem .75rem; padding: .15rem 0; }
.quote-supplier dt { flex: 0 0 10rem; }
.quote-supplier dd { flex: 1 1 16rem; }
.quote-supplier a { color: inherit; white-space: nowrap; }
.email-print-note { display: none; }
@media print {
  body:has(.shell[data-stage="3"]) > :not(.shell),
  .shell[data-stage="3"] > :not(.email-print-note) { display: none !important; }
  .shell[data-stage="3"] > .email-print-note { display: block; }
  .shell { padding: 0; }
  .topbar, .intro, .progress-wrap { display: none; }
  .summary-sketch, .total-card { break-inside: avoid; }
  .total-card { border: 1px solid #bbb; background: white; color: black; }
  .total-card :is(.total-label,.total-sub,.review-line span,.review-line strong,.total-price) { color: black; }
}

.stock-length-control {
  display: grid;
  grid-template-columns: max-content minmax(10rem, 17rem) 1fr;
  gap: .4rem .75rem;
  align-items: center;
  padding: .65rem .9rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.stock-length-control label { font-weight: 700; }
.stock-length-control input { min-width: 0; min-height: 44px; padding: .5rem .7rem; border: 1px solid #c9c6ba; border-radius: .5rem; font: inherit; color: var(--ink); }
.stock-help, .stock-error { font-size: .875rem; }
.stock-error { grid-column: 1 / -1; color: #982915; }
.stock-error:empty { display: none; }
.stock-length-control input[aria-invalid="true"] { border-color: #982915; }
@media (max-width: 720px) {
  .stock-length-control { grid-template-columns: 1fr; }
}

.board-layout-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .7rem .9rem .3rem;
  min-width: 0;
  border: 0;
  background: #fff;
}
.board-layout-choice legend { float: left; margin: 0 .5rem 0 0; padding: 0; font-weight: 700; }
.board-layout-choice label {
  position: relative; display: inline-flex; gap: .45rem; align-items: center; min-height: 44px;
  padding: .35rem .7rem; border: 1px solid var(--line); border-radius: .55rem; cursor: pointer;
}
.board-layout-choice label:has(input:checked) { background: #fff6d8; border-color: #976d0c; box-shadow: inset 0 0 0 1px #976d0c; }
.board-layout-choice label:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.board-layout-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.layout-sample {
  display: grid; width: 1.9rem; height: 1rem; padding: 1px; gap: 1px;
  background: currentColor; border-radius: 2px; overflow: hidden;
}
.layout-sample::before, .layout-sample::after {
  content: ''; background: repeating-linear-gradient(90deg, #e5c390 0 .72rem, transparent .72rem .81rem);
}
.layout-sample.half::after { background-position: .405rem 0; }
@media (max-width: 520px) { .board-layout-choice legend { width: 100%; } }

.language-switch {
  display: inline-flex;
  flex-shrink: 0;
  gap: 2px;
  margin-inline-start: auto;
  padding: 2px;
  border: 1px solid #898679;
  border-radius: 9px;
}
.language-switch button {
  min-width: 40px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: white;
  font-size: .875rem;
  font-weight: 700;
}
.language-switch button[aria-pressed="true"] { background: var(--gold); color: #211e14; }
.language-switch button:focus-visible { outline: 2px solid white; outline-offset: 1px; }
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 4px; }
  .language-switch button { min-height: 40px; }
  .top-actions { flex: 1 0 100%; justify-content: flex-end; }
}

.offer-email { margin-top: 1.5rem; padding: clamp(16px,3vw,26px); border: 1px solid #d3d8cb; border-radius: 14px; background: #f6f7f1; }
.offer-email h3 { margin: 0 0 8px; }
.offer-email p { margin: 0 0 14px; }
.offer-contact-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 18px; margin-bottom: 16px; }
.offer-contact-fields label { display: grid; gap: 6px; font-weight: 650; }
.offer-contact-fields input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #bcbfb4; border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }
.offer-email button { min-height: 44px; }
.offer-email .offer-feedback { margin: 10px 0 0; font-weight: 600; }
.offer-email .offer-feedback:empty { margin: 0; }
@media (max-width: 540px) { .offer-contact-fields { grid-template-columns: minmax(0,1fr); } .offer-email button { width: 100%; } }
@media print { .offer-email { display: none !important; } }
