/* Europe Makine wash-site builder. Tokens match the site and the 3D viewer:
   ink, paper, stainless, teal; brush red is a fault marker only.
   One text face for everything that is not a heading: Hanken Grotesk, with
   tabular figures so sizes and prices line up. No monospace anywhere.
   Type scale: 22 page title, 17 panel heading, 14.5 body and names, 13 secondary, 12.5 fine.
   Spacing steps: 4, 8, 12, 16, 20, 24. Corners: 2px, as the site's buttons. */
:root {
  --paper: #f4f5f3; --ink: #14181c; --ink-soft: #4b535a; --stainless: #d9dee2; --accent: #09acba; --accent-deep: #08838d; --red: #d5202a;
  --hairline: #d9dee2; --card: #ffffff;
  --display: "Archivo Variable", "Archivo", "Arial Narrow", ui-sans-serif, sans-serif;
  --body: "Hanken Grotesk Variable", "Hanken Grotesk", "Segoe UI", ui-sans-serif, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font: 14.5px/1.45 var(--body); font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
body { overflow: hidden; }
button, select, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { font-family: var(--display); font-stretch: 112%; margin: 0; }

.app { display: grid; grid-template-columns: 312px minmax(0, 1fr) 356px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "bar bar bar" "parts stage detail"; height: 100vh; height: 100dvh; }
.bar { grid-area: bar; display: flex; align-items: baseline; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--hairline); background: var(--card); }
.bar-link { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent-deep); text-underline-offset: 3px; }
.brand { font: 700 14px/1 var(--display); font-stretch: 112%; letter-spacing: 0.01em; color: var(--accent-deep); text-decoration: none; }
.bar h1 { font-weight: 650; font-size: 22px; line-height: 1.1; }
.embed .bar { display: none; }
.embed .app { grid-template-rows: minmax(0, 1fr); grid-template-areas: "parts stage detail"; }
.tabs { display: none; }

/* ---------- side panels ---------- */
.side { background: var(--card); overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.side-parts { grid-area: parts; border-right: 1px solid var(--hairline); }
.side-detail { grid-area: detail; border-left: 1px solid var(--hairline); }
.sec { padding: 20px; }
.sec + .sec { border-top: 1px solid var(--hairline); }
.sec h2 { font-weight: 650; font-size: 17px; line-height: 1.2; margin-bottom: 12px; }
.sec h3 { font: 600 13px/1.3 var(--body); color: var(--ink-soft); margin: 20px 0 4px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { margin: 0; }
.quiet { color: var(--ink-soft); margin: 0; }
.fine { color: var(--ink-soft); font-size: 12.5px; line-height: 1.45; margin: 12px 0 0; }
.status { margin: 8px 0 0; font-size: 13.5px; color: var(--accent-deep); font-weight: 600; min-height: 0; }
.status:empty { display: none; }

.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 32px; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); align-content: end; }
.num { display: flex; align-items: center; border: 1px solid var(--stainless); border-radius: 2px; background: var(--card); }
.num:focus-within { border-color: var(--accent-deep); }
.num input { border: 0; background: none; width: 100%; min-width: 0; padding: 7px 4px 7px 9px; font: 500 14.5px/1.2 var(--body); color: var(--ink); outline: none; -moz-appearance: textfield; }
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num input:disabled { color: transparent; }
.num .unit { font: normal 13px/1 var(--body); color: var(--ink-soft); padding-right: 9px; }
.gates { margin-top: 12px; display: grid; gap: 8px; }
.gate { display: grid; grid-template-columns: 1fr 108px; align-items: center; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent-deep); margin: 0; flex: none; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* Buttons as on the site: solid ink primary, outlined secondary, teal on hover, square corners. */
.btn { border: 1px solid var(--ink); background: transparent; border-radius: 2px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); line-height: 1.2; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.lot-btns .btn { flex: 1 1 0; }

