/* Daiku site, direction B ("canvas"): bright and clean, a floating sticky bar,
   the product on a dotted canvas, cards in a bento grid. Colours come from the
   logo: graphite #1F2328 and amber #D49A45. Dark mode is its own palette. */

@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("fonts/manrope-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("fonts/manrope-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("fonts/manrope-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("fonts/manrope-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("fonts/manrope-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("fonts/manrope-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Daiku mark (daiku-sigla/README.md): graphite on light, ivory on dark; the gold stays. */
  --dk-top: #55595F;
  --dk-front: #26282B;
  --dk-side: #3A3D42;
  --bg: #FAFAF8;
  --card: #FFFFFF;
  --sunk: #F2F0EC;
  --line: #E6E3DD;
  --dot: #D9D6D0;
  --ink: #1F2328;
  --muted: #5E5B57;
  --brand: #D49A45;        /* logo amber: fills, marks, chips (graphite text on it) */
  --accent-strong: #B8741C; /* large highlighted text */
  --accent-text: #9A5B0C;   /* small highlighted text */
  --on-brand: #1F2328;
  --cta: #1F2328;
  --on-cta: #FFFFFF;
  --focus: #B8741C;
  --danger: #A3271B;
  --melamine: #F4F2EE;
  --front: #FFFFFF;
  --hdf: #C8AD86;
  --edge: #1F2328;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 1px 2px rgba(31,35,40,.05), 0 12px 32px rgba(31,35,40,.08);
  --radius: 24px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
:root[data-theme="dark"] {
  --dk-top: #F6F2EA;
  --dk-front: #D9D3C7;
  --dk-side: #A39E93;
  --bg: #121417;
  --card: #1A1D21;
  --sunk: #22262B;
  --line: #2C3036;
  --dot: #30353B;
  --ink: #F2F1EE;
  --muted: #A3A8AE;
  --brand: #D49A45;
  --accent-strong: #E2AE62;
  --accent-text: #E8B36A;
  --on-brand: #121417;
  --cta: #D49A45;
  --on-cta: #121417;
  --focus: #E2AE62;
  --danger: #FF8A7A;
  /* Boards keep their real colours on the dark stage: white melamine stays white. */
  --melamine: #D9D5CD;
  --front: #ECE9E3;
  --hdf: #B89A72;
  --edge: #1F2328;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.45);
  color-scheme: dark;
}

html[data-lang="ro"] [lang="en"], html[data-lang="en"] [lang="ro"] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 1rem/1.6 var(--sans); }
img, svg, video, canvas { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.03em; line-height: 1.08; }
h1 { font-size: clamp(2.6rem, 6.2vw, 5.25rem); font-weight: 800; letter-spacing: -0.055em; line-height: .98; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); font-weight: 800; letter-spacing: -0.045em; }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.em { color: var(--accent-strong); }
.kicker { font: 500 .82rem/1.3 var(--mono); color: var(--accent-text); letter-spacing: .02em; }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 40ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 40; border-radius: 10px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

/* Floating sticky bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; padding-block: 12px; }
.bar-in { display: flex; align-items: center; gap: 14px; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); border-radius: 16px; padding: 7px 7px 7px 14px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; text-decoration: none; }
.logo svg { width: 24px; height: 30px; flex: none; }
.tabs { flex: 1 1 auto; min-width: 0; }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: .86rem; }
.tabs ul::-webkit-scrollbar { display: none; }
.tabs a { display: inline-block; text-decoration: none; padding: 7px 9px; border-radius: 10px; color: var(--muted); font-weight: 600; transition: background-color .15s, color .15s; }
.tabs a:hover { color: var(--ink); background: var(--sunk); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--sunk); }
.seg { display: inline-flex; gap: 2px; background: var(--sunk); border-radius: 10px; padding: 3px; }
.seg button { font: 500 .78rem/1 var(--mono); min-height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--sunk); color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 17px; height: 17px; }
.cta { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 16px; border-radius: 11px; background: var(--cta); color: var(--on-cta); font-weight: 700; font-size: .92rem; text-decoration: none; white-space: nowrap; border: 0; cursor: pointer; transition: transform .15s; }
.cta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
:root[data-theme="dark"] .cta::before { background: var(--on-cta); }
.cta:hover { transform: translateY(-1px); }
.ghost { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: .92rem; text-decoration: none; color: var(--ink); cursor: pointer; }
@media (max-width: 1080px) {
  .bar-in { flex-wrap: wrap; }
  .tabs { order: 5; flex: 1 1 100%; }
}
@media (max-width: 560px) { .bar .cta { display: none; } }

main { padding-block: 24px 24px; }
.stack { display: flex; flex-direction: column; gap: 72px; }
.stack-s { display: flex; flex-direction: column; gap: 12px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding-top: 32px; }
.hero-text { display: flex; flex-direction: column; gap: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.facts { display: flex; gap: 24px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.facts b { display: block; font: 500 1.35rem/1.15 var(--mono); color: var(--ink); letter-spacing: -0.03em; }
@media (max-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr); } }

/* Dotted canvas (3D stage) */
.canvas { position: relative; border-radius: 28px; background-color: var(--card); background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 22px 22px; border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.stage { position: relative; width: 100%; aspect-ratio: 4 / 3.2; max-height: 620px; }
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; outline: none; }
.stage canvas:active { cursor: grabbing; }
.stage canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.stage .fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.floating { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.viewbar { top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; }
.viewbar button { font: 700 .78rem/1 var(--sans); padding: 8px 11px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; min-height: 32px; }
.viewbar button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.props { right: 14px; bottom: 14px; width: 248px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: .85rem; }
.props h3 { font-size: .92rem; letter-spacing: -0.01em; }
.prop { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; color: var(--muted); }
.prop b { font: 500 .85rem var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.prop input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--brand); margin: 2px 0 4px; }
.hint { position: absolute; left: 16px; bottom: 14px; font: 500 .74rem var(--mono); color: var(--muted); }
@media (max-width: 640px) {
  .stage { aspect-ratio: 1 / 1; }
  .props { position: static; width: auto; margin: 0 12px 12px; box-shadow: none; }
  .hint { display: none; }
}

/* Bento */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card p { color: var(--muted); font-size: .92rem; }
.c7 { grid-column: span 7; } .c5 { grid-column: span 5; } .c4 { grid-column: span 4; } .c8 { grid-column: span 8; } .c6 { grid-column: span 6; } .c12 { grid-column: span 12; }
@media (max-width: 900px) { .bento > * { grid-column: 1 / -1; } }
.shot { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--sunk); }
.placeholder { border-radius: 14px; aspect-ratio: 21 / 8; display: grid; place-items: center; text-align: center; padding: 12px; color: var(--muted); font: 500 .78rem var(--mono); background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 16px 16px; border: 1px dashed var(--dot); }
.stat { font: 500 3.2rem/1 var(--mono); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.stat small { font-size: 1.1rem; color: var(--accent-text); margin-left: 4px; }
.band { border-radius: var(--radius); background: var(--sunk); border: 1px solid var(--line); padding: 22px 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.band p { flex: 1 1 340px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; font: 500 .78rem var(--mono); padding: 6px 10px; border-radius: 999px; background: var(--brand); color: var(--on-brand); }

/* App (configurator) */
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr) 460px; gap: 14px; align-items: start; }
@media (max-width: 1240px) { .app { grid-template-columns: 280px minmax(0, 1fr); } .app .results { grid-column: 1 / -1; } }
@media (max-width: 820px) { .app { grid-template-columns: minmax(0, 1fr); } }
.pane { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); min-width: 0; }
.controls { padding: 16px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }
@media (max-width: 820px) { .controls { position: static; } }
.controls fieldset { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.controls fieldset.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.controls legend { font: 800 .8rem/1 var(--sans); padding: 0 0 8px; letter-spacing: -0.01em; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); min-width: 0; }
.field.full { grid-column: 1 / -1; }
.input { display: flex; align-items: center; background: var(--sunk); border-radius: 10px; border: 1px solid transparent; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.input:focus-within { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent); }
.input input, .input select { font: 500 .92rem/1.2 var(--mono); color: var(--ink); background: transparent; border: 0; padding: 9px 10px; width: 100%; min-width: 0; min-height: 40px; outline: none; }
.input select { font-family: var(--sans); font-weight: 600; }
.input .unit { font: 400 .74rem var(--mono); color: var(--muted); padding-right: 10px; }
.note { font-size: .78rem; color: var(--muted); grid-column: 1 / -1; line-height: 1.45; }
.viewer { display: flex; flex-direction: column; overflow: hidden; }
.viewer .canvas { border: 0; border-radius: 0; box-shadow: none; }
.viewer .stage { aspect-ratio: 4 / 3.4; }
.drawing2d { padding: 20px; display: block; width: 100%; height: auto; }
.results { display: flex; flex-direction: column; overflow: hidden; }
.rtabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rtabs button { font: 700 .82rem/1 var(--sans); padding: 9px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; min-height: 36px; }
.rtabs button[aria-selected="true"] { background: color-mix(in srgb, var(--brand) 22%, var(--card)); color: var(--ink); }
.rtabs .spacer { flex: 1; }
.tabpanel { animation: fade .2s ease; }
@keyframes fade { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.table-box { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .8rem; }
th { text-align: left; color: var(--muted); font-weight: 700; font-size: .72rem; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); white-space: nowrap; }
td.num, th.num, td.c, th.c { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; } td.c, th.c { text-align: center; }
tbody tr { transition: background-color .15s; } tbody tr:hover { background: var(--sunk); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.kpi { background: var(--sunk); border-radius: 12px; padding: 10px 12px; font-size: .74rem; color: var(--muted); min-width: 0; }
.kpi b { display: block; font: 500 1.1rem/1.3 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-list { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.sheet-list figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sheet-list figcaption, .status-line { font: 500 .76rem var(--mono); color: var(--muted); }
.msg { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger); font-weight: 700; font-size: .9rem; }
.msg.info { background: var(--sunk); color: var(--muted); font-weight: 600; }

/* SVG drawings (2D views and sheets) */
.d-carcass { fill: var(--melamine); stroke: var(--edge); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.d-front { fill: var(--front); stroke: var(--edge); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.d-back { fill: var(--hdf); stroke: var(--edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.d-hidden { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.d-leg { fill: var(--muted); stroke: none; }
.d-dim { stroke: var(--accent-strong); stroke-width: 1.2; fill: none; vector-effect: non-scaling-stroke; }
.d-floor { stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.d-text { fill: var(--ink); font-family: var(--mono); }
.d-sheet { fill: var(--sunk); stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.d-part { fill: var(--melamine); stroke: var(--edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.d-part.front { fill: var(--brand); }
.d-trim { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }

/* Plain pages */
.prose { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.prose pre { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; overflow-x: auto; white-space: pre-wrap; font: 400 .78rem/1.5 var(--mono); margin: 0; }

/* Footer */
.foot { margin-top: 72px; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; padding-block: 24px 40px; font-size: .86rem; color: var(--muted); }
.foot .logo { font-size: 1rem; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* Project planner (configurator) */
.planner-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 520px; justify-content: flex-end; }
.toolbar .ghost { min-height: 38px; }
.planner-grid { grid-template-columns: 290px 320px minmax(0, 1fr); }
@media (max-width: 1180px) { .planner-grid { grid-template-columns: 290px minmax(0, 1fr); } .planner-grid .viewer { grid-column: 1 / -1; } }
@media (max-width: 760px) { .planner-grid { grid-template-columns: minmax(0, 1fr); } }
.pane-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pane-title { font-size: 1rem; letter-spacing: -0.02em; margin-right: auto; }
.cabinets { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cab { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; padding: 8px 8px 8px 6px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: background-color .15s, border-color .15s; }
.cab:hover { background: var(--sunk); }
.cab[aria-current="true"] { background: color-mix(in srgb, var(--brand) 16%, var(--card)); border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.cab.dragging { opacity: .45; }
.cab.over { box-shadow: inset 0 3px 0 var(--brand); }
.cab .grip { color: var(--muted); cursor: grab; font: 700 .8rem/1 var(--mono); user-select: none; }
.cab .select { all: unset; display: flex; flex-direction: column; min-width: 0; cursor: pointer; border-radius: 8px; }
.cab .select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cab .name { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab .meta { font: 500 .74rem var(--mono); color: var(--muted); }
.cab .tools { display: flex; gap: 2px; }
.cab .tools button { width: 26px; height: 26px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 700 .8rem/1 var(--mono); }
.cab .tools button:hover { background: var(--card); color: var(--ink); }
.empty-list { padding: 18px 14px; color: var(--muted); font-size: .88rem; }
.wall-pane .pane-head { border-bottom: 0; }
.wall-status { margin: 0; font: 500 .82rem var(--mono); color: var(--muted); }
.wall-status.bad { color: var(--danger); font-weight: 700; }
.wall-box { padding: 0 16px 16px; overflow-x: auto; }
.wall-svg { display: block; width: 100%; min-width: 640px; height: auto; max-height: 420px; }
.w-wall { fill: var(--sunk); stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.w-over { fill: color-mix(in srgb, var(--danger) 14%, transparent); stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.w-cab { cursor: pointer; }
.w-cab:focus { outline: none; }
.w-cab:focus-visible .w-hit, .w-cab:hover .w-hit { stroke: var(--brand); stroke-width: 3; }
.w-cab.on .w-hit { stroke: var(--accent-strong); stroke-width: 3; }
.w-hit { fill: transparent; stroke: transparent; vector-effect: non-scaling-stroke; }
.w-label { fill: var(--muted); font-family: var(--mono); }
.cut-table { table-layout: fixed; }
.cut-table th, .cut-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 6px; }
.cut-table td.cabs { white-space: normal; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.cut-table col.c-nr { width: 3.2em; } .cut-table col.c-qty { width: 3.4em; } .cut-table col.c-band { width: 3.4em; }
.sheet-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.sheet-grid > .status-line, .sheet-grid > .msg { grid-column: 1 / -1; }
.quote-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; padding: 14px; align-items: start; }
@media (max-width: 900px) { .quote-grid { grid-template-columns: minmax(0, 1fr); } }
.prices { display: flex; flex-direction: column; gap: 10px; background: var(--sunk); border-radius: 16px; padding: 14px; }
.prices h3 { font-size: .95rem; }
.price-fields { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 6px 10px; align-items: center; font-size: .82rem; }
.price-fields .sub { grid-column: 1 / -1; font: 800 .74rem var(--sans); color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .06em; }
.price-fields .input { background: var(--card); }
.price-fields .input input { min-height: 34px; padding: 6px 8px; text-align: right; }
.price-fields label.check { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.quote-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 14px 0 0; font-size: .9rem; }
.quote-totals dt { color: var(--muted); } .quote-totals dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.quote-totals .grand { font-weight: 800; color: var(--ink); font-size: 1.05rem; border-top: 1px solid var(--line); padding-top: 8px; }
@media print {
  .bar, .foot, .no-print, .skip, .hint { display: none !important; }
  body { background: #fff; color: #000; }
  .pane, .card, .canvas { box-shadow: none !important; }
  .planner-grid { grid-template-columns: 1fr !important; }
  .viewer .canvas { display: none; }
  .tabpanel[hidden] { display: block !important; }
  .rtabs { display: none; }
  .tabpanel { break-inside: auto; page-break-before: auto; }
  .tabpanel + .tabpanel { margin-top: 18px; }
  .sheet-grid { grid-template-columns: repeat(2, 1fr); }
  .wall-svg { min-width: 0; }
}
.cut-table col.c-cabs { width: 20%; }

.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.check-inline input { width: 16px; height: 16px; accent-color: var(--brand); }
.example-note { background: color-mix(in srgb, var(--brand) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 50%, transparent); border-radius: 12px; padding: 10px 12px; font-size: .8rem; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.example-note summary { cursor: pointer; font-weight: 700; }
.sources { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.price-tools .ghost { min-height: 34px; padding: 0 10px; font-size: .8rem; }
.msg .msg-action { margin-left: 10px; min-height: 30px; padding: 0 10px; font-size: .8rem; }

/* Sheet optimiser */
.opt-grid { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1160px) { .opt-grid { grid-template-columns: minmax(0, 1fr); } }
.parts-box { max-height: 520px; overflow: auto; }
.parts-table { min-width: 540px; }
.parts-table { table-layout: fixed; }
.parts-table col.p-nr { width: 2.6em; } .parts-table col.p-num { width: 5.6em; } .parts-table col.p-qty { width: 4em; } .parts-table col.p-mat { width: 8.2em; } .parts-table col.p-g { width: 3.4em; } .parts-table col.p-del { width: 2.6em; }
.parts-table td { padding: 3px 4px; }
.parts-table input, .parts-table select { width: 100%; min-width: 0; font: 500 .82rem/1.2 var(--mono); color: var(--ink); background: var(--sunk); border: 1px solid transparent; border-radius: 8px; padding: 6px 6px; }
.parts-table input[type="text"], .parts-table select { font-family: var(--sans); font-weight: 600; }
.parts-table input:focus, .parts-table select:focus { outline: none; border-color: var(--brand); background: var(--card); }
.parts-table input[type="number"] { text-align: right; }
.parts-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.parts-table input[aria-invalid="true"] { border-color: var(--danger); }
.parts-table .del { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.parts-table .del:hover { background: var(--sunk); color: var(--danger); }
.paste { padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.paste summary { cursor: pointer; font-weight: 700; font-size: .88rem; }
.paste textarea { width: 100%; margin: 8px 0; min-height: 120px; font: 400 .84rem/1.5 var(--mono); border-radius: 12px; background: var(--sunk); color: var(--ink); border: 1px solid transparent; padding: 10px; resize: vertical; }
input.sheet-settings { width: 100%; min-width: 0; text-align: right; font: 500 .82rem var(--mono); background: var(--sunk); color: var(--ink); border: 1px solid transparent; border-radius: 8px; padding: 6px; }
input.sheet-settings:focus { outline: none; border-color: var(--brand); background: var(--card); }
.sheets-table { table-layout: fixed; }
.sheets-table th:first-child, .sheets-table td:first-child { white-space: normal; }
.materials { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.material-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 8px 4px 2px; }
.material-head h3 { font-size: 1rem; }
.sheet-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; }
.sheet-card svg { width: 100%; height: auto; display: block; }
.sheet-card figcaption { font: 500 .78rem var(--mono); color: var(--muted); }
.offcuts { font: 500 .76rem var(--mono); color: var(--muted); margin: 0; }
.d-off { fill: color-mix(in srgb, var(--brand) 14%, transparent); stroke: var(--accent-strong); stroke-width: 1.2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
/* Text on boards: boards keep their real colours in both themes, so their text stays dark. */
.d-part-label { fill: #1F2328; font-family: var(--sans); font-weight: 700; }
.d-part-size { fill: #4A4F57; font-family: var(--mono); }
@media print { .opt-grid { grid-template-columns: 1fr !important; } .parts-box { max-height: none; overflow: visible; } .sheet-card { break-inside: avoid; } }

/* Calculators */
.calc-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.calc-tabs button { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; min-width: 0; }
.calc-tabs button b { font-size: .92rem; letter-spacing: -0.01em; }
.calc-tabs button small { font-size: .74rem; color: var(--muted); }
.calc-tabs button:hover { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }
.calc-tabs button[aria-selected="true"] { background: color-mix(in srgb, var(--brand) 18%, var(--card)); border-color: var(--brand); }
@media (max-width: 900px) { .calc-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .calc-tabs button:last-child { grid-column: 1 / -1; } }
.calc-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 14px; align-items: start; }
.calc-grid[hidden] { display: none; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: minmax(0, 1fr); } .calc-form.controls { position: static; } }
.calc-out .kpis { border-top: 0; border-bottom: 1px solid var(--line); }
.calc-svg { max-height: 460px; }
.calc-out table { font-size: .82rem; }
.calc-out .table-box { padding: 0 12px; }
.calc-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.calc-note { padding: 8px 12px 0; }
td.calc-error, li.calc-error { color: var(--danger); font-weight: 700; white-space: normal; }
li.calc-error { list-style: none; padding: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--sunk); border: 1px solid transparent; font: 500 .84rem var(--mono); color: var(--ink); cursor: pointer; }
.chip:has(input:checked) { background: color-mix(in srgb, var(--brand) 22%, var(--card)); border-color: var(--brand); }
.chip input { accent-color: var(--accent-strong); margin: 0; }
.options { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.option { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.option.first { border-color: var(--brand); }
.option-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.option-head b { font: 600 1rem var(--mono); }
.option-head .ghost { margin-left: auto; min-height: 34px; font-size: .84rem; }
.option-bar { display: flex; gap: 2px; height: 34px; }
.option-bar span { flex-basis: 0; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; font: 500 .7rem var(--mono); border-radius: 4px; }
.option-bar .cab { background: var(--melamine); border: 1px solid var(--edge); color: #1F2328; }
.option-bar .reserved { background: repeating-linear-gradient(45deg, var(--sunk), var(--sunk) 5px, var(--line) 5px, var(--line) 10px); color: var(--muted); }
.option-bar .fill { background: var(--brand); }
@media print { .calc-tabs, .calc-form, .calc-actions { display: none !important; } .calc-grid { grid-template-columns: 1fr !important; } }
td.calc-advice { white-space: normal; color: var(--accent-text); font-weight: 600; background: color-mix(in srgb, var(--brand) 10%, transparent); }
@media (max-width: 560px) {
  .calc-out .kpis { grid-template-columns: minmax(0, 1fr) !important; }
  .calc-tabs button { padding: 10px 12px; }
  .calc-tabs button small { display: none; }
}
.tool-card { text-decoration: none; color: inherit; }
.tool-card h3::after { content: " →"; color: var(--accent-strong); }
.tool-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps .card { position: relative; padding-top: 20px; }
.steps .card:hover { transform: none; box-shadow: none; }
.steps .card .ghost { align-self: flex-start; margin-top: auto; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font: 700 1rem var(--mono); }
.howto-read { display: flex; flex-direction: column; gap: 14px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; }
@media (max-width: 760px) { .legend { grid-template-columns: minmax(0, 1fr); } }
.legend dt { font: 700 .86rem var(--mono); color: var(--accent-text); }
.legend dd { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.ticks { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: .92rem; }
.ticks li::marker { color: var(--accent-strong); }
.steps h2 { font-size: 1.2rem; letter-spacing: -0.02em; }

/* Questions */
.faq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .faq-grid { grid-template-columns: minmax(0, 1fr); max-width: 820px; } }
.faq-h { font-size: 1.1rem; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--accent-text); font-family: var(--mono); font-weight: 600; }
.faq { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 1.1rem/1 var(--mono); color: var(--accent-strong); }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 8px 0 0; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.check-field .check-inline { min-height: 40px; }
td small.why { display: block; font: 500 .7rem var(--sans); color: var(--muted); white-space: normal; }

/* Starter projects */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .project-grid { grid-template-columns: minmax(0, 1fr); } }
.project h2 { font-size: 1.15rem; letter-spacing: -0.02em; }
.project:hover { transform: none; }
.project-svg { width: 100%; height: 190px; background: var(--sunk); border-radius: 14px; padding: 10px; }
.p-wall { fill: var(--card); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.project-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
.project-facts div { display: flex; align-items: baseline; gap: 5px; }
.project-facts dt { font: 600 1rem var(--mono); color: var(--ink); }
.project-facts dd { margin: 0; font-size: .8rem; color: var(--muted); }
.project .actions { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; max-width: 980px; }
.news > li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 24px; padding: 24px 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .news > li { grid-template-columns: minmax(0, 1fr); } }
.news time { font: 600 .9rem var(--mono); color: var(--accent-text); padding-top: 4px; }
.news h2 { font-size: 1.2rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.news .ticks b { color: var(--ink); }

/* Configurator: the selected cabinet's parts on the sheets and in the cut list */
.sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 14px 0; }
.sel-status { flex: 1 1 100%; margin: 0; font: 600 .82rem var(--mono); color: var(--accent-text); }
.d-piece { cursor: pointer; }
.d-piece:hover .d-part { stroke-width: 2.4; }
.sel-mode .d-piece:not(.sel) .d-part { fill: color-mix(in srgb, var(--ink) 9%, var(--card)); stroke: color-mix(in srgb, var(--ink) 38%, transparent); }
.sel-mode .d-piece:not(.sel) text { fill: var(--muted); }
.d-piece.sel .d-part { fill: color-mix(in srgb, var(--brand) 62%, #FFFFFF); stroke: var(--accent-strong); stroke-width: 2; }
.sheet-list figure.has-sel figcaption { color: var(--accent-text); font-weight: 700; }
.cut-table tr.sel td { background: color-mix(in srgb, var(--brand) 16%, transparent); }
@media print { .sel-mode .d-piece:not(.sel) .d-part { fill: var(--melamine); stroke: var(--edge); } }

/* Homepage showcase: captures straight from Daiku */
.showcase-head { display: grid; gap: 10px; max-width: 62ch; margin-bottom: 28px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gallery .wide { grid-column: span 2; grid-row: span 2; }
.screens-h { margin: 48px 0 16px; font-size: 1.3rem; }
.screens { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.work { margin: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
.work-open { display: block; flex: 1; padding: 0; border: 0; background: var(--sunk); cursor: zoom-in; overflow: hidden; }
.work-open img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.work-open:hover img { transform: scale(1.025); }
.work-open:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -4px; }
.work-wait { flex: 1; min-height: 150px; aspect-ratio: 16 / 10; display: grid; place-items: center; background-color: var(--sunk); background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 18px 18px; font: 500 .76rem var(--mono); color: var(--muted); }
.work figcaption { display: grid; gap: 2px; padding: 14px 16px 16px; font-size: .88rem; color: var(--muted); }
.work figcaption b { color: var(--ink); font-size: .98rem; }
.work-facts { margin-top: 4px; font: 500 .76rem/1.4 var(--mono); color: var(--accent-text); font-variant-numeric: tabular-nums; }
.gallery .work-open { background: #FFFFFF; }
.gallery .work-open img { object-fit: contain; }
.screens .work-open { flex: none; aspect-ratio: 4 / 3; background: #FFFFFF; }
.screens .work-open img { object-position: top center; }
.lightbox { width: min(1200px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgba(10, 12, 14, .72); }
.lightbox img { display: block; width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 12px; background: var(--sunk); }
.lightbox-cap { margin: 10px 4px 0; color: var(--muted); font-size: .9rem; }
.lightbox-bar { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
@media (max-width: 960px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery .wide { grid-row: auto; }
  .screens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .gallery, .screens { grid-template-columns: minmax(0, 1fr); }
  .gallery .wide { grid-column: auto; }
}
