:root {
  color-scheme: light;
  --k-ink: #173a28;
  --k-muted: #55675a;
  --k-paper: #fffaf1;
  --k-card: #faf7eb;
  --k-line: #c9cbb9;
  --k-soft-line: #dddccc;
  --k-selected: #e7edde;
  --k-pad: clamp(14px, 1.34vw, 22px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
main { padding-bottom: 30px; line-height: 1.45; }
main :is(h2,h3,p) { margin: 0; }
main h2 { font-size: clamp(1.1rem, 1.45vw, 1.45rem); line-height: 1.2; letter-spacing: -.043em; }
main h3 { font-size: 1rem; line-height: 1.25; letter-spacing: -.025em; }
main button, main input, main select { font: inherit; color: inherit; }
main button, main summary { cursor: pointer; -webkit-tap-highlight-color: transparent; }
main button { appearance: none; }
main button:disabled { cursor: default; opacity: .42; }
main :is(a,button,input,select,summary,canvas,#kitchen-3d-view):focus-visible { outline: 3px solid #916429; outline-offset: 2px; }
.skip { position: fixed; top: 6px; left: 8px; z-index: 10; transform: translateY(-145%); background: #183c29; padding: .6rem 1rem; color: white; }
.skip:focus { transform: none; }
.icon-bank { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.icon { display: inline-block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.intro p { margin-top: .42rem; max-width: 70ch; font-size: clamp(1rem,1.19vw,1.14rem); }
.no-script { padding: 1rem; background: var(--k-selected); }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,30%); align-items: start; gap: clamp(12px,1.45vw,24px); }
.workspace:focus:not(:focus-visible) { outline: none; }
.result-column, .settings { display: grid; gap: 12px; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--k-line); border-radius: 14px; background: var(--k-paper); color: var(--k-ink); }
.plan { overflow: hidden; container-type: inline-size; }
.plan-head, .plan-foot, .section-heading, .selection-line, .area-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-head { justify-content: flex-start; flex-wrap: wrap; column-gap: clamp(10px, 2vw, 24px); padding: 10px var(--k-pad); }
.plan-head h2 { white-space: nowrap; }
.metric { font-size: .85rem; font-variant-numeric: tabular-nums; line-height: 1.35; font-weight: 520; color: var(--k-muted); }
#plan-caption { margin-top: .15rem; }
.result-actions, .drawing-tools, .item-actions { display: flex; align-items: center; gap: 6px; }
.result-actions { margin-left: auto; }
.view-switch { display: inline-flex; align-items: stretch; flex-shrink: 0; gap: 2px; padding: 2px; border: 1px solid var(--k-line); border-radius: 9px; background: #f3f2e6; }
.view-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 55px; min-height: 36px; padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: #355440; font-size: .89rem; font-weight: 700; line-height: 1; }
.view-switch button:hover { background: #e4eadb; }
.view-switch button[aria-pressed=true] { background: #285239; color: #fffdf2; }
.view-switch .icon { width: 17px; height: 17px; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 12px; border: 1px solid #a6b29d; border-radius: 8px; background: var(--k-paper); font-size: .92rem; font-weight: 650; line-height: 1.15; }
.icon-button { width: 39px; height: 37px; min-height: 37px; padding: 0; }
button.tk-share[data-tk-share], .download { min-height: 42px; }
button.tk-share[data-tk-share] { color: #fffaf0; background: #1b4b31; border-color: #1b4b31; }
button.tk-share[data-tk-share]:hover { background: #29613f; }
main .button:not(:disabled):hover, main .icon-button:not(:disabled):hover { background: var(--k-selected); }
.drawing { position: relative; height: clamp(340px,50vw,600px); border-block: 1px solid var(--k-soft-line); background: #f2eee3; }
#kitchen-canvas, #kitchen-3d-view { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#kitchen-3d-view { overflow: hidden; }
#kitchen-3d-view canvas { display: block; width: 100%; height: 100%; }
#kitchen-canvas:active, #kitchen-3d-view:active { cursor: grabbing; }
#kitchen-canvas:focus-visible, #kitchen-3d-view:focus-visible { outline-offset: -4px; z-index: 1; }
#kitchen-3d-view:focus-visible::after { content: ''; position: absolute; inset: 2px; border: 2px solid #916429; pointer-events: none; }
#kitchen-view-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
#kitchen-3d-view[aria-busy=true]:not([hidden]) + #kitchen-view-status { top: 50%; left: 50%; transform: translate(-50%,-50%); width: max-content; max-width: 85%; height: auto; padding: .55rem .9rem; border: 1px solid var(--k-line); border-radius: 8px; clip-path: none; color: var(--k-ink); background: var(--k-paper); font-size: .92rem; font-weight: 600; text-align: center; }
#kitchen-3d-view[aria-busy=true] + #kitchen-view-status:empty::before { content: 'Loading 3D view…'; }
.camera-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 6px var(--k-pad); border-bottom: 1px solid var(--k-soft-line); background: #f5f4e9; }
.camera-buttons { display: flex; align-items: center; gap: 3px; }
.camera-tools .icon { width: 20px; height: 20px; }
.camera-tools .reset-view { margin-left: auto; min-height: 37px; }
.plan-foot { padding: 8px var(--k-pad) 0; }
#layout-status { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 640; line-height: 1.25; }
#layout-status:not(:empty)::before { content: ''; flex: none; width: .55em; height: .55em; background: #62825c; border-radius: 50%; }
#layout-status[data-state=overlap] { color: #9d4628; }
#layout-status[data-state=overlap]::before { background: #b35c38; }
#layout-status[data-state=empty]::before { background: #969a82; }
.grid-toggle { min-height: 37px; display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; cursor: pointer; font-size: .88rem; font-weight: 600; }
.grid-toggle input { margin: 0; width: 16px; height: 16px; accent-color: #245336; cursor: pointer; }
.view-hint, #selection-empty, .help p { color: var(--k-muted); }
.view-hint { padding: 5px var(--k-pad) 10px; font-size: .86rem; }
.plan-guide { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: var(--k-pad); }
.plan-guide .view-hint { padding-right: 0; }
.mobile-jumps a, .back-link { display: none; }
.mobile-jumps .finish-jump, .finishes .back-link { display: inline-flex; align-items: center; min-height: 36px; color: #315b3d; font-size: .86rem; font-weight: 630; text-underline-offset: .18em; }
.finish-jump { white-space: nowrap; }
.items { border-top: 1px solid var(--k-soft-line); }
main summary { display: flex; align-items: center; gap: 8px; font-weight: 650; list-style: none; }
main summary::-webkit-details-marker { display: none; }
main summary:hover { color: #357046; }
.items summary { min-height: 45px; padding: 7px var(--k-pad); }
.items summary .metric { margin-left: auto; }
.chevron { width: 15px; height: 15px; }
details[open] > summary .chevron { transform: rotate(180deg); }
#objects-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--k-pad) 14px; }
.object-entry { min-height: 38px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--k-line); border-radius: 6px; background: var(--k-card); color: var(--k-ink); font-size: .86rem; overflow-wrap: anywhere; }
.object-entry[aria-pressed=true], .object-entry:hover { border-color: #849a7d; background: var(--k-selected); }
.status-message:not(:empty) { margin: 0; padding: 8px var(--k-pad); border-top: 1px solid var(--k-soft-line); background: var(--k-selected); font-size: .88rem; }
.room, .palette, .editor, .finishes { padding: var(--k-pad); }
.finishes { container-type: inline-size; }
.finish-surfaces { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 22px; margin-top: 10px; }
.finish-surface { min-width: 0; margin: 0; padding: 0; border: 0; }
.finish-surface legend { margin: 0 0 9px; padding: 0; font-weight: 700; }
.finish-inputs { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.finish-field { display: grid; grid-template-columns: minmax(0,1fr); min-width: 0; gap: 4px; font-size: .87rem; font-weight: 620; }
.finish-select { position: relative; display: block; }
.finish-select select, .finish-picker { width: 100%; min-height: 42px; border: 1px solid #aeb8a4; border-radius: 7px; background: #fffdf7; color: var(--k-ink); }
.finish-select select { appearance: none; padding: 4px 24px 4px 10px; font-size: 1rem; font-weight: 500; cursor: pointer; }
.finish-select .icon { position: absolute; top: 50%; right: 7px; width: 13px; height: 13px; transform: translateY(-50%); pointer-events: none; }
.finish-picker { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 4px 7px; font-family: ui-monospace,monospace; font-size: .84rem; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.finish-picker input { appearance: none; flex: none; width: 24px; height: 24px; padding: 0; background: transparent; border: 0; cursor: pointer; }
.finish-picker input::-webkit-color-swatch-wrapper { padding: 0; }
.finish-picker input::-webkit-color-swatch { border: 1px solid #66705f; border-radius: 5px; }
.finish-picker input::-moz-color-swatch { border: 1px solid #66705f; border-radius: 5px; }
.finish-picker:focus-within { outline: 3px solid #916429; outline-offset: 2px; }
.finish-picker input:focus-visible { outline: none; }
.finish-palette-label { display: flex; gap: 8px; align-items: baseline; margin-top: 10px; font-size: .87rem; font-weight: 620; }
.finish-palette-label :is([data-finish-name],[data-item-color-name]) { color: var(--k-muted); font-weight: 500; }
.finish-swatches { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; max-width: 340px; }
.finish-swatches button { position: relative; min-width: 0; width: 100%; height: 41px; padding: 0; border: 0; background: transparent; border-radius: 7px; }
.finish-swatches button::before { content: ''; position: absolute; inset: 5px 1px; border: 1px solid rgb(36 54 40 / .26); border-radius: 5px; background: var(--swatch); }
.finish-swatches button[aria-pressed="true"]::before { outline: 2px solid var(--k-ink); outline-offset: 1px; }
.finish-swatches button[aria-pressed="true"]::after { content: ''; position: absolute; left: 50%; top: 48%; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2px 2px; transform: translate(-50%,-55%) rotate(-45deg); filter: drop-shadow(0 0 1px #142319) drop-shadow(0 0 1px #142319); }
.finish-swatches button:hover::before { border-color: #254630; }
#finishes-heading, #plan-heading { scroll-margin-block-start: 10px; }
@container (max-width: 545px) {
  .finish-surfaces { grid-template-columns: 1fr; }
  .finish-surface + .finish-surface { border-top: 1px solid var(--k-soft-line); padding-top: 8px; }
}
.units { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--k-line); border-radius: 8px; background: var(--k-card); }
.units button { min-width: 36px; min-height: 29px; padding: 3px 7px; border: 0; border-radius: 5px; background: transparent; font-size: .86rem; font-weight: 670; }
.units button[aria-pressed=true] { background: #285239; color: #fffdf2; }
.room-fields, .measurements { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.field { min-width: 0; display: grid; align-content: start; gap: 3px; }
.field label { font-size: .85rem; font-weight: 650; }
.field label span { color: var(--k-muted); font-size: .8rem; font-weight: 450; }
.field input { width: 100%; min-width: 0; height: 41px; border: 1px solid #aeb8a4; border-radius: 7px; background: #fffdf7; padding: 6px 9px; font-size: 1rem; }
.area-line { margin-top: 8px; font-size: .84rem; color: var(--k-muted); }
.area-line .metric { color: var(--k-ink); }
.room h3 { margin: 14px 0 9px; border-top: 1px solid var(--k-soft-line); padding-top: 13px; }
.presets, .fixtures { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.presets button, .fixtures button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-width: 0; border: 1px solid var(--k-soft-line); border-radius: 8px; padding: 5px 2px; background: var(--k-card); font-size: .83rem; font-weight: 630; line-height: 1.15; }
.presets button { min-height: 50px; }
.presets svg { display: block; width: 27px; height: 19px; fill: none; stroke: #56725c; stroke-width: 4; stroke-linejoin: round; stroke-linecap: square; }
.presets button[aria-pressed=true] { border-color: #859a7c; background: var(--k-selected); box-shadow: inset 0 0 0 1px #859a7c; }
.presets button:hover, .fixtures button:hover { background: var(--k-selected); border-color: #99aa90; }
.fixtures { margin-top: 12px; }
.fixtures button { min-height: 59px; gap: 1px; padding: 4px 2px; }
.fixtures canvas { display: block; width: 36px; height: 34px; flex: none; }
#selection-empty { margin-top: 8px; font-size: .9rem; }
.selection-line { justify-content: flex-start; margin-top: 8px; }
#selected-title { overflow-wrap: anywhere; }
.measurements { grid-template-columns: repeat(4,minmax(0,1fr)); }
.name-field { grid-column: 1/-1; }
.item-appearance { min-width: 0; margin: 14px 0 0; padding: 8px 0 0; border: 0; border-top: 1px solid var(--k-soft-line); }
.item-appearance legend { padding: 0 7px 0 0; font-size: .96rem; font-weight: 700; }
.item-appearance .finish-inputs, .item-color-palette { max-width: 440px; }
.item-color-palette .finish-palette-label { margin-top: 6px; align-items: center; }
.item-color-palette .finish-swatches { max-width: 100%; }
.color-reset { margin-left: auto; min-height: 34px; padding: 3px 0 3px 6px; border: 0; border-radius: 3px; background: transparent; color: #315b3d; font-weight: 620; text-decoration: underline; text-underline-offset: .18em; }
.color-reset:hover { color: #173a28; }
.item-actions { margin-top: 12px; flex-wrap: wrap; }
.help { margin-top: clamp(18px,2.4vw,36px); max-width: 850px; }
.help details { border-bottom: 1px solid var(--k-line); }
.help summary { justify-content: space-between; min-height: 47px; padding: .68rem 1px; }
.help p { max-width: 75ch; padding: .15rem 1px .95rem; line-height: 1.55; }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0,1fr) minmax(280px,32%); }
  .drawing { height: clamp(340px,49vw,515px); }
}
@media (max-width: 760px) {
  .workspace { display: flex; flex-direction: column; gap: 12px; }
  .result-column, .settings { display: contents; }
  .panel { width: 100%; border-radius: 11px; }
  .plan { order: 0; }
  .editor { order: 1; }
  .editor:has(#inspector[hidden]) { display: none; }
  .room { order: 3; }
  .palette { order: 4; }
  .finishes { order: 2; }
  .plan-guide { display: block; padding-right: 0; }
  .plan-guide .view-hint { padding-right: var(--k-pad); }
  .finish-swatches button, .finish-picker, .finish-select select { min-height: 44px; }
  .drawing { height: auto; aspect-ratio: 1.4; }
  .mobile-jumps { display: flex; flex-wrap: wrap; gap: 3px 14px; padding: 0 var(--k-pad); }
  .mobile-jumps a, .back-link { align-items: center; min-height: 38px; color: #315b3d; font-size: .86rem; font-weight: 630; text-underline-offset: .18em; }
  .mobile-jumps a, .back-link { display: inline-flex; }
  .mobile-jumps a[href="#edit-heading"] { display: none; }
  .workspace:has(#inspector:not([hidden])) .mobile-jumps a[href="#edit-heading"] { display: inline-flex; }
  .view-hint { padding-bottom: 0; }
  .grid-toggle, .icon-button, .object-entry, .button, button.tk-share[data-tk-share], .view-switch button, .camera-tools .reset-view { min-height: 44px; }
  .icon-button { width: 42px; }
  .units button { min-height: 39px; min-width: 42px; }
  .fixtures { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .drawing { aspect-ratio: 1.14; }
  .plan-head { padding: 8px 10px; }
  .result-actions { gap: 4px; }
  .plan-foot { padding: 5px 10px 0; }
  .drawing-tools { gap: 4px; }
  .fixtures { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .measurements { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .intro p { line-height: 1.35; }
}
@media (max-width: 370px) {
  .drawing { aspect-ratio: 1.05; }
  .plan-head { gap: 5px; }
  .result-actions button { padding-inline: 8px; }
  .icon-button { width: 36px; }
  .grid-toggle { margin-right: 0; }
  .plan-foot { gap: 5px; }
  #layout-status { font-size: .79rem; }
  .drawing-tools { gap: 3px; }
}
@container (max-width: 445px) {
  .plan-head { row-gap: 6px; column-gap: 5px; }
  .plan-label { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; width: 100%; }
  #plan-caption { margin-top: 0; }
  .camera-tools { gap: 6px; padding-inline: 8px; }
  .camera-tools .reset-view { padding-inline: 7px; }
}
@container (max-width: 320px) {
  .view-switch button { min-width: 40px; padding-inline: 5px; }
  .view-switch .icon { display: none; }
  .camera-tools { gap: 5px; }
  .camera-tools .icon-button { width: 36px; }
  .camera-tools .reset-view { gap: 4px; padding-inline: 5px; font-size: .85rem; }
}
@media (forced-colors: active) {
  .units button[aria-pressed=true], .presets button[aria-pressed=true], .view-switch button[aria-pressed=true], .object-entry[aria-pressed=true] { outline: 2px solid Highlight; }
  .finish-swatches button::before { forced-color-adjust: none; }
  .finish-swatches button[aria-pressed=true] { outline: 2px solid Highlight; }
  #layout-status:not(:empty)::before { border: 1px solid currentColor; }
}
