/* WorkInSync Office Planner - Staging 2 look. Tokens mirror the Figma collection "Office Planner v2" (Light + Dark). Inter only. */
:root, :root[data-theme="light"] {
  --rv-floor: #fbfaf6; --rv-line: #c9c3b6;
  --page: #eef0f7; --blob-blue: #bcd3ff; --blob-pink: #f4c8e6; --blob-peach: #ffd8c0;
  --card: #ffffff; --solid: #ffffff; --inset: #f3f4fa; --chip: #ffffff;
  --hair: #daddea; --field: #cfd3e3;
  --text: #14141c; --muted: #565a6e; --faint: #8a8ea3;
  --accent: #2f5bea; --accent-soft: #e3e9ff; --accent-on: #ffffff;
  --ink: #14141c; --ink-on: #ffffff;
  --short: #d8452e; --short-bg: #fde6e1; --ok: #1b8f62; --ok-bg: #dbf4e8; --warn: #a9690e; --warn-bg: #fff0d2; --idle: #a3a8be; --fit: #12a594;
  --z-desks: #dde5ff; --z-desks-line: #9fb2ff; --z-meeting: #d5f3ee; --z-meeting-line: #86d9ca;
  --z-collab: #e8dfff; --z-collab-line: #b7a4ff; --z-focus: #ffe8d3; --z-focus-line: #f2c39a;
  --z-booth: #ffdde8; --z-booth-line: #f2a9c3; --z-neutral: #ecebf2; --z-neutral-line: #cbc9d8;
  --scrim: rgba(11,11,20,.45); --grid: #e6e8f2;
  --sh-btn: 0 4px 12px rgba(20,20,51,.16); --sh-card: 0 12px 32px rgba(20,20,51,.12); --sh-float: 0 20px 48px rgba(20,20,51,.18);
  --r-btn: 999px; --r-field: 14px; --r-card: 24px; --r-pill: 999px;
}
:root[data-theme="dark"] {
  --rv-floor: #e9e6dd; --rv-line: #8d887b;
  --page: #0d0b16; --blob-blue: #2b2a8c; --blob-pink: #5e2a66; --blob-peach: #1f3a7a;
  --card: #1c1830; --solid: #151227; --inset: #241f3b; --chip: #2a2545;
  --hair: #352f55; --field: #403a66;
  --text: #f4f4fa; --muted: #b3b6c9; --faint: #7e8199;
  --accent: #8c9bff; --accent-soft: #2a2f66; --accent-on: #0d0b16;
  --ink: #f4f4fa; --ink-on: #0d0b16;
  --short: #ff8b77; --short-bg: #3e1d22; --ok: #5edda6; --ok-bg: #15352b; --warn: #f2c36b; --warn-bg: #3b2d13; --idle: #5c6078; --fit: #4fd1c5;
  --z-desks: #2a3470; --z-desks-line: #5b6fd6; --z-meeting: #1d4a47; --z-meeting-line: #3fa89a;
  --z-collab: #3f2f78; --z-collab-line: #7e67d6; --z-focus: #4b3320; --z-focus-line: #b8814f;
  --z-booth: #4d2433; --z-booth-line: #b8587a; --z-neutral: #2b2840; --z-neutral-line: #48446a;
  --scrim: rgba(0,0,0,.6); --grid: #2a2545;
  --sh-btn: 0 4px 12px rgba(0,0,0,.4); --sh-card: 0 12px 32px rgba(0,0,0,.4); --sh-float: 0 20px 48px rgba(0,0,0,.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, sans-serif; color: var(--text); background: var(--page); font-size: 14px; line-height: 1.2; min-height: 100vh; position: relative; overflow-x: hidden; }
body::before, body::after { content: ""; position: fixed; border-radius: 50%; filter: blur(90px); opacity: .7; z-index: 0; pointer-events: none; }
body::before { width: 520px; height: 520px; left: -140px; top: -120px; background: var(--blob-blue); }
body::after { width: 480px; height: 480px; right: -120px; bottom: -100px; background: var(--blob-pink); }
#root { position: relative; z-index: 1; }
#root::before { content: ""; position: fixed; width: 360px; height: 360px; right: 20%; top: -140px; border-radius: 50%; background: var(--blob-peach); filter: blur(90px); opacity: .6; z-index: -1; pointer-events: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 64px; text-align: center; color: var(--muted); }

/* header */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; margin: 16px 16px 0; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: var(--sh-card); position: sticky; top: 12px; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; letter-spacing: -.2px; }
.brand b { font-weight: 800; color: var(--accent); } .brand span { font-weight: 600; color: var(--text); }
.brand .mark { width: 28px; height: 20px; }
.tagline { font-size: 14px; color: var(--faint); padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--hair); line-height: 1.2; }
.proto { font-size: 14px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 8px 20px; border-radius: var(--r-pill); }
.spacer { flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* buttons */
.btn { position: relative; border: 1px solid var(--hair); background: var(--chip); padding: 8px 18px; border-radius: var(--r-btn); font-weight: 600; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; min-height: 40px; transition: background .15s, transform .15s, box-shadow .15s, border-color .15s, filter .15s; }
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--ink); color: var(--ink-on); border-color: var(--ink); box-shadow: var(--sh-btn); }
.btn.primary:hover { background: var(--ink); filter: brightness(1.15); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 32px; padding: 4px 14px; font-size: 13px; }
.lock { font-size: 12px; }

