/* Q.eng — paper theme of the Q labs brand book (tokens.css [data-theme="light"], 26.11.2026).
   A chat: conversations on the right, the thread in the middle, one composer docked at the bottom.
   Orange (brand-signal) once per screen: send, or the live dot while the agent works, or the Excel download.
   Borders, not shadows. Mono for every number. The dot grid lives only behind the agent's working strip. */

@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url(/static/fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Hebrew"; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-sans-hebrew-hebrew-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Hebrew"; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-sans-hebrew-hebrew-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Hebrew"; font-weight: 600; font-display: swap; src: url(/static/fonts/ibm-plex-sans-hebrew-hebrew-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --brand-ink: #0d0f12; --brand-paper: #f4f3ef; --brand-signal: #f2541a; --brand-steel: #5b6470;
  /* paper theme, as in tokens.css [data-theme="light"] */
  --surface-100: var(--brand-paper); --surface-200: #ffffff; --line: #d9dce0; --line-strong: #7d8590;
  --text: var(--brand-ink); --text-muted: var(--brand-steel); --accent: var(--brand-signal); --on-signal: var(--brand-ink);
  --accent-text: #c23a06; --focus: var(--accent-text);
  --wash: #ebe9e3;            /* paper one step down: the selected conversation, the user's own messages */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-16: 64px;
  --radius-sm: 4px; --radius-md: 8px; --radius-full: 9999px;
  --font-display: "Space Grotesk", "IBM Plex Sans Hebrew", system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", "IBM Plex Sans Hebrew", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "IBM Plex Sans Hebrew", ui-monospace, monospace;
  --side-w: 272px; --thread-w: 760px; --log-w: 1000px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; height: 100%; background: var(--surface-100); color: var(--text); font: 400 16px/26px var(--font-sans); caret-color: var(--accent-text); }
::selection { background: #f9c9b4; color: var(--brand-ink); }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: #c3c7cc transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

h1, h2, p { margin: 0; }
.meta { font: 400 13px/18px var(--font-sans); color: var(--text-muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; unicode-bidi: isolate; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- frame */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100%; }
body.bare .app { grid-template-columns: minmax(0, 1fr); }
body.bare .side { display: none; }
.view { min-width: 0; height: 100%; overflow: hidden; display: flex; flex-direction: column; }

.side { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); border-inline-end: 1px solid var(--line); background: var(--surface-100); min-height: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: var(--space-1) var(--space-2) 0; }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text); text-decoration: none; font: 500 21px/28px var(--font-display); letter-spacing: -0.01em; direction: ltr; }
.close-side { display: none; }
.new-chat { justify-content: center; }
.new-chat[aria-current="page"] { background: var(--surface-200); border-color: var(--text); }
.convs { flex: 1; min-height: 0; overflow-y: auto; margin: 0 calc(-1 * var(--space-2)); }
.convs ul { list-style: none; margin: 0; padding: 0 var(--space-2); }
.side-label { font-size: 12px; line-height: 16px; color: var(--text-muted); padding: 0 var(--space-2); margin-bottom: calc(-1 * var(--space-2)); }
.projects > li + li { margin-top: 2px; }
.convs a { display: grid; gap: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.convs a:hover { background: var(--wash); }
.convs a[aria-current="page"] { background: var(--surface-200); box-shadow: inset 0 0 0 1px var(--line); }
/* the open project: its name, then its tabs hanging from a rule, like sheets under a project in a drawing register */
.projects > li.open { background: var(--surface-200); border: 1px solid var(--line); border-radius: var(--radius-sm); padding-bottom: var(--space-2); margin-block: var(--space-1); }
.projects > li.open > .proj { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.projects > li.open > .proj .conv-name { font-weight: 500; }
.projects > li.open > .proj[aria-current="page"] { box-shadow: none; background: transparent; }
.convs .tabs { list-style: none; margin: var(--space-1) var(--space-4) 0 var(--space-3); padding: 0; border-inline-start: 1.5px solid var(--text); }
.tabs a { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); padding: 5px var(--space-3); border-radius: 0;
  font-size: 14px; line-height: 20px; color: var(--text-muted); margin-inline-start: -1.5px; border-inline-start: 1.5px solid transparent; }
.tabs a:hover { background: var(--wash); color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 500; border-inline-start-color: var(--accent-text); background: var(--surface-100); box-shadow: none; }
.tab-count { font: 400 12px/16px var(--font-mono); color: var(--text-muted); }
.conv-name { font-size: 15px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; align-items: baseline; gap: var(--space-3); }
.conv-date { font: 400 12px/16px var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.conv-state { font-size: 12px; line-height: 16px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.conv-state::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); border: 1.5px solid currentColor; }
.conv-state.done::before { background: currentColor; }
.conv-state.failed::before { border: 0; height: 1.5px; border-radius: 0; background: currentColor; }
.conv-state.waiting { color: var(--accent-text); font-weight: 500; }
.side-empty { color: var(--text-muted); font-size: 14px; line-height: 20px; padding: var(--space-2) var(--space-3); }
.side-foot { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-2) var(--space-4); border-top: 1px solid var(--line); padding: var(--space-4) var(--space-2) 0; }
.who { display: grid; color: var(--text); text-decoration: none; min-width: 0; }
.who:hover .who-name { text-decoration: underline; text-underline-offset: 3px; }
.who-name { font-size: 14px; line-height: 20px; font-weight: 500; }
.who-org { font-size: 13px; line-height: 18px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot { grid-column: 1 / -1; font-size: 12px; line-height: 16px; color: var(--text-muted); }
.scrim { display: none; }

/* ---------------------------------------------------------------- controls */
button, .btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: 9px var(--space-4); font: 500 15px/20px var(--font-sans);
  color: var(--text); background: var(--surface-200); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out; }
