/* ===== Tokens ===== */
:root {
  --bg: #f4eee4;
  --surface: #fffdf9;
  --surface-2: #f8f3eb;
  --canvas-bg: #efe6d8;
  --ink: #2b2118;
  --ink-2: #6b5644;
  --ink-3: #a08d7a;
  --line: #e6dbcb;
  --line-2: #d8cab6;
  --accent: #b5652b;
  --accent-ink: #8e4a1d;
  --accent-soft: #f6e4d4;
  --ok: #3f7d4e;
  --warn: #b5452b;
  --wood-light: #E9D5AE;
  --wood-mid: #BA6E46;
  --wood-dark: #5E3D25;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 35, 10, .06), 0 6px 20px rgba(60, 35, 10, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --header-h: 60px;
  --stepper-h: 58px;
  --footer-h: 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .38; }
svg { display: block; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 0 4px; border-radius: 4px; font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Top bar ===== */
.topbar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: #2e2119;
  color: #f5ebdd;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 19px; font-weight: 600; white-space: nowrap; }
.brand em { font-style: normal; color: #e0a46f; }
.logo { width: 30px; height: 30px; }
.board-name {
  flex: 1; min-width: 0; max-width: 360px; margin-left: auto;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  color: #f5ebdd; border-radius: 9px; padding: 7px 12px; font-weight: 500;
}
.board-name:focus { outline: none; border-color: #e0a46f; background: rgba(255,255,255,.12); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .icon-btn { color: #f5ebdd; }
.top-actions .icon-btn:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.divider { width: 1px; height: 22px; background: rgba(255,255,255,.15); margin: 0 6px; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--ink-2);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn svg, .btn svg, .muted svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted svg { display: inline-block; vertical-align: -4px; width: 16px; height: 16px; }

/* ===== Stepper ===== */
.stepper {
  height: var(--stepper-h);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.step {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  border: 0; background: none; padding: 6px 10px; border-radius: 999px; color: var(--ink-3); font-weight: 600;
}
.step:hover { background: var(--surface-2); color: var(--ink-2); }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-2); font-size: 12px; background: var(--surface);
}
.step-num svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.step.done { color: var(--ink-2); }
.step.done .step-num { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.step.active { color: var(--ink); }
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.step-line { width: 28px; height: 2px; background: var(--line); border-radius: 2px; flex-shrink: 0; }

/* ===== Workspace ===== */
.workspace {
  display: grid;
  grid-template-columns: minmax(380px, 480px) minmax(0, 1fr);
  height: calc(100vh - var(--header-h) - var(--stepper-h) - var(--footer-h));
  height: calc(100dvh - var(--header-h) - var(--stepper-h) - var(--footer-h));
}
.panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--surface); border-right: 1px solid var(--line);
}
.panel-head { padding: 22px 26px 10px; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.panel-head h1 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 2px 0 0; letter-spacing: -.01em; }
.panel-body { flex: 1; overflow-y: auto; padding: 6px 26px 24px; }
.panel-nav {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 26px; border-top: 1px solid var(--line); background: var(--surface);
}

.lead { color: var(--ink-2); margin: 4px 0 16px; }
.lead.tight { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
h3 { font-family: var(--serif); font-weight: 600; font-size: 17px; margin: 24px 0 10px; }
.warn { color: var(--warn); font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.row-between > :first-child { min-width: 0; flex: 1; }

/* ===== Buttons & controls ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover:not(:disabled) { border-color: var(--ink-3); background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon-only { padding: 9px; }
.btn-row { display: flex; gap: 8px; align-items: center; }
.btn-row.wrap { flex-wrap: wrap; margin-top: 12px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  margin-bottom: 12px;
}
.seg button {
  border: 0; background: none; padding: 7px 13px; border-radius: 8px;
  font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(60,35,10,.15); }
.seg.small { margin: 0; }
.seg.small button { padding: 5px 11px; font-size: 12px; }
.seg.wrap { flex-wrap: wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-weight: 600; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: baseline;
}
.chip small { color: var(--ink-3); font-weight: 500; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.toggle {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: none; padding: 8px 0; text-align: left;
}
.btn-row .toggle { width: auto; }
.toggle strong { display: block; font-weight: 600; }
.toggle small { display: block; color: var(--ink-3); font-size: 12px; }
.toggle-track {
  width: 38px; height: 22px; border-radius: 99px; background: var(--line-2);
  position: relative; flex-shrink: 0; transition: background .15s;
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.toggle.on .toggle-track { background: var(--accent); }
.toggle.on .toggle-thumb { transform: translateX(16px); }

/* fields */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; margin-bottom: 6px; }
.field .field-label { margin-bottom: 0; }
.field-label output { color: var(--accent-ink); font-weight: 700; }
.field-hint { font-size: 11.5px; color: var(--ink-3); }
.field > input[type=text], .search input, .custom-row input[type=text] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
}
.input-unit {
  display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.input-unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-unit input { flex: 1; width: 100%; min-width: 0; border: 0; padding: 9px 10px; background: none; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; }
.input-unit em { font-style: normal; color: var(--ink-3); font-size: 12px; padding: 0 10px 0 2px; }
.input-unit.sm input { padding: 6px 6px; width: 54px; }
.input-unit.sm em { padding-right: 8px; }
.field > input:focus, .search input:focus, .custom-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

input[type=range] { width: 100%; accent-color: var(--accent); margin: 2px 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.align-end { align-items: end; }
.align-end .btn-row { margin-bottom: 14px; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin-bottom: 14px;
  background: var(--surface);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-head strong { font-size: 14px; }
.callout { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 4px 0 14px; }

details.shop { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
details.shop summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; color: var(--ink-2); }

/* ===== Style step ===== */
.style-cards { display: flex; flex-direction: column; gap: 12px; }
.style-card {
  position: relative; display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center;
  padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.style-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.style-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.style-card img { width: 132px; height: 88px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(60,35,10,.25)); }
.style-head { display: flex; gap: 8px; align-items: center; }
.style-head strong { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.style-body p { margin: 3px 0 6px; color: var(--ink-2); font-size: 13px; }
.style-body ul { margin: 0; padding-left: 16px; color: var(--ink-3); font-size: 12px; }
.badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.badge.easy { background: #e3efe2; color: var(--ok); }
.badge.mid { background: #f7e6d3; color: var(--accent-ink); }
.style-check {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; place-items: center;
}
.style-check svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; }
.style-card.on .style-check { display: grid; }

/* ===== Size step ===== */
.mini-diagram { display: flex; align-items: center; }
.eg-diagram { width: 100%; height: auto; }
.eg-diagram text { font-size: 9px; fill: var(--ink-2); font-family: var(--font); font-weight: 600; }
.eg-diagram text.accent { fill: var(--accent); }

/* ===== Woods step ===== */
.palette {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); margin-bottom: 12px; background: var(--surface-2);
}
.palette-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-right: 4px; }
.wood-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px;
  border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 12px; white-space: nowrap;
}
.wood-chip i { width: 18px; height: 18px; border-radius: 50%; background: var(--sw) center/cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.wood-chip small { color: var(--ink-3); font-weight: 500; }
.wood-chip.removable b { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--ink-3); }
.wood-chip.removable b svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.wood-chip.removable:hover { border-color: var(--warn); }
.wood-chip.removable:hover b { color: var(--warn); }
.search { margin-bottom: 12px; }
.wood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.wood-card {
  display: flex; gap: 10px; align-items: center; text-align: left;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 7px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.wood-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.wood-card.on { border-color: var(--accent); background: #fffaf4; }
.wood-swatch {
  width: 54px; height: 54px; border-radius: 9px; flex-shrink: 0; background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); display: grid; place-items: center;
}
.wood-tick { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.wood-tick svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; }
.wood-meta { display: flex; flex-direction: column; min-width: 0; }
.wood-meta strong { font-size: 13px; }
.wood-meta small { color: var(--ink-3); font-size: 11px; }
.wood-meta .wood-note { color: var(--ink-2); line-height: 1.3; margin-top: 2px; }
.custom-wood { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.custom-row { display: flex; gap: 8px; margin-top: 6px; }
.custom-row input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: pointer; }

/* ===== Layout step ===== */
.pattern-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
.pattern-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
.pattern-btn:hover { border-color: var(--line-2); }
.pattern-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.pattern-icon { width: 34px; height: 34px; border-radius: 4px; overflow: hidden; }

.width-meter { font-weight: 700; font-size: 13px; color: var(--warn); }
.width-meter.ok { color: var(--ok); }
.brush-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.brushes { display: flex; flex-wrap: wrap; gap: 6px; }
.brush {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface);
  background-size: cover; background-position: center; box-shadow: 0 0 0 1px var(--line-2);
}
.brush.on { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.08); }

.strip-list { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.strip-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 6px; align-items: center;
  padding: 4px 6px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
}
.strip-row:hover { background: var(--surface-2); }
.strip-row.sel { background: #fff6e1; border-color: #f0c96a; }
.strip-sw {
  width: 28px; height: 28px; border-radius: 7px; background-size: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  display: grid; place-items: center;
}
.strip-sw b {
  min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255,253,249,.88); font-size: 10.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.strip-row select { min-width: 0; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-weight: 500; font-size: 13px; }
.strip-tools { display: flex; gap: 0; }
.strip-tools button { width: 26px; height: 28px; border: 0; background: none; border-radius: 7px; color: var(--ink-3); display: grid; place-items: center; }
.strip-tools button:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.strip-tools svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.strip-tools button.on { color: var(--accent); }
.strip-tools button.open { background: var(--accent-soft); color: var(--accent-ink); }

/* splits */
.split-summary {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.split-summary:hover { border-color: var(--accent); }
.split-summary.inactive { opacity: .55; }
.split-bar {
  display: flex; flex: 1; min-width: 36px; height: 18px; border-radius: 4px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.split-bar i { display: block; background-size: cover; border-right: 1px solid rgba(30,15,5,.3); }
.split-bar i:last-child { border-right: 0; }
.split-bar.layers { flex-direction: column; }
.split-bar.layers i { border-right: 0; border-bottom: 1px solid rgba(30,15,5,.3); }
.split-editor {
  margin: 2px 0 8px 34px; padding: 10px 12px 4px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
}
.split-editor .seg { margin-bottom: 8px; }
.split-editor p { margin: 0 0 8px; }
.chips.tight { gap: 6px; margin-bottom: 8px; }
.chips.tight .chip { padding: 4px 10px; font-size: 12px; }
.split-parts { display: flex; flex-direction: column; gap: 4px; }
.split-part { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.split-part select { min-width: 0; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 13px; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.sm svg { width: 15px; height: 15px; }
.btn-row.tight { margin-top: 8px; margin-bottom: 6px; gap: 6px; }

/* panels & accent rows (end grain) */
:root { --panel-b: #3f6f8f; --panel-b-soft: #e1ecf3; }
.panel-tabs { display: flex; margin-bottom: 10px; }
.panel-tabs button { flex: 1; }
.card.panel-b { border-color: var(--panel-b); box-shadow: inset 3px 0 0 var(--panel-b); }
.card.panel-b .panel-tabs button.on { color: var(--panel-b); }
.warn-note {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 9px; font-size: 12px;
  background: #fbeee6; color: var(--warn); border: 1px solid #f0cdbb;
}
button.link { border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 700; text-decoration: underline; font-size: inherit; }
.slice-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 6px; }
.slice-chip {
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 7px; font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.slice-chip:hover { border-color: var(--ink-3); }
.slice-chip.b { background: var(--panel-b); border-color: var(--panel-b); color: #fff; }
.slice-chip { position: relative; }
.slice-chip.sel { outline: 2.5px solid #4a9fe0; outline-offset: 1px; }
.slice-chip.ov::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}
.slice-nav { display: flex; align-items: center; gap: 4px; margin: 4px 0 8px; }
.slice-nav .icon-btn { width: 30px; height: 30px; }
.slice-nav .icon-btn:first-child svg { transform: rotate(-90deg); }
.slice-nav .icon-btn:nth-child(3) svg { transform: rotate(-90deg); }
.slice-nav strong { font-size: 14px; }
.cell-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 8px; max-height: 300px; overflow-y: auto; }
.cell-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 44px; gap: 6px; align-items: center; padding: 2px 4px; border-radius: 8px; }
.cell-row.over { background: var(--accent-soft); }
.cell-row select { min-width: 0; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 13px; }
.click-mode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.key-a, .key-b { display: inline-block; padding: 0 6px; border-radius: 5px; font-weight: 700; font-size: 11px; }
.key-a { border: 1.5px solid var(--line-2); color: var(--ink-2); }
.key-b { background: var(--panel-b); color: #fff; }
.inline-field { flex-direction: row; align-items: center; gap: 10px; margin: 2px 0 4px; }
.inline-field .input-unit em { white-space: nowrap; }
.acc-head, .acc-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 96px 92px 28px; gap: 6px; align-items: center; }
.acc-head { margin-bottom: 4px; font-weight: 600; }
.acc-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.acc-row select { min-width: 0; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 13px; }
.acc-row .input-unit.sm input { width: 100%; }
.acc-row .input-unit em { white-space: nowrap; }

/* ===== Summary step ===== */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stats span { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stats strong { font-size: 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.cut { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cut th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cut td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cut tr:last-child td { border-bottom: 0; }
.materials { display: flex; flex-direction: column; gap: 8px; }
.mat { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; }
.mat-bar { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.mat-bar i { display: block; height: 100%; background-size: cover; }
.mat-num { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }
.mat-num strong { color: var(--ink); font-size: 14px; }
.mat.total { grid-template-columns: 1fr auto; border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; }
ol.steps { padding-left: 20px; margin: 0; color: var(--ink-2); }
ol.steps li { margin-bottom: 8px; padding-left: 4px; }
ol.steps li::marker { color: var(--accent); font-weight: 700; }
.export { margin-top: 22px; }

/* ===== Preview ===== */
.preview {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.55), transparent 70%),
    var(--canvas-bg);
}
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.spacer { flex: 1; }
.toggle-chip { padding: 5px 11px; font-size: 12px; }
.canvas-wrap { position: relative; flex: 1; min-height: 240px; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.tip {
  position: absolute; pointer-events: none; z-index: 2;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(43,33,24,.94); color: #f5ebdd; padding: 8px 10px; border-radius: 10px;
  font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.2); white-space: nowrap;
}
.tip[hidden] { display: none; }
.tip .wood-chip { background: transparent; border-color: rgba(255,255,255,.2); color: #fff; align-self: flex-start; }
.preview-foot { display: flex; align-items: center; gap: 14px; padding: 6px 16px 4px; flex-wrap: wrap; }
.dims { display: flex; flex-direction: column; }
.dims strong { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.dims span { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; justify-content: flex-end; }
.hint { margin: 0; padding: 4px 16px 12px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 13px;
  transition: opacity .2s, transform .2s; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .brand span { display: none; }
}
@media (max-width: 960px) {
  .workspace { grid-template-columns: minmax(0, 1fr); height: auto; }
  .preview { order: -1; position: sticky; top: 0; z-index: 5; height: 46vh; border-bottom: 1px solid var(--line); }
  .preview-foot .legend { display: none; }
  .hint { display: none; }
  .panel { border-right: 0; scroll-margin-top: 46vh; }
  .panel-body { overflow: visible; padding: 6px 16px 20px; }
  .panel-head { padding: 18px 16px 6px; }
  .panel-nav { position: sticky; bottom: 0; padding: 12px 16px; }
  .step-label { display: none; }
  .step.active .step-label { display: inline; }
  .step-line { width: 14px; }
  .board-name { max-width: none; }
  .topbar { padding: 0 12px; gap: 10px; }
  .top-actions .divider, #new, #open { display: none; }
}
@media (max-width: 520px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .style-card { grid-template-columns: 96px 1fr; }
  .style-card img { width: 96px; height: 70px; }
  .mat { grid-template-columns: 1fr auto; }
  .mat-bar { display: none; }
  .pattern-grid { grid-template-columns: repeat(3, 1fr); }
  .top-actions #redo { display: none; }
}

/* ===== Print ===== */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .topbar, .stepper, .panel-nav, .preview-bar, .hint, .export, .toast { display: none !important; }
  .workspace { display: flex; flex-direction: column; height: auto; }
  .preview { order: -1; height: 92mm; background: #fff; break-inside: avoid; position: static; }
  .panel { border: 0; }
  .panel-body { overflow: visible; }
  .panel-head { padding-top: 0; }
  .panel-body > .field { display: none; }
}

/* handle sub-options */
.sub-options { margin: -4px 0 10px; padding: 10px 12px 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.sub-options .seg { margin-bottom: 10px; }

/* ===== Pattern catalog ===== */
.catalog-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 10px; border-radius: 9px;
  border: 1px solid rgba(224,164,111,.55); background: rgba(224,164,111,.14); color: #f5ebdd; font-weight: 600; font-size: 13px;
}
.catalog-btn:hover { background: rgba(224,164,111,.26); }
.catalog-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.catalog-open .catalog-btn { background: #e0a46f; color: #2e2119; border-color: #e0a46f; }

.catalog { display: none; height: calc(100vh - var(--header-h) - var(--footer-h)); height: calc(100dvh - var(--header-h) - var(--footer-h)); overflow-y: auto; background: var(--bg); }
.catalog-open .catalog { display: block; }
.catalog-open .stepper, .catalog-open .workspace { display: none; }
.catalog-inner { max-width: 1320px; margin: 0 auto; padding: 28px 24px 60px; }
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.catalog-head h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; margin: 4px 0 6px; letter-spacing: -.01em; }
.catalog-head .lead { margin: 0; max-width: 640px; }
.catalog-tools {
  position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 0; margin-bottom: 8px; background: var(--bg);
}
.catalog-tools .seg { margin: 0; }
.catalog-tools .seg .count { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.catalog-search {
  flex: 1; min-width: 200px; max-width: 360px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
}
.catalog-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.tpl-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.tpl-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60,35,10,.08), 0 14px 30px rgba(60,35,10,.12); }
.tpl-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; border: 0; padding: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.6), transparent 70%), var(--canvas-bg);
}
.tpl-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .25s; }
.tpl-thumb .tpl-iso { opacity: 0; }
.tpl-thumb:hover .tpl-iso { opacity: 1; }
.tpl-thumb:hover:has(.tpl-iso) .tpl-top { opacity: 0; }
.tpl-hover {
  position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700;
  background: rgba(43,33,24,.75); color: #fff; opacity: 0; transition: opacity .2s;
}
.tpl-thumb:hover .tpl-hover { opacity: 1; }
.tpl-loading {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tpl-body { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px 14px; flex: 1; }
.tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-head h3 { margin: 0; font-size: 17px; }
.badge.adv { background: #e7e1f3; color: #5a3f8c; }
.tpl-meta { font-size: 11.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tpl-body p { margin: 0; color: var(--ink-2); font-size: 13px; flex: 1; }
.tpl-woods { display: flex; flex-wrap: wrap; gap: 4px; }
.tpl-woods .wood-chip { font-size: 11px; padding: 2px 8px 2px 2px; }
.tpl-woods .wood-chip i { width: 14px; height: 14px; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.tpl-tags span { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tpl-body .btn { align-self: flex-start; margin-top: 4px; }

.catalog-promo {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: -4px 0 16px; padding: 12px 14px; text-align: left;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); color: var(--ink);
}
.catalog-promo:hover { border-color: var(--accent); background: var(--accent-soft); }
.catalog-promo svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; flex-shrink: 0; }
.catalog-promo span { flex: 1; }
.catalog-promo strong { display: block; }
.catalog-promo small { color: var(--ink-3); }
.catalog-promo b { color: var(--accent); font-size: 18px; }

@media (max-width: 960px) {
  .catalog-btn span { display: none; }
  .catalog-btn { padding: 7px; }
  .catalog-head { flex-direction: column; align-items: flex-start; }
  .catalog-head h1 { font-size: 26px; }
  .catalog-inner { padding: 20px 16px 48px; }
}

/* angled patterns */
.pattern-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .pattern-grid.four { grid-template-columns: repeat(2, 1fr); } }
.pattern-grid.three { grid-template-columns: repeat(3, 1fr); }
.warn-text { color: var(--warn); }
.field-select { width: 100%; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }

/* ===== Build-step diagrams ===== */
.diagram-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: -2px 0 10px; }
details.diagram { margin: 6px 0 4px; }
details.diagram summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 700; color: var(--accent-ink); padding: 3px 10px; border-radius: 99px;
  background: var(--accent-soft); border: 1px solid #efcfb4;
}
details.diagram summary::-webkit-details-marker { display: none; }
details.diagram summary::before { content: '▸'; font-size: 11px; transition: transform .15s; }
details.diagram[open] summary::before { transform: rotate(90deg); }
details.diagram[open] summary { background: var(--surface); }
.diagram-body { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
svg.dg { display: block; width: 100%; height: auto; font-family: var(--font); }
.dg-t { font-size: 12px; fill: var(--ink-2); }
.dg-h { font-size: 13px; font-weight: 700; fill: var(--ink); }
.dg-a { font-size: 12px; font-weight: 700; fill: var(--accent-ink); }
.dg-arrow line { stroke: var(--accent); stroke-width: 2; }
.dg-arrow polygon { fill: var(--accent); }
.dg-dim line { stroke: var(--accent); stroke-width: 1.2; }
.dg-cut { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 4; }
.dg-waste { fill: rgba(255, 255, 255, .62) !important; stroke: var(--accent); stroke-dasharray: 3 3; }
.dg-table { stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; }
.dg-blade { stroke: #8a96a3; stroke-width: 7; stroke-linecap: round; opacity: .85; }
.dg-blade-v { stroke: #8a96a3; stroke-width: 5; opacity: .8; }
.dg-guide { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 4 4; }
.dg-angle { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.dg-wax { fill: #fbf6ea; stroke: var(--line-2); stroke-dasharray: 6 4; }
.dg-first { stroke: var(--accent) !important; stroke-width: 2.4 !important; }
.dg-trim { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 7 5; }
.dg-groove { fill: none; stroke: rgba(40, 20, 5, .55); stroke-width: 3; }
.dg-feet { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 3 3; }
@media print { details.diagram summary { display: none; } .diagram-body { break-inside: avoid; } }
details.diagram .if-open, details.diagram[open] .if-closed { display: none; }
details.diagram[open] .if-open { display: inline; }
.dg-void { fill: #e0442b; stroke: #a32613; stroke-width: 1; }
.dg-bad line { stroke: #c4371f; }
.dg-bad polygon { fill: #c4371f; }
.dg-bad-t { font-size: 12px; font-weight: 700; fill: #c4371f; }
.dg-grain { fill: none; stroke: rgba(40, 20, 5, .28); stroke-width: 1.2; }
.dg-tape { fill: none; stroke: #5f8fb5; stroke-width: 3; stroke-dasharray: 10 5; opacity: .8; }
.dg-w { font-size: 13px; font-weight: 700; fill: #fff; }
.dg-triangle { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; opacity: .75; }

/* ===== Full-size diagram viewer ===== */
button.diagram-body { position: relative; display: block; width: 100%; padding: 8px; font: inherit; color: inherit; text-align: left; cursor: zoom-in; }
button.diagram-body:hover { border-color: var(--accent); }
.zoom-hint {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: var(--surface); border: 1px solid var(--line-2); opacity: 0; transition: opacity .15s;
}
.zoom-hint svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; }
button.diagram-body:hover .zoom-hint, button.diagram-body:focus-visible .zoom-hint { opacity: 1; }
@media (hover: none) { .zoom-hint { opacity: 1; } }
.diagram-viewer {
  width: min(1180px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(20, 10, 0, .35);
}
.diagram-viewer::backdrop { background: rgba(30, 20, 12, .62); backdrop-filter: blur(3px); }
.dv-card { display: flex; flex-direction: column; max-height: 94vh; }
.dv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 22px 8px; }
.dv-text { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; max-width: 900px; }
.dv-fig { flex: 1; min-height: 0; overflow: auto; margin: 6px 22px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.dv-fig svg.dg { width: 100%; max-height: calc(94vh - 220px); }
.dv-fig .dg-t, .dv-fig .dg-a { font-size: 11px; }
.dv-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px 18px; }
.dv-nav .btn svg, .dv-nav [data-icon] svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; display: inline-block; vertical-align: -3px; }
@media print { .zoom-hint { display: none; } }

/* ===== Footer ===== */
.app-footer {
  height: var(--footer-h); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px; font-size: 12px; color: var(--ink-3); background: var(--surface); border-top: 1px solid var(--line);
}
.app-footer nav { display: flex; gap: 16px; }
.app-footer a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.app-footer a:hover, .app-footer a.on { color: var(--accent-ink); }
.top-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; flex-shrink: 0;
  color: #f5ebdd; font-weight: 600; font-size: 13px; text-decoration: none; border: 1px solid transparent;
}
.top-link:hover { background: rgba(255,255,255,.1); }
.top-link.on { border-color: rgba(224,164,111,.55); background: rgba(224,164,111,.14); }
.top-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top-link[href="#support"] svg { stroke: #e9a07a; }
@media (max-width: 960px) { .top-link span { display: none; } .top-link { padding: 7px; } }

/* ===== Content pages ===== */
.page { display: none; height: calc(100vh - var(--header-h) - var(--footer-h)); height: calc(100dvh - var(--header-h) - var(--footer-h)); overflow-y: auto; background: var(--bg); }
.page-open .page { display: block; }
.page-open .stepper, .page-open .workspace, .page-open .catalog { display: none !important; }
.page-inner { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; margin: 4px 0 6px; letter-spacing: -.01em; }
.page-head .lead { margin: 0; max-width: 680px; font-size: 15px; }
.page-layout.with-toc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.page-toc { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 2px 8px 6px; }
.page-toc button { border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.page-toc button:hover { background: var(--surface-2); color: var(--ink); }
.page-article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 32px 28px; line-height: 1.6; font-size: 15px; }
.page-article section { padding-top: 18px; border-bottom: 1px solid var(--line); padding-bottom: 14px; scroll-margin-top: 12px; }
.page-article section:last-child { border-bottom: 0; }
.page-article h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 6px 0 10px; }
.page-article h4 { font-size: 15px; margin: 18px 0 6px; }
.page-article ul, .page-article ol { padding-left: 22px; }
.page-article li { margin-bottom: 6px; }
.page-article a { color: var(--accent-ink); }
.big-steps li { margin-bottom: 12px; }
.big-steps .try { margin-left: 6px; }
.try {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; padding: 5px 12px; border-radius: 99px;
  border: 1px solid #efcfb4; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 12.5px;
}
.try:hover { background: var(--surface); border-color: var(--accent); }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: underline; }
.callout-box { display: flex; gap: 10px; margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: #eef4ec; border: 1px solid #cfe1cb; font-size: 14px; }
.callout-box strong { flex-shrink: 0; color: var(--ok); }
.callout-box.is-warn { background: #fbeee6; border-color: #f0cdbb; }
.callout-box.is-warn strong { color: var(--warn); }
.callout-box.is-note { background: var(--surface-2); border-color: var(--line); }
.callout-box.is-note strong { color: var(--ink-2); }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: var(--surface-2); }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font: 600 12px var(--font); text-align: center; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); }
.support-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 10px 0; }

@media (max-width: 960px) {
  .app-footer { height: auto; flex-direction: column; align-items: flex-start; padding: 12px 16px; }
  .app-footer nav { flex-wrap: wrap; gap: 8px 14px; }
  .page, .catalog { height: auto; min-height: 60vh; }
  .page-inner { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 27px; }
  .page-layout.with-toc { grid-template-columns: 1fr; }
  .page-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .page-article { padding: 4px 18px 20px; }
}
@media print {
  .app-footer { display: block; height: auto; border: 0; padding: 8px 0 0; }
  .app-footer nav { display: none; }
  .page-open .page { height: auto; overflow: visible; }
  .page-toc, .page-head .btn { display: none; }
}
.creator-line { font-family: var(--serif); font-size: 20px; margin: 0; }