/* ---------- parts palette: a render of each part, then name, size and price ---------- */
.parts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.part { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; align-items: center; border-bottom: 1px solid var(--hairline); cursor: grab; user-select: none; -webkit-user-select: none; }
.part:hover .part-name { color: var(--accent-deep); }
.part.is-open { box-shadow: inset 3px 0 0 var(--accent); }
.part-thumb { display: block; width: 96px; height: 72px; touch-action: none; }
.part-thumb img { display: block; width: 96px; height: 72px; object-fit: contain; -webkit-user-drag: none; }
.part-pick { all: unset; display: grid; gap: 2px; padding: 8px 0; cursor: inherit; min-width: 0; }
.part-pick:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: -2px; }
.part-name { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.part-dims { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.part-price { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.part-price b { font-weight: 650; color: var(--ink); white-space: nowrap; }
.part-price span { white-space: nowrap; }
.parts-note { margin-top: 8px; }
.part-more { grid-column: 2; padding: 0 0 16px; cursor: default; display: grid; gap: 8px; justify-items: start; }
.part-desc { font-size: 14px; line-height: 1.45; margin: 0; max-width: 38em; }
.dragging, .dragging * { cursor: grabbing !important; }
.chip { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 5px 9px; border-radius: 2px; white-space: nowrap; }

/* ---------- stage ---------- */
.stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #e9ebe7; }
.view { position: absolute; inset: 0; }
.view canvas { display: block; width: 100%; height: 100%; outline-offset: -3px; }
.labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font: 500 11.5px/1 var(--body); color: var(--ink); will-change: transform; }
.lbl-dim { background: #e9ebe7; padding: 3px 6px; font-size: 12.5px; font-weight: 600; }
.lbl-street { color: #fff; font: 600 12px/1 var(--body); letter-spacing: 0.02em; }
.lbl-gate { color: #fff; font: 600 11.5px/1 var(--body); background: var(--accent-deep); padding: 3px 6px; }
.lbl-part { font: 600 11.5px/1 var(--body); color: var(--ink); transform-origin: 50% 50%; }
/* Plan annotation: small type on a light plate inside the part, never over another name (scene.js placeLabels). */
.is-plan .lbl-part { background: rgba(250, 251, 249, 0.82); padding: 2px 4px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em; }
.lbl-part.is-sel { background: var(--ink); color: #fff; padding: 4px 7px; z-index: 2; }
/* Why a spot will not do, under the part being dragged. */
.lbl-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; background: var(--red, #d5202a); color: #fff; font: 600 11.5px/1 var(--body); padding: 4px 7px; white-space: nowrap; }
.nogl { position: absolute; inset: 0; margin: auto; height: max-content; max-width: 46ch; padding: 24px; text-align: center; z-index: 3; }
.nogl a { color: var(--accent-deep); font-weight: 600; }
.no-gl .tools, .no-gl .scale { display: none; }

/* Toolbar: one strip of grouped controls over the lot. */
.tools { position: absolute; left: 16px; top: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; pointer-events: none; }
.tools > * { pointer-events: auto; }
.tool-group { display: inline-flex; background: var(--card); border: 1px solid var(--stainless); border-radius: 2px; }
.tool { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0 12px; min-height: 36px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.tool + .tool { border-left: 1px solid var(--stainless); }
.tool-icon { padding: 0; width: 38px; justify-content: center; }
.tool:hover:not(:disabled) { background: var(--paper); color: var(--accent-deep); }
.tool:disabled { color: var(--ink); opacity: 0.32; cursor: default; }
.tool[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tool[aria-pressed="true"]:hover { background: var(--ink); color: #fff; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px 0 10px; background: var(--card); border: 1px solid var(--stainless); border-radius: 2px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.switch-track { position: relative; width: 28px; height: 16px; border: 1.5px solid var(--ink-soft); background: var(--card); flex: none; transition: background-color 0.15s, border-color 0.15s; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 9px; height: 9px; background: var(--ink-soft); transition: transform 0.15s, background-color 0.15s; }
.switch[aria-pressed="true"] .switch-track { background: var(--accent-deep); border-color: var(--accent-deep); }
.switch[aria-pressed="true"] .switch-knob { background: #fff; transform: translateX(12px); }
.switch:hover .switch-track { border-color: var(--ink); }
.switch-ico { display: none; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-knob, .btn { transition: none; } }

/* Plan view scale bar, bottom left of the lot. */
.scale { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.scalebar { display: block; height: 7px; border: 1.5px solid var(--ink); border-top: 0; }

/* ---------- selected part ---------- */
.specs { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 4px; }
.specs th { text-align: left; font-weight: 400; color: var(--ink-soft); padding: 6px 10px 6px 0; vertical-align: top; width: 42%; }
.specs td { font: 400 13.5px/1.45 var(--body); padding: 7px 0 6px; }
.specs tr + tr { border-top: 1px solid var(--hairline); }
.opts { display: grid; gap: 14px; margin: 14px 0; }
.opts:empty { display: none; }
.opt { margin: 0; padding: 0; border: 0; min-width: 0; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 600; }
.opt-head output { font: 500 13.5px/1 var(--body); }
.opt input[type="range"] { width: 100%; accent-color: var(--accent-deep); margin: 8px 0 0; display: block; }
.opt-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.opt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
select { border: 1px solid var(--stainless); background: var(--card); padding: 6px 8px; border-radius: 2px; font-weight: 400; }
.stations legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.count { font: 400 13px/1 var(--body); color: var(--ink-soft); margin-left: 6px; }
.station-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.station-list .check { font-size: 13.5px; }
.flagline { margin: 12px 0 0; padding-left: 16px; position: relative; font-weight: 600; font-size: 14px; }
.flagline::before, .warn li::before { content: ""; position: absolute; left: 0; top: 0.4em; width: 8px; height: 8px; background: var(--red); }

/* ---------- schedule ---------- */
.sched { width: 100%; border-collapse: collapse; font-size: 14px; }
.sched th { text-align: left; font-weight: 400; font-size: 13px; color: var(--ink-soft); padding: 0 8px 6px 0; border-bottom: 1px solid var(--ink); }
.sched td { padding: 8px 8px 8px 0; vertical-align: top; border-bottom: 1px solid var(--hairline); }
.sched .n { text-align: right; width: 34px; }
.sched .fig { white-space: nowrap; padding-right: 0; }
.linklike { all: unset; cursor: pointer; font-weight: 600; }
/* Parts schedule in the panel: one line per part, identical parts counted. */
.parts-sched { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.sg { padding: 10px 0 11px; border-bottom: 1px solid var(--hairline); }
.sg.is-sel { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
.sg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.linklike.sg-name { font-size: 14.5px; line-height: 1.3; }
.sg-qty { font-weight: 400; color: var(--ink-soft); }
.sg-price { font-weight: 650; white-space: nowrap; }
.sg-meta { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0; }
.sg-opts { display: block; margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.linklike.sg-toggle { margin-left: 12px; font-size: 13px; color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.sg-list { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 1px solid var(--stainless); display: grid; gap: 4px; }
.sg-list li.is-sel { box-shadow: inset 3px 0 0 var(--accent); margin-left: -13px; padding-left: 13px; }
.linklike.sg-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; font-size: 13px; font-weight: 500; }
.linklike.sg-row:hover { color: var(--accent-deep); }
.sg-list .sg-opts { margin: 0 0 2px; }
.fig { white-space: nowrap; }
/* Not yet confirmed: a small open square after the size, explained once under the list. */
.linklike:hover { color: var(--accent-deep); }
.linklike:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.totals { margin: 16px 0 0; font-size: 13px; }
.totals div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 2px 0; }
.totals dt { color: var(--ink-soft); flex: none; }
.totals dd { margin: 0; text-align: right; }
.totals .total { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--ink); font-size: 14.5px; font-weight: 650; }
.totals .total dt { color: var(--ink); }
#priceNote { margin-top: 4px; }
.warn { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; }
.warn li { position: relative; padding: 3px 0 3px 16px; }
.actions { margin-top: 20px; }
.actions .btn-primary { width: 100%; padding: 12px 14px; font-size: 15px; min-height: 48px; }
.actions .row-btns { margin-top: 8px; }
.actions .row-btns .btn { flex: 1 1 auto; justify-content: center; }

/* ---------- dialog ---------- */
.dlg { border: 1px solid var(--ink); border-radius: 2px; padding: 22px; width: min(620px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
.dlg::backdrop { background: rgba(20, 24, 28, 0.45); }
.dlg h2 { font-size: 20px; font-weight: 650; margin-bottom: 12px; }
.dlg textarea { width: 100%; border: 1px solid var(--stainless); border-radius: 2px; padding: 10px 12px; font: 400 13.5px/1.55 var(--body); resize: vertical; background: var(--paper); }

/* ---------- print sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: #d3d7d8; overflow: auto; }
.sheet-bar { position: sticky; top: 0; z-index: 1; display: flex; gap: 8px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--hairline); }
.page { background: #fff; width: min(980px, calc(100% - 32px)); margin: 20px auto 40px; padding: 34px 38px 30px; border: 1px solid var(--stainless); }
.page-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 20px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.page-brand { grid-column: 1 / -1; margin: 0; font: 700 14px/1 var(--display); font-stretch: 112%; color: var(--accent-deep); }
.page-head h1 { font-size: 28px; font-weight: 650; line-height: 1.1; }
.page-date { margin: 0; font: 400 13px/1 var(--body); color: var(--ink-soft); }
.page-body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; margin: 22px 0 8px; align-items: start; }
.page-plan { margin: 0; }
.plan { display: block; width: 100%; height: auto; max-height: 620px; font-family: var(--body); font-weight: 600; fill: var(--ink); }
.plan .gate { fill: var(--accent-deep); }
.page h2 { font-size: 18px; font-weight: 650; margin: 22px 0 10px; }
.page h3 { font-size: 14px; font-weight: 650; margin: 18px 0 2px; }
.sched-full .small { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.sched-full td.name { font-weight: 600; white-space: nowrap; }
.sched-full td.key, .plan .key { font-family: var(--body); font-weight: 600; }
.sched-full td.key { width: 36px; }
.sched-full td.n { padding-right: 14px; }
.page-foot { margin: 20px 0 0; font-size: 12.5px; color: var(--ink-soft); border-top: 1px solid var(--hairline); padding-top: 10px; }

/* ---------- setup steps (funnel.js): one question a screen, over the builder ---------- */
.funnel { position: fixed; inset: 0; z-index: 30; background: var(--paper); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.fn-top { display: flex; align-items: baseline; gap: 18px; padding: 13px 24px; background: var(--card); border-bottom: 1px solid var(--hairline); }
.fn-brand { font: 700 14px/1 var(--display); font-stretch: 112%; letter-spacing: 0.01em; color: var(--accent-deep); }
.embed .fn-brand { display: none; }
.fn-progress { margin: 0; font: 500 13.5px/1 var(--body); color: var(--ink-soft); }
.fn-skip { all: unset; margin-left: auto; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.fn-skip:hover { color: var(--accent-deep); }
.fn-skip:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }
.fn-body { overflow-y: auto; overscroll-behavior: contain; }
.fn-form { width: min(820px, 100%); margin: 0 auto; padding: clamp(28px, 7vh, 72px) 24px 0; min-height: 100%; display: flex; flex-direction: column; }
.fn-content { padding-bottom: 12px; }
.fn-nav { margin-top: auto; }
.fn-title { font-weight: 650; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.06; letter-spacing: -0.005em; margin-bottom: 28px; outline: none; }
.fn-sub { font-weight: 600; font-size: 15px; color: var(--ink-soft); margin: 26px 0 10px; }
.fn-content > .fn-sub:first-child { margin-top: 0; }
.fn-options { display: grid; gap: 10px; }
.fn-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 16px; padding: 17px 20px; min-height: 64px; background: var(--card); border: 1px solid #b9c0c5; border-radius: 2px; cursor: pointer; }
.fn-option.has-media { grid-template-columns: auto auto minmax(0, 1fr); }
.fn-option input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent-deep); cursor: inherit; }
.fn-option:hover:not(.is-off) { border-color: var(--ink); }
.fn-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 5px 0 0 var(--accent); }
.fn-option:has(input:focus-visible) { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.fn-option input:focus-visible { outline: none; }
.fn-option-text { display: grid; gap: 3px; min-width: 0; }
.fn-option-name { font-size: 18px; font-weight: 600; line-height: 1.25; }
.fn-option-sub { font-size: 14.5px; color: var(--ink-soft); }
.fn-option-price { font: 650 14px/1.45 var(--body); color: var(--ink); }
.fn-option.is-off .fn-option-price { color: #7a838a; }
.fn-option-fig, .fn-fig { font: 400 13.5px/1.45 var(--body); color: var(--ink-soft); }
.fn-option.is-off { background: var(--paper); border-style: dashed; cursor: not-allowed; }
.fn-option.is-off .fn-option-name, .fn-option.is-off .fn-option-sub, .fn-option.is-off .fn-option-fig { color: #7a838a; }
.fn-option-why { font-size: 14px; color: var(--ink); margin-top: 3px; }
.fn-media { display: grid; place-items: center; }
.fn-plan { display: block; }
.fn-plan .pl-lot { fill: #fff; stroke: var(--ink); stroke-width: 1.2; }
.fn-plan .pl-street { fill: #6f757a; }
.fn-plan .pl-ground { fill: var(--stainless); }
.fn-plan .pl-structure { fill: var(--ink-soft); }
.fn-plan .pl-shell { fill: none; stroke: var(--ink); stroke-width: 0.8; }
.fn-plan .pl-machine { fill: var(--accent); }
.fn-plan .pl-gate { fill: var(--accent-deep); }
.fn-plan .pl-nofit { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 2; }
.fn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fn-grid .fn-option { padding: 12px 14px; min-height: 54px; gap: 4px 10px; }
.fn-grid .fn-option-name { font: 600 16px/1.2 var(--body); }
.fn-note { margin: 16px 0 0; font-size: 14.5px; padding-left: 16px; position: relative; display: block; }
.fn-note::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 8px; height: 8px; background: var(--ink); }
.fn-or { margin: 26px 0 10px; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.fn-field { display: grid; gap: 7px; max-width: 440px; }
.fn-field label, .fn-row label { font-size: 16px; font-weight: 600; }
.fn-field input, .fn-stepper input { border: 1px solid #8b949a; border-radius: 2px; background: var(--card); padding: 12px 14px; font-size: 18px; width: 100%; min-width: 0; }
.fn-field input:focus-visible, .fn-stepper input:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 1px; border-color: var(--accent-deep); }
.fn-size { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.fn-size .fn-field { width: 170px; }
.fn-size .seg button { min-height: 50px; padding: 5px 18px; font-size: 15px; }
.fn-num { position: relative; display: block; }
.fn-num input { font-family: var(--body); padding-right: 40px; -moz-appearance: textfield; }
.fn-num input::-webkit-outer-spin-button, .fn-num input::-webkit-inner-spin-button, .fn-stepper input::-webkit-outer-spin-button, .fn-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fn-num i { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font: normal 13px/1 var(--body); color: var(--ink-soft); }
.fn-area { margin: 14px 0 0; }
.fn-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: start; }
.fn-figure { display: grid; gap: 10px; justify-items: start; max-width: 240px; }
.fn-extras { display: grid; gap: 0; margin-top: 26px; max-width: 520px; border-top: 1px solid var(--hairline); }
.fn-row, .fn-check { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); min-height: 60px; }
.fn-check { justify-content: flex-start; font-size: 16px; font-weight: 600; cursor: pointer; }
.fn-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent-deep); flex: none; }
.fn-stepper { display: inline-flex; align-items: stretch; }
.fn-stepper input { width: 68px; text-align: center; font-family: var(--body); border-radius: 0; border-left: 0; border-right: 0; padding: 9px 4px; -moz-appearance: textfield; }
.fn-stepper button { width: 46px; min-height: 46px; border: 1px solid #8b949a; background: var(--card); font-size: 20px; line-height: 1; cursor: pointer; }
.fn-stepper button:first-child { border-radius: 2px 0 0 3px; }
.fn-stepper button:last-child { border-radius: 0 2px 2px 0; }
.fn-stepper button:hover { background: var(--paper); }
.fn-review { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); border-top: 1px solid var(--ink); }
.fn-review dt, .fn-review dd { padding: 13px 0; border-bottom: 1px solid var(--hairline); margin: 0; }
.fn-review dt { color: var(--ink-soft); padding-right: 28px; font-size: 15px; }
.fn-review dd { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 16px; font-weight: 600; }
.fn-change { all: unset; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; flex: none; }
.fn-change:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }
.fn-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; position: sticky; bottom: 0; padding: 14px 0 18px; background: var(--paper); border-top: 1px solid var(--hairline); }
.fn-nav .btn { min-height: 50px; padding: 12px 24px; font-size: 16px; }
.fn-nav .btn-primary:disabled { background: #aab1b6; border-color: #aab1b6; cursor: default; }
.funnel-open .chip { display: none; }

/* ---------- layout assistant (assistant.js) ---------- */
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; max-height: 232px; overflow-y: auto; overscroll-behavior: contain; }
.chat-empty p { margin: 0 0 6px; color: var(--ink-soft); font-size: 14px; }
.examples { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.examples .linklike { font-size: 14px; color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; display: inline-block; }
.examples .linklike:disabled { color: var(--ink-soft); cursor: default; }
.turn { font-size: 14.5px; line-height: 1.45; padding-left: 11px; border-left: 3px solid var(--stainless); color: var(--ink-soft); overflow-wrap: anywhere; }
.turn-assistant { border-left-color: var(--accent); color: var(--ink); }
.turn.is-busy { color: var(--ink-soft); }
.as-notice { margin: 10px 0 0; font-size: 14px; font-weight: 600; padding-left: 16px; position: relative; }
.as-notice::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 8px; height: 8px; background: var(--red); }
.as-notice:empty { display: none; }
.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer input { flex: 1 1 auto; min-width: 0; border: 1px solid #8b949a; border-radius: 2px; background: var(--card); padding: 8px 10px; font-size: 15px; }
.composer input:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 1px; }
.composer .btn:disabled { background: #aab1b6; border-color: #aab1b6; cursor: default; }
.as-fine { margin-top: 9px; }

/* What the planner could not place */
.plannote { position: absolute; left: 14px; top: 58px; z-index: 2; max-width: min(620px, calc(100% - 28px)); display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--ink); padding: 9px 10px 9px 30px; font-size: 14px; }
.plannote::before { content: ""; position: absolute; left: 12px; top: 50%; margin-top: -4px; width: 8px; height: 8px; background: var(--red); }
.plannote p { margin: 0; }
.plannote .btn { min-height: 32px; padding: 4px 10px; font-size: 13.5px; flex: none; }

/* ---------- narrower desktops ---------- */
@media (max-width: 1180px) and (min-width: 821px) {
  .app { grid-template-columns: 280px minmax(0, 1fr) 316px; }
  .sec { padding: 16px; }
  .part { grid-template-columns: 80px minmax(0, 1fr); }
  .part-thumb, .part-thumb img { width: 80px; height: 60px; }
}
/* Where the toolbar would wrap, Fit, Rotate, Duplicate and Delete keep their icons; the names stay for screen readers and in the tooltips. */
@media (max-width: 1720px) {
  .tool .tool-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tool:has(.tool-text) { padding: 0; width: 38px; justify-content: center; }
}

/* ---------- phones: lot on top, controls in a row, panels in a bottom sheet ---------- */
@media (max-width: 820px) {
  .app, .embed .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 44dvh); grid-template-areas: "bar" "stage" "tabs" "sheet"; }
  .embed .app { grid-template-rows: minmax(0, 1fr) auto minmax(0, 44dvh); grid-template-areas: "stage" "tabs" "sheet"; }
  .app[data-sheet="closed"] { grid-template-rows: auto minmax(0, 1fr) auto 0; }
  .embed .app[data-sheet="closed"] { grid-template-rows: minmax(0, 1fr) auto 0; }
  .bar { padding: 9px 14px; gap: 10px; }
  .bar h1 { font-size: 18px; }
  .stage { display: flex; flex-direction: column; }
  .view { position: relative; inset: auto; flex: 1 1 auto; min-height: 0; }
  .tools { position: static; flex: 0 0 auto; flex-wrap: nowrap; overflow-x: auto; padding: 7px 10px; background: var(--card); border-top: 1px solid var(--hairline); scrollbar-width: none; pointer-events: auto; }
  .tools::-webkit-scrollbar { display: none; }
  .bar-link { display: none; }
  .tools { gap: 6px; padding: 7px 8px; }
  .tools > * { flex: 0 0 auto; }
  .tool { min-height: 40px; }
  .tool { padding: 0 9px; }
  .tool-icon, .tool:has(.tool-text) { width: 34px; }
  .switch { min-height: 42px; gap: 6px; padding: 0 8px; }
  .switch-track { width: 24px; }
  .switch[aria-pressed="true"] .switch-knob { transform: translateX(8px); }
  .switch-ico { display: block; order: -1; }
  .switch-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .scale { left: 8px; bottom: 8px; }
  .is-plan .lbl-part:not(.is-sel) { font-size: 10px; padding: 2px 3px; }
  .tabs { grid-area: tabs; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); background: var(--card); }
  .tabs button { border: 0; background: var(--card); padding: 0 6px; min-height: 46px; font-size: 14px; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
  .tabs button + button { border-left: 1px solid var(--hairline); }
  .tabs button[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--accent-deep); }
  .side { grid-area: sheet; border: 0; border-top: 1px solid var(--hairline); display: none; padding-bottom: env(safe-area-inset-bottom); }
  .app[data-sheet="open"][data-tab="parts"] .side-parts, .app[data-sheet="open"][data-tab="lot"] .side-parts { display: block; }
  .app[data-tab="parts"] #secLot, .app[data-tab="lot"] #secPalette { display: none; }
  #secPalette { border-top: 0; }
  .app[data-sheet="open"][data-tab="selected"] .side-detail, .app[data-sheet="open"][data-tab="schedule"] .side-detail { display: block; }
  .app[data-tab="selected"] #secSchedule, .app[data-tab="schedule"] #secSelected { display: none; }
  .tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tabs button { font-size: 13px; padding: 0 2px; }
  .app[data-sheet="open"][data-tab="assistant"] .side-detail { display: block; }
  .app[data-tab="assistant"] #secSelected, .app[data-tab="assistant"] #secSchedule, .app[data-tab="selected"] #secAssistant, .app[data-tab="schedule"] #secAssistant { display: none; }
  .app[data-tab="selected"] #secSelected, .app[data-tab="schedule"] #secSchedule { border-top: 0; }
  .composer input { font-size: 16px; }
  .plannote { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); }
  .fn-top { padding: 11px 16px; gap: 12px; }
  .fn-form { padding: 26px 16px 0; }
  .fn-title { font-size: 27px; margin-bottom: 20px; }
  .fn-option { padding: 14px 14px; gap: 4px 12px; }
  .fn-option-name { font-size: 17px; }
  .fn-systems .fn-plan { width: 84px; height: 66px; }
  .fn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fn-split { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .fn-size .fn-field { width: calc(50% - 7px); }
  .fn-review { grid-template-columns: minmax(0, 1fr); }
  .fn-review dt { border-bottom: 0; padding: 11px 0 0; font-size: 14px; }
  .fn-review dd { padding: 2px 0 11px; }
  .fn-nav { padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
  .fn-content { padding-bottom: 28px; }
  .sec { padding: 14px 16px 16px; }
  .page { padding: 20px 16px; margin: 12px auto 30px; }
  .page-body { grid-template-columns: minmax(0, 1fr); }
  .sched-full { display: block; overflow-x: auto; }
}

/* ---------- print: the sheet only ---------- */
/* Narrow phones: the controls take two rows rather than a hidden scroll strip, so none is cut off. */
@media (max-width: 600px) {
  .tools { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
}

@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .app, .chip, .dlg, .sheet-bar, .funnel { display: none !important; }
  .sheet { position: static; background: #fff; overflow: visible; }
  .sheet[hidden] { display: block !important; }
  .page { border: 0; margin: 0; padding: 0; width: 100%; }
  .plan { max-height: 150mm; }
  .sched tr { break-inside: avoid; }
  @page { margin: 14mm; }
}

/* ?shot=1: the lot alone, full window, for the homepage picture. */
.shot .app { display: block; height: 100vh; }
.shot .bar, .shot .side, .shot .tools, .shot .tabs, .shot .scale, .shot .labels, .shot .plannote, .shot .funnel, .shot .lbl-tip { display: none !important; }
.shot .stage { position: fixed; inset: 0; }
