/* Lloyd Studio: the 3D editor. Everything here is prefixed st-. Tokens come from lloyd.css,
   a copy of the Lloyd design system master: change tokens there, not here.

   Three layouts. Wide: tools | view | tray (Revit style: ribbon on top, tray on the left).
   A phone held upright (the SHEET query, also in tray.js): header, tools in a row, the view,
   then the tray as a sheet under it. In between, the wide layout with a shorter header.
   The hi-vis accent is used once: Connect Claude. */

html:has(> body.st) { overscroll-behavior: none; }
.st {
  display: grid;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font: 400 13px/1.4 var(--sans);
  grid-template: "top top top" auto "access access access" auto "tools stage tray" minmax(0, 1fr) "status status status" auto / auto minmax(0, 1fr) auto;
  --st-review: #5b3fa8;
  --st-warn: #d98e00;
}
/* Revit layout: ribbon across the top, Properties and Project Browser on the left. */
.st[data-mode="revit"] {
  grid-template: "top top" auto "access access" auto "tools tools" auto "tray stage" minmax(0, 1fr) "status status" auto / auto minmax(0, 1fr);
}
.st button, .st input, .st select, .st textarea { font: inherit; color: inherit; }
.st button { touch-action: manipulation; }
.st :focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.st-top :focus-visible { outline-color: var(--hivis); }
.st-menu :focus-visible { outline-color: var(--ink); }

/* top bar */
.st-top { grid-area: top; position: relative; z-index: 6; display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s3); background: var(--night); color: var(--on-night); min-width: 0; }
.st-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 15px; flex: none; border-radius: 6px; }
.st-logo svg rect:first-child { stroke: #3a3936; }
.st-name { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; min-width: 48px; flex: 0 1 220px; text-overflow: ellipsis; }
.st-name:hover, .st-name:focus { border-color: #4a4944; }
.st-seg { display: flex; border: 1px solid #4a4944; border-radius: 8px; overflow: hidden; flex: none; }
.st-seg button { background: transparent; border: 0; padding: 5px 12px; cursor: pointer; color: var(--on-night-2); }
.st-seg button[aria-pressed="true"] { background: var(--on-night); color: var(--ink); font-weight: 600; }
.st-seg button:focus-visible { outline-offset: -3px; }
.st-top__right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.st-btn { background: transparent; border: 1px solid currentColor; border-radius: 6px; padding: 4px 10px; cursor: pointer; opacity: .85; white-space: nowrap; }
.st-btn:hover { opacity: 1; }
.st-btn:disabled { opacity: .4; cursor: default; }
.st .st-btn--hi { background: var(--hivis); color: var(--ink); border-color: var(--hivis); font-weight: 600; opacity: 1; }
/* The primary action inside a panel is ink, not hi-vis: the accent is spent once, on Connect Claude (and on a dialog's one action). */
.st .st-btn--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; opacity: 1; }
.st-status { font: 500 11px var(--mono); padding: 3px 8px; border-radius: var(--r-pill); background: #3a3936; color: var(--on-night-2); flex: none; }
.st-status[data-on="true"] { background: #1f3d1f; color: #9be29b; }
/* More: what the header has no room for, the sample house, and the disclosure in full. */
.st-more { position: relative; display: flex; }
.st-more__btn { display: flex; align-items: center; justify-content: center; padding: 4px 6px; }
.st-more__btn svg { fill: currentColor; }
.st-more__btn[aria-expanded="true"] { background: var(--on-night); color: var(--ink); opacity: 1; }
.st-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; display: grid; gap: 6px; width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 64px); overflow: auto; padding: 10px; background: var(--card); color: var(--ink); border: 1px solid var(--ink); border-radius: var(--r-card); box-shadow: 0 10px 30px rgba(18, 18, 17, .25); }
.st-menu[hidden] { display: none; }
.st-menu__slot { display: grid; gap: 6px; }
.st-menu__slot:empty { display: none; }
.st-menu .st-btn { width: 100%; text-align: left; padding: 7px 10px; border-color: var(--line); opacity: 1; }
.st-menu .st-btn:hover { background: var(--paper-2); }
.st-menu .st-btn--hi { border-color: var(--hivis); }
.st-menu #st-units::before { content: "Units: "; color: var(--ink-2); }
.st-menu .st-seg { border-color: var(--line); }
.st-menu .st-seg button { flex: 1; padding: 7px 8px; color: var(--ink-2); }
.st-menu .st-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.st-menu__note { margin: 2px 2px 0; font-size: 12px; color: var(--ink-2); }
.st-menu__note:empty { display: none; }
.st-menu .st-menu__link { display: block; text-decoration: none; color: var(--ink); }

/* tools: a vertical strip in SketchUp mode, a labelled ribbon in Revit mode */
.st-tools { grid-area: tools; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--paper-2); border-right: 1px solid var(--line); overflow: auto; scrollbar-width: none; overscroll-behavior: contain; }
.st-tool { display: flex; align-items: center; justify-content: center; position: relative; width: 44px; height: 40px; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; flex: none; }
.st-tool:hover { background: var(--card); border-color: var(--line); }
.st-tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.st-tool:focus-visible { outline-offset: -2px; }
.st-tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; max-width: none; }
.st-tool__label { display: none; }
.st-tool__key { position: absolute; right: 2px; bottom: 0; font: 500 9px var(--mono); opacity: .6; }
.st-tools__sep { height: 1px; background: var(--line); margin: 4px 2px; flex: none; }
.st-tools__group { display: none; }

