:root { color-scheme: light; --ink: #213b34; --muted: #6b7872; --green: #164e43; --line: #e0e5dc; --paper: #fbfcf8; }
* { box-sizing: border-box; }
body { margin: 0; background: #f3f5ef; color: var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #ced7cd; background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 14px; font-weight: 600; }
button:hover { background: #e7eee3; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #81b5a2; outline-offset: 2px; }
.topbar { position: sticky; top: 0; z-index: 10; background: #fbfcf8; border-bottom: 1px solid var(--line); padding: 19px max(24px, calc((100vw - 1480px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { color: var(--green); text-decoration: none; font-weight: 750; font-size: 22px; display: flex; align-items: center; gap: 9px; letter-spacing: -.6px; }
.brand-icon { font-size: 30px; line-height: 1; }
.badge { font-size: 9px; letter-spacing: 1px; border: 1px solid #bdcdbd; border-radius: 4px; padding: 3px 5px; margin-left: 5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
#language { width: auto; margin: 0; }
main { max-width: 1528px; margin: auto; padding: 38px 24px; }
.intro { margin-bottom: 30px; }
.eyebrow { color: #6b846d; font-size: 10px; font-weight: 750; letter-spacing: 1.8px; margin: 0 0 8px; }
h1 { font-size: clamp(27px, 3vw, 40px); line-height: 1.2; font-weight: 650; letter-spacing: -1.3px; margin: 0 0 12px; }
.intro > p:last-child { color: var(--muted); margin: 0; }
.workspace { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 28px; align-items: start; }
.workspace > * { min-width: 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 22px; margin-bottom: 18px; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.section-heading h2 { flex: 1; }
h2 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -.3px; }
.step { color: #70917c; border: 1px solid #d8e3d4; border-radius: 50%; width: 27px; height: 27px; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 13px; }
label > span { font-weight: 400; color: var(--muted); float: right; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; min-width: 0; border: 1px solid #ced8cd; border-radius: 6px; background: white; color: var(--ink); padding: 9px 10px; margin-top: 5px; }
textarea { font-family: ui-monospace, monospace; font-weight: 400; font-size: 12px; resize: vertical; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 12px 0 0; }
input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; flex-shrink: 0; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 8px 0 14px; }
.hint strong { font-weight: 650; }
.small { font-size: 11px; padding: 6px 9px; }
.area-editor { border: 0; border-top: 1px solid var(--line); padding: 12px 0 0; min-width: 0; margin: 18px 0 0; }
legend { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #7c8b7c; padding-right: 8px; }
.area-title { display: flex; gap: 8px; align-items: center; margin-bottom: 15px; }
.area-title input { font-weight: 650; margin-top: 0; }
.remove { border: 0; color: #8a6656; background: transparent; }
.generate { margin: 12px 0; }
.mode-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.surface-editor { margin-top: 16px; }
.surface-editor > summary { font-size: 13px; font-weight: 650; }
.surface-settings { margin-top: 15px; }
.opening-editor { border: 1px solid var(--line); border-radius: 8px; margin: 18px 0; padding: 12px; min-width: 0; }
.opening-editor legend { font-size: 10px; }
.remove-opening { margin-bottom: 12px; }
.reveal-options { display: flex; flex-wrap: wrap; gap: 12px; }
.reveal-options .check { margin-top: 0; }
.wall-preview { margin-top: 14px; }
.wall-preview .plan-svg { max-height: 180px; }
.wall-link { font-weight: 700; paint-order: stroke; stroke: white; stroke-width: 12px; cursor: pointer; }
.error-text { color: #833d2e; }
.primary { background: var(--green); color: white; border-color: var(--green); }
.primary:hover { background: #0c3b32; }
.calculate { width: 100%; display: flex; justify-content: space-between; padding: 14px 18px; }
.local-note { text-align: center; color: var(--muted); font-size: 10px; margin: 12px 8px; }
.notice { border: 1px solid #dacb98; background: #fff8de; border-radius: 8px; padding: 14px 18px; margin-bottom: 18px; }
.notice.error { border-color: #dfbdb3; background: #fff0e9; color: #833d2e; }
#cancel-calculation { margin-bottom: 18px; }
.result-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.result-heading h2 { font-size: 23px; }
.pill { white-space: nowrap; font-size: 10px; border-radius: 30px; background: #e8eee1; color: #59704e; padding: 5px 10px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--green); color: #fff; border-radius: 12px; padding: 24px 8px; }
.rest-heading { margin-top: 22px; }
.stats > div { padding: 0 18px; border-right: 1px solid #487267; }
.stats > div:last-child { border: 0; }
.stats strong { display: block; font-size: 33px; font-weight: 600; letter-spacing: -1px; line-height: 1.2; margin-bottom: 8px; }
.stats small { font-size: 13px; font-weight: 400; letter-spacing: 0; }
.stats span { font-size: 10px; color: #bfd5c6; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; } .stats > div:nth-child(2) { border-right: 0; } }
.result-note { font-size: 11px; color: var(--muted); margin: 12px 2px 22px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.legend-piece { width: 12px; height: 12px; background: #dcece2; border: 1px solid #52675b; }
.legend-line { width: 20px; border-top: 2px dashed #b06e31; margin-left: 12px; }
.legend-toggle { font-size: 11px; margin: 0; }
.area-plan { margin-top: 24px; }
.area-plan + .area-plan { border-top: 1px solid var(--line); padding-top: 20px; }
h3 { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; font-weight: 650; margin: 0 0 12px; }
h3 span { font-size: 10px; color: var(--muted); font-weight: 400; }
.plan-svg { display: block; width: 100%; max-height: 570px; background: #fff; border-radius: 7px; }
.piece-id, .piece-size, .dimension { text-anchor: middle; fill: #284537; font-family: ui-sans-serif, system-ui, sans-serif; }
.piece-id { font-weight: 650; }
.piece-size { fill: #5e7165; }
.dimension { fill: #798378; }
.hide-battens .batten-lines { display: none; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.piece-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.piece-tags span { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #eef2e9; }
details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { font-size: 11px; color: var(--green); cursor: pointer; }
.cuts { font-size: 11px; padding-left: 20px; color: #4f6357; }
.cuts li { margin: 8px 0; }
h4 { font-size: 12px; margin-bottom: 0; }
.table-scroll { overflow: auto; }
.mobile-nav { display: none; }
.plan-viewer { min-width: 0; }
.plan-zoom { margin: 0 0 8px; }
.plan-scroll { overflow: auto; max-height: 70vh; border-radius: 7px; }
.plan-scroll:focus-visible { outline: 3px solid #81b5a2; outline-offset: 2px; }
.is-zoomed .plan-svg { width: max(100%, 900px); max-height: none; }
table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
th { color: #758271; font-weight: 500; white-space: nowrap; }
td, th { padding: 10px; border-bottom: 1px solid var(--line); }
td:first-child { font-weight: 650; }
.assumptions { background: transparent; }
.assumptions h2 { font-size: 13px; }
.assumptions p { font-size: 11px; color: var(--muted); }
.assumptions p:last-child { margin-bottom: 0; }
.stale { opacity: .55; }
footer { border-top: 1px solid var(--line); padding: 22px; text-align: center; color: #87917f; font-size: 10px; }
[hidden] { display: none !important; }
@media (min-width: 1250px) { .workspace { grid-template-columns: 380px minmax(0, 1fr); gap: 35px; } }
@media (max-width: 950px) { .workspace { grid-template-columns: 310px minmax(0, 1fr); gap: 18px; } .card { padding: 17px; } .sheet-grid { grid-template-columns: 1fr; } .stats { padding: 17px 3px; } .stats > div { padding: 0 10px; } .stats strong { font-size: 25px; } .result-heading { align-items: start; flex-direction: column; } }
@media (max-width: 720px) {
  html { scroll-padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .workspace { grid-template-columns: 1fr; }
  .topbar { position: static; flex-wrap: wrap; padding: 15px 16px; gap: 14px; }
  .topbar .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  button, .small { min-height: 44px; }
  input:not([type=checkbox]), select, textarea { font-size: 16px; min-height: 44px; }
  input[type=checkbox] { width: 22px; height: 22px; }
  .check { min-height: 44px; }
  summary { min-height: 44px; padding: 10px 0; font-size: 13px; }
  .hint, .result-note, .cuts, .assumptions p { font-size: 13px; }
  .local-note { font-size: 12px; }
  main { padding: 24px 16px; }
  .intro { margin-bottom: 24px; }
  .sheet-grid { grid-template-columns: 1fr; }
  .results { margin-top: 12px; }
  #settings, #results { scroll-margin-top: 16px; }
  .card, .result-heading, .stats, h3 { overflow-wrap: anywhere; }
  h3 { flex-wrap: wrap; }
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -3px 14px #213b3410; }
  .mobile-nav a { display: grid; place-items: center; min-height: 44px; color: var(--green); font-weight: 600; text-decoration: none; }
  .mobile-nav a:focus-visible { outline: 3px solid #81b5a2; }
}
@media (max-width: 360px) { .fields { grid-template-columns: 1fr; gap: 0; } .card { padding: 14px; } }
@media print {
  html[lang="en"] .stale::before { content: 'WARNING: PLAN OUT OF DATE'; }
  .mobile-nav, .plan-zoom, #cancel-calculation { display: none !important; }
  .plan-scroll { overflow: visible; max-height: none; }
  .is-zoomed .plan-svg { width: 100%; }
  body { padding-bottom: 0; }
}
@media (max-width: 450px) { .sheet-grid { grid-template-columns: 1fr; } .stats strong { font-size: 24px; } .stats small { display: block; } }
@media print { @page { margin: 12mm; } body { background: white; font-size: 10px; } .topbar, .intro, aside, footer, #status, #csv, .legend-toggle { display: none; } main { padding: 0; } .workspace { display: block; } .card { border: 1px solid #ccc; margin: 14px 0; padding: 12px; } .stats { color: #173b30; background: #edf2e8; print-color-adjust: exact; } .stats span { color: #555; } .stats > div { border-color: #ccc; } .area-plan, .sheet, tr { break-inside: avoid; } .plan-svg { max-height: 210mm; print-color-adjust: exact; } .sheet-grid { display: block; } .sheet { margin-bottom: 14px; } .sheet .plan-svg { max-height: 95mm; } details { display: block; } details > * { display: block; } details::details-content { content-visibility: visible; } summary { display: none; } .result-heading { flex-direction: row; } .stale::before { content: 'ACHTUNG: PLAN NICHT AKTUELL'; display: block; color: #a00; font-size: 20px; } }