button:hover, .btn:hover { border-color: var(--text); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn.quiet:hover { color: var(--text); border-color: var(--line-strong); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-signal); }
button.primary:hover, .btn.primary:hover { background: #e04812; border-color: #e04812; }
button:disabled { cursor: not-allowed; color: var(--text-muted); border-color: var(--line); background: var(--surface-100); }
button.link { padding: 0; border: 0; background: none; color: var(--accent-text); font-weight: 400; font-size: 14px; }
button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { padding: 0; width: 40px; height: 40px; justify-content: center; border-color: transparent; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm); }
.icon-btn:hover { color: var(--text); border-color: transparent; background: var(--wash); }
.icon-btn:disabled { background: transparent; border-color: transparent; color: #b4b9bf; }
label { display: block; margin: var(--space-4) 0 var(--space-1); font-size: 14px; color: var(--text-muted); }
input[type=text], input[type=email], input[type=password] { width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface-200); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
input[readonly] { font-family: var(--font-mono); font-size: 14px; }
input[dir=ltr] { text-align: left; }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-top: var(--space-4); }
.row input { flex: 1 1 220px; width: auto; }
.error { color: var(--accent-text); font-size: 14px; line-height: 20px; margin-top: var(--space-2); }
.error:empty { display: none; }

/* ---------------------------------------------------------------- status: the brand's two shapes */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; color: var(--text-muted); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); border: 1.5px solid currentColor; }
.status.measured, .status.done, .status.running, .status.queued { color: var(--text); }
.status.measured::before, .status.done::before { background: currentColor; }
.status.not_measured::before, .status.failed::before { border: 0; height: 1.5px; border-radius: 0; background: currentColor; }
.status.waiting { color: var(--accent-text); }
.status.running::before, .status.queued::before { display: none; }

/* ---------------------------------------------------------------- chat */
.chat { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.open-side { display: none; align-self: center; }
.scroller { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-8) var(--space-8) var(--space-4); scroll-behavior: smooth; }

