@font-face {
    font-family: Novoterm;
    src: url('./montserrat-regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: Novoterm;
    src: url('./montserrat-semibold.woff2') format('woff2');
    font-weight: 600 800;
    font-display: swap;
}
:root {
    --paper: #fcf8f4;
    --surface: #fff;
    --ink: #292320;
    --muted: #55483f;
    --accent: #963c24;
    --accent-deep: #702915;
    --line: #e1d3c8;
    --control: #9e887a;
    --wash: #f6ebe2;
    --error: #8b2831;
    --warn: #76450b;
    --success: #326048;
    color: var(--ink);
    background: var(--paper);
    font: 14px/1.5 Novoterm, Arial, sans-serif;
    accent-color: var(--accent);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
::selection { color: var(--accent-deep); background: #f0d9cb; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent-deep); text-underline-offset: .17em; }
button, input, select { font: inherit; color: inherit; }
button, select, summary, .check { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.17; letter-spacing: -.03em; font-weight: 700; }
h2 { font-size: 1.33rem; }
.bathroom-app { max-width: 1240px; margin: 0 auto; padding: 24px 28px 38px; }
.intro { padding-bottom: 23px; }
.intro-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 15px; }
.brand { display: block; }
.brand img { display: block; width: 163px; height: auto; }
.tools-link { font-size: .87rem; font-weight: 600; }
.intro h1 { font-size: 3rem; }
.intro h1 span { display: inline-block; color: var(--accent); }
.intro p { margin-top: 9px; max-width: 69ch; color: var(--muted); }
.planner {
    display: grid;
    grid-template-columns: 312px minmax(0, 1fr);
    align-items: start;
    gap: 14px 18px;
}
.planner-sidebar, .planner-main { display: grid; min-width: 0; gap: 14px; }
.planner-sidebar { grid-template-areas: 'room' 'palette'; }
.planner-main { grid-template-areas: 'board' 'editor' 'review'; }
.room { grid-area: room; }
.palette { grid-area: palette; }
.board { grid-area: board; }
.editor { grid-area: editor; }
.review { grid-area: review; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 17px; }
.hint { color: var(--muted); font-size: .87rem; }
.room h2 + .hint { margin: 6px 0 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.field { display: grid; gap: 4px; align-content: end; font-size: .87rem; font-weight: 600; min-width: 0; }
.field input, .field select {
    width: 100%; min-width: 0; min-height: 41px; padding: 7px 9px; border: 1px solid var(--control); border-radius: 7px;
    background: var(--surface); font-weight: 400; font-variant-numeric: tabular-nums;
}
.field input[aria-invalid='true'] { border-color: var(--error); background: #fff4f3; }
.field-error { color: var(--error); font-size: .8rem; }
.door { border-top: 1px solid var(--line); margin-top: 14px; }
.door summary { display: flex; min-height: 39px; margin-bottom: -7px; align-items: center; gap: 7px; font-weight: 600; color: var(--accent-deep); list-style: none; }
.door summary::-webkit-details-marker { display: none; }
.door summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin: 0 4px 1px 2px; }
.door[open] summary::before { transform: rotate(45deg); margin-bottom: 3px; }
.door-summary { font-weight: 400; color: var(--muted); margin-left: auto; text-align: right; font-size: .82rem; }
.door-body { display: grid; gap: 9px; margin-top: 12px; }
.feature-form { display: grid; gap: 8px; }
.feature-actions, .project-actions, .view-options { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.feature-list { display: grid; gap: 4px; list-style: none; padding: 0; margin: 0 0 3px; }
.feature-list button { width: 100%; text-align: left; overflow-wrap: anywhere; }
.feature-list button[aria-pressed='true'] { border-color: var(--accent); background: var(--wash); }
.open-catalog { width: 100%; margin-top: 13px; text-align: left; }
.template-label { margin: 13px 0 6px; }
.palette-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.fixture-button { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 49px; text-align: left; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fdfaf7; color: var(--ink); }
.fixture-button svg { width: 23px; height: 23px; flex: none; color: var(--accent-deep); }
.fixture-button span { display: block; font-size: .82rem; font-weight: 600; line-height: 1.2; }
.fixture-button:hover:not(:disabled), .button:hover:not(:disabled) { background: var(--wash); border-color: var(--control); }
#palette-limit { margin-top: 7px; }
.preset-actions { display: flex; flex-wrap: wrap; gap: 4px 13px; margin-top: 8px; }
.subtle { padding: 4px 0; border: 0; min-height: 34px; background: none; color: var(--accent-deep); font-size: .83rem; text-decoration: underline; text-underline-offset: .2em; }
.subtle:hover:not(:disabled) { color: var(--accent); }
.board { padding: 17px 17px 12px; }
.board-heading, .editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.button { border: 1px solid var(--control); border-radius: 7px; padding: 8px 12px; min-height: 41px; font-size: .89rem; font-weight: 600; background: var(--surface); color: var(--accent-deep); }
.button.compact { padding: 6px 9px; min-height: 35px; font-size: .82rem; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover:not(:disabled) { background: var(--accent-deep); border-color: var(--accent-deep); }
.button[aria-pressed='true'] { background: var(--wash); border-color: var(--accent); color: var(--accent-deep); }
.board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.board-heading .board-tools { justify-content: flex-end; }
.plan-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin-top: 10px; }
.zoom-control { min-width: 35px; }
.board-hint { margin: 7px 0 9px; }
.contour-inspector {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    margin-top: 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fdfaf7;
}
.contour-inspector-heading { display: flex; align-items: center; justify-content: space-between; grid-column: 1 / -1; gap: 8px; }
.contour-inspector-heading .remove { color: var(--error); }
.contour-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; }
.contour-fields .field { flex: 0 1 132px; }
.contour-fields .field input { min-height: 35px; }
.contour-apply { align-self: end; }
#contour-error { grid-column: 1 / -1; }
.drawing { position: relative; display: grid; place-items: center; padding: 8px; isolation: isolate; background: #f4f2ef; border: 1px solid #e4dcd4; border-radius: 9px; overflow: hidden; }
#floor-plan { display: block; width: 100%; height: clamp(300px, 39vw, 495px); }
#floor-plan[data-mode='measure'] { cursor: crosshair; touch-action: none; }
#floor-plan[data-mode='measure'] .bp-fixture, #floor-plan[data-mode='pan'] .bp-fixture { cursor: inherit; }
#floor-plan[data-mode='pan'] { cursor: grab; touch-action: none; }
#floor-plan[data-mode='pan']:active { cursor: grabbing; }
.empty-plan { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.empty-plan span { padding: 8px 10px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; font-size: .86rem; max-width: 65%; }
.board-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding-top: 6px; }
.check { display: inline-flex; align-items: center; gap: 7px; min-height: 37px; font-size: .84rem; color: var(--muted); }
.check input { width: 16px; height: 16px; margin: 0; flex: none; }
.metrics { display: flex; flex-wrap: wrap; gap: 4px 19px; margin: 0; }
.metrics > div { display: flex; align-items: baseline; gap: 6px; }
.metrics dt { color: var(--muted); font-size: .82rem; }
.metrics dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-feedback { display: inline-block; margin-top: 3px; color: var(--warn); font-size: .87rem; font-weight: 600; }
.board-feedback.is-error { color: var(--error); }
.editor-picker { width: min(49%, 245px); }
.editor-fields { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 9px; }
.editor-actions .remove { margin-left: auto; }
.item-product { margin-top: 8px; color: var(--muted); font-size: .87rem; overflow-wrap: anywhere; }
.item-product a { font-weight: 600; }
.field input[readonly] { background: #f4f2ef; }
.position-hint { margin-top: 5px; }
#editor-empty { margin-top: 6px; }
.review-status { font-weight: 600; margin: 7px 0 5px; }
#review-title { scroll-margin-top: 18px; }
.review-status.is-success { color: var(--success); }
.review-status.is-error { color: var(--error); }
.review-status.is-warning { color: var(--warn); }
.issues { display: grid; gap: 4px; padding-left: 21px; margin: 7px 0 10px; }
.issues li { color: var(--warn); font-size: .88rem; }
.issues li.is-error { color: var(--error); }
.issues button { padding: 0; border: 0; text-align: left; color: inherit; background: none; text-decoration: underline; text-underline-offset: .17em; }
.issues button:hover { text-decoration-thickness: 2px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.project-actions { margin-top: 5px; }
.report-status { margin-top: 8px; }
.noscript { padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 795px) {
    .bathroom-app { padding: 20px 16px 28px; }
    .planner {
        grid-template-columns: minmax(0,1fr);
        grid-template-rows: auto;
        grid-template-areas: 'room' 'board' 'palette' 'editor' 'review';
        gap: 12px;
        reading-flow: grid-rows;
    }
    .planner-sidebar, .planner-main { display: contents; }
    .palette-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    #floor-plan { height: clamp(285px, 67vw, 470px); }
    .intro h1 { font-size: 2.5rem; }
}
@media (max-width: 475px) {
    .bathroom-app { padding-inline: 11px; }
    .intro { padding-bottom: 15px; }
    .intro-nav { gap: 7px 14px; margin-bottom: 12px; }
    .brand img { width: 133px; }
    .tools-link { font-size: .77rem; }
    .intro h1 { font-size: 2rem; }
    .intro p { margin-top: 7px; font-size: .91rem; }
    .panel { padding: 13px; }
    .board { padding-inline: 11px; }
    .board-heading { align-items: start; }
    .board-heading h2 { margin-top: 6px; }
    .board-tools .button { min-height: 40px; }
    .contour-inspector { grid-template-columns: minmax(0, 1fr); }
    .contour-fields .field { flex: 1 1 90px; }
    .contour-inspector .button { min-height: 41px; justify-self: start; }
    .editor-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .editor-heading { flex-wrap: wrap; }
    .editor-picker { width: 100%; }
    .field input, .field select { font-size: 16px; min-height: 43px; }
    .board-bar { gap: 0; }
    .metrics { padding-bottom: 3px; }
    .metrics > div { gap: 4px; }
    .fixture-button { flex-direction: column; justify-content: center; gap: 4px; text-align: center; padding: 6px 3px; min-height: 61px; }
    .report-actions .button { min-height: 43px; padding-inline: 8px; }
}