/* brief: hero left, form card right (Staging 2 desktop layout) */
.brief-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(475px, 550px); gap: 48px; align-items: center; min-height: calc(100vh - 150px); padding: 24px 0 32px; }
.brief-hero { align-self: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 6px 14px; margin-bottom: 20px; }
.brief-hero h1 { font-size: clamp(40px, 4.6vw, 68px); line-height: 1.2; letter-spacing: -1.5px; }
.brief-hero h1 em { color: var(--accent); }
.brief-hero .lede { font-size: clamp(16px, 1.5vw, 22px); max-width: 38ch; margin-bottom: 24px; }
.brief-hero .note { font-size: 14px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: var(--r-field); padding: 12px 16px; max-width: 640px; }
.brief-side { align-self: center; }
.brief-foot { text-align: center; color: var(--faint); font-size: 13px; margin: 16px 0 0; }
.brief-layout .brief { margin: 0; max-width: none; padding: 28px; border-radius: 32px; }
.brief-layout .grid2 { grid-template-columns: 1fr; gap: 20px; }
.brief-layout .field label, .brief-layout .field .lbl { font-weight: 400; color: var(--muted); }
.brief-layout input[type=number], .brief-layout select { background: var(--inset); min-height: 48px; font-size: 16px; }
.brief-layout .btn.primary { width: 100%; justify-content: center; min-height: 52px; font-size: 16px; }
.brief-layout .seg { align-self: stretch; align-items: center; }
@media (max-width: 960px) { .brief-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 24px; align-items: start; } .brief-hero { align-self: start; } .brief-hero h1 { font-size: 36px; } }
@media (max-width: 760px) { .brief-layout .brief { padding: 20px 16px; } .tagline { display: none; } .proto { padding: 4px 12px; font-size: 12px; } }

