
:root {
--bg: #FAF9F7;
--surface: #FFFFFF;
--panel: #F2EFE9;
--ink: #191611;
--muted: #7C766C;
--line: rgba(25, 22, 17, 0.13);
--line-strong: rgba(25, 22, 17, 0.26);
--acc: #D96A1F;
--acc-deep: #A64B10;
--acc-soft: rgba(217, 106, 31, 0.11);
--danger: #C24B3C;
--danger-soft: rgba(194, 75, 60, 0.10);
--badge: #0d9488;
--r: 10px;
--rail-l: 268px;
--rail-r: 328px;
--top: 56px;
--shadow: 0 1px 2px rgba(25, 22, 17, .05), 0 8px 24px rgba(25, 22, 17, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
background: var(--bg);
color: var(--ink);
font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
font-size: 14px;
line-height: 1.45;
-webkit-font-smoothing: antialiased;
display: grid;
grid-template-rows: var(--top) minmax(0, 1fr);
overflow: hidden;
}

body.is-booting > * { opacity: 0; }
body > * { transition: opacity .18s ease; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; }

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
button:disabled { cursor: not-allowed; }

:focus-visible {
outline: 2px solid var(--acc);
outline-offset: 2px;
border-radius: 4px;
}


.btn {
display: inline-flex;
align-items: center;
gap: 7px;
height: 34px;
padding: 0 12px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface);
font-size: 13px;
font-weight: 500;
white-space: nowrap;
transition: background .13s ease, border-color .13s ease, color .13s ease;
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--panel); }
.btn:disabled { opacity: .4; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.small { height: 30px; font-size: 12.5px; padding: 0 10px; }
.btn.big { height: 40px; padding: 0 20px; font-size: 14px; }

.btn.primary {
background: var(--acc);
border-color: var(--acc);
color: #fff;
}
.btn.primary:hover:not(:disabled) { background: var(--acc-deep); border-color: var(--acc-deep); }
.btn.danger, .danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }

.btn-group { display: flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }

.linkish {
font-size: 12.5px;
color: var(--muted);
text-decoration: underline;
text-underline-offset: 3px;
}
.linkish:hover { color: var(--ink); }

.input {
width: 100%;
height: 32px;
padding: 0 9px;
border: 1px solid var(--line);
border-radius: 7px;
background: var(--surface);
font: inherit;
font-size: 13px;
color: var(--ink);
}
.input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
select.input { padding-right: 4px; }

.field { display: grid; gap: 4px; min-width: 0; }
.field-label {
font-size: 11px;
font-weight: 600;
letter-spacing: .04em;
text-transform: uppercase;
color: var(--muted);
}

.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 3px 0; }
.checkline input { accent-color: var(--acc); width: 15px; height: 15px; }

.slider { display: grid; gap: 3px; margin: 8px 0; }
.slider-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.slider input[type="range"] { width: 100%; accent-color: var(--acc); }


