:root { color-scheme: light; --ink: #24362f; --paper: #faf9f4; --accent: #dfab51; }
* { box-sizing: border-box; }
body { margin: 0; background: #e6e7e1; color: var(--ink); font-family: 'Plan Sans', 'Avenir Next', sans-serif; }
.toolbar { min-height: 86px; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #c4cbc1; background: #fafbf7; }
.identity { display: flex; align-items: center; gap: 13px; }
.mark { width: 38px; height: 38px; border: 1.5px solid var(--ink); display: grid; place-items: center; font-family: 'Plan Mono', monospace; font-size: 13px; }
.identity strong { display: block; font-size: 15px; font-weight: 600; }
.identity small { display: block; margin-top: 3px; font-size: 11px; color: #69776d; letter-spacing: .06em; text-transform: uppercase; }
.actions { display: flex; align-items: center; gap: 8px; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 15px; border: 1px solid #bac3b8; border-radius: 3px; background: transparent; color: var(--ink); font: 600 13px 'Plan Sans', 'Avenir Next', sans-serif; cursor: pointer; white-space: nowrap; }
button:hover { background: #e8ece4; border-color: var(--ink); }
button:focus-visible { outline: 3px solid #bb8729; outline-offset: 3px; }
button:disabled { cursor: progress; opacity: .65; }
.primary { background: var(--ink); border-color: var(--ink); color: #fffdf4; }
.primary:hover { background: #365242; }
button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.viewer { padding: 30px 32px 20px; overflow: auto; }
.sheet { width: min(100%, 1680px); margin: 0 auto; background: var(--paper); box-shadow: 0 8px 28px #20352817, 0 1px 3px #20352824; }
#plan { display: block; width: 100%; height: auto; }
.view-note { margin: 0; padding: 0 24px 24px; text-align: center; color: #5c6b60; font-size: 12px; }
#export-status { min-height: 18px; }
dialog { width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #000; border-radius: 0; background: #fff; color: #000; box-shadow: 0 24px 80px #0003; overscroll-behavior: contain; }
dialog::backdrop { background: #0009; backdrop-filter: blur(4px); }
.costs { --costs-muted: #666; font-family: 'Plan Sans', 'Avenir Next', sans-serif; }
.costs-head { display: grid; grid-template-columns: 1fr auto; gap: 32px; padding: 34px 38px 30px; border-bottom: 1px solid #000; }
.costs-kicker, .costs-label { font-family: 'Plan Mono', monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.costs h2 { margin: 18px 0 8px; font: 600 clamp(38px, 6vw, 72px)/.92 'Plan Display', 'DIN Condensed', sans-serif; letter-spacing: -.025em; text-transform: uppercase; }
.costs-address { margin: 0; color: var(--costs-muted); font-size: 14px; line-height: 1.5; }
.proposal-status { align-self: start; min-width: 210px; padding: 12px 14px 13px; border: 1px solid #000; border-top: 3px solid #f5a623; background: #fafafa; }
.proposal-status span, .proposal-status small { display: block; color: #666; font: 9px 'Plan Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.proposal-status strong { display: block; margin: 8px 0 5px; font-size: 14px; font-weight: 600; }
.costs-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #000; }
.costs-meta > div { padding: 18px 38px; border-right: 1px solid #d8d8d8; }
.costs-meta > div:last-child { border-right: 0; }
.costs-meta strong { display: block; margin-top: 7px; font: 400 13px 'Plan Mono', monospace; }
.costs-body { padding: 4px 38px 32px; }
.costs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.costs-table th { padding: 18px 0 11px; border-bottom: 1px solid #000; color: var(--costs-muted); font: 10px 'Plan Mono', monospace; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.costs-table td { padding: 16px 0; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
.costs-table th:nth-child(n+2), .costs-table td:nth-child(n+2) { text-align: right; }
.item-name { display: block; font-weight: 600; }
.item-note { display: block; margin-top: 4px; color: var(--costs-muted); font-size: 11px; line-height: 1.5; }
.costs-total { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; padding: 24px 0 28px; border-bottom: 1px solid #000; }
.costs-total p { max-width: 520px; margin: 8px 0 0; color: var(--costs-muted); font-size: 11px; line-height: 1.55; }
.costs-total strong { font: 600 clamp(38px, 5vw, 64px)/1 'Plan Display', 'DIN Condensed', sans-serif; letter-spacing: -.02em; white-space: nowrap; }
.costs-deposit { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; margin-top: 18px; padding: 20px 22px; background: #000; color: #fff; }
.costs-deposit .costs-label { color: #aaa; }
.costs-deposit h3 { margin: 7px 0 5px; font-size: 15px; font-weight: 600; }
.costs-deposit p { max-width: 670px; margin: 0; color: #bbb; font-size: 11px; line-height: 1.55; }
.deposit-amount { text-align: right; }
.deposit-amount strong { display: block; font: 600 clamp(30px, 4vw, 48px)/1 'Plan Display', 'DIN Condensed', sans-serif; letter-spacing: -.015em; white-space: nowrap; }
.deposit-amount small { display: block; margin-top: 6px; color: #aaa; font: 10px 'Plan Mono', monospace; letter-spacing: .06em; text-transform: uppercase; }
.costs-scope { padding: 28px 0 24px; border-bottom: 1px solid #000; }
.scope-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 34px; margin: 14px 0 0; padding: 0; list-style: none; }
.scope-list li { position: relative; padding: 9px 0 9px 20px; border-bottom: 1px solid #ececec; font-size: 12px; line-height: 1.4; }
.scope-list li::before { content: '+'; position: absolute; left: 0; font-family: 'Plan Mono', monospace; }
.costs-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 38px; border-top: 1px solid #000; background: #fff; }
.costs-actions button { border-color: #000; border-radius: 0; color: #000; }
.costs-actions .costs-primary { background: #000; color: #fff; }
.costs-actions .costs-primary:hover { background: #222; }
.print-costs-document { display: none; }
html.map-open { overflow: hidden; overscroll-behavior: none; }
body.map-open { position: fixed; width: 100%; overflow: hidden; }
.map-dialog { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: #17251e; box-shadow: none; overscroll-behavior: none; }
.map-dialog::backdrop { background: #17251e; backdrop-filter: none; }
.map-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.map-viewport.is-dragging { cursor: grabbing; }
.map-viewport:focus-visible { outline: 2px solid #f2cb7c; outline-offset: -4px; }
#map-art { position: absolute; left: 0; top: 0; display: block; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.map-close { position: absolute; z-index: 1; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 48px; height: 48px; min-height: 48px; padding: 0; border: 1px solid #ffffff40; border-radius: 50%; background: #1d3028e8; color: #fffdf4; box-shadow: 0 2px 14px #0003; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); touch-action: manipulation; }
.map-close:hover { background: #243e31; border-color: #ffffff80; }
.map-close svg { width: 22px; height: 22px; }
.map-hint { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); margin: 0; padding: 11px 16px; border: 1px solid #ffffff26; border-radius: 24px; background: #1d3028e8; color: #fffdf4; font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; opacity: 1; transition: opacity .3s ease; }
.map-hint.is-hidden { opacity: 0; }
.map-help { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .map-hint { transition: none; } }
@media screen and (max-width: 700px) {
  .toolbar { padding: 14px 16px; flex-wrap: wrap; gap: 14px; }
  .identity { min-width: 0; }
  .mark { flex-shrink: 0; }
  .actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  button { flex: 1; min-height: 44px; padding: 10px 8px; font-size: 12px; }
  .viewer { padding: 16px 12px; }
  .view-note { font-size: 11px; line-height: 1.6; }
  dialog { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; }
  .costs-head { padding: 26px 22px; grid-template-columns: 1fr; gap: 20px; }
  .proposal-status { justify-self: start; }
  .costs-meta { grid-template-columns: 1fr; }
  .costs-meta > div { padding: 14px 22px; border-right: 0; border-bottom: 1px solid #e5e5e5; }
  .costs-body { padding: 4px 22px 26px; }
  .costs-table { table-layout: fixed; }
  .costs-table th:nth-child(2), .costs-table td:nth-child(2), .costs-table th:nth-child(3), .costs-table td:nth-child(3) { display: none; }
  .costs-table th:last-child, .costs-table td:last-child { width: 104px; }
  .scope-list { grid-template-columns: 1fr; }
  .costs-total, .costs-deposit { grid-template-columns: 1fr; }
  .deposit-amount { text-align: left; }
  .costs-actions { padding: 12px 22px; }
}
@page plan-sheet { size: 24in 18in; margin: 0; }
@page costs-sheet { size: letter portrait; margin: .5in; }
@media print {
  html, body { margin: 0; background: white; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html.map-open, body.map-open { position: static; top: auto !important; width: auto; overflow: visible; }
  .toolbar, .view-note, dialog { display: none !important; }
  .viewer { page: plan-sheet; padding: 0; overflow: visible; }
  .sheet { width: 24in; height: 18in; max-width: none; margin: 0; box-shadow: none; }
  #plan { width: 24in; height: 18in; }
  body.print-costs .viewer { display: none !important; }
  .print-costs-document { page: costs-sheet; display: block; color: #000; }
  .costs-head { gap: 16px; padding: 16px 0 22px; }
  .costs h2 { font-size: 50px; }
  .proposal-status { min-width: 175px; }
  .costs-meta > div { padding: 16px; }
  .costs-meta > div:first-child { padding-left: 0; }
  .costs-body { padding: 4px 0 0; }
  .costs-deposit { grid-template-columns: 1fr; gap: 16px; break-inside: avoid; }
  .deposit-amount { text-align: left; }
  .costs-actions { display: none; }
}
