/* VIBRIYOGN Design. A dark drafting desk: the plan is a sheet of paper on it, the model is poured concrete.
   Ink and signal yellow from the brand; the spectrum only names things (takeoff colours, the thin rule). */
:root {
  --ink: #0a0a0a; --desk: #15171a; --panel: #1b1e22; --raise: #24282d; --line: #32373d; --line-2: #262a2f;
  --chalk: #f1efe9; --mute: #a3a8ae; --faint: #747a81;
  --signal: #ffd400; --good: #35c27a; --warn: #ffb020; --bad: #ff5d4f; --info: #4aa3ff;
  --paper: #fbfaf6;
  --head: "Archivo", "Arial Black", system-ui, sans-serif; --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 12px; --r-sm: 8px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--desk); color: var(--chalk); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; line-height: 1.15; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--mute); } .small { font-size: 13px; }
.boot { padding: 40px; color: var(--mute); }
#app { height: 100dvh; display: flex; flex-direction: column; }

/* Top bar */
.top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--ink); min-height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--chalk); flex: none; }
.brand img { width: 26px; height: 30px; }
.brand span { font: 800 18px/1 var(--head); letter-spacing: -.02em; }
.jobname { flex: 1 1 120px; min-width: 0; background: none; border: 1px solid transparent; border-radius: var(--r-sm); padding: 7px 10px; font-weight: 600; color: var(--chalk); text-overflow: ellipsis; }
.jobname:hover { border-color: var(--line); } .jobname:focus { border-color: var(--signal); outline: none; background: var(--panel); }
.bid { flex: none; text-align: right; line-height: 1.1; cursor: pointer; padding: 4px 12px; border-left: 3px solid var(--line); }
.bid b { display: block; font: 800 24px/1.05 var(--head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bid small { color: var(--mute); font-size: 12px; }
.bid[data-v=go] { border-color: var(--good); } .bid[data-v=tight] { border-color: var(--warn); } .bid[data-v=nogo] { border-color: var(--bad); }
.top-actions { display: flex; gap: 6px; flex: none; }
.tb { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 12px; font-weight: 600; font-size: 14px; }
.tb:hover { border-color: var(--faint); }
.rule { height: 3px; flex: none; background: linear-gradient(90deg, #7b3fbf, #3b3fb5, #1e7fd8, #1fa85a, #e8b900, #ff8a00, #e63b2e); }

/* Steps */
.nav { display: flex; gap: 2px; padding: 0 12px; background: var(--ink); border-bottom: 1px solid var(--line-2); overflow-x: auto; flex: none; scrollbar-width: none; }
.nav button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 11px 14px 9px; font-weight: 600; color: var(--mute); white-space: nowrap; }
.nav button:hover { color: var(--chalk); }
.nav button.on { color: var(--chalk); border-bottom-color: var(--signal); }

/* Workspace */
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.pane { min-width: 0; min-height: 0; position: relative; }
.pane.right { background: var(--panel); border-left: 1px solid var(--line-2); overflow-y: auto; padding: 22px 22px 60px; }
.screen { position: absolute; inset: 0; display: none; }
body[data-left=plan] #plan, body[data-left=model] #model { display: block; }
.sheet, .stage { position: absolute; inset: 0; }
.sheet canvas { display: block; }
.sheet { background: radial-gradient(circle at 1px 1px, #23262b 1px, transparent 0) 0 0 / 22px 22px, var(--desk); }
#model .stage { background: linear-gradient(#1d2024, #121416); }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage img { width: 100%; height: 100%; object-fit: contain; }

.tools { position: absolute; left: 14px; top: 14px; display: flex; flex-direction: column; gap: 4px; background: rgba(10,10,10,.88); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; backdrop-filter: blur(6px); }
.tools button { display: flex; align-items: center; gap: 9px; background: none; border: 0; border-radius: var(--r-sm); padding: 8px 12px; font-weight: 600; font-size: 14px; text-align: left; color: var(--chalk); }
.tools button i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.tools button:hover { background: var(--raise); }
.tools button[aria-pressed=true] { background: var(--signal); color: var(--ink); }
.zoom, .views { position: absolute; right: 14px; top: 14px; display: flex; gap: 4px; background: rgba(10,10,10,.88); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; }
.zoom button, .views button { background: none; border: 0; border-radius: var(--r-sm); min-width: 38px; height: 36px; padding: 0 10px; font-weight: 600; color: var(--chalk); }
.zoom button:hover, .views button:hover { background: var(--raise); }
.views { left: 14px; right: auto; flex-wrap: wrap; max-width: calc(100% - 28px); }
.views button[aria-pressed=true] { background: var(--signal); color: var(--ink); }
.hud { position: absolute; left: 14px; bottom: 14px; color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.empty3d { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; padding: 30px; color: var(--mute); }
.empty3d b { color: var(--chalk); font: 700 20px var(--head); } .empty3d span { max-width: 380px; }
.planbar { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: rgba(10,10,10,.9); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px 8px 14px; backdrop-filter: blur(6px); }
.planbar:empty { display: none; }
.planbar .msg { flex: 1 1 200px; font-size: 14px; } .planbar .msg.warn { color: var(--warn); font-weight: 600; }
.found { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: min(560px, calc(100% - 300px)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 10px 12px 10px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.4); border-left: 5px solid var(--signal); }
.found > div { flex: 1 1 220px; } .found b { display: block; } .found span { font-size: 13px; color: #55595e; }
.found .btn { background: #fff; color: var(--ink); border-color: #cfcfc8; } .found .btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Buttons and fields */
.btn { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--chalk); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; }
.btn:hover:not(:disabled) { border-color: var(--faint); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #ffe14d; border-color: #ffe14d; }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; margin-top: 8px; } .btn.big { min-height: 48px; padding: 10px 22px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--info); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.f { display: block; margin: 0 0 12px; min-width: 0; }
.f.grow { flex: 1; }
.f > span { display: block; font-size: 13px; color: var(--mute); margin-bottom: 4px; }
.f input, .f select, .f textarea, .extras input, .linkrow input { width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; min-height: 40px; color: var(--chalk); }
.f textarea { resize: vertical; line-height: 1.45; }
.f input:focus, .f select:focus, .f textarea:focus, .extras input:focus { border-color: var(--signal); outline: none; }
.in { display: flex; align-items: center; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); }
.in:focus-within { border-color: var(--signal); }
.in input { border: 0 !important; background: none !important; min-width: 0; flex: 1; font-variant-numeric: tabular-nums; }
.in i { font-style: normal; color: var(--faint); padding: 0 10px; font-size: 13px; flex: none; }
.in i:first-child { padding-right: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--signal); flex: none; }

/* Panels */
.p-head { margin-bottom: 16px; } .p-head h2 { font-size: 24px; font-weight: 800; } .p-head p { margin: 4px 0 0; color: var(--mute); font-size: 14px; }
.tlist { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.tlist li { background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.tlist li.sel { border-color: var(--signal); }
.trow { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 11px 14px; text-align: left; }
.trow > i { width: 10px; align-self: stretch; border-radius: 3px; flex: none; }
.tn { flex: 1; min-width: 0; } .tn b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn small, .tq small { display: block; color: var(--mute); font-size: 12.5px; }
.tq { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.editor { padding: 4px 14px 14px; border-top: 1px solid var(--line-2); }
.ed-head { display: flex; gap: 12px; margin-top: 12px; }
.totals { display: grid; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; margin: 14px 0; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--raise); font-size: 14px; }
.totals span { color: var(--mute); } .totals b { font-variant-numeric: tabular-nums; }
.hint { background: var(--raise); border-radius: var(--r); padding: 18px; }
.hint ol { margin: 8px 0 14px; padding-left: 20px; color: var(--mute); } .hint li { margin: 4px 0; } .hint p { color: var(--mute); margin: 6px 0 14px; }
.verdict { border-radius: var(--r); padding: 16px; background: var(--raise); border-left: 5px solid var(--line); margin-bottom: 18px; }
.verdict[data-v=go] { border-color: var(--good); } .verdict[data-v=tight] { border-color: var(--warn); } .verdict[data-v=nogo] { border-color: var(--bad); }
.v-top b { display: block; font: 800 22px var(--head); }
.verdict[data-v=go] .v-top b { color: var(--good); } .verdict[data-v=tight] .v-top b { color: var(--warn); } .verdict[data-v=nogo] .v-top b { color: var(--bad); }
.v-top span { font-size: 14px; }
.verdict ul { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.verdict li { display: flex; gap: 10px; font-size: 14px; }
.verdict li > b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex: none; margin-top: 1px; }
.verdict li.ok > b { background: var(--good); color: var(--ink); } .verdict li.no > b { background: var(--warn); color: var(--ink); }
.verdict li small { display: block; color: var(--mute); }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines td, .lines th { padding: 7px 0; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.lines .n, .lines th:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 10px; }
.lines td.n:nth-child(2) { color: var(--mute); font-size: 12.5px; }
.lines tr.g th { padding-top: 16px; font: 700 15px var(--head); border-bottom-color: var(--line); }
.lines tr.tot th { font: 800 20px var(--head); border-bottom: 0; padding-top: 14px; }
.sub { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.sub h3 { font-size: 17px; margin-bottom: 12px; } .sub h4 { font: 600 13px var(--body); color: var(--mute); margin: 16px 0 8px; }
details.sub summary { font: 700 17px var(--head); cursor: pointer; }
.note { background: #2a2614; border-left: 4px solid var(--signal); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 12px; font-size: 13.5px; margin: 12px 0 0; }
.extras { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.extras li { display: grid; grid-template-columns: 1fr 120px auto; gap: 6px; }
.send { background: var(--raise); border-radius: var(--r); padding: 16px; }
.send-amt span { display: block; color: var(--mute); font-size: 13px; } .send-amt b { font: 800 32px var(--head); font-variant-numeric: tabular-nums; display: block; margin-bottom: 10px; }
.linkrow { display: flex; gap: 6px; margin-bottom: 10px; } .linkrow input { font-size: 13px; }
.chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--ink); border: 1px solid var(--line); }
.chip.good { background: var(--good); color: var(--ink); border-color: var(--good); } .chip.bad { background: var(--bad); color: var(--ink); border-color: var(--bad); }
.send blockquote { margin: 10px 0 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--mute); font-size: 14px; }
.conn { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.conn li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; background: var(--raise); border-radius: var(--r); padding: 12px 14px; }
.conn small { display: block; color: var(--mute); font-size: 13px; margin-top: 2px; } .conn .chip { flex: none; }

/* Start screen */
.start { position: absolute; inset: 0; overflow-y: auto; background: var(--desk); display: grid; place-items: start center; padding: clamp(24px, 6vh, 70px) 22px 60px; z-index: 3; }
.start-in { max-width: 720px; }
.start h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; }
.start p { color: var(--mute); font-size: 17px; max-width: 60ch; margin: 16px 0 26px; }
.start h2 { font: 600 15px var(--body); color: var(--mute); margin: 30px 0 12px; letter-spacing: 0; }
.drop { display: block; border: 2px dashed var(--line); border-radius: var(--r); padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-within { border-color: var(--signal); background: #1d1c14; }
.drop b { display: block; font: 700 18px var(--head); } .drop span { color: var(--mute); font-size: 14px; }
.drop.big { background: var(--signal); border: 0; color: var(--ink); padding: 26px; } .drop.big b { font-size: 22px; } .drop.big span { color: #3d3500; }
.drop.big:hover { background: #ffe14d; }
.samples { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.sample { text-align: left; background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 16px; transition: border-color .15s, transform .15s; }
.sample:hover { border-color: var(--signal); transform: translateY(-2px); }
.sample b { display: block; margin-bottom: 4px; } .sample span { color: var(--mute); font-size: 13.5px; }
.start .linkbtn { margin-top: 22px; }

/* Dialogs and toasts */
dialog.dlg { background: var(--panel); color: var(--chalk); border: 1px solid var(--line); border-radius: 16px; padding: 26px; width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow-y: auto; }
dialog.dlg.wide { width: min(680px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.dlg h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; padding-right: 30px; } .dlg h3 { font: 600 14px var(--body); color: var(--mute); margin: 22px 0 10px; }
.dlg .x { position: absolute; right: 14px; top: 12px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--mute); width: 36px; height: 36px; }
.exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.exports button { text-align: left; background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; }
.exports button:hover:not(:disabled) { border-color: var(--signal); } .exports button:disabled { opacity: .4; }
.exports b { display: block; font: 700 17px var(--head); } .exports span { color: var(--mute); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--paper); color: var(--ink); font-weight: 600; padding: 11px 18px; border-radius: 99px; box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: 1000; max-width: calc(100vw - 32px); text-align: center; animation: rise .2s ease-out; }
.toast.bad { background: var(--bad); border-radius: 14px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

/* Phones and narrow windows: one screen at a time, steps stay at the top */
@media (max-width: 979px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .pane.right { display: none; border-left: 0; padding: 18px 16px 80px; }
  body:is([data-screen=takeoff], [data-screen=estimate], [data-screen=proposal]) .pane.right { display: block; }
  body:is([data-screen=takeoff], [data-screen=estimate], [data-screen=proposal]) .pane.left { display: none; }
  .nav button.on { border-bottom-color: transparent; color: var(--mute); }
  .nav button.cur { border-bottom-color: var(--signal); color: var(--chalk); }
  .top { gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
  .brand span { display: none; }
  .jobname { order: 5; flex-basis: 100%; padding: 4px 6px; font-size: 14px; }
  .bid { margin-left: auto; } .bid b { font-size: 20px; }
  .tools { flex-direction: row; left: 8px; right: 8px; top: 8px; overflow-x: auto; scrollbar-width: none; }
  .tools button { white-space: nowrap; padding: 8px 10px; }
  .zoom { display: none; }
  .found { top: 62px; width: calc(100% - 16px); padding: 8px 10px 8px 12px; gap: 6px; }
  .found span { display: none; } .found > div { flex: 1 1 100%; }
  .planbar { left: 8px; right: 8px; bottom: 8px; }
  .views { left: 8px; top: 8px; }
  .toast { bottom: auto; top: 118px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── The client's proposal page (and the printed proposal): paper, not desk ── */
body.client { background: #e9e7e1; overflow: auto; color-scheme: light; }
body.client #app { height: auto; display: block; padding: clamp(0px, 3vw, 40px) 0; }
.prop { background: var(--paper); color: #17181a; max-width: 880px; margin: 0 auto; padding: clamp(22px, 5vw, 56px); box-shadow: 0 20px 60px rgba(0,0,0,.12); }
.prop h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: -.03em; margin: 4px 0 10px; }
.prop h2 { font-size: 19px; margin: 34px 0 10px; }
.prop .from { font-weight: 700; margin: 0; } .prop .meta { color: #5c6066; margin: 0; font-size: 14.5px; }
.prop-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 22px; }
.price { text-align: left; } .price span { display: block; color: #5c6066; font-size: 14px; }
.price b { font: 800 clamp(34px, 6vw, 54px)/1 var(--head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.prop-model { margin-top: 22px; position: relative; }
.prop-model .stage { position: relative; inset: auto; height: clamp(260px, 46vw, 430px); background: linear-gradient(#22262b, #131517); border-radius: 10px; overflow: hidden; }
.prop-model .views { position: static; display: inline-flex; margin-top: 10px; background: #17181a; border: 0; }
.prop-model .small { color: #5c6066; display: inline-block; margin: 0 0 0 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 34px; margin-top: 26px; padding: 16px 0; border-top: 1px solid #dcd9d0; border-bottom: 1px solid #dcd9d0; }
.stats > div { min-width: 110px; } .stats span { display: block; color: #5c6066; font-size: 13px; } .stats b { font: 700 20px var(--head); font-variant-numeric: tabular-nums; }
.scope { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.scope th { text-align: left; font-weight: 600; color: #5c6066; font-size: 13px; }
.scope th, .scope td { padding: 9px 12px 9px 0; border-bottom: 1px solid #e2dfd7; vertical-align: top; }
.scope td:first-child { font-weight: 600; } .scope .n { text-align: right; font-variant-numeric: tabular-nums; } .scope tr.tot td { font-weight: 800; border-bottom: 0; font-size: 17px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 34px; }
.prop p { margin: 0 0 10px; max-width: 70ch; }
.respond, .answer { margin-top: 38px; padding: 24px; border-radius: 12px; background: #17181a; color: var(--chalk); color-scheme: dark; }
.respond h2 { margin-top: 0; font-size: 24px; } .respond .muted { color: var(--mute); margin-top: 14px; }
.respond .warn { color: var(--warn); } .err { background: #4a1d19; color: #ffd9d5; padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.answer b { font: 800 28px var(--head); display: block; } .answer.accepted b { color: var(--good); } .answer.declined b { color: var(--bad); } .answer p { margin-top: 10px; color: var(--mute); }
.prop-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid #e2dfd7; color: #74787e; font-size: 13px; }
.gone { max-width: 520px; margin: 14vh auto; padding: 30px; text-align: center; color: #17181a; } .gone h1 { margin: 16px 0 10px; font-size: 28px; }
#printbox { position: fixed; left: -200vw; top: 0; width: 880px; }
@media print {
  body { background: #fff !important; overflow: visible !important; }
  body.printing #app, .toast, dialog { display: none !important; }
  #printbox { position: static; width: auto; }
  .prop { box-shadow: none; max-width: none; padding: 0; background: #fff; }
  .prop-model .stage { height: 330px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rule, .stats, .answer { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .respond, .views, .prop-model .small { display: none !important; }
  section, tr { break-inside: avoid; }
}
