@font-face { font-family: Inter; src: url(fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #15181b; --panel: #1d2226; --panel2: #242a2f; --line: #343c42;
  --ink: #ebe7df; --mute: #a7afb4; --teal: #33b5a9; --tealD: #1f6f68; --amber: #e6a73c; --red: #e0705a; --green: #5cc28a;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
b, strong { color: #fff; font-weight: 700; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: rgba(21,24,27,.96); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand b { display: block; font-size: 16.5px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 34px; height: 34px; border-radius: 9px; flex: none; background: url(icons/icon-192.png) center/cover; }
.units { display: flex; background: var(--panel2); border-radius: 10px; padding: 3px; flex: none; }
.units button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--mute); }
.units button.on { background: var(--teal); color: #0d1012; }
.tabs { position: sticky; top: 55px; z-index: 19; display: flex; gap: 4px; overflow-x: auto; padding: 8px 10px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; border: 1px solid var(--line); background: var(--panel); color: var(--mute); border-radius: 20px; padding: 7px 9px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tabs button.on { background: var(--ink); color: #111; border-color: var(--ink); }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px 0; }
.view { display: none; }
.view.on { display: block; }
.intro { color: var(--mute); font-size: 15px; margin: 6px 0 12px; }
h2 { font-size: 20px; margin: 22px 0 8px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
h2 .n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #0d1012; font-size: 14px; align-items: center; justify-content: center; flex: none; }
h3 { font-size: 16.5px; margin: 0 0 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.muted, .help { color: var(--mute); }
.help { font-size: 13px; margin: 4px 0 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 10px; }
.seg button { border: 1.5px solid var(--line); background: var(--panel2); border-radius: 11px; padding: 10px 6px; font-size: 14px; font-weight: 600; color: var(--mute); min-height: 48px; }
.seg button.on { border-color: var(--teal); color: #fff; background: rgba(51,181,169,.14); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.f { display: block; min-width: 0; }
.f > span { display: block; font-size: 13px; color: var(--mute); margin-bottom: 4px; font-weight: 500; }
.inp { display: flex; align-items: center; background: #101315; border: 1.5px solid var(--line); border-radius: 10px; min-height: 48px; padding: 0 10px; }
.inp:focus-within { border-color: var(--teal); }
.inp input, .inp select { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: none; font-size: 17px; padding: 10px 0; }
.inp select { font-size: 15.5px; }
.inp select option { background: #1d2226; }
.inp i { font-style: normal; color: var(--mute); font-size: 13px; margin-left: 6px; white-space: nowrap; }
input::placeholder { color: #6c757b; }
.area-live { margin-top: 10px; font-size: 15px; color: var(--mute); }
.area-live b { font-size: 20px; color: var(--teal); }
.floor-opt { display: grid; gap: 8px; }
.floor-opt button { text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 2px; }
.floor-opt button b { font-size: 16.5px; }
.floor-opt button small { color: var(--mute); font-size: 13px; }
.floor-opt button.on { border-color: var(--teal); background: rgba(51,181,169,.10); }
.layer header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.layer header h3 { margin: 0; }
.layer .idx { color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.stepper { display: flex; align-items: center; gap: 0; background: #101315; border: 1.5px solid var(--line); border-radius: 10px; flex: none; }
.stepper button { width: 42px; height: 42px; border: 0; background: none; font-size: 20px; font-weight: 700; color: var(--teal); }
.stepper span { min-width: 64px; text-align: center; font-size: 14px; font-weight: 600; }
.layer .row { margin-top: 10px; }
.chk { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14.5px; }
.chk input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--teal); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button { border: 1px solid var(--line); background: var(--panel2); border-radius: 20px; padding: 6px 11px; font-size: 13px; color: var(--ink); }
.chips button.on { border-color: var(--teal); color: #fff; }
details.how { background: var(--panel2); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: 14px; }
details.how summary { font-weight: 600; color: var(--teal); cursor: pointer; }
details.how ul { margin: 8px 0 2px; padding-left: 18px; color: var(--ink); }
.multi-row { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; align-items: end; margin-bottom: 8px; }
.icon-btn { height: 48px; border: 1.5px solid var(--line); background: var(--panel2); border-radius: 10px; font-size: 20px; color: var(--mute); }
.add-btn { border: 1.5px dashed var(--line); background: none; border-radius: 10px; padding: 10px; width: 100%; color: var(--teal); font-weight: 600; }

/* results */
.sumcard { background: linear-gradient(160deg, #1d2a2b, #1d2226 60%); border: 1px solid #2d4643; }
.big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.big div { background: rgba(0,0,0,.2); border-radius: 10px; padding: 10px; }
.big small { display: block; color: var(--mute); font-size: 12.5px; }
.big b { font-size: 24px; color: var(--teal); letter-spacing: -.01em; }
.big b.am { color: var(--amber); }
.lrow { border-top: 1px solid var(--line); padding: 12px 0 2px; }
.lrow:first-of-type { border-top: 0; padding-top: 2px; }
.lrow .h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lrow .h b { font-size: 16px; }
.buy { color: #0d1012; background: var(--amber); border-radius: 8px; padding: 3px 9px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; font-size: 14px; margin-top: 6px; color: var(--mute); }
.kv span:nth-child(odd) { white-space: nowrap; }
.kv span:nth-child(even) { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.src { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; margin-left: 4px; vertical-align: 1px; }
.src.tds { background: rgba(92,194,138,.18); color: var(--green); }
.src.theory, .src.guide { background: rgba(230,167,60,.16); color: var(--amber); }
.warns { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.warns li { padding: 6px 0 6px 22px; position: relative; border-top: 1px dashed var(--line); }
.warns li:first-child { border-top: 0; }
.warns li::before { content: "!"; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--amber); color: #111; font-size: 11px; font-weight: 800; text-align: center; line-height: 16px; }
.err { color: var(--red); font-weight: 600; }
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl li:first-child { border-top: 0; }
.tl .d { font-size: 12px; color: var(--mute); line-height: 1.25; }
.tl .d b { display: block; font-size: 15px; color: var(--amber); }
.tl .t b { font-size: 15.5px; }
.tl .t p { margin: 3px 0 0; font-size: 13.5px; color: var(--mute); }
.tl .t .tm { color: var(--teal); font-size: 13px; font-weight: 600; }
.tl li.coat .t b, .tl li.vinyl .t b { color: var(--teal); }
.tl li.gate .t b { color: var(--amber); }
.list { list-style: none; padding: 0; margin: 4px 0 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px dotted var(--line); font-size: 14.5px; }
.list li:first-child { border-top: 0; }
.list input { width: 22px; height: 22px; accent-color: var(--teal); flex: none; margin: 0; }
.list .q { margin-left: auto; color: var(--amber); font-weight: 700; white-space: nowrap; font-size: 13.5px; padding-left: 6px; }
.list li.stop input { accent-color: var(--red); }
.list li.stop.on { color: var(--red); }
.verdict { border-radius: var(--r); padding: 14px; font-weight: 800; font-size: 20px; text-align: center; margin: 10px 0; }
.verdict.go { background: rgba(92,194,138,.16); color: var(--green); border: 1.5px solid var(--green); }
.verdict.no { background: rgba(224,112,90,.14); color: var(--red); border: 1.5px solid var(--red); }
.verdict.wait { background: var(--panel); color: var(--mute); border: 1.5px dashed var(--line); font-size: 16px; font-weight: 600; }
.verdict small { display: block; font-size: 13px; font-weight: 500; margin-top: 2px; }
.cond { margin-top: 10px; font-size: 14px; }
.cond .ok { color: var(--green); } .cond .bad { color: var(--red); }
.saved-item { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding: 10px 0; }
.saved-item:first-child { border-top: 0; }
.saved-item div { flex: 1; min-width: 0; }
.saved-item small { display: block; color: var(--mute); font-size: 12.5px; }
.saved-item button { border: 1px solid var(--line); background: var(--panel2); border-radius: 9px; padding: 8px 10px; font-size: 13.5px; }
.empty { color: var(--mute); text-align: center; padding: 18px 8px; }

.disclaimer { font-size: 12.5px; color: var(--mute); border-top: 1px solid var(--line); margin: 24px 0 0; padding-top: 12px; }
.foot { color: #7d878d; font-size: 12px; margin: 8px 0; text-align: center; }
.spacer { height: 170px; } /* room for the action bar + the Netlify badge */
/* bottom bar: leaves ~76 px free at the bottom so the "Powered by Netlify" badge of the free plan never covers a button */
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 16px calc(76px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(21,24,27,0), var(--bg) 26%); display: grid; gap: 8px; max-width: 720px; margin: 0 auto; pointer-events: none; }
.sticky > * { pointer-events: auto; }
.sticky.two { grid-template-columns: 1fr 1.4fr; }
.cta { background: var(--teal); color: #0d1012; border: 0; border-radius: var(--r); min-height: 54px; padding: 12px; font-weight: 800; font-size: 16.5px; box-shadow: 0 6px 20px rgba(51,181,169,.25); }
.ghost { background: var(--panel2); color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--r); min-height: 54px; padding: 10px; font-weight: 700; font-size: 15px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 150px; z-index: 30; background: #fff; color: #111; border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4); opacity: 0; transform: translateY(8px); transition: .25s; max-width: 680px; margin: 0 auto; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.print-head { display: none; }

@media (min-width: 560px) { .floor-opt { grid-template-columns: repeat(3, 1fr); } }

@media print {
  @page { size: Letter; margin: 0.5in; }
  body { background: #fff; color: #111; font-size: 10.5pt; }
  b, strong { color: #000; }
  .top, .tabs, .sticky, .toast, #view-plan, #view-saved, .spacer, .noprint, .foot { display: none !important; }
  #view-results, #view-schedule, #view-check { display: block !important; }
  #view-schedule, #view-check { break-before: page; }
  main { max-width: none; padding: 0; }
  .print-head { display: block; border-bottom: 2px solid #1f6f68; padding-bottom: 6px; margin-bottom: 8px; }
  .print-head h1 { font-size: 18pt; margin: 0; }
  .print-head p { margin: 2px 0 0; font-size: 9.5pt; color: #444; }
  .card, .sumcard { background: #fff; border: 1px solid #bbb; break-inside: auto; padding: 8px 10px; margin: 6px 0; }
  .sumcard { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  #results .list { columns: 2; column-gap: 18px; }
  #results .list li { padding: 3px 0; font-size: 9pt; border-top: 0; border-bottom: 1px dotted #ccc; }
  .list li { break-inside: avoid; }
  .big small { color: #555; }
  .inp { background: #fff; border-color: #999; min-height: 34px; }
  .inp input { color: #000; padding: 4px 0; }
  .inp input::placeholder { color: #999; }
  .big div { background: #f1f4f4; }
  .big b, .lrow .h b { color: #1f6f68; }
  .big b.am { color: #8a5a00; }
  .buy { background: #f3dfb5; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kv, .help, .muted, .tl .d, .tl .t p, .warns li { color: #333; }
  .kv span:nth-child(even) { color: #000; }
  .tl li, .lrow, .list li { border-color: #ccc; break-inside: avoid; }
  .tl .d b { color: #8a5a00; }
  .tl li.coat .t b, .tl li.vinyl .t b, .tl .t .tm { color: #1f6f68; }
  h2 { font-size: 14pt; margin: 12px 0 4px; }
  h2 .n { background: #1f6f68; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .list input { accent-color: #333; }
  .verdict { border: 1.5px solid #555 !important; color: #000 !important; background: #fff !important; }
  .disclaimer { color: #333; border-color: #bbb; }
}