/* The title block of a drawing sheet: labelled cells, ink rules. It heads every conversation and closes the blank sheet. */
.titleblock { display: grid; background: var(--surface-200); }
.tb-cell { display: grid; align-content: center; gap: 2px; min-width: 0; padding: 10px var(--space-4); border-inline-start: 1px solid var(--line-strong); }
.tb-cell:first-child, .titleblock > .open-side + .tb-cell { border-inline-start: 0; }
.tb-label { font-size: 12px; line-height: 16px; color: var(--text-muted); }
.tb-value { font: 500 15px/22px var(--font-sans); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.num-v { font-family: var(--font-mono); font-weight: 400; font-variant-numeric: tabular-nums; }
.titleblock.head { grid-template-columns: minmax(0, 3fr) minmax(0, 1.3fr) repeat(2, minmax(0, .8fr)) minmax(0, 1.4fr); border-bottom: 1.5px solid var(--text); flex: none; }
.titleblock.head h1.tb-value { font: 500 18px/24px var(--font-display); }
.tb-state .status { font-size: 15px; }

/* The thread is a work log: a gutter for who and when, one margin rule down the page, the body beside it. */
.thread { --gutter: 120px; list-style: none; margin: 0 auto; padding: 0; max-width: var(--log-w); display: flex; flex-direction: column; gap: var(--space-8);
  background: linear-gradient(var(--line), var(--line)) no-repeat right var(--gutter) top 0 / 1px 100%; }
.msg { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); min-width: 0; }
.gutter { display: grid; align-content: start; justify-items: start; gap: 2px; padding-inline-end: var(--space-4); padding-top: 3px; }
.g-who { font: 500 13px/18px var(--font-sans); color: var(--text-muted); }
.msg.user .g-who { color: var(--text); }
.g-time { font: 400 12px/16px var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.body { display: grid; gap: var(--space-3); padding-inline-start: var(--space-6); min-width: 0; }
.body > p { max-width: 68ch; }
.answer-to { color: var(--text-muted); }
.note-text { white-space: pre-wrap; border-inline-start: 2px solid var(--line-strong); padding-inline-start: var(--space-3); }
.msg.hint .body > p { color: var(--text-muted); }

/* ---------------------------------------------------------------- a project's tab */
.tab-body { max-width: var(--log-w); margin: 0 auto; display: grid; gap: var(--space-6); }
.register { width: 100%; border-collapse: collapse; background: var(--surface-200); border: 1px solid var(--line-strong); }
.register th { padding: 10px var(--space-3); }
.register td { padding: 10px var(--space-3); border-bottom: 1px solid var(--line); vertical-align: baseline; }
.register tr[aria-current="true"] { background: var(--surface-100); font-weight: 500; }
.register a { color: var(--text); font-weight: 500; }
.reg-time { font: 400 12px var(--font-mono); color: var(--text-muted); }
.register .muted { color: var(--text-muted); font-size: 14px; }
.register .reg-dl { text-align: end; }
.register .reg-dl a { color: var(--accent-text); font-weight: 400; }
.blank { border: 1.5px solid var(--text); background-color: var(--surface-200); padding: var(--space-16) var(--space-8); display: grid; justify-items: start; gap: var(--space-3);
  background-image: radial-gradient(circle, #cfd2d6 1px, transparent 1.2px); background-size: var(--space-4) var(--space-4); }
.blank > * { background: var(--surface-200); box-shadow: 0 0 0 6px var(--surface-200); }
.blank-title { font: 500 28px/34px var(--font-display); }
.blank-text { color: var(--text-muted); max-width: 56ch; }
.blank .btn { margin-top: var(--space-3); }
.answer { font-weight: 500; }
.msg.arrive { animation: arrive 260ms var(--ease-out) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* the drawing register: plans listed as numbered sheets */
.sheet-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); width: 100%; }
.sheet-list li { display: flex; align-items: center; gap: var(--space-3); min-width: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sheet-no { font: 500 12px/16px var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sheet-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; font-size: 15px; }
a.sheet-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.sheet-state { font-size: 12px; color: var(--text-muted); }
.sheet-list li.sending .sheet-name { color: var(--text-muted); }
.sheet-list.in-thread { max-width: 560px; }

.chip-size { font: 400 12px/16px var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; margin-inline-start: auto; white-space: nowrap; }

/* the agent's working strip: the only place the dot grid appears */
.work-strip { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-3);
  background-color: var(--surface-100); background-image: radial-gradient(circle, #cfd2d6 1px, transparent 1.2px); background-size: var(--space-4) var(--space-4); }
.work-state { display: flex; align-items: center; gap: var(--space-3); }
.work-state .meta { font-family: var(--font-mono); font-size: 12px; }
.live-dot { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--accent); animation: pulse 1.6s var(--ease-out) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242, 84, 26, .45); } 100% { box-shadow: 0 0 0 9px rgba(242, 84, 26, 0); } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-1); }
.steps li { padding: var(--space-2) var(--space-2) 0; border-top: 2px solid var(--line); color: var(--text-muted); font-size: 13px; line-height: 18px; background: var(--surface-100); }
.steps li.past { border-top-color: var(--brand-steel); color: var(--text); }
.steps li.on { border-top-color: var(--text); color: var(--text); font-weight: 500; }
.work-strip.live .steps li.on { border-top-color: var(--accent); }