/* brief (legacy single card, still used by error screen) */
.page { max-width: 2200px; margin: 0 auto; padding: 16px; }
.brief { max-width: 720px; margin: 32px auto; background: var(--card); border: 1px solid var(--hair); border-radius: 32px; padding: 40px; box-shadow: var(--sh-float); position: relative; overflow: hidden; }
.brief > * { position: relative; z-index: 1; }
h1 { font-size: 34px; line-height: 1.2; font-weight: 800; margin: 0 0 8px; letter-spacing: -.8px; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 4px; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 56ch; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .field .lbl { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--short); font-weight: 500; }
input[type=number], input[type=text], input[type=email], select { border: 1px solid var(--field); border-radius: var(--r-field); padding: 8px 14px; min-height: 44px; background: var(--solid); width: 100%; color: var(--text); }
input[aria-invalid=true] { border-color: var(--short); box-shadow: 0 0 0 1px var(--short); }
.seg { display: inline-flex; flex: none; border: 1px solid var(--field); border-radius: var(--r-btn); overflow: hidden; background: var(--solid); padding: 3px; gap: 2px; }
.field input[type=number] { min-width: 0; }
.seg button { white-space: nowrap; border: 0; background: transparent; border-radius: var(--r-btn); padding: 6px 14px; min-height: 36px; cursor: pointer; font-weight: 500; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--ink-on); font-weight: 600; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.days { display: flex; gap: 8px; }
.chip { border: 1px solid var(--field); background: var(--chip); border-radius: var(--r-pill); padding: 4px 14px; min-height: 32px; cursor: pointer; font-weight: 500; }
.chip[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.note { background: var(--accent-soft); border: 1px solid transparent; border-radius: var(--r-field); padding: 8px 14px; font-size: 12px; color: var(--text); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.err { background: var(--short-bg); color: var(--short); }

/* workspace */
.work { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 20px; box-shadow: var(--sh-card); }
.card + .card { margin-top: 16px; }
.palette .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.palette .hd h2 { margin: 0; }
.palette ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.palette li { display: flex; align-items: center; gap: 8px; }
.swatch { width: 16px; height: 16px; border-radius: 6px; border: 1.5px solid var(--hair); flex: none; }
.palette .name { flex: 1; font-size: 13px; }
.palette .cnt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; min-width: 20px; text-align: right; }
.iconbtn { width: 32px; height: 32px; border: 1px solid var(--hair); background: var(--chip); border-radius: 50%; cursor: pointer; font-weight: 700; line-height: 1.2; }
.iconbtn:hover { background: var(--accent-soft); }
.iconbtn[disabled] { opacity: .4; cursor: not-allowed; }
.canvaswrap { padding: 0; overflow: hidden; }
.toolbar { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--hair); align-items: center; flex-wrap: wrap; }
.toolbar .meta { color: var(--muted); font-size: 12px; margin-left: auto; }
svg.plan { display: block; width: 100%; height: auto; background: var(--solid); touch-action: pan-y pinch-zoom; }
svg.plan .block, svg.plan .handle, svg.plan .rot-handle { touch-action: none; }
.block { cursor: grab; }
.block:active { cursor: grabbing; }
.block:focus { outline: none; }
.block:focus-visible .shape, .block.sel .shape { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 3; }
.blk-label { font-size: 11px; font-weight: 700; fill: var(--text); pointer-events: none; }
.blk-sub { font-size: 10px; fill: var(--muted); pointer-events: none; }
.handle { cursor: nwse-resize; fill: var(--accent); }
.rot-handle { cursor: pointer; } .rot-handle circle { fill: var(--accent); stroke: #fff; stroke-width: 1.5; } .rot-handle text { fill: #fff; font-size: 13px; font-weight: 700; pointer-events: none; }

/* left column: inputs. Folds, info tooltip, floor plan box. */
.col-in > * + * { margin-top: 16px; }
.info { position: relative; display: inline-flex; }
.infobtn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--field); background: var(--chip); color: var(--muted); font: italic 700 12px Georgia, serif; line-height: 1.2; cursor: help; padding: 0; }
.infobtn:hover, .infobtn:focus-visible { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tip { position: absolute; left: -8px; top: 30px; width: 232px; padding: 10px 12px; border-radius: 14px; background: var(--ink); color: var(--ink-on); font-size: 12px; line-height: 1.2; box-shadow: var(--sh-float); z-index: 10; opacity: 0; visibility: hidden; transform: translateY(-2px); transition: opacity .12s, transform .12s; pointer-events: none; }
.info:hover .tip, .info:focus-within .tip { opacity: 1; visibility: visible; transform: none; }
details.fold { padding: 0; }
details.fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 16px; font-weight: 600; cursor: pointer; border-radius: var(--r-card); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(225deg); }
details.fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
details.fold > :last-child { margin-bottom: 16px; }
.col-in .card { padding: 16px; }
.col-in details.fold { padding: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.planbox { padding: 16px; }
.planbox svg.plan { border-radius: 16px; border: 1px solid var(--hair); }
.facts { margin: 16px 0 4px; display: grid; gap: 6px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* gated full report: decoy is blurred placeholder content only; real numbers are never in the DOM while locked */
.locked { position: relative; overflow: hidden; }
.decoy { filter: blur(7px); opacity: .85; user-select: none; -webkit-user-select: none; pointer-events: none; margin-top: 8px; }
.unlock-card { position: relative; margin-top: -84px; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(3px); border: 1px solid var(--hair); box-shadow: var(--sh-card); }
.unlock-card h3 { font-size: 15px; margin: 0; }
.unlock-card .est { margin: 0; }
.unlock-card .grid2 { gap: 10px; }
.unlock-card input { min-height: 38px; }
.unlock-card .btn { justify-content: center; }
.reveal { animation: reveal .35s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* live panel */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: var(--inset); border-radius: 16px; padding: 10px 14px; }
.kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi.bad .v { color: var(--short); } .kpi.good .v { color: var(--ok); }
.est { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); }
.legend span { display: inline-flex; gap: 4px; align-items: center; }
table.mini { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
table.mini th, table.mini td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--hair); }
.tag { display: inline-block; padding: 0 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.tag.short { background: var(--short-bg); color: var(--short); }
.tag.idle, .tag.surplus { background: var(--inset); color: var(--muted); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
details.card summary { cursor: pointer; font-weight: 600; }
.afield { display: grid; grid-template-columns: 1fr 64px; gap: 8px; align-items: center; margin-top: 8px; font-size: 12px; }
.afield input { min-height: 32px; padding: 4px 8px; }
.shape5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; font-size: 11px; }
.shape5 input { min-height: 32px; padding: 4px; width: 100%; }
.toggle { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13px; }
.toggle input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.delta { font-size: 12px; color: var(--muted); }

/* skeleton / states */
.skel { background: linear-gradient(90deg, var(--inset), var(--chip), var(--inset)); background-size: 200% 100%; animation: sh 1.2s infinite linear; border-radius: 12px; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* modal */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { background: var(--card); border: 1px solid var(--hair); border-radius: 28px; padding: 28px; width: min(480px, 100%); box-shadow: var(--sh-float); max-height: 90vh; overflow: auto; }
.modal h2 { font-size: 20px; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--ink-on); padding: 10px 20px; border-radius: var(--r-pill); z-index: 30; box-shadow: var(--sh-float); }

/* mobile stepper list */
.steppers { display: none; }
.stepper { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.stepper .name { flex: 1; }
.stepper .cnt { min-width: 32px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.print-only { display: none; }

@media (max-width: 1100px) { .work { grid-template-columns: minmax(0,1fr) 340px; } .col-in { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; } .col-in > * + * { margin-top: 0; } }
@media (max-width: 760px) {
  .page { padding: 16px; } .brief { padding: 24px 16px; margin: 16px auto; border-radius: 24px; } h1 { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; }
  .palette { display: none; }
  .col-in { display: block; order: 2; } .col-in > * + * { margin-top: 16px; } .col-mid { order: 1; } .col-out { order: 3; }
  .steppers { display: block; }
  .desktop-only { display: none !important; }
  .block { cursor: default; }
  .topbar { padding: 8px 16px; margin: 12px 16px 0; }
}
/* capture deterrents (see protect.js) */
#wis-cover { display: none; position: fixed; inset: 0; z-index: 2147483000; background: #000; }
html.covered #wis-cover { display: block; }

/* Print protection: output is blank unless the permitted PDF export (html.print-ok) is running. */
@media print {
  html:not(.print-ok) #root, html:not(.print-ok) .scrim, html:not(.print-ok) .toast { display: none !important; }
  html:not(.print-ok) body::before { content: "Printing is disabled for this page. Use Download PDF in the planner."; display: block; position: static; width: auto; height: auto; filter: none; opacity: 1; background: none; color: #000; font: 600 14px Inter, sans-serif; padding: 24px; }
  html.print-ok body { background: #fff; color: #000; }
  html.print-ok body::before, html.print-ok body::after, html.print-ok #root::before { display: none; }
  html.print-ok .topbar, html.print-ok main, html.print-ok .toast, html.print-ok .scrim { display: none !important; }
  html.print-ok .print-only { display: block; padding: 0; }
  html.print-ok .print-only svg { max-width: 100%; height: auto; }
  @page { size: A4; margin: 0; }
  html.print-ok .pr { color: #14182b; font-family: Inter, sans-serif; position: relative; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-page { width: 210mm; height: 296mm; padding: 14mm 14mm 18mm; box-sizing: border-box; position: relative; page-break-after: always; break-after: page; overflow: hidden; background: #fff; }
  .pr-page:last-child { page-break-after: auto; break-after: auto; }
  .pr-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #2b4ad8; padding-bottom: 10px; margin-bottom: 14px; }
  .pr-logo { height: 34px; width: auto; }
  .pr-title h2 { font-size: 20px; margin: 0; line-height: 1.2; } .pr-title p { margin: 2px 0 0; font-size: 11px; color: #5b6078; }
  .pr h3 { font-size: 13px; margin: 16px 0 6px; }
  .pr-verdict { border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #eef2ff; border-left: 6px solid #2b4ad8; }
  .pr-verdict.short { background: #fff1f0; border-color: #d33a2c; } .pr-verdict.idle { background: #fff8e6; border-color: #d9930d; }
  .pr-vlabel { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: #5b6078; }
  .pr-vtext { font-size: 17px; font-weight: 700; line-height: 1.35; margin-top: 4px; }
  .pr-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pr-kpis > div { border: 1px solid #dfe3f0; border-radius: 8px; padding: 10px; } .pr-kpis b { display: block; font-size: 22px; } .pr-kpis span { font-size: 10px; color: #5b6078; }
  .pr-kpis .bad b { color: #d33a2c; } .pr-kpis .good b { color: #1c8a4a; }
  .pr-brief, .pr-note, .pr-contact, .pr-sec { font-size: 10px; color: #5b6078; margin: 8px 0 0; }
  .pr-warn { font-size: 11px; color: #a4570a; margin: 6px 0 0; }
  .pr-banner { display: flex; justify-content: space-between; margin-top: 14px; background: #2b4ad8; color: #fff !important; text-decoration: none; padding: 10px 14px; border-radius: 8px; font-weight: 700; font-size: 12px; }
  .pr-banner span { font-weight: 500; opacity: .9; }
  .pr-chart svg { max-height: 62mm; width: 100%; }
  .pr-plan svg { max-height: 150mm; }
  .pr-plan { border: 1px solid #dfe3f0; border-radius: 8px; padding: 6px; }
  .pr-costs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pr-costs > div { border: 1px solid #dfe3f0; border-radius: 8px; padding: 12px; } .pr-costs span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #5b6078; display: block; }
  .pr-costs b { font-size: 22px; display: block; margin: 4px 0; } .pr-costs small { font-size: 9px; color: #5b6078; line-height: 1.3; display: block; }
  .pr-costs .hot { background: #fff1f0; border-color: #f2b8b2; } .pr-costs .hot b { color: #d33a2c; }
  .pr-inline { display: block; margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: #eef2ff; color: #2b4ad8 !important; text-decoration: none; font-weight: 600; font-size: 11px; }
  .pr-inline span { display: block; font-weight: 500; color: #5b6078; margin-top: 2px; }
  .pr-recs { padding-left: 18px; margin: 0; } .pr-recs li { margin: 0 0 10px; } .pr-recs b { font-size: 13px; } .pr-recs p { margin: 2px 0 0; font-size: 11.5px; line-height: 1.45; color: #3a3f58; }
  .pr-help { padding-left: 16px; margin: 0; font-size: 11.5px; line-height: 1.5; } .pr-help li { margin-bottom: 4px; }
  .pr-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #2b4ad8; color: #fff !important; text-decoration: none; padding: 16px 18px; border-radius: 10px; margin-top: 16px; }
  .pr-cta b { font-size: 16px; } .pr-cta p { margin: 4px 0 0; font-size: 11px; opacity: .92; } .pr-ctaurl { font-size: 11px; font-weight: 700; background: #fff; color: #2b4ad8; border-radius: 6px; padding: 8px 10px; white-space: nowrap; }
  .pr-foot { position: absolute; left: 14mm; right: 14mm; bottom: 8mm; display: flex; justify-content: space-between; font-size: 9px; color: #8a8fa6; border-top: 1px solid #e6e9f3; padding-top: 5px; }
  .pr-mark { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 800; color: rgba(20, 24, 43, .05); transform: rotate(-35deg); pointer-events: none; z-index: 5; }
  html.print-ok .pr .mini { font-size: 11px; }
  #wis-cover { display: none !important; }
}

/* interactive buttons: lift on hover, press on click, clear focus ring */
.btn:hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(9, 55, 178, .22); border-color: #0937B2; }
.btn:active:not([disabled]) { transform: translateY(1px) scale(.97); box-shadow: none; filter: brightness(.92); }
.btn:focus-visible { outline: 2px solid #4C7DF0; outline-offset: 2px; }
.btn.primary.dl { background: #0937B2; border-color: #0937B2; color: #fff; }
.btn.primary.dl:hover:not([disabled]) { background: #0B45D6; border-color: #0B45D6; filter: none; box-shadow: 0 8px 20px rgba(9, 55, 178, .45); }
.btn.primary.dl:active:not([disabled]) { background: #072A8C; border-color: #072A8C; filter: none; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover, .btn:active { transition: none; transform: none; } }

button, input, select, textarea, table, td, th, p, li, h1, h2, h3, summary, label { line-height: 1.2; }
.consent { font-size: 12px; margin: 0; }

/* header logo: the artwork is dark blue, so it sits on a light chip to stay readable in dark theme */
.logo-chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 12px; }
.logo { height: 32px; width: auto; display: block; }
:root[data-theme="dark"] .logo-chip { background: #fff; }
.tagline { font-size: 16px; font-weight: 600; color: var(--text); }

/* zones list: one line per zone, name left, compact - n + group right */
.palette li { min-height: 34px; gap: 10px; }
.palette .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 14px; }
.palette .qty { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.palette .iconbtn { width: 26px; height: 26px; font-size: 14px; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, transform .15s; }
.palette .iconbtn:hover:not([disabled]) { background: var(--accent-soft); transform: scale(1.08); }
.palette .iconbtn:active:not([disabled]) { transform: scale(.92); }
.palette .cnt { min-width: 22px; text-align: center; font-size: 14px; font-weight: 700; color: var(--faint); }
.palette .cnt.on { color: var(--text); }
.palette li:has(.cnt.on) .name { color: var(--text); }
.theme-toggle { font-size: 16px; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; transition: background .15s, transform .15s; }
.actions + .theme-toggle { margin-left: 0; }
.theme-toggle:hover { background: var(--accent-soft); transform: rotate(15deg); }

/* shape picker: five big pictures, tap one */
.shapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 6px; }
.shape { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border: 1.5px solid var(--hair); border-radius: 14px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.shape svg { width: 40px; height: 32px; fill: currentColor; opacity: .55; }
.shape:hover { transform: translateY(-2px); border-color: var(--accent); }
.shape:active { transform: scale(.96); }
.shape.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.shape.on svg { opacity: 1; }
@media (max-width: 420px) { .shape span { font-size: 11px; } }

.shape.draw svg path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-dasharray: 4 3; }
.drawpad { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.drawpad .est { margin: 0; }
.pad { display: grid; gap: 2px; width: 100%; aspect-ratio: 3 / 2; touch-action: none; user-select: none; -webkit-user-select: none; padding: 4px; border: 1.5px solid var(--hair); border-radius: 12px; background: var(--chip); }
.pad .sq { border-radius: 3px; background: repeating-linear-gradient(45deg, var(--hair) 0 2px, transparent 2px 5px); cursor: pointer; transition: background .1s; }
.pad .sq.on { background: var(--accent); opacity: .85; }

.hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; position: relative; z-index: 3; }
.hd h2 { margin: 0; }
.tip-wide { width: 260px; left: -100px; }
.tip-wide ul { margin: 6px 0 0; padding-left: 16px; }
.tip-wide li { margin: 2px 0; }
.gate-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.gate-actions .btn { width: 100%; justify-content: center; min-height: 48px; font-size: 16px; }
.link-btn { width: 100%; min-height: 40px; background: none; border: 0; box-shadow: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; border-radius: var(--r-field); }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.share-link { display: flex; gap: 8px; margin-bottom: 12px; }
.share-link input { flex: 1; min-width: 0; font-size: 13px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-grid .btn { justify-content: center; text-decoration: none; }

.col-out .card { padding: 16px; }
.col-out .facts { margin: 8px 0 0; gap: 0; }
.col-out .facts > div { padding: 6px 0; }
.col-out .mini td, .col-out .mini th { padding-top: 4px; padding-bottom: 4px; }
.col-out .unlock-card { margin-top: -64px; padding: 12px; gap: 8px; }
.col-out .unlock-card .lede, .col-out .unlock-card .est { margin: 0; }
.col-out .hd { margin-bottom: 4px; }
.brief-layout { max-width: 1392px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.work { padding-left: 60px; padding-right: 60px; }
@media (max-width: 960px) { .work { padding-left: 0; padding-right: 0; } }

/* Desktop plan screen: the page stays put, each side panel scrolls on its own, the floor plan fits the screen */
@media (min-width: 1101px) {
  html:has(.work) { overflow: hidden; }
  .work { height: calc(100vh - 120px); align-items: stretch; }
  .col-in, .col-out { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 2px 6px 16px 2px; margin: -2px -6px 0 -2px; scrollbar-width: thin; }
  .col-mid { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .col-mid .canvaswrap { margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .col-mid .planbox { flex: 1; min-height: 0; display: flex; }
  .col-mid .planbox svg.plan { width: 100%; height: 100%; max-height: 100%; }
}

.viewtoggle { display: inline-flex; background: var(--chip); border: 1px solid var(--hair); border-radius: 999px; padding: 2px; }
.viewtoggle button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.viewtoggle button.on { background: var(--ink); color: var(--ink-on); }
.viewtoggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toolbar .toolbar-actions { margin-left: auto; }
.plan-meta { display: block; text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 12px; margin: 0; }
.toolbar { flex-wrap: nowrap; gap: 12px; }
.toolbar h2 { white-space: nowrap; }
.toolbar .toolbar-actions { flex-wrap: nowrap; gap: 6px; }
.toolbar .toolbar-actions .btn.sm { padding: 6px 10px; white-space: nowrap; }
.viewtoggle button { padding: 6px 12px; white-space: nowrap; }
@media (max-width: 1100px) { .toolbar { flex-wrap: wrap; } }

.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Responsive hardening: nothing may push the page wider than the viewport */
html, body { max-width: 100%; overflow-x: hidden; }
.brief-hero, .brief-side, .brief, .field, .row { min-width: 0; }
.shapes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.shape { min-width: 0; }
.row .seg { max-width: 100%; }
@media (max-width: 560px) {
  .shapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brief-hero h1 { font-size: 32px; letter-spacing: -1px; }
}
@media (max-width: 760px) {
  .topbar { position: static; gap: 8px; row-gap: 8px; }
  .topbar .btn { padding: 8px 14px; min-height: 40px; font-size: 14px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .topbar { padding: 10px 20px; margin: 12px 16px 0; }
  .page { padding-left: 16px; padding-right: 16px; }
}
/* Tablet: plan first, then zone controls and results, one column so nothing is squeezed */
@media (max-width: 1100px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .col-mid { order: 1; grid-column: 1; min-width: 0; }
  .col-in { order: 2; grid-column: 1; }
  .col-out { order: 3; grid-column: 1; min-width: 0; }
  .col-mid .planbox, .col-mid .canvaswrap { max-width: 100%; overflow-x: auto; }
}

/* Touch: bigger invisible hit areas on the resize and rotate handles; toolbar scrolls instead of wrapping off-screen */
@media (pointer: coarse), (max-width: 760px) {
  .handle, .rot-handle circle { stroke: transparent; stroke-width: 40px; }
  .toolbar .toolbar-actions { flex-wrap: wrap; width: 100%; margin-left: 0; }
  .toolbar .toolbar-actions .btn.sm { min-height: 40px; padding: 8px 14px; }
}
/* Phone header: logo left, theme switch right; Edit brief / Save / Share / Download on one line below */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; justify-content: space-between; align-items: center; }
  .topbar .spacer { display: none; }
  .topbar > :first-child { order: 1; }
  .topbar .theme-toggle { order: 2; margin-left: auto; }
  .topbar .actions { order: 3; flex: 0 0 100%; display: flex; flex-wrap: nowrap; gap: 6px; justify-content: space-between; }
  .topbar .actions .btn { flex: 1 1 auto; min-width: 0; padding: 8px 6px; min-height: 40px; font-size: 13px; white-space: nowrap; justify-content: center; }
  .topbar .actions .btn.ghost { flex: 0 1 auto; padding: 8px 4px; }
}