.st[data-mode="revit"] .st-tools { flex-direction: row; align-items: stretch; border-right: 0; border-bottom: 1px solid var(--line); background: var(--card); padding: 4px 8px 2px; gap: 2px; }
.st[data-mode="revit"] .st-tool { width: auto; min-width: 58px; height: 50px; flex-direction: column; gap: 1px; padding: 2px 6px; }
.st[data-mode="revit"] .st-tool__label { display: block; font-size: 11px; white-space: nowrap; }
.st[data-mode="revit"] .st-tool__key { position: static; opacity: .5; display: none; }
.st[data-mode="revit"] .st-tools__sep { width: 1px; height: auto; margin: 2px 6px; }

/* stage */
.st-stage { grid-area: stage; position: relative; overflow: hidden; background: #e9eef0; min-width: 0; min-height: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.st-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.st-options { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 5px 10px; background: color-mix(in srgb, var(--card) 88%, transparent); border-bottom: 1px solid var(--line); scrollbar-width: none; overscroll-behavior: contain; }
.st-options label { display: flex; align-items: center; gap: 5px; color: var(--ink-2); white-space: nowrap; }
.st-options select { max-width: 210px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
.st-options .st-btn { padding: 2px 9px; color: var(--ink); border-color: var(--ink-3); border-radius: var(--r-pill); }
.st-options .st-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); opacity: 1; }
.st-options__spacer { flex: 1; }
.st-options__panels { display: inline-flex; align-items: center; gap: 6px; }
.st-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.st-label { position: absolute; top: 0; left: 0; background: var(--ink); color: var(--paper); font: 500 11px var(--mono); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.st-label small { display: block; font: 400 10px var(--mono); color: var(--ink-2); }
.st-snap { position: absolute; top: 0; left: 0; width: 11px; height: 11px; border: 2.5px solid; border-radius: 50%; background: #fff; pointer-events: none; }
.st-tip { position: absolute; top: 0; left: 0; background: #fffbe0; border: 1px solid #b9b08a; font-size: 11px; padding: 1px 5px; pointer-events: none; white-space: nowrap; }
.st-toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 6px 14px; border-radius: var(--r-pill); max-width: 90%; z-index: 3; }
.st-toast[data-bad="true"] { background: var(--redline); }
/* "Ground not set": a small note on the canvas, bottom left, that opens the Site properties. */
.st-ground-note { position: absolute; left: 10px; bottom: 12px; z-index: 2; max-width: calc(100% - 20px); font: 500 12px var(--sans); color: var(--ink); background: #fff7e0; border: 1px solid #c9a227; border-radius: var(--r-pill); padding: 4px 11px; cursor: pointer; text-align: left; }
.st-ground-note:hover, .st-ground-note:focus-visible { background: #ffefbf; }
.st-ground { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.st-ground__warn { color: var(--ink); background: #fff7e0; border: 1px solid #c9a227; border-radius: 6px; padding: 5px 8px; }

/* tray: the panels, as tabs */
.st-tray { grid-area: tray; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; width: clamp(280px, var(--st-tray-w, 340px), calc(100vw - 340px)); background: var(--card); border-left: 1px solid var(--line); }
.st[data-mode="revit"] .st-tray { border-left: 0; border-right: 1px solid var(--line); }
.st[data-tray="closed"] .st-tray { display: none; }
.st-tray__resize { position: absolute; top: 0; bottom: 0; left: -4px; width: 8px; z-index: 4; cursor: col-resize; touch-action: none; }
.st[data-mode="revit"] .st-tray__resize { left: auto; right: -4px; }
.st-tray__resize:hover, .st-tray__resize:focus-visible, .st-tray__resize[data-drag] { background: color-mix(in srgb, var(--ink) 22%, transparent); outline: none; }
.st-tabsbar { display: flex; align-items: stretch; flex: none; min-width: 0; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.st-tray__grab { display: none; }
.st-tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior: contain; }
.st-tabs[data-more="true"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.st-tab { display: flex; align-items: center; gap: 5px; flex: none; height: 36px; padding: 0 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font-weight: 500; white-space: nowrap; cursor: pointer; }
.st-tab:hover { color: var(--ink); }
.st-tab[aria-selected="true"] { color: var(--ink); background: var(--card); border-bottom-color: var(--ink); }
.st-tab:focus-visible, .st-tray__toggle:focus-visible, .st-tray__grab:focus-visible { outline-offset: -2px; }
.st-tray__toggle { display: flex; align-items: center; justify-content: center; flex: none; width: 32px; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; }
.st-tray__toggle:hover { background: var(--card); }
.st-tray__toggle svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.st[data-mode="revit"] .st-tray__toggle svg { transform: rotate(180deg); }
/* Checks on its tab: to fix, flagged, not judged. Numbers only; the words are in the panel and the title. */
.st-badge { display: inline-flex; gap: 2px; }
.st-badge i { min-width: 17px; padding: 1px 4px; border-radius: var(--r-pill); font: 600 10px/1.3 var(--mono); font-style: normal; text-align: center; color: #fff; }
.st-badge i[data-sev="error"] { background: var(--redline); }
.st-badge i[data-sev="warning"] { background: var(--st-warn); color: var(--ink); }
.st-badge i[data-sev="review"] { background: var(--st-review); }
.st-tray__body { position: relative; flex: 1; min-height: 0; }
.st-pane { height: 100%; overflow: auto; overscroll-behavior: contain; padding: 10px 12px 18px; outline: none; overflow-wrap: break-word; }
.st-pane[hidden] { display: none; }
.st-pane__meta { margin: 0 0 8px; font: 500 11px var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.st-pane__meta:empty { display: none; }
.st-pane__meta b { color: var(--redline); }
.st-field { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 4px 8px; margin-bottom: 4px; }
.st-field > span { color: var(--ink-2); }
.st-field input:not([type="checkbox"]), .st-field select { width: 100%; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; min-width: 0; }
.st-field input[type="checkbox"] { justify-self: start; }
.st-type { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 0 0 6px; }
.st-muted + .st-type, .st-field + .st-type { margin-top: 12px; }
.st-muted, .st-small { color: var(--ink-2); font-size: 12px; margin: 6px 0 0; }
.st-h { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 10px 0 4px; }
.st-h:first-child { margin-top: 0; }
/* An assembly's layers in order, each with its roles */
.st-asm { list-style: decimal; margin: 0 0 6px; padding-left: 20px; font-size: 12px; color: var(--ink-2); }
.st-asm li { margin: 0 0 4px; overflow-wrap: anywhere; }
.st-asm-name { display: block; }
.st-asm-roles { display: block; font: 500 10px var(--mono); color: var(--ink-3); }
.st-row { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; text-align: left; background: transparent; border: 0; padding: 3px 6px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; }
.st-row:hover { background: var(--paper-2); }
.st-row[aria-current="true"], .st-row[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.st-row small { flex: none; margin-left: auto; font: 400 10px var(--mono); opacity: .7; overflow-wrap: normal; white-space: nowrap; }
.st-row--child { padding-left: 22px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.st-chips .st-row { width: auto; border: 1px solid var(--line); }
.st-tree summary { cursor: pointer; padding: 3px 2px; overflow-wrap: anywhere; }
.st-finding { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-left: 3px solid var(--line); padding: 5px 8px; margin-bottom: 6px; cursor: pointer; }
.st-finding:hover { background: var(--paper-2); }
.st-finding[data-sev="error"] { border-left-color: var(--redline); }
.st-finding[data-sev="warning"] { border-left-color: #d98e00; }
/* Not judged: Studio measured or assumed it and cannot judge it. Marked so it is never read as a note. */
.st-finding[data-sev="review"] { border-left: 3px double #5b3fa8; background: #f4f0fb; }
.st-finding[data-sev="review"]:hover { background: #ebe4f8; }
.st-tag { display: inline-block; margin: 0 6px 2px 0; padding: 0 5px; border-radius: 3px; background: #5b3fa8; color: #fff; font: 600 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.st-unjudged { color: #5b3fa8; font-weight: 600; }
.st-open { margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }
.st-start { margin: 0 0 10px; padding: 8px 8px 2px; border: 1px solid var(--ink); border-radius: 4px; }
.st-start .st-sev { margin-top: 0; }
.st-start .st-finding { font-weight: 600; }
.st-sev { margin: 12px 0 0; font: 600 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.st-sev[data-sev="review"] { color: #5b3fa8; }
.st-sev[data-sev="error"] { color: var(--redline); }
.st-sev-about { margin: 2px 0 6px; }
.st-area { margin: 10px 0 0; font: 600 12px var(--sans, inherit); color: #5b3fa8; }
.st-area[data-area="structure"] { border-left: 3px solid #5b3fa8; padding-left: 6px; }
.st-finding { overflow-wrap: anywhere; }
.st-finding cite { display: block; font: 400 10px var(--mono); color: var(--ink-3); font-style: normal; margin-top: 2px; }
.st-finding em { display: block; color: var(--ink-2); font-style: normal; margin-top: 2px; }
.st-verify { margin: 0 0 8px; padding: 6px 8px; background: var(--paper-2); border-radius: 4px; }
.st-tray a { color: inherit; overflow-wrap: anywhere; }
.st-req { border-left: 3px solid #d98e00; padding: 4px 8px 6px; margin-bottom: 10px; }
.st-req[data-status="supplied"] { border-left-color: var(--line); }
.st-req[data-status="unused"] { border-left-color: var(--paper-2); opacity: .8; }
.st-req p { margin: 0; }
.st-req__title { font-weight: 600; }
.st-req__key { font: 400 10px var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.st-req__supplied { margin-top: 4px !important; font-family: var(--mono); }
.st-req__supplied small { font-family: var(--sans); color: var(--ink-2); }
.st-req__how { margin: 4px 0; }
.st-req__how summary { cursor: pointer; font-size: 12px; color: var(--ink-2); }
.st-req__steps { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); }
.st-req__form { margin-top: 6px; }
.st-req__value { display: flex; align-items: center; gap: 6px; min-width: 0; }
.st-req__value input, .st-req__value select { flex: 1; }
.st-req__unit { font: 400 11px var(--mono); color: var(--ink-2); }
.st-req__buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px !important; }
.st-req__group { margin: 8px 0 4px !important; font-weight: 600; color: var(--ink-2); }
.st-req__form textarea { width: 100%; box-sizing: border-box; font: 400 11px var(--mono); }
.st-codetable { max-width: 100%; overflow-x: auto; margin: 4px 0; }
.st-codetable table { border-collapse: collapse; font: 400 11px var(--mono); }
.st-codetable th, .st-codetable td { border: 1px solid var(--line); padding: 1px 5px; text-align: left; white-space: nowrap; }
.st-codetable th { font-weight: 600; background: var(--paper-2); }
/* materials (bill of materials) */
.st-bom__totals { border-left: 3px solid #5b3fa8; padding: 2px 8px 6px; margin: 8px 0; }
.st-bom__totals p { margin: 0 0 2px; }
.st-bom__stage { border-top: 1px solid var(--paper-2); }
.st-bom__stage > summary { cursor: pointer; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; padding: 5px 0; font-weight: 600; }
.st-bom__sum { font: 400 11px var(--mono); color: var(--ink-2); }
.st-bom__line { border-left: 3px solid var(--line); padding: 3px 0 6px 8px; margin: 0 0 8px; min-width: 0; }
.st-bom__line[data-priced="false"] { border-left-color: #d98e00; }
.st-bom__line[data-firm="placeholder"] { border-left-color: #5b3fa8; }
.st-bom__line[data-firm="allowance"] { border-left-style: dotted; }
.st-bom__line p { margin: 0; overflow-wrap: anywhere; }
.st-bom__item { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; }
.st-bom__order { font: 500 12px var(--mono); white-space: nowrap; }
.st-bom__fields { display: flex; flex-wrap: wrap; align-items: end; gap: 4px 8px; margin: 4px 0 6px !important; }
.st-bom__field { display: grid; gap: 1px; font-size: 11px; color: var(--ink-2); }
.st-bom__field input { width: 86px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: 400 12px var(--mono); }
.st-bom__amount { margin-left: auto; font: 500 12px var(--mono); }
.st-table { width: 100%; border-collapse: collapse; }
.st-table td, .st-table th { text-align: left; padding: 2px 4px; border-bottom: 1px solid var(--paper-2); font-weight: 400; }
.st-table td:not(:first-child), .st-table th:not(:first-child) { text-align: right; font-family: var(--mono); font-size: 11px; }
.st-table th { color: var(--ink-3); font-size: 11px; }
/* Site panel */
.st-kv { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 3px 8px; margin: 8px 0 0; font-size: 12px; }
.st-kv:first-child { margin-top: 0; }
.st-kv dt { color: var(--ink-2); }
.st-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.st-first { margin-top: 0; }
.st-site-note { margin-top: 2px; }
.st-site-lines { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--paper-2); }
.st-site-lines li { padding: 4px 0; border-bottom: 1px solid var(--paper-2); }
.st-site-line__name { display: block; font-size: 12px; font-weight: 500; }
.st-site-line__nums { display: flex; flex-wrap: wrap; gap: 0 10px; font: 400 11px var(--mono); color: var(--ink-2); }
.st-site-line__item { max-width: 100%; overflow-wrap: anywhere; }
.st-site-flag { color: var(--redline); font-weight: 600; }
.st-link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font: inherit; }
.st-site-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
/* When the editor does not start (boot-check.js). */
.st-boot-fail { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 50; width: min(440px, calc(100% - 32px)); background: var(--card); color: var(--ink); border: 1px solid var(--ink); border-radius: 8px; padding: 14px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15); font-size: 14px; }
.st-boot-fail p { margin: 0 0 8px; }
.st-boot-fail__h { font-weight: 600; font-size: 16px; }
.st-boot-fail__detail { font: 400 11px var(--mono); color: var(--ink-2); overflow-wrap: anywhere; margin-bottom: 0 !important; }

/* status bar: one quiet line. The hint and the measurements box show while a tool uses them. */
.st-statusbar { grid-area: status; display: flex; align-items: center; gap: var(--s3); min-height: 26px; padding: 2px 10px; background: var(--paper-2); border-top: 1px solid var(--line); min-width: 0; font-size: 12px; }
.st-keys { font: 500 12px var(--mono); min-width: 22px; color: var(--redline); }
.st-keys:empty { display: none; }
.st-hint { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.st-disclosure { margin-left: auto; color: var(--ink-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1000 auto; min-width: min(100%, 11em); }
.st-vcb { display: flex; align-items: center; gap: 6px; flex: none; color: var(--ink-2); }
.st-vcb input { width: 130px; padding: 1px 6px; border: 1px solid var(--ink-3); border-radius: 4px; background: #fff; color: var(--ink); font-family: var(--mono); }
.st-vcb input[data-typing="true"] { background: #fffbe0; }
.st-statusbar[data-vcb="false"] .st-vcb { display: none; }

/* Read-only (account.js): a banner under the header says why; the tools that change the model
   are disabled, the panels' fields too, and the forms and buttons that only edit are left out. */
.st-access { grid-area: access; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 6px var(--s3); background: var(--paper-2); border-bottom: 1px solid var(--ink); font-size: 13px; line-height: 1.4; min-width: 0; }
.st-access[hidden] { display: none; }
.st-access__words { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.st-access__do { display: flex; gap: 12px; flex: none; }
.st-access a.st-link { color: var(--ink); }
@media (max-width: 760px) { .st-access__detail { display: none; } .st-access__words { flex-basis: auto; } }
.st-tool:disabled { opacity: .3; cursor: not-allowed; background: transparent; border-color: transparent; }
.st[data-readonly="true"] [data-edit], .st[data-readonly="true"] .st-req__form, .st[data-readonly="true"] .st-req__how { display: none; }
.st[data-readonly="true"] .st-tray input:disabled, .st[data-readonly="true"] .st-tray select:disabled { background: var(--paper); color: var(--ink); opacity: 1; border-color: transparent; }
.st-name:read-only { cursor: default; }
.st-name:read-only:hover, .st-name:read-only:focus { border-color: transparent; }

/* No access, or no project at this link: a page of its own over the editor. */
.st-gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--paper); overflow: auto; }
.st-gate[hidden] { display: none; }
.st-gate__card { width: min(480px, 100%); border: 1px solid var(--ink); border-radius: var(--r-card); background: var(--card); padding: var(--s5); font-size: 15px; }
.st-gate__card h1 { margin: 0 0 8px; font: 500 24px/1.2 var(--sans); letter-spacing: -.01em; }
.st-gate__card p { margin: 0 0 12px; }
.st-gate__do { display: flex; flex-wrap: wrap; gap: 8px; }
.st-gate .st-btn { color: var(--ink); text-decoration: none; padding: 8px 14px; }
.st-gate .st-btn--ink { color: var(--paper); }

/* connect dialog */
.st-dialog { border: 1px solid var(--ink); border-radius: var(--r-card); padding: var(--s5); max-width: min(560px, 92vw); background: var(--card); color: var(--ink); font-size: 14px; }
.st-dialog::backdrop { background: rgba(18, 18, 17, .5); }
.st-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.st-dialog .st-btn { color: var(--ink); }
.st-code { display: flex; gap: 8px; align-items: flex-start; background: var(--night); color: var(--on-night); padding: 10px; border-radius: 8px; }
.st-code code { font: 400 12px var(--mono); word-break: break-all; flex: 1; }
.st-code .st-btn { color: var(--on-night); flex: none; }
.st-steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 10px; }
.st-steps .st-code { margin-top: 6px; }
.st-dialog > form[method="dialog"] { margin-top: 12px; }

/* share dialog and the export links */
.st-msg { margin: 6px 0 0; font-size: 13px; }
.st-msg:empty { display: none; }
.st-msg[data-tone="bad"] { color: var(--redline); }
.st-members { list-style: none; margin: 6px 0 4px; padding: 0; border-top: 1px solid var(--line); }
.st-member { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-member__who { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.st-member__who small { display: block; color: var(--ink-2); font-size: 12px; }
.st-member__email { font-family: var(--mono); font-size: 12px; }
.st-member__end { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.st-member__role { font: 500 11px var(--mono); padding: 2px 8px; border: 1px solid currentColor; border-radius: var(--r-pill); flex: none; }
.st-dialog .st-btn--ink { color: var(--paper); }
.st-share__add { display: flex; flex-wrap: wrap; gap: 6px; }
.st-share__add input { flex: 1 1 200px; min-width: 0; padding: 5px 8px; border: 1px solid var(--ink-3); border-radius: 6px; background: #fff; }
.st-share__add select { padding: 5px 6px; border: 1px solid var(--ink-3); border-radius: 6px; background: #fff; max-width: 100%; }
.st-linkbox { margin-top: 10px; }
.st-linkbox .st-small { margin: 0 0 4px; }
.st-links { margin: 8px 0; }

/* A header with less room: the mode switch and units are in the More menu (tray.js moves them), and the view options are one row that scrolls. */
/* Room for all six tabs where the screen is wide. */
@media (min-width: 1280px) {
  .st-tray { width: clamp(280px, var(--st-tray-w, 420px), calc(100vw - 340px)); }
}
@media (max-width: 1000px) {
  .st-options { flex-wrap: nowrap; overflow-x: auto; }
  .st-options > * { flex: none; }
  .st-options__spacer { display: none; }
  .st-tray { width: clamp(280px, var(--st-tray-w, 300px), calc(100vw - 340px)); }
}
/* Narrower still: Export and Connect are in the menu too, and the connection is a dot. */
@media (max-width: 760px) {
  .st-top { padding: 6px 10px; }
  .st-logo span { display: none; }
  .st-name { flex: 1 1 80px; }
  .st-status { width: 10px; height: 10px; padding: 0; overflow: hidden; font-size: 0; color: transparent; background: #8a877f; }
  .st-status[data-on="true"] { background: #6fd66f; color: transparent; }
}

/* A phone held upright: the view gets the screen, and the panels are a sheet under it. */
@media (max-width: 760px) and (orientation: portrait) {
  .st, .st[data-mode="revit"] { grid-template: "top" auto "access" auto "tools" auto "stage" minmax(0, 1fr) "tray" auto "status" auto / minmax(0, 1fr); }
  .st-tools, .st[data-mode="revit"] .st-tools { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 4px 6px; }
  .st-tools__sep, .st[data-mode="revit"] .st-tools__sep { width: 1px; height: 24px; margin: 0 4px; }
  .st-tray, .st[data-mode="revit"] .st-tray, .st[data-tray="closed"] .st-tray { display: flex; width: auto; border: 0; border-top: 1px solid var(--ink-3); }
  .st-tray__resize { display: none; }
  .st-tabsbar { display: grid; grid-template: "grab grab" 14px "tabs toggle" 44px / minmax(0, 1fr) 44px; touch-action: pan-x; }
  .st-tray__grab { grid-area: grab; display: block; padding: 0; border: 0; background: transparent; cursor: grab; touch-action: none; }
  .st-tray__grab span { display: block; width: 40px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--ink-3); }
  .st-tabs { touch-action: pan-x; }
  .st-tab { height: 44px; padding: 0 12px; font-size: 14px; }
  .st-tray__toggle { width: 44px; }
  .st-tray__toggle svg, .st[data-mode="revit"] .st-tray__toggle svg { transform: rotate(90deg); }
  .st[data-tray="closed"] .st-tray__toggle svg { transform: rotate(-90deg); }
  .st[data-tray="closed"] .st-tabsbar { border-bottom: 0; }
  .st-tray__body { flex: none; height: clamp(120px, var(--st-sheet-h, 46dvh), calc(100dvh - 390px)); }
  .st[data-tray="closed"] .st-tray__body { display: none; }
  .st[data-sheet-drag] .st-tray__body { height: clamp(0px, var(--st-sheet-h), calc(100dvh - 390px)); }
  /* Two lines only while a tool has something to say; the disclosure keeps a line of its own. */
  .st-statusbar { flex-wrap: wrap; gap: 2px 8px; min-height: 22px; }
  .st-statusbar[data-hint="idle"] .st-hint { display: none; }
  .st-hint { flex: 1 1 0; font-size: 11px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .st-disclosure { order: 5; flex: 1 1 100%; margin-left: 0; }
  .st-vcb input { width: 96px; }
  .st-toast { bottom: 10px; max-width: calc(100% - 20px); width: max-content; text-align: center; border-radius: 14px; }
}

/* Fingers: no keyboard letters, targets of 40 px and up, and type that does not make a phone zoom in on focus. */
@media (pointer: coarse) {
  .st-tool__key { display: none; }
  .st-tool { width: 46px; height: 44px; }
  .st[data-mode="revit"] .st-tool { min-width: 62px; height: 52px; }
  .st-btn, .st-seg button, .st-row, .st-finding, .st-tree summary, .st-req__how summary, .st-bom__stage > summary { min-height: 40px; }
  .st-tree summary, .st-req__how summary { display: flex; align-items: center; }
  .st-tree summary::before { content: "\25B8"; margin-right: 6px; }
  .st-tree[open] > summary::before { content: "\25BE"; }
  .st-more__btn, .st-chips .st-row, .st-tab { min-width: 44px; justify-content: center; }
  .st-logo { min-width: 40px; min-height: 40px; }
  .st-options { padding: 4px 8px; }
  .st-options .st-btn { padding: 2px 12px; }
  .st-options select { min-height: 40px; }
  .st input:not([type="checkbox"]), .st select, .st textarea { font-size: 16px; min-height: 40px; }
  .st input[type="checkbox"] { width: 22px; height: 22px; }
  .st-name { min-height: 40px; }
  .st-bom__field input { width: 104px; }
  .st-link { padding: 10px 0; margin: -10px 0; }
  .st-tab { height: 44px; }
  .st-tray__toggle { width: 44px; }
  .st-tray__resize { width: 16px; left: -8px; }
  .st[data-mode="revit"] .st-tray__resize { right: -8px; }
}