/* a question carries a revision triangle in the gutter, numbered like the deltas in a title block */
.delta { width: 30px; height: 26px; overflow: visible; }
.delta path { fill: var(--surface-200); stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; }
.delta text { font: 500 12px var(--font-mono); fill: var(--text); }
.msg.question:not(.open) .delta path { stroke: var(--brand-steel); fill: var(--surface-100); }
.msg.question:not(.open) .delta text { fill: var(--brand-steel); }
.msg.question .q-text { font-size: 18px; line-height: 28px; max-width: 60ch; }
.q-facts { margin: 0; display: grid; gap: var(--space-2); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.q-facts div { display: grid; grid-template-columns: 9.5em 1fr; gap: var(--space-4); }
.q-facts dt { font-size: 14px; line-height: 22px; color: var(--text-muted); }
.q-facts dd { margin: 0; font-size: 15px; line-height: 22px; }
.options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.options button:disabled { color: var(--text-muted); }

/* the BOQ arrives as a sheet */
.sheet { background: var(--surface-200); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: var(--space-4) var(--space-6) var(--space-6); }
.sheet-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; padding-bottom: var(--space-3); }
.sheet-head h2 { font: 500 20px/28px var(--font-display); }
.sheet-head .meta { font-family: var(--font-mono); font-size: 12px; }
.sheet-head .actions { margin-inline-start: auto; display: flex; gap: var(--space-2); align-self: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 12px var(--space-2); border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 13px/16px var(--font-sans); color: var(--text-muted); border-bottom-color: var(--line-strong); white-space: nowrap; }
td.no { font: 500 12px/24px var(--font-mono); color: var(--text-muted); width: 3em; }
td.item { min-width: 14em; }
td.item .key { display: block; font: 400 12px/16px var(--font-mono); color: var(--text-muted); margin-top: 2px; text-align: start; }
td.num { font: 500 17px/24px var(--font-mono); font-variant-numeric: tabular-nums; text-align: end; direction: ltr; white-space: nowrap; }
td.unit { font: 400 14px/24px var(--font-mono); }
td.source { font-size: 14px; line-height: 20px; color: var(--text-muted); min-width: 18em; }
td.source .formula { font: 400 13px/20px var(--font-mono); color: var(--text); text-align: left; margin-top: var(--space-1); }
td.source .note { margin-top: var(--space-1); }
tr.assumption td.item, tr.not_measured td.item { color: var(--text-muted); }
tr.not_measured td.num { color: var(--text-muted); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- composer */
.dock { padding: 0 var(--space-8) var(--space-4); }
.dock > * { max-width: calc(var(--log-w) - 120px); margin-inline: auto; }
.composer { background: var(--surface-200); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: var(--space-2); display: grid; gap: var(--space-2);
  transition: border-color 120ms ease-out; }
.composer:focus-within { border-color: var(--text); }
.composer.busy { border-color: var(--line); background: var(--surface-100); }
.composer-row { display: flex; align-items: flex-end; gap: var(--space-2); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; padding: 7px var(--space-1); max-height: 200px; }
.composer textarea::placeholder { color: var(--text-muted); }
.composer textarea:disabled { cursor: default; }
.attach-prompt { flex: 1; min-width: 0; justify-content: flex-start; padding: 9px var(--space-1); border: 0; background: transparent;
  color: var(--text-muted); font-weight: 400; font-size: 16px; line-height: 22px; text-align: start; }
.attach-prompt:hover { color: var(--text); border: 0; text-decoration: underline; text-underline-offset: 3px; }
.send { padding: 0; width: 40px; height: 40px; justify-content: center; flex: none; }
.send .icon { transform: none; }
.intake { width: 100%; justify-content: center; gap: var(--space-3); padding: var(--space-6) var(--space-4); border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface-100); color: var(--text); font-weight: 400; }
.intake:hover { border-color: var(--text); background: var(--wash); }
.intake > .icon { width: 24px; height: 24px; color: var(--text-muted); }
.intake-text { display: grid; text-align: start; gap: 2px; }
.intake-text strong { font-weight: 500; font-size: 16px; line-height: 22px; }
.intake-text span { font-size: 14px; line-height: 20px; color: var(--text-muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; gap: var(--space-2); max-width: 100%; padding: 5px var(--space-2); background: var(--surface-100); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; }
.chip > .icon { width: 16px; height: 16px; color: var(--text-muted); }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.chip-x { padding: 0; width: 24px; height: 24px; justify-content: center; border: 0; background: transparent; color: var(--text-muted); }
.chip-x .icon { width: 16px; height: 16px; }
.chip-x:hover { color: var(--text); background: var(--wash); }
.chip.sending { border-color: var(--line-strong); }
.chip.sending .chip-size::after { content: " · עולה"; font-family: var(--font-sans); }
.chip.sent .chip-size::after { content: " · עלה"; font-family: var(--font-sans); }
.dock .error { margin: var(--space-2) auto 0; }
.dock-note { margin: var(--space-2) auto 0; font-size: 12px; line-height: 16px; color: var(--text-muted); text-align: center; }

/* drop anywhere on the conversation */
.chat::after { content: "משחררים כאן, והקבצים נכנסים להודעה"; position: absolute; inset: var(--space-4); display: grid; place-items: center;
  border: 1.5px dashed var(--text); border-radius: var(--radius-md); background: rgba(244, 243, 239, .94); font: 500 18px/26px var(--font-sans);
  opacity: 0; pointer-events: none; transition: opacity 120ms ease-out; }
.chat.dragging::after { opacity: 1; }

/* ---------------------------------------------------------------- a new conversation: a blank drawing sheet */
.chat.empty { overflow-y: auto; }
.chat.empty .chat-head { display: none; }
.desk { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; padding: var(--space-8); }
.desk > .error { max-width: var(--log-w); width: 100%; margin: var(--space-2) auto 0; }
.drawing { --edge: 28px; position: relative; width: 100%; max-width: var(--log-w); margin: 0 auto; padding: var(--edge); background: var(--surface-200); border: 1px solid var(--line-strong); }
/* zone references along the top and the start edge, as on a sheet border */
.zones { position: absolute; list-style: none; margin: 0; padding: 0; display: flex; font: 400 11px/1 var(--font-mono); color: var(--text-muted); }
.zones li { flex: 1; display: grid; place-items: center; }
.zones-x { inset-inline: var(--edge); top: 0; height: var(--edge); }
.zones li { position: relative; }
.zones-x li + li::before { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 1px; height: 9px; background: var(--line-strong); }
.zones-y { inset-block: var(--edge); inset-inline-start: 0; width: var(--edge); flex-direction: column; }
.zones-y li + li::before { content: ""; position: absolute; top: 0; inset-inline-end: 0; height: 1px; width: 9px; background: var(--line-strong); }
.frame { border: 1.5px solid var(--text); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(360px, 1fr) auto; min-height: min(620px, calc(100vh - 2 * var(--space-8) - 2 * 28px - 40px)); }
.plot { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: start; min-width: 0; gap: var(--space-4); padding: var(--space-8) var(--space-16) var(--space-8) var(--space-8);
  background-image: radial-gradient(circle, #cfd2d6 1px, transparent 1.2px); background-size: var(--space-4) var(--space-4); background-position: center; }
.plot > * { position: relative; }
.plot .sheet-list { background: var(--surface-200); max-width: 640px; }
.plot .sheet-list li { padding-inline: var(--space-3); }
.plot-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.formats { font-size: 13px; line-height: 18px; color: var(--text-muted); background: var(--surface-200); box-shadow: 0 0 0 4px var(--surface-200); }
.formats .ltr { font-family: var(--font-mono); font-size: 12px; }
.claim { font: 500 52px/56px var(--font-display); letter-spacing: -0.02em; }
.lead { font-size: 17px; line-height: 27px; color: var(--text-muted); max-width: 54ch; background: var(--surface-200); box-shadow: 0 0 0 6px var(--surface-200); }
.drawing .titleblock { grid-template-columns: auto minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, .7fr) auto; border-top: 1.5px solid var(--text); }
.tb-brand { grid-auto-flow: column; align-items: center; gap: var(--space-2); font: 500 18px/24px var(--font-display); }
.tb-name { margin: 0; cursor: text; }
.tb-name input { border: 0; padding: 0; background: transparent; font: 500 15px/22px var(--font-sans); width: 100%; outline: 0; }
.tb-name:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
.tb-name input::placeholder { color: var(--text-muted); font-weight: 400; }
.tb-send { padding: var(--space-2); }
.send-sheet { height: 100%; padding-inline: var(--space-6); }
.send-sheet .icon { width: 18px; height: 18px; }
.chat.empty.dragging .plot { background-color: var(--wash); }

/* ---------------------------------------------------------------- pages (organisation) */
.page { height: 100%; overflow-y: auto; }
.page-body { max-width: var(--thread-w); margin: 0 auto; padding: var(--space-8); display: grid; gap: var(--space-6); }
.page .sheet h2 { font: 500 18px/26px var(--font-sans); margin: var(--space-2) 0 var(--space-3); }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people .end { margin-inline-start: auto; }
.tag-admin { font: 500 12px/16px var(--font-mono); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 1px 6px; }
.notice { border-color: var(--line-strong); }
.notice > p:first-child { margin-bottom: var(--space-1); }

/* ---------------------------------------------------------------- sign-in */
.auth { min-height: 100%; overflow-y: auto; display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-8); padding: var(--space-6) var(--space-8); }
.auth .brand { justify-self: start; }
.auth-body { align-self: center; display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-16); align-items: center; max-width: 1040px; width: 100%; margin: 0 auto; }
.auth-body.single { grid-template-columns: minmax(0, 420px); justify-content: center; }
.auth .claim { font-size: 56px; line-height: 60px; margin-bottom: var(--space-4); }
.auth-form { padding: var(--space-6) var(--space-8) var(--space-8); }
.auth-form h2 { font: 500 20px/28px var(--font-display); }
.auth .foot { font-size: 13px; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, var(--side-w)); z-index: 20; transform: translateX(100%);
    transition: transform 220ms var(--ease-out); visibility: hidden; }
  body.side-open .side { transform: none; visibility: visible; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 10; background: rgba(13, 15, 18, .32); }
  .close-side { display: inline-flex; }
  .open-side { display: inline-flex; margin-inline-start: calc(-1 * var(--space-2)); }
  .chat.empty .chat-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); min-height: 57px; flex: none; }
  .chat-head .brand { font-size: 18px; }
  .titleblock.head { grid-template-columns: auto minmax(0, 1fr) auto; padding-inline-start: var(--space-2); }
  .titleblock.head .tb-cell:not(.tb-name):not(.tb-state) { display: none; }
  .titleblock.head .tb-name { border-inline-start: 0; padding-inline: var(--space-2); }
  .titleblock.head h1.tb-value { font-size: 16px; }
  .scroller { padding: var(--space-6) var(--space-4) var(--space-4); }
  .dock { padding: 0 var(--space-4) var(--space-3); }
  .thread { background: none; gap: var(--space-6); }
  .msg { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .gutter { grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--space-2); padding: 0; }
  .body { padding-inline-start: 0; }
  .delta { width: 24px; height: 21px; }
  .desk { padding: var(--space-2) var(--space-4) var(--space-6); align-content: start; }
  .drawing { --edge: 0px; border: 0; padding: 0; background: transparent; }
  .zones { display: none; }
  .frame { min-height: 0; grid-template-rows: auto auto; background: var(--surface-200); }
  .plot { padding: var(--space-6) var(--space-4); }
  .drawing .titleblock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .drawing .tb-brand { display: none; }
  .drawing .tb-name { grid-column: 1 / -1; border-inline-start: 0; border-bottom: 1px solid var(--line-strong); }
  .drawing .tb-cell:nth-child(3) { border-inline-start: 0; }
  .drawing .tb-send { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--line-strong); }
  .send-sheet { width: 100%; justify-content: center; padding-block: 12px; }
  .claim { font-size: 34px; line-height: 40px; }
  .lead { font-size: 16px; line-height: 26px; }
  .page-body { padding: var(--space-4); }
  .auth { padding: var(--space-4); gap: var(--space-6); }
  .auth-body { grid-template-columns: 1fr; gap: var(--space-6); }
  .auth .claim { font-size: 34px; line-height: 40px; }
  .auth-form { padding: var(--space-4); }
  .q-facts div { grid-template-columns: 1fr; gap: 0; }
  td.no { display: none; }
  .register thead { display: none; }
  .register tr { grid-template-columns: auto 1fr auto; }
  .register td { border: 0; padding: 2px var(--space-3); }
  .register td.muted { grid-column: 1 / -1; }
  .blank { padding: var(--space-8) var(--space-4); }
  .steps li { font-size: 12px; padding-inline: var(--space-1); }
  .sheet { padding: var(--space-3) var(--space-4) var(--space-4); }
  .sheet-head .actions { margin-inline-start: 0; width: 100%; }
  thead { display: none; }
  table, tbody { display: block; }
  tr { display: grid; grid-template-columns: auto auto 1fr; column-gap: var(--space-3); align-items: baseline; border-bottom: 1px solid var(--line); padding: var(--space-3) 0; }
  tbody tr:last-child { border-bottom: 0; }
  td { border: 0; padding: 2px 0; min-width: 0; }
  td.item, td.source { grid-column: 1 / -1; min-width: 0; }
  td.st { justify-self: end; }
}

/* ---------------------------------------------------------------- print: the BOQ sheet only */
@media print {
  .side, .titleblock.head, .dock, .msg.user, .msg.work, .msg.question, .gutter, .msg.boq .body > p, .sheet-head .actions { display: none !important; }
  .app, .view, .chat, .scroller { display: block; height: auto; overflow: visible; padding: 0; }
  .thread { background: none; }
  .msg, .body { display: block; padding: 0; }
  .sheet { border: 0; padding: 0; }
  body { background: #fff; }
}

