@import './ecosystem.css';
@import './design/tokens.css';
@import './design/components.css';
@font-face{font-family:system-fallback;src:local('Arial')}
:root{color-scheme:light;--bg:#f6f8fc;--card:#fff;--ink:#152b42;--muted:#56687a;--line:#dce4ee;--blue:#185ac3;--blue-soft:#edf3fb;--input:#fff;--yellow:#f8c154;--shadow:0 3px 18px #152b4206;--danger:#b91c1c;--danger-bg:#fff1f2;--canvas:#f8fafc}
:root[data-theme=dark]{color-scheme:dark;--bg:#0c1724;--card:#142337;--ink:#eff5ff;--muted:#acbfd5;--line:#30445d;--blue:#8fbbff;--blue-soft:#1b3049;--input:#101c2e;--shadow:none;--danger:#fda4af;--danger-bg:#381d2a;--canvas:#cbd5e1}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,"Helvetica Neue",sans-serif;font-size:14px;line-height:1.5}button,input,select{font:inherit}button,a,input,select{outline-offset:4px}button{cursor:pointer}a{color:var(--blue);text-decoration:none}a:hover{text-decoration:underline}button{border:1px solid var(--line);border-radius:9px;background:var(--card);color:var(--ink);padding:9px 12px;min-height:40px;font-weight:550;transition:background .15s}button:hover{background:var(--blue-soft);border-color:var(--blue)}button.primary{background:#185ac3;color:#fff;border-color:#185ac3}button.primary:hover{background:#164ea7}button.subtle{background:transparent}button.icon{padding:8px;display:inline-flex;align-items:center;justify-content:center;min-width:40px}button:disabled{opacity:.5;cursor:default}svg.icon{width:19px;height:19px;flex-shrink:0}button svg.icon{margin-right:6px}.icon-only svg.icon{margin:0}h1,h2,h3,p{margin:0}h1{font-size:30px;letter-spacing:-1px;line-height:1.25}h2{font-size:16px;letter-spacing:-.2px}h3{font-size:14px}header{height:76px;border-bottom:1px solid var(--line);background:var(--card);padding:0 32px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{display:flex;gap:10px;align-items:center;color:var(--ink)}.brandmark{width:36px;height:36px;flex-shrink:0}.brand strong{font-size:18px;letter-spacing:-.5px}.brand small{display:block;font-size:11px;color:var(--muted)}.header-actions{display:flex;gap:8px;align-items:center}.home-link{font-size:12px;margin-right:10px}.hero{max-width:1600px;margin:auto;padding:28px 32px 24px;display:flex;align-items:center;justify-content:space-between;gap:18px}.eyebrow{font-size:10px;font-weight:750;color:var(--blue);letter-spacing:1.5px;display:flex;align-items:center;gap:7px;margin-bottom:9px}.eyebrow::before{content:'';width:6px;height:6px;background:var(--yellow);border-radius:50%}.hero p{color:var(--muted);margin-top:7px}.hero-actions{display:flex;gap:8px}.local-badge{color:var(--muted);font-size:11px;display:flex;align-items:center;gap:5px;margin-top:10px}.layout{max-width:1600px;margin:auto;padding:0 32px 24px;display:grid;grid-template-columns:285px minmax(0,1fr) 276px;gap:20px;align-items:start}.card{background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden}.card-head{padding:17px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}.card-head h2{display:flex;gap:8px;align-items:center}.step{color:var(--blue);font-size:10px;font-weight:700;letter-spacing:.5px}.card-body{padding:18px}.stack{display:flex;flex-direction:column;gap:16px;min-width:0}.fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field{min-width:0}.field.full{grid-column:1/-1}label.field{display:block}label span.label{display:block;font-size:11px;color:var(--muted);font-weight:550;margin-bottom:5px}.input-wrap{display:flex;align-items:center;border:1px solid var(--line);border-radius:8px;background:var(--input)}input,select{color:var(--ink);background:var(--input);min-height:40px;border:1px solid var(--line);border-radius:8px;width:100%;padding:8px 10px;min-width:0}input[type=number]{padding-right:0}input:focus,select:focus{outline:2px solid var(--blue);outline-offset:1px}input[aria-invalid=true]{border-color:var(--danger)}.input-wrap input{border:0;width:100%;background:transparent}.input-wrap:focus-within{outline:2px solid var(--blue)}.input-wrap input:focus{outline:0}.suffix{color:var(--muted);font-size:11px;padding:0 10px 0 5px;flex-shrink:0}.segmented{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:9px;margin-bottom:15px;background:var(--bg)}.segmented button{flex:1;font-size:12px;background:transparent;border-color:transparent;min-height:33px;padding:5px}.segmented button.active{background:var(--card);color:var(--blue);box-shadow:0 1px 4px #0001;border-color:var(--line)}.help{font-size:11px;line-height:1.6;color:var(--muted);margin-top:9px}.presets{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:14px}.presets button{min-height:29px;padding:4px 7px;font-size:10px;font-weight:500}.presets button.active{background:var(--blue-soft);color:var(--blue);border-color:var(--blue)}.check-label{display:flex;align-items:center;gap:8px;margin:12px 0;font-size:12px}.check-label input{width:16px;min-height:16px;height:16px;accent-color:#185ac3}.section-line{border:0;border-top:1px solid var(--line);margin:16px 0}.zone{background:var(--bg);border-radius:10px;border:1px solid var(--line);padding:11px;margin-top:10px}.zone-head{display:flex;align-items:center;gap:5px;margin-bottom:10px}.zone-head input{font-size:12px}.zone-head button{border:0;background:transparent;padding:4px;min-width:32px}.zone .fields{gap:8px}.zone input{font-size:12px;min-height:36px}.zone .suffix{padding-right:5px}.small-button{font-size:11px;min-height:32px;padding:5px 9px}.drawing-head{flex-wrap:wrap}.plan-label{font-size:11px;color:var(--muted);margin-top:3px}.toolbar{display:flex;gap:4px;align-items:center}.toolbar button{font-size:11px;padding:7px 8px;min-height:34px}.toolbar .active{color:var(--blue);background:var(--blue-soft);border-color:var(--blue)}.canvas-wrap{height:435px;position:relative;margin:14px;background:var(--canvas);border:1px solid var(--line);border-radius:10px;overflow:hidden;background-image:radial-gradient(#94a3b822 1px,transparent 1px);background-size:18px 18px}.canvas-wrap svg{width:100%;height:100%;display:block;touch-action:pan-y;user-select:none}.canvas-wrap.pan svg{touch-action:none;cursor:grab}.canvas-wrap.pan svg:active{cursor:grabbing}.canvas-wrap [data-tile]{cursor:pointer}.canvas-wrap [data-tile]:hover{filter:brightness(.94)}.legend{display:flex;justify-content:center;gap:17px;flex-wrap:wrap;font-size:10px;color:var(--muted);padding:0 14px 12px}.legend span{display:flex;gap:6px;align-items:center}.swatch{width:10px;height:10px;border-radius:3px;border:1px solid #0001}.drawing-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:10px;color:var(--muted);padding:12px 18px;border-top:1px solid var(--line);background:var(--bg)}.canvas-help{padding:0 18px 12px;margin:0}.selected-box{padding:14px 18px;border-top:1px solid var(--line)}.selected-box .pieces{display:flex;gap:8px;align-items:start}.piece-svg{width:94px;height:78px;flex-shrink:0;background:#f8fafc;border-radius:6px}.piece-list{font-size:11px;color:var(--muted);max-height:140px;overflow:auto}.selected-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.comparison{overflow-x:auto}.compare-table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:11px}.compare-table th{font-weight:500;color:var(--muted);background:var(--bg);text-align:right;padding:10px 9px;border-bottom:1px solid var(--line)}.compare-table td{padding:12px 9px;border-bottom:1px solid var(--line);text-align:right}.compare-table th:first-child,.compare-table td:first-child{text-align:left;white-space:normal;min-width:150px;padding-left:18px}.compare-table td:last-child{padding-right:14px}.compare-table tr.chosen{background:var(--blue-soft)}.badge{display:inline-block;font-size:9px;border-radius:5px;padding:2px 5px;background:var(--blue-soft);color:var(--blue);margin-top:4px}.compare-table .badge{display:block;width:fit-content}.compare-notes{padding:0 18px 16px}.edge-lines{font-size:10px;color:var(--muted);line-height:1.6}.purchase-card{background:#185ac3;border-color:#185ac3;color:#fff;padding:21px}.purchase-card .step{color:#c7dcff}.purchase-number{font-size:44px;font-weight:700;line-height:1.2;letter-spacing:-2px;margin-top:8px}.purchase-number small{font-size:14px;letter-spacing:0;font-weight:500}.purchase-card .purchase-sub{font-size:12px;color:#dbeafe;margin-top:5px}.purchase-card .purchase-detail{font-size:11px;border-top:1px solid #ffffff30;margin-top:17px;padding-top:13px;display:flex;justify-content:space-between;gap:8px}.quantity-list{padding:4px 18px 10px}.quantity-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:11px 0;border-bottom:1px solid var(--line);font-size:11px}.quantity-row:last-child{border:0}.quantity-row span{color:var(--muted)}.quantity-row strong{font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}.cost-box{margin:0 18px 18px;padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--bg)}.cost-box span{font-size:11px;color:var(--muted);display:block}.cost-box strong{font-size:19px;display:block;margin-top:4px}.assumptions{padding:13px 15px;border-radius:10px;background:var(--blue-soft);font-size:11px;line-height:1.6;color:var(--ink)}.assumptions p+p{margin-top:8px}.export-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}.export-buttons button{font-size:11px;min-height:40px;padding:8px}.export-buttons .full{grid-column:1/-1}.footer{max-width:1600px;padding:4px 32px 24px;margin:auto;display:flex;justify-content:space-between;gap:16px;font-size:10px;color:var(--muted)}.footer p{max-width:800px}.error-banner,.status-banner{max-width:1536px;margin:0 auto 16px;padding:12px 16px;border:1px solid var(--line);border-radius:10px;font-size:12px;background:var(--blue-soft)}.error-banner{color:var(--danger);background:var(--danger-bg);border-color:var(--danger);margin-left:32px;margin-right:32px}.status-banner{display:flex;gap:16px;align-items:center;justify-content:space-between}.error-banner:empty,.status-banner:empty{display:none}.mobile-tabs{display:none}.hidden{display:none!important}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--ink);color:var(--card);box-shadow:0 4px 20px #0002;padding:12px 20px;border-radius:10px;z-index:100;font-size:13px;max-width:calc(100% - 30px);width:max-content}#toast:empty{display:none}dialog{border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--ink);width:560px;max-width:calc(100% - 24px);max-height:85dvh;padding:0;box-shadow:0 20px 80px #0003}dialog::backdrop{background:#0f172a70;backdrop-filter:blur(3px)}.dialog-body{padding:20px}.dialog-footer{display:flex;justify-content:flex-end;gap:8px;padding:16px 20px;border-top:1px solid var(--line)}.saved-item{padding:14px 0;border-bottom:1px solid var(--line)}.saved-item strong{font-size:14px;overflow-wrap:anywhere}.saved-item p{font-size:11px;color:var(--muted);margin:4px 0 10px}.saved-actions{display:flex;gap:6px;flex-wrap:wrap}.saved-actions button{font-size:11px;min-height:34px;padding:6px 10px}.skip-link{position:absolute;top:-100px;left:16px;background:var(--card);padding:10px;z-index:200}.skip-link:focus{top:10px}#print-report{display:none}summary{font-size:11px;color:var(--muted);cursor:pointer}details p{font-size:11px;color:var(--muted);margin-top:8px}.empty-state{color:var(--muted);font-size:12px;padding:24px;text-align:center}
@media(min-width:1600px){.layout{grid-template-columns:305px minmax(0,1fr) 296px}.canvas-wrap{height:490px}}
@media(max-width:1200px){.layout{grid-template-columns:260px minmax(0,1fr);gap:16px;padding:0 24px 24px}.result-column{grid-column:2;display:grid;grid-template-columns:1fr 1fr;align-items:start}.parameter-column{grid-row:1/3}.result-column .export-card{grid-column:1/-1}.hero{padding:24px}.canvas-wrap{height:400px}.home-link{display:none}}
@media(max-width:760px){header{height:64px;padding:0 16px}.brand strong{font-size:16px}.brand small{font-size:9px}.brandmark{width:30px;height:30px}.header-actions{gap:5px}.header-actions button{font-size:11px;min-height:36px;min-width:36px;padding:7px}.hero{padding:22px 16px 18px;display:block}h1{font-size:26px;letter-spacing:-.7px}.hero p{font-size:12px}.hero-actions{margin-top:16px}.hero-actions button{flex:1;font-size:12px}.eyebrow{font-size:9px}.layout{display:block;padding:0 12px 20px}.stack{gap:12px}.mobile-tabs{display:flex;position:sticky;top:0;background:var(--bg);padding:8px 12px;gap:4px;z-index:10;border-bottom:1px solid var(--line);margin-bottom:12px}.mobile-tabs button{flex:1;border-color:transparent;background:transparent;border-radius:8px;font-size:12px;min-height:42px}.mobile-tabs button.active{background:var(--card);color:var(--blue);border-color:var(--line);box-shadow:var(--shadow)}[data-panel]{display:none!important}[data-panel].visible{display:flex!important}.result-column.visible{display:flex!important}.card-body{padding:16px}.canvas-wrap{height:360px;margin:10px}.drawing-head{padding:14px}.toolbar{margin-top:6px;width:100%;justify-content:flex-end}.toolbar button{min-height:38px}.legend{gap:12px}.compare-table{font-size:10px}.compare-table th:first-child,.compare-table td:first-child{min-width:124px;padding-left:12px}.compare-table td{padding:10px 7px}.compare-table th{padding:10px 7px}.comparison{max-width:100%}.footer{padding:0 16px 20px;display:block}.footer a{display:inline-block;margin-top:8px}.error-banner{margin:0 12px 12px}.status-banner{margin:0 12px 12px}.fields{gap:12px}input,select{font-size:16px;min-height:44px}.presets button{font-size:12px;min-height:35px}.small-button{min-height:40px}.export-buttons button{font-size:13px;min-height:44px}.local-badge{font-size:10px}.zone input{font-size:16px}.zone .suffix{font-size:10px}.check-label{font-size:13px}.purchase-card{padding:22px}.quantity-row{font-size:13px}.quantity-row strong{font-size:14px}.help{font-size:12px}.result-column .export-card{grid-column:auto}}
@media print{@page{size:A4;margin:12mm}body{background:white;color:#152b42}#app,#toast,dialog,.skip-link{display:none!important}#print-report{display:block}#print-report h1{font-size:21px}#print-report h2{font-size:15px;margin:16px 0 8px}#print-report p{font-size:10px;line-height:1.6}#print-report svg{display:block;max-width:100%;height:280px;width:100%;break-inside:avoid}#print-report .legend{font-size:10px;color:#334155;padding:4px}#print-report table{width:100%;border-collapse:collapse;font-size:10px}#print-report td{border-bottom:1px solid #ddd;padding:5px 0}#print-report td:last-child{text-align:right}#print-report tr{break-inside:avoid}#print-report .print-inputs{margin:12px 0}.print-assumptions{margin-top:12px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

.brand-mark{width:40px;height:40px;display:grid;place-items:center;position:relative;border-radius:10px;background:var(--ink);color:var(--card);font-size:14px;font-weight:700;letter-spacing:-1px;flex-shrink:0}.brand-mark::after{content:"";position:absolute;right:4px;top:4px;width:8px;height:8px;border-radius:2px;background:var(--yellow)}.brand small.brand-tools{font-size:10px;letter-spacing:2px;margin-top:3px}.theme-switch{display:flex;gap:2px}.theme-switch button{border-color:transparent;background:transparent;color:var(--muted)}.theme-switch button[aria-pressed=true]{background:var(--blue-soft);color:var(--blue);border-color:var(--line)}.app-back{display:none}@media(max-width:1200px){.app-back{display:block;padding:10px 24px 0;font-size:12px}}@media(max-width:760px){.brand-mark{width:32px;height:32px;border-radius:8px;font-size:12px}.brand-mark::after{width:6px;height:6px}.app-back{padding:10px 16px 0}.header-actions button{min-width:36px}.theme-switch{gap:0}}@media print{.app-back{display:none}}

@media(max-width:760px){.toolbar{flex-wrap:wrap}.hero-actions button{min-height:44px}.zone-head button{min-width:44px;min-height:44px}.footer>span{display:block;margin-top:6px}.compare-scroll{display:block}}@media(min-width:761px){.compare-scroll{display:none}}


/* App Starter v1.0.1 compatibility: technical drawing/status colors stay in app CSS. */
button.primary{background:var(--hh-primary);border-color:var(--hh-primary);color:var(--hh-button-foreground);}button.primary:hover{background:var(--hh-primary);filter:brightness(.97);}
:root,:root[data-theme=dark],:root[data-theme=light]{--bg:var(--hh-bg);--card:var(--hh-surface);--ink:var(--hh-text);--muted:var(--hh-muted);--line:var(--hh-border);--blue:var(--hh-primary);--blue-soft:var(--hh-soft);--input:var(--hh-surface);--yellow:var(--hh-gold);--shadow:var(--hh-shadow);}
body{font-family:var(--hh-font);font-size:1rem;line-height:1.6;font-variant-numeric:tabular-nums;}
button,input,select,textarea{font-family:var(--hh-font);}
.app-header,header{background:var(--hh-surface);border-color:var(--hh-border);}
.hh-brand{min-height:44px;}.hh-brand-text strong{font-size:1.1rem;}.hh-brand-text small{font-size:.8125rem;}
.theme-button,.theme-switch button{min-width:44px;min-height:44px;height:44px;width:44px;}
@media(max-width:640px){.app-header,header{height:auto;min-height:78px;flex-wrap:wrap;gap:12px;padding:12px 16px;}.header-actions,.header-tools{gap:6px;flex-wrap:wrap;}.hh-brand-text strong{font-size:1.05rem;}}
header{height:auto;min-height:78px;}.header-actions button{min-width:44px;min-height:44px;font-size:.875rem;}.label,.field>span:first-child{font-size:.875rem;}.field input,.field select,.input-wrap input,select{min-height:46px;}.hero-actions button,.toolbar button,.presets button{min-height:44px;}.hint,.note,.local-badge{font-size:.8125rem;}h2{font-size:1.25rem;}h3{font-size:1.125rem;}button{border-radius:var(--hh-radius-button);}.primary{background:var(--hh-primary);color:var(--hh-button-foreground);}@media(max-width:640px){header{justify-content:space-between;}.header-actions{margin-left:auto;}h1{font-size:1.85rem;}}


/* HappyHome Mobile Typography v1.1 — UI only; preserves drawing scale and geometry. */
@media (max-width: 767px) {
  body { font-size: 16px; line-height: 1.6; }
  .hero p, .note, .help, .compare-notes, .purchase-detail, .empty-state, .canvas-help {
    font-size: 14px; line-height: 1.6;
  }
  .label, .field > span:first-child, .check-label, .selected-header, .plan-label {
    font-size: 15px; line-height: 1.45;
  }
  .field input:not([type=checkbox]):not([type=radio]), .field select,
  .input-wrap input, select, textarea { font-size: 17px; min-height: 46px; min-width: 0; }
  .mobile-tabs button, .segmented button, .toolbar button, .small-button,
  .export-buttons button, .dialog-footer button {
    font-size: 15px; min-height: 44px; line-height: 1.4; white-space: normal;
  }
  .hint, .local-badge, .badge, .canvas-help, .compare-table small {
    font-size: 13px; line-height: 1.5;
  }
  .step h2, .selected-header h2 { font-size: 20px; line-height: 1.3; }
  .field, .step { min-width: 0; }
}


@media (max-width:767px) { .mobile-tabs { top: var(--hh-eco-header-height, 0px); } }
