:root {
  color-scheme: light;
  --dn-ink: #183c29;
  --dn-muted: #506456;
  --dn-green: #28563e;
  --dn-line: #c6cbb8;
  --dn-rule: #dddecc;
  --dn-panel: #fffaf0;
  --dn-field: #fffdf7;
  --dn-pad: clamp(14px, 1.45vw, 23px);
}
*, *::after, *::before { box-sizing: border-box; }
[hidden] { display: none !important; }
.tk-tool main { padding-bottom: 36px; line-height: 1.44; }
.tk-tool main :is(h2, h3, p, dl, dd) { margin: 0; }
.tk-tool main h2 { font-size: clamp(1.15rem, 1.45vw, 1.44rem); line-height: 1.2; letter-spacing: -.04em; }
.tk-tool main h3 { font-size: 1rem; line-height: 1.25; letter-spacing: -.025em; }
.dn-intro p { max-width: 82ch; margin-top: .45rem !important; font-size: clamp(1rem, 1.16vw, 1.16rem); }
.dn-skip { position: fixed; top: 0; left: 9px; z-index: 20; transform: translateY(-120%); padding: 9px 14px; background: var(--dn-ink); color: #fff; }
.dn-skip:focus { transform: none; }
.tk-tool main :is(a, button, input, select, summary, [tabindex]):focus-visible { outline: 3px solid #996824; outline-offset: 2px; }
.dn-workspace { display: grid; grid-template: "preview editor" auto "compare editor" 1fr / minmax(0, 1fr) minmax(295px, 30%); align-items: start; gap: clamp(12px, 1.5vw, 23px); }
.dn-panel { min-width: 0; border: 1px solid var(--dn-line); border-radius: 13px; background: var(--dn-panel); }
.dn-preview { grid-area: preview; overflow: hidden; }
.dn-editor { grid-area: editor; }
.dn-compare { grid-area: compare; padding: var(--dn-pad); }
.dn-toolbar, .dn-preview-tools, .dn-form-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 9px var(--dn-pad); }
.dn-view-title { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; }
.dn-form-heading { padding-top: var(--dn-pad); }
.dn-panel :is(button, input, select) { color: inherit; font: inherit; }
.dn-panel :is(button, select) { cursor: pointer; }
.dn-panel button:disabled { cursor: default; opacity: .56; }
.dn-panel svg { display: block; flex: none; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.dn-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--dn-line); border-radius: 8px; background: #f0efe1; }
.dn-button, .dn-panel .tk-share[data-tk-share], .dn-switch button, #compare-body button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 11px;
  border: 1px solid #aab59f; border-radius: 6px; color: var(--dn-ink); background: var(--dn-field); font-weight: 650; font-size: .9rem; line-height: 1.2;
}
.dn-switch button { min-height: 32px; min-width: 51px; border: 0; background: transparent; }
.dn-switch button[aria-pressed="true"], .dn-preview button.tk-share[data-tk-share] { color: #fffaf0; background: var(--dn-green); border-color: var(--dn-green); }
.dn-switch button:hover:not([aria-pressed="true"]), .dn-button:hover, #compare-body button:hover { background: #e5ecdd; }
.dn-preview button.tk-share[data-tk-share]:hover { background: #346b47; }
.dn-stage { position: relative; width: 100%; height: clamp(345px, 32vw, 515px); background: #f1ede1; border-block: 1px solid var(--dn-rule); }
#dining-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#dining-canvas:active { cursor: grabbing; }
.dn-preview-tools { padding-block: 8px 5px; }
.dn-actions, .dn-checkbox { display: inline-flex; align-items: center; gap: 7px; }
.dn-checkbox { min-height: 38px; font-size: .94rem; font-weight: 640; cursor: pointer; }
.dn-checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--dn-green); }
.dn-hint { padding: 0 var(--dn-pad) 10px; color: var(--dn-muted); font-size: .87rem; }
.dn-status:empty, .dn-fit:empty { display: none; }
.dn-status, .dn-error { padding: 9px var(--dn-pad); font-size: .94rem; font-weight: 600; }
.dn-status { background: #ebf0e0; color: var(--dn-ink); }
.dn-error { background: #f9e7d6; color: #75391e; }
.dn-angle { display: flex; align-items: center; gap: 10px; padding: 2px var(--dn-pad) 9px; font-size: .89rem; font-weight: 650; }
.dn-angle input { flex: 1 1 85px; min-width: 0; max-width: 240px; accent-color: var(--dn-green); }
.dn-angle span { min-width: 4ch; font-variant-numeric: tabular-nums; }
.dn-estimate { padding: 14px var(--dn-pad) 0; border-top: 1px solid var(--dn-rule); }
.dn-fit { padding: .46rem .8rem; border-radius: 5px; border-inline-start: 3px solid #60836b; background: #e9efdf; color: #264830; font-weight: 690; font-size: .98rem; }
.dn-fit:is([data-fit="tight"],[data-fit="error"]) { border-color: #a75a32; background: #f8e9d5; color: #75381e; }
.dn-metrics { display: grid; grid-template-columns: 1.18fr .94fr .9fr 1.2fr; padding-block: 15px; }
.dn-metrics > div { min-width: 0; padding-inline: clamp(6px,1.05vw,18px); border-inline-start: 1px solid var(--dn-rule); }
.dn-metrics > div:first-child { border: 0; padding-left: 0; }
.dn-metrics > div:last-child { padding-right: 0; }
.dn-metrics dt { font-size: .86rem; color: var(--dn-muted); }
.dn-metrics dd { margin-top: 5px !important; color: var(--dn-ink); font-size: clamp(1.08rem,1.45vw,1.45rem); line-height: 1.18; letter-spacing: -.035em; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dn-clearances { display: flex; align-items: center; gap: 12px 22px; padding: 12px var(--dn-pad); border-top: 1px solid var(--dn-rule); }
#wall-gaps { display: grid; flex: 1; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px 12px; }
#wall-gaps dt { color: var(--dn-muted); font-size: .85rem; }
#wall-gaps dd { margin-top: 2px; font-size: .94rem; font-weight: 650; font-variant-numeric: tabular-nums; }
#wall-gaps [data-fit="tight"], #wall-gaps [data-tight="true"] { color: #924320; }
.dn-panel a, .dn-notes a { color: var(--dn-green); text-underline-offset: .16em; }
.dn-jumps, .dn-mobile { display: none; }
.dn-fields { padding: 0 var(--dn-pad) var(--dn-pad); }
.dn-fields fieldset { min-width: 0; margin: 0; padding: 0 0 14px; border: 0; }
.dn-fields legend { width: 100%; margin: 0; padding: 12px 0 8px; border-top: 1px solid var(--dn-rule); font-size: 1rem; font-weight: 730; letter-spacing: -.014em; }
.dn-fields fieldset:first-child legend { border: 0; padding-top: 2px; }
.dn-inputs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 11px; }
.dn-wide { grid-column: 1 / -1; }
.dn-fields label { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; gap: 5px; font-size: .89rem; line-height: 1.25; font-weight: 620; }
.dn-fields small { display: inline-block; color: var(--dn-muted); font-size: .8rem; font-weight: 475; }
.dn-fields :is(input,select) { display: block; width: 100%; min-width: 0; min-height: 41px; padding: 5px 9px; border: 1px solid #aab59f; border-radius: 6px; background-color: var(--dn-field); font-size: 1rem; line-height: 1.2; font-weight: 490; }
.dn-fields select { appearance: none; padding-right: 27px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23385240' stroke-width='1.55'%3E%3Cpath d='m1.5 1.5 4.5 5 4.5-5'/%3E%3C/svg%3E"); background-position: right 9px center; background-repeat: no-repeat; }
.dn-fields input[type="number"] { font-variant-numeric: tabular-nums; }
.dn-fields input[type="color"] { height: 41px; padding: 4px; cursor: pointer; }
.dn-fields input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.dn-fields input[type="color"]::-webkit-color-swatch { border: 1px solid #0003; border-radius: 3px; }
.dn-custom { margin-top: 10px; }
.dn-options { border-top: 1px solid var(--dn-rule); }
.dn-options summary, .dn-notes summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.dn-options summary { min-height: 44px; font-weight: 670; font-size: .96rem; }
:is(.dn-options,.dn-notes) summary::-webkit-details-marker { display: none; }
:is(.dn-options,.dn-notes) summary::after { content: ""; display: block; flex: none; width: 8px; height: 8px; margin-right: 4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
:is(.dn-options,.dn-notes details)[open] > summary::after { transform: rotate(225deg); }
.dn-center { margin: 8px 0 14px; }
.dn-compare p { margin: 4px 0 12px !important; font-size: .93rem; color: var(--dn-muted); }
.dn-scroll { overflow-x: auto; }
.dn-scroll table { width: 100%; border-collapse: collapse; line-height: 1.3; text-align: left; }
.dn-scroll :is(td,th) { padding: 8px 7px; border-bottom: 1px solid var(--dn-rule); font-size: .94rem; font-variant-numeric: tabular-nums; }
.dn-scroll thead th { font-size: .85rem; font-weight: 650; color: var(--dn-muted); background: #eef0e2; }
.dn-scroll tbody :first-child { font-weight: 620; }
.dn-scroll tr > :last-child { text-align: right; }
#compare-body button { min-height: 34px; font-size: .84rem; white-space: normal; }
#compare-body button[aria-pressed="true"], #compare-body tr[data-selected="true"] { background: #e7efdf; }
.dn-handoff { margin-top: 13px; padding: 11px 13px; border-radius: 6px; background: #edf1e3; }
.dn-handoff a { display: inline-flex; align-items: center; min-height: 36px; font-weight: 670; }
.dn-compare .dn-handoff p { margin: 0 !important; font-size: .88rem; }
.dn-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dn-notes { max-width: 835px; margin-top: clamp(17px,2vw,32px); }
.dn-notes details { border-bottom: 1px solid var(--dn-line); }
.dn-notes summary { min-height: 47px; padding: 8px 0; font-weight: 650; }
.dn-notes p { max-width: 76ch; padding-bottom: 13px; color: var(--dn-muted); }
@media (max-width:1150px) {
  .dn-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 0; }
  .dn-metrics > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .dn-clearances { flex-direction: column; align-items: stretch; gap: 8px; }
}
@media (max-width:800px) {
  .dn-workspace { grid-template: "preview" "compare" "editor" / minmax(0,1fr); }
  .dn-stage { height: auto; aspect-ratio: 1.5; }
  .dn-jumps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 0 var(--dn-pad); border-top: 1px solid var(--dn-rule); }
  .dn-mobile, .dn-jumps a { display: inline-flex; align-items: center; min-height: 42px; font-weight: 630; font-size: .9rem; }
  .dn-compare-back { margin-bottom: -6px; }
  .dn-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 18px; }
  .dn-fields :is(input,select), .dn-switch button, .dn-button, .dn-panel .tk-share[data-tk-share], #compare-body button { min-height: 44px; }
}
@media (max-width:540px) {
  .dn-stage { aspect-ratio: 1.22; }
  .dn-toolbar, .dn-preview-tools { padding: 7px 12px; }
  .dn-checkbox { min-height: 44px; }
  .dn-switch button { min-width: 44px; padding-inline: 6px; }
  .dn-fields { grid-template-columns: minmax(0,1fr); gap: 0; }
  .dn-scroll :is(th,td) { padding: 6px 4px; }
  .dn-scroll th { font-size: .8rem; }
  .dn-scroll td { font-size: .85rem; }
  #compare-body button { padding-inline: 6px; font-size: .81rem; }
  .dn-metrics { gap: 10px 0; }
}
@media (max-width:365px) {
  .dn-compare { padding-inline: 9px; }
  .dn-preview-tools { gap: 3px; padding-inline: 8px; }
  .dn-actions { gap: 4px; }
  .dn-checkbox { font-size: .86rem; gap: 4px; }
  .dn-actions :is(button.tk-share[data-tk-share],.dn-button) { padding-inline: 7px; }
  #wall-gaps { gap: 5px; }
}
@media (forced-colors:active) { .dn-fields select { appearance: auto; background-image: none; } }
@media print {
  .dn-workspace { display: block; }
  .dn-editor, .dn-jumps, .dn-mobile, .dn-notes, .dn-handoff, .dn-preview-tools, .dn-angle, .dn-hint, .dn-switch, .dn-status, #compare-body td:last-child, .dn-scroll th:last-child { display: none !important; }
  .dn-stage { height: 320px; }
  .dn-compare { margin-top: 12px; }
}
