:root {
  color-scheme: light;
  --ink:#18342c; --muted:#536960; --green:#255b49; --green-dark:#173e32;
  --sage:#dce9df; --cream:#f7f5ed; --paper:#fffefa; --line:#d6ded5;
  --gold:#b78335; --error:#9c3026;
  font-family:"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  color:var(--ink); background:var(--cream);
}
* { box-sizing:border-box; }
body { margin:0; min-width:320px; line-height:1.55; }
.site-header { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.9rem max(1rem,calc((100% - 1180px)/2)); color:#fff; background:var(--green-dark); }
.brand { color:#fff; font-weight:800; text-decoration:none; letter-spacing:.01em; }
.header-note { color:#d8e7de; font-size:.9rem; }
main,footer { width:min(1180px,calc(100% - 2rem)); margin-inline:auto; }
.intro { max-width:900px; padding:3.1rem 0 1.65rem; }
.eyebrow { margin:0 0 .35rem; color:var(--green); font-size:.74rem; font-weight:850; letter-spacing:.13em; text-transform:uppercase; }
h1,h2,h3 { color:var(--ink); line-height:1.17; }
h1 { max-width:780px; margin:0 0 .8rem; font-size:clamp(2.2rem,5.2vw,4rem); letter-spacing:-.05em; }
h2 { margin:0; font-size:1.45rem; letter-spacing:-.025em; }
h3 { margin:0; font-size:1.08rem; }
.intro > p:not(.eyebrow) { max-width:850px; color:var(--muted); font-size:1.04rem; }
.privacy-callout,.example-callout { padding:.75rem .95rem; border-left:4px solid var(--gold); background:#fff9e9; font-size:.92rem !important; }
.example-callout { border-color:var(--green); background:#edf5ef; }
.workspace-grid { display:grid; grid-template-columns:minmax(320px,.96fr) minmax(0,1.04fr); align-items:start; gap:1rem; }
.panel,.method-section { min-width:0; border:1px solid var(--line); border-radius:16px; background:var(--paper); box-shadow:0 8px 25px rgb(24 52 44 / 5%); }
.panel { padding:1.3rem; }
.section-heading,.subheading-row { display:flex; justify-content:space-between; align-items:center; gap:.8rem; margin-bottom:1rem; }
.section-heading h2 { max-width:25rem; }
label { display:grid; gap:.35rem; color:var(--ink); font-size:.88rem; font-weight:750; }
input,select { width:100%; min-height:44px; padding:.58rem .68rem; border:1px solid #aabbb0; border-radius:8px; background:#fff; color:var(--ink); font:inherit; font-size:.94rem; }
input[type=file] { min-height:auto; padding:.45rem; font-size:.81rem; }
input:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible { outline:3px solid #d2a149; outline-offset:2px; }
.button-row { display:flex; gap:.55rem; margin-top:.65rem; }
button { min-height:44px; padding:.62rem .9rem; border:0; border-radius:9px; background:var(--green); color:#fff; font:inherit; font-weight:800; cursor:pointer; }
button:hover:not(:disabled) { background:var(--green-dark); }
button:disabled { cursor:not-allowed; opacity:.48; }
.button-row .secondary-button,.text-button { min-height:38px; padding:.42rem .68rem; border:1px solid var(--green); background:transparent; color:var(--green); font-size:.82rem; }
.button-row .secondary-button:hover:not(:disabled),.text-button:hover:not(:disabled) { background:var(--sage); }
.text-button { flex:none; }
.preview-block { margin-top:1.15rem; padding-top:1.1rem; border-top:1px solid var(--line); }
.subheading-row { margin-bottom:.5rem; }
.field-help,.defaults-note,.print-instructions,.method-section p,footer p { color:var(--muted); }
.field-help { margin:.45rem 0 .8rem; font-size:.81rem; }
.image-frame { position:relative; display:grid; place-items:center; min-height:185px; overflow:hidden; border:1px solid var(--line); border-radius:9px; background:#f2f0e7; }
.image-frame.empty { border-style:dashed; }
.image-frame:not(.empty) { min-height:0; }
#plan-image { display:block; width:100%; height:auto; cursor:crosshair; user-select:none; }
.point-overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.point-marker { position:absolute; width:22px; height:22px; border:3px solid #a13a22; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgb(0 0 0 / 40%); transform:translate(-50%,-50%); }
.point-marker.second { border-color:#1557a0; }
.empty-state { margin:1rem 0; padding:1rem; border:1px dashed #bdc9bf; border-radius:10px; color:var(--muted); text-align:center; font-size:.85rem; }
.status-message { min-height:1.25em; margin:.5rem 0 0; color:var(--muted); font-size:.81rem; }
.error { margin:.6rem 0 0; color:var(--error); font-size:.88rem; font-weight:750; }
.settings-block { margin-top:1.15rem; padding-top:1.1rem; border-top:1px solid var(--line); }
.settings-block h3 { margin-bottom:.75rem; }
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:.7rem; }
.settings-grid label { font-size:.78rem; }
.settings-grid select,.settings-grid input { min-height:42px; font-size:.88rem; }
.input-with-unit,.scale-input { display:flex; align-items:center; gap:.35rem; }
.input-with-unit select { width:76px; flex:none; }
.scale-input > span { flex:none; font-size:.95rem; }
.defaults-note { margin:.65rem 0; font-size:.77rem; }
#generate-button,#print-button { width:100%; }
.result-panel { position:sticky; top:1rem; }
.state-pill { flex:none; padding:.28rem .56rem; border-radius:99px; background:#efeee6; color:#5e6256; font-size:.7rem; font-weight:800; }
.state-pill.ready { background:#e1efe5; color:#1c6047; }
.summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; margin-bottom:.7rem; }
.summary-item { padding:.62rem .68rem; border:1px solid var(--line); border-radius:9px; background:#fcfbf6; }
.summary-item strong { display:block; color:var(--green-dark); font-size:1.24rem; line-height:1.1; }
.summary-item span { color:var(--muted); font-size:.76rem; }
.layout-summary { margin:.45rem 0 .6rem; color:var(--green-dark); font-size:.89rem; font-weight:800; }
.grid-preview-frame { display:grid; place-items:center; min-height:150px; padding:.8rem; border:1px solid var(--line); border-radius:9px; background:#f2f0e7; }
.grid-preview { position:relative; width:min(100%,440px); overflow:hidden; border:1px solid #889b8c; background:#fffefa; box-shadow:0 3px 12px rgb(24 52 44 / 9%); }
.grid-preview > img { display:block; width:100%; height:100%; object-fit:fill; }
.grid-cell { position:absolute; border:1px solid #b14529; background:rgb(255 255 255 / 10%); color:#6d2110; font-size:clamp(9px,1.1vw,12px); font-weight:900; text-shadow:0 1px #fff; }
.grid-cell span { position:absolute; top:2px; left:3px; padding:0 .2rem; border-radius:3px; background:rgb(255 255 255 / 88%); }
.print-instructions { margin:.85rem 0; padding:.68rem .75rem; border-left:3px solid var(--gold); background:#fff9e9; font-size:.81rem; }
.method-section { margin:1.1rem 0 2rem; padding:1.4rem; }
.method-section .eyebrow { margin-top:0; }
.method-section p { max-width:900px; }
.limits-note { margin-top:1rem; padding:.82rem .95rem; border-left:4px solid var(--gold); background:#fff9e9; }
.limits-note h3 { font-size:.96rem; }
.limits-note p { margin-bottom:0; font-size:.87rem; }
footer { padding:0 0 2rem; font-size:.8rem; }
footer a { color:var(--green); font-weight:750; }
.print-output { display:none; }
.print-sheet { position:relative; margin:0 auto; overflow:hidden; break-after:page; page-break-after:always; background:#fff; color:#18342c; }
.print-sheet:last-child { break-after:auto; page-break-after:auto; }
.sheet-art { position:absolute; overflow:hidden; border:1px dashed #536960; background:#fff; }
.sheet-plan { position:absolute; max-width:none; user-select:none; }
.sheet-label,.sheet-footer { position:absolute; left:8mm; right:8mm; display:flex; justify-content:space-between; align-items:center; color:#263e35; font:8pt/1.1 "Segoe UI",sans-serif; }
.sheet-label { top:1.4mm; height:5mm; }
.sheet-footer { bottom:5mm; height:3mm; justify-content:flex-start; }
.page-mark { font-weight:800; }
.assembly-note { font-size:6.5pt; white-space:nowrap; }
.calibration-bar { display:flex; flex:0 0 auto; align-items:center; gap:2mm; }
.calibration-line { position:relative; display:block; flex:0 0 100mm; width:100mm; height:3mm; border-bottom:.35mm solid #18342c; }
.calibration-line::before,.calibration-line::after { position:absolute; bottom:0; width:.35mm; height:2.5mm; background:#18342c; content:""; }
.calibration-line::before { left:0; }
.calibration-line::after { right:0; }
.calibration-label { font-size:7pt; }
@media(max-width:900px) { .workspace-grid { grid-template-columns:1fr; } .result-panel { position:static; } .intro { padding-top:2.3rem; } }
@media(max-width:560px) {
  main,footer { width:calc(100% - 1rem); }
  .site-header { padding:.78rem .65rem; }
  .header-note { font-size:.73rem; }
  .intro { padding:1.7rem 0 1rem; }
  .panel,.method-section { padding:1rem; border-radius:12px; }
  .section-heading { align-items:flex-start; }
  .section-heading h2 { font-size:1.24rem; }
  .settings-grid { gap:.5rem; }
  .grid-preview-frame { min-height:120px; padding:.5rem; }
}
@page { margin:0; }
@media print {
  html,body { width:auto !important; min-width:0 !important; margin:0 !important; padding:0 !important; background:#fff !important; }
  .site-header,main > :not(.print-output),footer { display:none !important; }
  main { display:block !important; width:auto !important; margin:0 !important; padding:0 !important; }
  .print-output { display:block !important; width:auto !important; margin:0 !important; padding:0 !important; }
  .print-sheet { margin:0 !important; box-shadow:none !important; }
}