.top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 0 14px;
background: var(--surface);
border-bottom: 1px solid var(--line);
z-index: 30;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { width: 22px; height: 22px; color: var(--acc); flex: none; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.lang {
display: flex;
border: 1px solid var(--line);
border-radius: 8px;
overflow: hidden;
}
.lang button {
padding: 0 9px;
height: 32px;
font-size: 12px;
font-weight: 600;
color: var(--muted);
}
.lang button.is-active { background: var(--ink); color: var(--bg); }
.lang button:not(.is-active):hover { background: var(--panel); }


.pop-anchor { position: relative; }

.pop {
position: absolute;
top: calc(100% + 8px);
right: 0;
width: 288px;
padding: 14px;
background: var(--surface);
border: 1px solid var(--line);
border-radius: 12px;
box-shadow: var(--shadow);
z-index: 40;
}
.pop[hidden] { display: none; }
.pop-rule { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.pop-help { font-size: 11.5px; color: var(--muted); margin: -4px 0 8px; }
.pop-info { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.pop-info.is-warn { color: var(--danger); }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.nudge { margin: 10px 0 4px; display: grid; gap: 5px; }
.nudge-pad { display: flex; gap: 5px; }
.nudge-pad button {
width: 34px; height: 30px;
border: 1px solid var(--line);
border-radius: 7px;
background: var(--surface);
font-size: 13px;
color: var(--muted);
}
.nudge-pad button:hover { border-color: var(--line-strong); background: var(--panel); color: var(--ink); }

.pop-menu { width: 232px; padding: 6px; }
.pop-menu button {
display: block;
width: 100%;
text-align: left;
padding: 9px 10px;
border-radius: 7px;
font-size: 13px;
}
.pop-menu button:hover { background: var(--panel); }
.pop-menu .danger:hover { background: var(--danger-soft); }


.workspace {
display: grid;
grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r);
min-height: 0;
}

.rail {
display: flex;
flex-direction: column;
min-height: 0;
background: var(--surface);
}
.rail-left { border-right: 1px solid var(--line); }
.rail-right { border-left: 1px solid var(--line); }

.rail-head {
display: flex;
align-items: center;
gap: 8px;
padding: 14px 16px 10px;
}
.rail-head h2 {
font-size: 11px;
font-weight: 700;
letter-spacing: .08em;
text-transform: uppercase;
color: var(--muted);
}
.count {
margin-left: auto;
min-width: 20px;
padding: 1px 7px;
border-radius: 20px;
background: var(--panel);
font-size: 11px;
font-weight: 600;
color: var(--muted);
text-align: center;
}

.rail-hint {
padding: 0 16px 12px;
font-size: 12px;
color: var(--muted);
}
.rail-right .rail-hint { padding-top: 4px; }
.rail-hint.is-armed {
margin: 0 12px 12px;
padding: 9px 11px;
border-radius: 9px;
background: var(--acc-soft);
color: var(--acc-deep);
display: grid;
gap: 2px;
}
.rail-hint .hint-sub { opacity: .75; font-size: 11.5px; }


.cats {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 1fr;
gap: 3px;
margin: 0 12px 12px;
padding: 3px;
background: var(--panel);
border-radius: 9px;
}
.cat {
padding: 6px 4px;
border-radius: 7px;
font-size: 12px;
font-weight: 600;
color: var(--muted);
line-height: 1.2;
}
.cat:hover { color: var(--ink); }
.cat.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(25,22,17,.10); }

.chips { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px; display: grid; gap: 3px; align-content: start; }
.chip-group {
padding: 13px 9px 4px;
font-size: 10px;
font-weight: 700;
letter-spacing: .08em;
text-transform: uppercase;
color: var(--muted);
opacity: .8;
}
.chip-group:first-child { padding-top: 2px; }
.chip {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 7px 9px;
border: 1px solid transparent;
border-radius: 8px;
text-align: left;
font-size: 13px;
line-height: 1.25;
}
.chip:hover:not(:disabled) { background: var(--panel); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.chip.is-armed {
background: var(--acc-soft);
border-color: var(--acc);
font-weight: 600;
}
.chip .sym { flex: none; }
.sym { display: block; }


.stage {
position: relative;
min-width: 0;
background: var(--panel);
overflow: hidden;
display: grid;
place-items: center;
}

#planSvg {
display: block;
background: var(--surface);
border: 1px solid var(--line);
border-radius: 6px;
box-shadow: var(--shadow);
touch-action: none;
user-select: none;
cursor: grab;
}
#planSvg.is-panning { cursor: grabbing; }
#planSvg.is-placing { cursor: crosshair; }
body.no-plan #planSvg,
body.no-plan .stage-scale,
body.no-plan .stage-hint,
body.no-plan .stage-zoom { display: none; }

#planSvg text { pointer-events: none; user-select: none; }
#markerLayer .row-badge { pointer-events: none; }
#markerLayer .select-ring,
#markerLayer .select-ring-line,
#markerLayer .line-handle { display: none; }
#markerLayer .is-selected .select-ring,
#markerLayer .is-selected .line-handle { display: block; }
#markerLayer .dim-handle,
#markerLayer .dim-hit { display: none; }
#markerLayer .is-selected .dim-handle,
#markerLayer .is-selected .dim-hit { display: block; }
#markerLayer .wall-dim.is-ghost { display: none; }
#markerLayer .is-selected .wall-dim.is-ghost { display: block; opacity: .4; }
#snapGuideLayer .scale-line text { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
#markerLayer .is-selected .select-ring-line { display: block; opacity: .25; }
#snapGuideLayer { pointer-events: none; }

.empty {
position: absolute;
inset: 0;
display: none;
place-content: center;
justify-items: center;
gap: 4px;
padding: 24px;
text-align: center;
}
body.no-plan .empty { display: grid; }
.empty-art {
width: 108px; height: 81px;
fill: none; stroke: var(--line-strong); stroke-width: 3;
stroke-linecap: round; stroke-linejoin: round;
margin-bottom: 10px;
}
.empty h2 { font-size: 19px; }
.empty-body { color: var(--muted); max-width: 34ch; margin-bottom: 12px; }
.empty-note { font-size: 12px; color: var(--muted); max-width: 42ch; margin-top: 8px; }
.empty .linkish { margin-top: 14px; }

.drop-veil {
position: absolute;
inset: 10px;
display: none;
place-items: center;
border: 2px dashed var(--acc);
border-radius: 10px;
background: rgba(250, 249, 247, .88);
font-weight: 600;
color: var(--acc-deep);
z-index: 5;
pointer-events: none;
}
.stage.is-dropping .drop-veil { display: grid; }

.stage-scale {
position: absolute;
left: 26px;
bottom: 26px;
z-index: 6;
}
.stage-scale .btn { box-shadow: var(--shadow); }
.stage-scale .btn.is-set { border-color: var(--acc); color: var(--acc-deep); }
.pop-scale {
top: auto;
bottom: calc(100% + 8px);
left: 0;
right: auto;
width: 262px;
}
.pop-scale.is-pending {
position: fixed;
left: 50%;
top: 74px;
bottom: auto;
transform: translateX(-50%);
}
.pop-title { font-size: 13px; margin-bottom: 6px; }
.btn[hidden], .scale-ask[hidden] { display: none; }
.scale-ask { display: grid; gap: 6px; margin: 10px 0 2px; }
.scale-input { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.scale-input .input { flex: 1; min-width: 0; }

.pagerow { display: grid; gap: 5px; margin: 10px 0 2px; }
#imgSharpenRow[hidden], .pagerow[hidden] { display: none; }

.stage-hint {
position: absolute;
left: 50%;
top: 20px;
transform: translateX(-50%);
display: grid;
gap: 1px;
padding: 9px 14px;
max-width: min(360px, calc(100% - 40px));
text-align: center;
background: var(--surface);
border: 1px solid var(--acc);
border-radius: 10px;
box-shadow: var(--shadow);
font-size: 12.5px;
z-index: 6;
}
.stage-hint[hidden] { display: none; }
.stage-hint span { font-size: 11.5px; color: var(--muted); }

.stage-zoom {
position: absolute;
right: 26px;
bottom: 26px;
display: grid;
background: var(--surface);
border: 1px solid var(--line);
border-radius: 9px;
box-shadow: var(--shadow);
overflow: hidden;
}
.stage-zoom button {
width: 34px; height: 34px;
display: grid; place-items: center;
font-size: 16px;
color: var(--muted);
}
.stage-zoom button + button { border-top: 1px solid var(--line); }
.stage-zoom button:hover { background: var(--panel); color: var(--ink); }
.stage-zoom svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }


.list { flex: 1; min-height: 0; overflow-y: auto; }
.list:empty { flex: 0 0 auto; }

.mk { border-bottom: 1px solid var(--line); }
.mk.is-selected { background: var(--acc-soft); }
.mk.is-dragging { opacity: .4; }
.mk.is-drop-target { box-shadow: inset 0 2px 0 var(--acc); }

.mk-head { display: flex; align-items: stretch; }
.mk-grip {
display: grid;
place-items: center;
width: 18px;
flex: none;
cursor: grab;
opacity: 0;
transition: opacity .12s ease;
}
.mk:hover .mk-grip, .mk.is-selected .mk-grip { opacity: .45; }
.mk-grip svg { width: 9px; height: 15px; fill: var(--ink); }

.mk-main {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
gap: 9px;
padding: 9px 12px 9px 2px;
text-align: left;
}
.mk-num {
flex: none;
width: 19px; height: 19px;
display: grid; place-items: center;
border-radius: 50%;
background: var(--badge);
color: #fff;
font-size: 10.5px;
font-weight: 700;
}
.mk-main .sym { flex: none; }
.mk-text { min-width: 0; display: grid; }
.mk-name { font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk.is-selected .mk-name { font-weight: 600; }

.mk-body {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px 10px;
padding: 4px 16px 16px 20px;
}
.field-wide { grid-column: 1 / -1; }

.field-withpos { display: flex; align-items: flex-end; gap: 6px; }
.field-withpos .field-main { display: grid; gap: 4px; flex: 1; min-width: 0; }

.field-unit, .wallrow { position: relative; }
.field-unit::after, .wallrow::after {
content: attr(data-unit);
position: absolute;
right: 10px;
bottom: 0;
height: 32px;
display: grid;
align-items: center;
font-size: 11px;
color: var(--muted);
pointer-events: none;
}
.field-unit .input, .wallrow .input { padding-right: 28px; }

.field-num .field-main { flex: none; }

.pospick { position: relative; flex: none; }
.pospick-trigger {
width: 32px; height: 32px;
display: grid; place-items: center;
border: 1px solid var(--line);
border-radius: 7px;
background: var(--surface);
}
.pospick-trigger svg {
width: 15px; height: 15px;
fill: none; stroke: var(--muted); stroke-width: 1.6;
stroke-linecap: round; stroke-linejoin: round;
transform: rotate(var(--angle));
}
.pospick-trigger:hover { border-color: var(--acc); }
.pospick-trigger:hover svg { stroke: var(--acc-deep); }

.pospick-pop {
display: none;
position: absolute;
top: calc(100% + 6px);
right: 0;
padding: 6px;
background: var(--surface);
border: 1px solid var(--line);
border-radius: 10px;
box-shadow: var(--shadow);
z-index: 20;
}
.pospick.is-open .pospick-pop { display: block; }
.pospick.is-open .pospick-trigger { border-color: var(--acc); background: var(--acc-soft); }
.pospick.is-open .pospick-trigger svg { stroke: var(--acc-deep); }

.numchip {
width: 32px; height: 32px;
display: grid; place-items: center;
border-radius: 50%;
background: var(--badge);
color: #fff;
font-size: 12px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}

.posgrid {
display: grid;
grid-template-columns: repeat(3, 26px);
gap: 3px;
}
.posgrid-cell {
width: 26px; height: 26px;
display: grid; place-items: center;
border: 1px solid var(--line);
border-radius: 6px;
background: var(--surface);
}
.posgrid-cell svg {
width: 15px; height: 15px;
fill: none; stroke: var(--muted); stroke-width: 1.6;
stroke-linecap: round; stroke-linejoin: round;
transform: rotate(var(--angle));
}
.posgrid-cell:hover { border-color: var(--line-strong); }
.posgrid-cell.is-active { background: var(--acc); border-color: var(--acc); }
.posgrid-cell.is-active svg { stroke: #fff; }
.posgrid-centre {
display: grid; place-items: center;
}
.posgrid-centre::after {
content: "";
width: 7px; height: 7px;
border-radius: 50%;
background: var(--line-strong);
}

.mk-actions {
grid-column: 1 / -1;
display: flex; flex-wrap: wrap; gap: 5px;
margin-top: 4px;
padding-top: 12px;
border-top: 1px solid var(--line);
}
.act {
width: 30px; height: 30px;
display: grid; place-items: center;
border: 1px solid var(--line);
border-radius: 7px;
background: var(--surface);
}
.act svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.act:hover { border-color: var(--line-strong); background: var(--panel); }
.act:hover svg { stroke: var(--ink); }
.act.is-danger { margin-left: auto; }
.act.is-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.act.is-danger:hover svg { stroke: var(--danger); }


.panes { display: none; }

@media (min-width: 901px) {
body.no-plan .rail-right { display: none; }
body.no-plan .workspace { grid-template-columns: var(--rail-l) minmax(0, 1fr); }
}

@media (max-width: 1080px) {
:root { --rail-l: 236px; --rail-r: 280px; }
}

@media (max-width: 900px) {
body { grid-template-rows: var(--top) minmax(0, 1fr) 54px; }
.workspace { grid-template-columns: 1fr; }
.rail { display: none; border: none; }
body[data-pane="palette"] .rail-left { display: flex; }
body[data-pane="list"] .rail-right { display: flex; }
body[data-pane="palette"] .stage,
body[data-pane="list"] .stage { display: none; }

.panes {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 1fr;
background: var(--surface);
border-top: 1px solid var(--line);
z-index: 30;
}
.panes button {
display: grid;
place-items: center;
gap: 2px;
font-size: 10.5px;
font-weight: 600;
color: var(--muted);
}
.panes button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.panes button.is-active { color: var(--acc-deep); }

.brand-name { display: none; }
#printBtn span { display: none; }
#imageBtn span { display: none; }
#imageBtn { width: 34px; padding: 0; justify-content: center; }
#printBtn { width: 34px; padding: 0; justify-content: center; }
.pop { width: min(300px, calc(100vw - 24px)); }
}


.overlay {
position: fixed;
inset: 0;
z-index: 60;
background: rgba(25, 22, 17, .42);
display: flex;
}
.overlay[hidden] { display: none; }
.overlay-centre { display: grid; place-items: center; padding: 20px; }

.card {
width: min(660px, 100%);
max-height: 88vh;
overflow-y: auto;
padding: 22px 24px 24px;
background: var(--surface);
border-radius: 14px;
box-shadow: 0 20px 60px rgba(25, 22, 17, .3);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { font-size: 18px; }

.steps { list-style: none; display: grid; gap: 14px; }
.steps h3 { font-size: 14px; margin-bottom: 2px; }
.steps p { color: var(--muted); font-size: 13px; }

.keys-head { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; align-items: baseline; font-size: 13px; }
.keys dd { color: var(--muted); }
kbd {
display: inline-block;
padding: 1px 6px;
border: 1px solid var(--line-strong);
border-bottom-width: 2px;
border-radius: 5px;
background: var(--panel);
font-family: inherit;
font-size: 11.5px;
font-weight: 600;
}
.privacy { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.madeby { margin-top: 12px; font-size: 12px; }
.madeby a { color: var(--muted); text-decoration: none; }
.madeby a:hover { color: var(--acc-deep); }


.sheetbar {
width: 306px;
flex: none;
padding: 20px;
background: var(--surface);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 16px;
}
.sheetbar h2 { font-size: 17px; }
.sheetbar .stack { display: grid; gap: 6px; border: none; }
.sheetbar legend { padding: 0; }
.sheetbar-tip { font-size: 12px; color: var(--muted); }
.sheetbar-warn { font-size: 12.5px; color: var(--danger); }
.sheetbar-warn[hidden] { display: none; }
.sheetbar-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }

.print-preview {
flex: 1;
min-width: 0;
overflow: auto;
padding: 26px;
display: grid;
justify-items: center;
align-content: start;
gap: 22px;
}
#printDoc { display: grid; gap: 22px; justify-items: center; }

.sheet {
box-sizing: content-box;
background: #fff;
color: #14110d;
padding: 0;
box-shadow: 0 6px 24px rgba(0, 0, 0, .28);
font-size: 3.1mm;
line-height: 1.35;
}
.print-preview .sheet { padding: 10mm; zoom: var(--sheet-zoom, 1); }

.sheet-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 8mm;
padding-bottom: 2.5mm;
border-bottom: 0.4mm solid #14110d;
margin-bottom: 3.5mm;
}
.sheet-head h2 { font-size: 5mm; }
.sheet-head p { font-size: 3.2mm; color: #55504a; }
.sheet-date { white-space: nowrap; }

.sheet-legend { margin-bottom: 3.5mm; }
.sheet-legend h3,
.sheet-schedule h3 {
font-size: 2.6mm;
letter-spacing: .1em;
text-transform: uppercase;
color: #6b665e;
margin-bottom: 1.6mm;
}
.sheet-legend-row { display: flex; flex-wrap: wrap; gap: 1.5mm 6mm; }
.sheet-legend-item { display: inline-flex; align-items: center; gap: 1.6mm; }
.sheet-legend-item svg { width: 5mm; height: 5mm; flex: none; }

.sheet-plan {
margin: 0 auto 4mm;
border: 0.25mm solid #cfcac2;
overflow: hidden;
}
.sheet-plan svg { display: block; width: 100%; height: 100%; }

.sheet-empty { color: #6b665e; font-style: italic; }

.sheet-schedule table { width: 100%; border-collapse: collapse; }
.sheet-schedule th, .sheet-schedule td {
text-align: left;
padding: 1.1mm 1.6mm;
border-bottom: 0.2mm solid #ded9d1;
vertical-align: middle;
}
.sheet-schedule th {
font-size: 2.5mm;
letter-spacing: .06em;
text-transform: uppercase;
color: #6b665e;
border-bottom-width: 0.4mm;
border-bottom-color: #14110d;
}
.sheet-schedule .c-num { width: 7mm; font-weight: 700; }
.sheet-schedule .c-sym { width: 8mm; }
.sheet-schedule .c-sym svg { width: 5mm; height: 5mm; display: block; }
.sheet-schedule .c-h { width: 16mm; white-space: nowrap; }
.sheet-schedule .c-label { font-weight: 600; }

@media print {
html, body { height: auto; overflow: visible; background: #fff; }
body { display: block; }
.top, .workspace, .panes, #toast, #helpOverlay, .sheetbar { display: none !important; }
.overlay { position: static; display: block; background: none; padding: 0; }
.print-preview { display: block; overflow: visible; padding: 0; }
#printDoc { display: block; width: 100%; }
.print-preview .sheet {
box-shadow: none;
padding: 0;
margin: 0;
zoom: 1;
break-after: page;
page-break-after: always;
}
.print-preview .sheet:last-child { break-after: auto; page-break-after: auto; }
.sheet-schedule tr { break-inside: avoid; page-break-inside: avoid; }
}


#toast {
position: fixed;
left: 50%;
bottom: 24px;
transform: translate(-50%, 12px);
max-width: min(440px, calc(100vw - 32px));
padding: 11px 16px;
background: var(--ink);
color: var(--bg);
border-radius: 10px;
font-size: 13px;
box-shadow: var(--shadow);
opacity: 0;
pointer-events: none;
transition: opacity .18s ease, transform .18s ease;
z-index: 80;
}
#toast.is-open { opacity: 1; transform: translate(-50%, 0); }

.symbol-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.wallrow { display: flex; gap: 7px; align-items: center; }
.wallpick { display: flex; flex: none; }
.wallpick-cell {
width: 28px;
height: 32px;
display: grid;
place-items: center;
margin-left: -1px;
border: 1px solid var(--line);
background: var(--surface);
font-size: 13px;
line-height: 1;
color: var(--muted);
}
.wallpick-cell:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
.wallpick-cell:last-child { border-radius: 0 7px 7px 0; }
.wallpick-cell:hover { background: var(--panel); color: var(--ink); }
.wallpick-cell.is-active {
background: var(--acc);
border-color: var(--acc);
color: #fff;
position: relative;
z-index: 1;
}
.wallrow .input { flex: 1; min-width: 0; }
.wallfield { display: grid; gap: 6px; }
.field-hint { font-size: 11px; line-height: 1.45; color: var(--muted); }
.field-hint .linkish { font-size: 11px; }

.heights-card { width: min(720px, 100%); }
.card-lead {
font-size: 12.5px;
color: var(--muted);
margin: -4px 0 18px;
max-width: 62ch;
}
.card-foot {
display: flex;
justify-content: flex-end;
margin-top: 18px;
padding-top: 14px;
border-top: 1px solid var(--line);
}

.hgroup + .hgroup { margin-top: 18px; }
.hgroup > header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 8px;
}
.hgroup h3 {
font-size: 11px;
font-weight: 700;
letter-spacing: .08em;
text-transform: uppercase;
color: var(--muted);
}
.hall {
display: flex;
align-items: center;
gap: 7px;
margin-left: auto;
font-size: 11.5px;
color: var(--muted);
}
.hall .input { width: 74px; height: 28px; }

.hgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 18px; }
.hrow {
display: flex;
align-items: center;
gap: 9px;
min-width: 0;
font-size: 13px;
}
.hrow > span {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.hrow .sym { flex: none; }
.hrow .input { width: 74px; flex: none; height: 30px; }

@media (max-width: 640px) {
.hgrid { grid-template-columns: 1fr; }
}

.totals-card { width: min(560px, 100%); }
.totals-empty { color: var(--muted); font-size: 13px; }

.qcat + .qcat { margin-top: 20px; }
.qcat > header {
display: flex;
align-items: baseline;
gap: 10px;
padding-bottom: 6px;
border-bottom: 1px solid var(--line);
}
.qcat h3 { font-size: 14px; }
.qsum {
margin-left: auto;
font-size: 14px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.qgroup { margin-top: 10px; }
.qgroup-name {
font-size: 10px;
font-weight: 700;
letter-spacing: .08em;
text-transform: uppercase;
color: var(--muted);
margin-bottom: 3px;
}
.qrow {
display: flex;
align-items: center;
gap: 9px;
padding: 3px 0;
font-size: 13px;
}
.qrow .sym { flex: none; }
.qrow > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow b { font-variant-numeric: tabular-nums; }
.qtotal {
display: flex;
align-items: baseline;
gap: 10px;
margin-top: 18px;
padding-top: 12px;
border-top: 2px solid var(--ink);
font-size: 15px;
}
.qtotal b { margin-left: auto; font-variant-numeric: tabular-nums; }
.qrow i { font-style: normal; font-size: 11.5px; color: var(--muted); }

.count { transition: background .13s ease, color .13s ease; }
button.count:hover { background: var(--acc-soft); color: var(--acc-deep); }

.sheet-totals { margin-bottom: 4mm; }
.sheet-totals-row { display: flex; flex-wrap: wrap; gap: 1.4mm 5mm; align-items: center; }
.sheet-totals-item { display: inline-flex; align-items: center; gap: 1.4mm; }
.sheet-totals-item svg { width: 4.4mm; height: 4.4mm; flex: none; }
.sheet-totals-item b { font-weight: 700; }
.sheet-totals-item.is-total {
padding-left: 4mm;
border-left: 0.3mm solid #14110d;
font-weight: 700;
}
