:root{font-family:"Inter","DM Sans",system-ui,sans-serif;color:#18243b;background:#f6f7fa;--ink:#18243b;--muted:#55637b;--line:#e1e6ef;--blue:#2859d6;--soft:#edf3ff;--radius:14px;line-height:1.45}
*{box-sizing:border-box}
body{margin:0;min-width:290px}
button,select,input{font:inherit}
button{cursor:pointer}
a{color:inherit}
svg{display:block}
button svg,.panel-icon svg{width:17px;height:17px;stroke:currentColor;stroke-width:1.65;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}
:focus-visible{outline:3px solid #7296fa;outline-offset:3px}
h1,h2,h3,h4,p{margin:0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.topbar{background:#fff;border-bottom:1px solid var(--line)}
.topbar-inner{max-width:1470px;margin:auto;padding:13px clamp(16px,4.4vw,64px);display:flex;justify-content:space-between;align-items:center;gap:12px}
.brand{display:flex;gap:10px;align-items:center;text-decoration:none;font-size:16px;font-weight:690;letter-spacing:-.035em;white-space:nowrap}
.brand strong{color:var(--blue);font-weight:760}
.shell{max-width:1470px;margin:auto;padding:0 clamp(16px,4.4vw,64px)}
.intro{padding:34px 0 25px}
.intro h1{font-size:clamp(30px,4vw,42px);font-weight:760;letter-spacing:-.052em;line-height:1.12}
.intro p{font-size:14px;color:var(--muted);margin-top:9px}
.workspace{display:grid;grid-template-columns:minmax(260px,308px) minmax(0,1fr);gap:20px;align-items:start}
.card{background:white;border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 2px 4px #18243b07;min-width:0}
.settings{padding:20px}
.settings-heading{display:flex;gap:11px;align-items:center;margin-bottom:19px}
.settings-heading h2,.result-heading h2{font-size:19px;line-height:1.24;letter-spacing:-.035em}
.settings-heading p,.result-heading p{font-size:12px;color:var(--muted);margin-top:4px}
.panel-icon{border-radius:10px;background:var(--soft);width:39px;height:39px;display:grid;place-items:center;color:var(--blue);flex:none}
.form-section{border-top:1px solid var(--line);padding:16px 0 15px}
.form-section h3,.advanced h4{font-size:13px;font-weight:760}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.unit-label select{font-size:12px;padding:4px 5px;min-height:28px;color:var(--muted);background:#f7f9fc}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.field{display:grid;align-content:start;gap:5px;font-size:12px;font-weight:690;color:#34435d;min-width:0}
input:not([type=radio]):not([type=checkbox]),select{border:1px solid #dce3ee;border-radius:7px;background:#fff;color:var(--ink);min-width:0;max-width:100%;width:100%;padding:8px 9px;min-height:37px}
.field select{font-size:12px;padding:8px 4px}
input::placeholder{color:#6d798e;font-size:12px}
.input-unit{position:relative;display:block}
.input-unit input{padding-right:29px!important}
.input-unit input::-webkit-inner-spin-button,.input-unit input::-webkit-outer-spin-button{appearance:none;margin:0}
.input-unit input{appearance:textfield}
.input-unit>span{position:absolute;top:50%;right:9px;transform:translateY(-50%);font-size:11px;color:var(--muted);pointer-events:none}
.hint{font-size:12px;color:var(--muted);font-weight:400}
.form-section>.hint,.advanced-fields>.hint{margin-top:6px}
.bhk{border:0;padding:0;margin:10px 0 12px;display:grid;grid-template-columns:repeat(3,1fr);gap:6px;min-width:0}
.bhk label{position:relative;cursor:pointer;text-align:center}
.bhk input{position:absolute;opacity:0;width:1px;height:1px}
.bhk span{display:block;border:1px solid #dce3ee;border-radius:7px;color:#394966;padding:8px 2px;font-size:12px;font-weight:700}
.bhk input:checked+span{border-color:#a6bcfa;background:var(--soft);color:#1f4bc4}
.bhk input:focus-visible+span{outline:3px solid #7296fa;outline-offset:2px}
.advanced{border-block:1px solid var(--line);margin-bottom:15px}
.advanced summary{font-size:12px;font-weight:700;cursor:pointer;padding:12px 0;display:flex;align-items:center;justify-content:space-between}
.advanced summary::-webkit-details-marker{display:none}
.advanced summary::after{content:"";border:solid #67758d;border-width:0 1.5px 1.5px 0;width:6px;height:6px;transform:rotate(45deg);margin-right:2px}
.advanced[open] summary::after{transform:rotate(225deg)}
.advanced-fields{display:grid;gap:10px;padding:0 0 13px}
.advanced-fields>.hint{margin-top:-7px}
.check-label{display:flex;align-items:start;gap:7px;font-size:12px;color:#34435d}
.check-label input{accent-color:var(--blue);margin:2px 0}
.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:8px;font-size:12px;font-weight:720;min-height:36px;padding:7px 11px;white-space:nowrap}
.button.primary{background:var(--blue);border:1px solid var(--blue);color:#fff;box-shadow:0 2px 4px #2859d62b}
.button.primary:hover{background:#1f48bb}
.button.secondary{border:1px solid #dce3ee;background:#fff;color:#31435e}
.button.secondary:hover{background:#f2f6ff}
.generate{width:100%;min-height:42px;font-size:13px}
#draft-note:not(:empty){margin-top:8px}
.form-error{font-size:12px;line-height:1.4;padding:8px 10px;border:1px solid #f2bec2;border-radius:7px;background:#fff1f2;color:#912535;margin-bottom:9px}
.result-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:18px 18px 12px}
.options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:0 18px 12px}
.options button{display:flex;align-items:center;gap:7px;min-width:0;min-height:36px;text-align:left;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#35455f;font-size:12px;font-weight:650}
.options button::before{content:"";width:11px;height:11px;border:1px solid #a9b5ca;border-radius:50%;flex:none}
.options button[aria-pressed=true]{background:var(--soft);color:#204bbd;border-color:#b8cbfb}
.options button[aria-pressed=true]::before{border-color:var(--blue);background:var(--blue);box-shadow:inset 0 0 0 2px #edf3ff}
.tabs{display:flex;align-items:stretch;gap:16px;padding:0 18px;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:thin}
.tabs button{display:flex;align-items:center;gap:6px;padding:9px 0;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font-size:12px;font-weight:720;white-space:nowrap}
.tabs button svg{width:15px;height:15px}
.tabs button[aria-selected=true]{color:#234fc5;border-color:#3565e5}
.tabs button:focus-visible{outline-offset:-3px}
.tab-panel{padding:13px 18px 17px}
.drawing-toolbar,.view-toolbar,.plan-meta,.view-footer,.data-footer{display:flex;justify-content:space-between;align-items:center;gap:8px}
.drawing-toolbar{margin-bottom:8px}
.drawing-toolbar p{font-size:12px;font-weight:720;display:flex;align-items:center;gap:6px}
.live-dot{width:7px;height:7px;border-radius:50%;background:#4571e8}
.drawing-controls,.view-controls,.segmented{display:inline-flex;gap:2px;border:1px solid var(--line);border-radius:7px;padding:2px;background:#fff}
.drawing-controls button,.view-controls button,.segmented button{border:0;background:none;color:#374861;min-height:27px;min-width:27px;border-radius:4px;padding:3px 6px;font-size:12px;font-weight:680}
.drawing-controls button:hover,.view-controls button:hover,.segmented button:hover,.segmented button[aria-pressed=true]{background:var(--soft);color:#214fc6}
.drawing-controls button:disabled{opacity:.45;cursor:default}
.drawing{position:relative;display:grid;place-items:center;height:clamp(360px,46vw,510px);overflow:hidden;border:1px solid #e1e8f4;border-radius:9px;background-color:#f9fbff;background-image:linear-gradient(#dce6f568 1px,transparent 1px),linear-gradient(90deg,#dce6f568 1px,transparent 1px);background-size:20px 20px}
.drawing svg{position:absolute;inset:0;width:100%;height:100%;transform-origin:center}
.plan-meta{margin-top:10px;flex-wrap:wrap}
.legend{display:flex;flex-wrap:wrap;gap:11px;color:#495971;font-size:11px}
.legend span{display:flex;align-items:center;gap:4px}
.swatch{display:inline-block;width:9px;height:9px;border-radius:2px;border:1px solid #899ab177}
.swatch.living{background:#dce8ff}.swatch.bed{background:#dfe8d5}.swatch.service{background:#f6e8cd}.swatch.hall{background:#eef1f7}
.room-list{display:flex;flex-wrap:wrap;gap:5px;margin-top:12px}
.room-list button{border:1px solid var(--line);background:#fff;color:#35455f;border-radius:5px;font-size:11px;padding:4px 7px}
.room-list button[aria-pressed=true]{color:#204bbd;background:var(--soft);border-color:#a6bcfa}
.room-detail{font-size:12px;color:var(--muted);margin-top:8px;min-height:17px}
.room-detail strong{color:var(--ink)}
.footer{display:flex;justify-content:space-between;gap:10px;margin:17px 0 24px;font-size:11px;color:var(--muted)}
.footer span{white-space:nowrap}
.view-toolbar{margin-bottom:9px}
.scene{position:relative;background:#edf3ff;border:1px solid var(--line);border-radius:9px;overflow:hidden;height:clamp(320px,46vw,530px)}
.scene canvas{width:100%;height:100%;display:block;touch-action:none;cursor:grab}
.scene canvas:active{cursor:grabbing}
.scene p{position:absolute;inset:12px 12px auto}
.view-footer{margin-top:10px}
.data-panel h3{font-size:17px;letter-spacing:-.02em}
.data-panel>p{font-size:13px;color:var(--muted);margin-top:4px}.data-panel>.reference{margin-top:12px}.reference a{color:#214fc6;text-underline-offset:2px}
.estimate-fields{max-width:470px;margin:15px 0}
.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:8px}
table{border-collapse:collapse;width:100%;font-size:12px;text-align:left;min-width:380px}
th,td{padding:8px 9px;border-bottom:1px solid var(--line)}
thead th{background:#f3f6fb;color:#465671;font-size:11px;white-space:nowrap}
tbody tr:last-child>*{border-bottom:0}
tbody th{font-weight:650}
td input{min-width:75px!important;max-width:110px!important;min-height:29px!important;padding:4px 6px!important}
.summary-box{background:var(--soft);border-radius:8px;padding:10px 11px;margin-top:10px;font-size:12px;color:#294473}
.summary-box strong{font-size:15px;color:var(--ink)}
.data-footer{margin-top:11px}
.data-footer .hint{max-width:52ch}
.rule-ok{color:#226144;font-weight:700}.rule-over{color:#a12c38;font-weight:700}
#print-sheet{display:none}
@media(max-width:810px){.workspace{grid-template-columns:minmax(220px,245px) minmax(0,1fr);gap:12px}.settings{padding:13px}.tabs{gap:10px}.tabs button svg{display:none}.result-heading,.options,.tabs,.tab-panel{padding-left:12px;padding-right:12px}.options button{font-size:11px}}
@media(max-width:660px){.workspace{grid-template-columns:1fr}.intro{padding:22px 0 16px}.intro p{font-size:13px}.settings{padding:14px}.settings-heading{margin-bottom:12px}.form-section{padding:10px 0}.settings form{max-width:none}.drawing{height:clamp(315px,110vw,450px)}.footer{display:block}.footer span{display:none}.topbar-inner{padding-block:9px}}
@media(max-width:370px){.header-button svg{display:none}.brand{font-size:14px}.options button{gap:3px;padding:5px 4px}.tabs button{font-size:11px}}
@media print{@page{size:A4;margin:13mm}body{background:#fff;color:#18243b}body>*:not(#print-sheet){display:none!important}#print-sheet{display:block;padding:0}#print-sheet svg{width:100%;height:155mm}#print-sheet table{margin:4mm 0;min-width:0}#print-sheet th,#print-sheet td{padding:2px 6px;font-size:9pt}#print-sheet>*{break-inside:avoid}#print-sheet p{font-size:10pt;margin:2mm 0}*{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
