:root {
  color-scheme: dark;
  --ink: #e6e9ed;
  --muted: #89919c;
  --dim: #5d6570;
  --void: #101318;
  --base: #15191f;
  --panel: #1a1f26;
  --line: #2b323d;
  --line-hot: #414b58;
  --blue: #55a9e8;
  --green: #89c454;
  --yellow: #f1c44c;
  --red: #e4665f;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --sans: "Manrope", "Avenir Next", sans-serif;
  /* Editor gets a third of what the objects pane leaves, the viewport two thirds.
     Dragging the splitter overrides it with a pixel width on <html>. */
  --editor-share: calc((100% - var(--objects-width) - 4px) / 3);
  --console-height: 174px;
  --objects-width: 224px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--void); color: var(--ink); font-family: var(--sans); font-size: 12px; }
button, select, textarea { font: inherit; }
button { color: inherit; }

/* header, toolbar, read-only banner, workspace, status bar.
   Every child names its own row rather than relying on source order, because a
   `display: none` grid item is not laid out at all: while the banner is hidden
   the auto-placer would shift the workspace and the status bar up a row each,
   handing the workspace the banner's `auto` and the status bar the `1fr`. */
.app-shell { display: grid; grid-template-rows: 42px 50px auto 1fr 25px; height: 100vh; background: var(--base); }
.app-shell > .app-header { grid-row: 1; }
.app-shell > .toolbar { grid-row: 2; }
.app-shell > .readonly-banner { grid-row: 3; }
.app-shell > .workspace { grid-row: 4; }
.app-shell > .status-bar { grid-row: 5; }
.app-header { display: flex; align-items: center; border-bottom: 1px solid #090b0e; background: #12161b; padding: 0 12px; user-select: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 264px; font-weight: 700; letter-spacing: -.2px; }
.brand img { display: block; width: 21px; height: 21px; filter: saturate(.85); }
/* The brand is the way home: it leads to the landing page and its workspace list. */
.brand-home { display: flex; align-items: center; gap: 8px; border-radius: 3px; color: inherit; text-decoration: none; transition: opacity .15s; }
.brand-home:hover { opacity: .82; }
.brand-home:focus-visible { outline: 1px solid var(--blue); outline-offset: 3px; }
.brand-credit { align-self: center; padding-left: 10px; border-left: 1px solid #262d36; color: #4c545e; font: 400 8px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transform: translateY(.75px); transition: color .15s, border-color .15s; }
.brand-credit:hover { color: var(--muted); border-color: #37404b; }
.brand-credit:focus-visible { outline: 1px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
.workspace-identity { display: flex; align-self: stretch; align-items: center; gap: 10px; min-width: 0; margin-left: auto; }
/* Points up at the address bar: the URL is the design's only key. The text shares
   the header's centre line; the arrow is lifted on its own so it climbs toward the
   browser chrome while keeping clear of the header's top edge. */
.url-hint { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; margin: 0; line-height: 12px; color: #6b7581; font: 9px var(--mono); letter-spacing: .02em; cursor: default; }
.url-hint span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.url-hint svg { flex: none; width: 26px; height: 20px; transform: translateY(-3px); fill: none; stroke: #8792a0; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
body.read-only .url-hint { display: none; }
.sync-state { min-width: 48px; color: #69737e; font: 8px var(--mono); text-align: right; transform: translateY(.25px); text-transform: uppercase; letter-spacing: .08em; }
.sync-state[data-state="synced"] { color: var(--green); }.sync-state[data-state="saving"] { color: var(--yellow); }.sync-state[data-state="error"] { color: var(--red); }
.workspace-conflict-resolver { position: fixed; z-index: 30; width: 260px; border: 1px solid #72564a; border-radius: 4px; background: #211c1b; box-shadow: 0 14px 40px rgba(0,0,0,.5); padding: 12px; color: #d9d3cf; }.workspace-conflict-resolver b { font-size: 10px; }.workspace-conflict-resolver p { margin: 5px 0 12px; color: #9b8d87; font-size: 9px; line-height: 1.45; }.workspace-conflict-resolver div { display: flex; justify-content: flex-end; gap: 6px; }.workspace-conflict-resolver button { border: 1px solid #51443f; border-radius: 3px; background: #2c2522; color: #bdb3ad; padding: 6px 9px; cursor: pointer; font-size: 9px; }.workspace-conflict-resolver button[data-resolution="restore"] { border-color: #7d6332; color: #e2c368; }
.engine-pill { flex: none; margin-left: auto; height: 21px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 20px; padding: 0 9px; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.engine-pill[hidden] { display: none; }
.engine-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 8px color-mix(in srgb, var(--yellow), transparent 30%); }
.engine-pill.offline span { background: var(--red); }

.toolbar { display: flex; align-items: center; gap: 5px; background: linear-gradient(#20262e, #1a1f26); border-bottom: 1px solid #090b0e; box-shadow: 0 1px 0 #29303a inset; padding: 6px 10px; user-select: none; }
.tool-group { display: flex; gap: 2px; }
.tool-divider { height: 26px; width: 1px; background: #0d1014; border-right: 1px solid #303843; margin: 0 6px; }
.tool-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #aeb7c2; cursor: pointer; }
.tool-button:hover:not(:disabled) { background: #2b333d; border-color: #3a4551; color: #fff; }
.tool-button:active:not(:disabled) { transform: translateY(1px); background: #151a20; }
.tool-button:disabled { opacity: .32; cursor: default; }
.tool-button svg, [data-icon] svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.tool-button.primary { color: var(--blue); }
.tool-button.render { color: var(--green); }
.toolbar-spacer { flex: 1; }
.export-button { height: 32px; display: flex; align-items: center; gap: 8px; border: 1px solid #b78c24; border-radius: 4px; background: linear-gradient(#edc451, #d7a936); color: #211b0e; padding: 0 8px 0 10px; font-weight: 700; cursor: pointer; box-shadow: 0 1px #ffe080 inset; }
.export-button:hover { filter: brightness(1.06); }
.export-button svg { width: 15px; height: 15px; }
.export-button kbd { border-left: 1px solid #9d7920; padding-left: 8px; font: 9px var(--mono); }
.export-toast { position: fixed; z-index: 50; left: 50%; bottom: 40px; transform: translateX(-50%); width: max-content; max-width: min(440px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; border: 1px solid #36404b; border-left: 3px solid var(--blue); border-radius: 4px; background: #1a2027; color: #d6dbe1; padding: 8px 8px 8px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.45); font-size: 12px; }
.export-toast[hidden] { display: none; }
.export-toast[data-tone="success"] { border-left-color: #5fb36a; }
.export-toast[data-tone="warning"] { border-left-color: #d7a936; }
.export-toast[data-tone="error"] { border-left-color: #e0645a; }
.export-toast-message { min-width: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.export-toast-retry { flex: none; height: 28px; border: 1px solid #b78c24; border-radius: 4px; background: #d7a936; color: #211b0e; padding: 0 10px; font-weight: 700; cursor: pointer; }
.export-toast-retry[hidden] { display: none; }
.export-toast-close { flex: none; width: 28px; height: 28px; border: 0; border-radius: 4px; background: none; color: #909aa5; font-size: 16px; cursor: pointer; }
.export-toast-close:hover { color: #fff; background: #2a323c; }

.workspace { min-height: 0; display: grid; grid-template-columns: var(--objects-width) minmax(280px, var(--editor-share)) 4px minmax(320px, 1fr) auto; grid-template-rows: minmax(200px, 1fr) var(--console-height); overflow: hidden; }
.editor-pane, .viewer-pane, .customizer, .console-pane { min-width: 0; min-height: 0; background: var(--panel); }
.objects-pane { grid-column: 1; grid-row: 1 / 3; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(96px, 1fr) auto; background: #12171c; border-right: 1px solid #090c0f; box-shadow: 1px 0 #29313a inset; }
.editor-pane { grid-column: 2; grid-row: 1; }
.viewer-pane { grid-column: 4; grid-row: 1; display: flex; flex-direction: column; container-type: inline-size; container-name: viewer; }
.customizer { grid-column: 5; grid-row: 1 / 3; width: 254px; border-left: 1px solid #0b0d11; transition: width .18s ease, opacity .18s ease; }
.customizer.closed { width: 0; opacity: 0; overflow: hidden; }
.customizer[hidden], .pane-action[hidden] { display: none; }
.splitter.vertical { grid-column: 3; grid-row: 1; background: #0d1014; border-left: 1px solid #313944; cursor: col-resize; z-index: 4; }
.splitter.vertical:hover, .splitter.dragging { background: var(--blue); }
.console-pane { grid-column: 2 / 5; grid-row: 2; border-top: 1px solid #080a0d; }
.console-pane.collapsed { --collapsed: 30px; align-self: end; height: var(--collapsed); }

.pane-header { height: 34px; display: flex; align-items: center; background: #171b21; border-bottom: 1px solid #080a0d; box-shadow: 0 1px #272e37 inset; user-select: none; }
.ai-revision-badge { height: 23px; display: flex; align-items: center; gap: 6px; border: 1px solid #615332; border-radius: 2px; background: linear-gradient(90deg, rgba(241,196,76,.13), rgba(241,196,76,.04)); color: #e3c76e; padding: 0 4px 0 8px; font: 8px var(--mono); letter-spacing: .03em; animation: aiBadgeIn .36s ease both; }
.ai-revision-badge[hidden] { display: none; }.ai-revision-badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 9px var(--yellow); animation: blink 1.3s infinite; }.ai-revision-badge button { border: 0; background: transparent; color: #9e8b50; cursor: pointer; font-size: 15px; padding: 0 3px; }.ai-revision-badge button:hover { color: #fff; }
.pane-action { margin-left: auto; margin-right: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 10px var(--mono); }
.pane-action:hover { color: #fff; }

.editor-wrap { position: relative; height: 100%; overflow: hidden; background: #15191f; }
.editor-overlay { position: absolute; top: 7px; right: 13px; z-index: 4; display: flex; align-items: center; gap: 7px; pointer-events: none; }
.editor-overlay > * { pointer-events: auto; }
#dirtyIndicator { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); opacity: 0; transition: opacity .15s; }
#dirtyIndicator.visible { opacity: 1; }
.line-numbers { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 48px; padding: 16px 10px 24px 0; background: #13171c; border-right: 1px solid #252b34; color: #4f5864; text-align: right; white-space: pre; font: 12px/1.65 var(--mono); pointer-events: none; overflow: hidden; }
.highlight, #codeEditor { position: absolute; inset: 0; margin: 0; padding: 16px 20px 80px 64px; border: 0; white-space: pre; overflow: auto; tab-size: 2; font: 12px/1.65 var(--mono); letter-spacing: .01em; }
.highlight { color: #b9c0c8; pointer-events: none; scrollbar-width: none; }
#codeEditor { z-index: 2; resize: none; outline: none; background: transparent; color: transparent; caret-color: #fff; -webkit-text-fill-color: transparent; }
#codeEditor::selection { background: rgba(66, 123, 164, .65); -webkit-text-fill-color: transparent; }
.tok-comment { color: #596d5d; font-style: italic; }
.tok-string { color: #d9a873; }
.tok-number { color: #b6a0d9; }
.tok-keyword { color: #72a9da; font-weight: 600; }
.tok-builtin { color: #89c454; }
/* A change the AI made: a translucent wash with a left rule on every line it
   spans (clone), light enough that the syntax colours stay readable through it.
   Comments are the dimmest token, so inside a change they are lifted to keep
   their contrast on the yellow wash. */
.ai-code-change { color: inherit; background: rgba(241,196,76,.13); box-shadow: -3px 0 0 rgba(241,196,76,.7), inset 0 -1px rgba(241,196,76,.45); -webkit-box-decoration-break: clone; box-decoration-break: clone; animation: sourceGlow 1.5s ease-in-out 2; }
.ai-code-change .tok-comment { color: #a9b89d; }
/* While the "AI revised source" badge shows, the text starts one row lower so a
   long first line is never hidden underneath it. */
.editor-wrap.ai-revised .highlight, .editor-wrap.ai-revised #codeEditor, .editor-wrap.ai-revised .line-numbers { padding-top: 38px; }
/* The overlay text has no scrollbar of its own; the textarea's must be visible,
   or a long line simply ends at the pane edge with no hint that there is more. */
#codeEditor { scrollbar-width: thin; scrollbar-color: #3a434e transparent; }

/* An empty workspace is just an empty editor: a quiet hint, nothing over it. */
#codeEditor::placeholder { color: #4f5863; -webkit-text-fill-color: #4f5863; font-style: italic; }

/* Examples live on the landing page. Grouped, because twelve unlabelled cards
   is a wall; each group is a heading plus its own auto-filling row, so the set
   reflows from one column to three without breakpoint arithmetic. */
.example-catalogue { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.example-group { min-width: 0; }
.example-group > h3 { margin: 0; color: #cfd6de; font-size: 12px; letter-spacing: -.01em; }
.example-group > p { margin: 2px 0 10px; color: var(--dim); font-size: 11px; }
/* `auto-fill`, not `auto-fit`: auto-fit collapses the empty tracks, so a group
   of one would stretch across the row — and with a fixed-aspect thumbnail a
   full-width card is also a very tall one. */
.example-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
/* Name, blurb and hint each reserve the lines they usually take, so cards in
   different groups (and rows) come out the same height. */
.example-card { display: grid; grid-template-rows: auto 1fr auto; gap: 4px; border: 1px solid #262d36; border-radius: 4px; background: rgba(26,31,38,.88); color: inherit; padding: 7px 8px 9px; text-align: left; font: inherit; cursor: pointer; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.example-card:hover { border-color: #4e6a86; background: rgba(32,39,48,.95); transform: translateY(-1px); }
/* Name and blurb share one block that reserves room for a two-line name and a
   three-line blurb, so cards in every group come out the same height while the
   name keeps its natural distance to the blurb. */
.example-copy { display: grid; align-content: start; gap: 4px; min-height: calc(2 * 1.25 * 12px + 3 * 1.45 * 10px + 4px); }
.example-card b { color: #e2e7ec; font-size: 12px; line-height: 1.25; letter-spacing: -.01em; }
.example-card small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.example-card code { min-height: 2.9em; align-self: end; color: #7f9a6a; font: 9px/1.45 var(--mono); letter-spacing: .02em; }
.example-card code span { white-space: nowrap; }
/* A fixed aspect box, so a row's cards line up whatever each render's own
   proportions are, and the grid does not reflow as the images arrive. */
.example-shot { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 3px; border-radius: 3px; background: #151a21 repeating-linear-gradient(45deg, rgba(255,255,255,.014) 0 6px, transparent 6px 12px); overflow: hidden; }
/* Absolutely placed, so the image is sized by the 4:3 box and never sizes it:
   a percentage height against an aspect-ratio box let tall renders overflow
   and be cropped. */
.example-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; }
/* A missing image leaves the quiet placeholder, not a broken-image glyph. */
.example-shot img[data-failed] { display: none; }
.example-card[aria-busy="true"] { opacity: .6; cursor: progress; }
.example-empty { margin: 0; color: var(--dim); font-size: 11px; }
/* Anchored to the X it came from, and sized for the sentence rather than for
   the button: that sentence is the only thing that distinguishes "forget this
   link" from "delete my model". */
.forget-prompt { position: fixed; z-index: 45; width: 210px; border: 1px solid #39424d; border-radius: 4px; background: #20262e; padding: 10px; box-shadow: 0 13px 38px rgba(0,0,0,.45); animation: arrive .14s ease both; }
.forget-prompt p { margin: 0 0 9px; color: #c7cdd4; font-size: 10px; line-height: 1.5; }
.forget-prompt div { display: flex; gap: 6px; }
.forget-prompt button { flex: 1; border: 1px solid #39424d; border-radius: 3px; background: #2a323c; color: #dee3e9; padding: 5px 0; font: 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.forget-prompt button:hover { border-color: #4e6a86; background: #323b46; }
.forget-prompt [data-forget-confirm] { border-color: #6b3b41; background: #3a2226; color: #f0b6ba; }
.forget-prompt [data-forget-confirm]:hover { border-color: #8d4d55; background: #4a2a2f; }
.forget-prompt button:focus-visible { outline: 1px solid var(--blue); outline-offset: 1px; }

/* Wraps onto a second row when the pane is narrow instead of pushing the toggles
   and the customizer button off its right edge. */
.viewport-header { flex: none; height: auto; min-height: 34px; flex-wrap: wrap; justify-content: space-between; column-gap: 8px; padding: 0 8px; }
.viewport-header .view-mode { height: 34px; }
.view-mode { height: 100%; display: flex; align-items: center; gap: 3px; }
.view-mode button, .console-tabs button { height: 100%; padding: 0 9px; border: 0; background: transparent; color: var(--dim); font-size: 9px; cursor: pointer; }
.view-mode button.active, .console-tabs button.active { color: #dfe3e7; position: relative; }
.view-mode button.active::after, .console-tabs button.active::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 0; height: 2px; background: var(--blue); }
.viewport-options { min-width: 0; min-height: 34px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 12px; margin-left: auto; }
.viewport-options label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; cursor: pointer; }
.viewport-options input { width: 11px; height: 11px; accent-color: var(--blue); }
.viewport-options .pane-action { margin: 0; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 4px; padding: 0; }
/* Both header buttons are toggles: one look for hover and one for "on", driven by aria-pressed. */
.viewport-options .pane-action:hover { background: #222a33; }
.viewport-options .pane-action[aria-pressed="true"] { background: #233447; color: var(--blue); }
.viewport-options .pane-action:focus-visible { outline: 1px solid var(--blue); outline-offset: 1px; }
.viewport-options .pane-action[hidden] { display: none; }
.viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(circle at 48% 42%, #262c33 0, #1e242b 38%, #171b20 78%); }
.viewport::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,.32)); }
/* The ground surface is real scene geometry (MeshViewport.drawGround) at Z=0, so it
   orbits, zooms and scales with the model; there is no faked CSS grid behind the canvas. */
.render-canvas { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; opacity: 1; transition: opacity .25s ease, filter .25s ease; cursor: grab; }
/* Geometry of source that has since been replaced, while its re-render runs. */
.render-canvas.stale { opacity: .45; filter: saturate(.3); }
.ground-labels { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.grid-scale { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; border: 1px solid #303842; border-radius: 4px; background: rgba(24,29,35,.78); color: var(--muted); font: 8px var(--mono); text-transform: uppercase; letter-spacing: .08em; pointer-events: none; }
.grid-scale b { color: #b6c0cb; font: 10px var(--mono); letter-spacing: -.01em; text-transform: none; }
.grid-scale[hidden] { display: none; }
/* Sits directly above the grid readout: both describe the same surface. */
.plate-badge { position: absolute; z-index: 3; left: 12px; bottom: 40px; display: flex; flex-direction: column; gap: 2px; max-width: min(360px, calc(100% - 70px)); padding: 4px 8px; border: 1px solid #303842; border-radius: 4px; background: rgba(24,29,35,.78); font: 8px var(--mono); pointer-events: none; }
.plate-badge b { overflow: hidden; color: #b6c0cb; font: 10px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.plate-badge span { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
/* An oversize model is the one thing the plate exists to reveal, so it shouts. */
.plate-badge[data-fit="over"] { border-color: #6d2f2a; }
.plate-badge[data-fit="over"] span { color: #e8756a; }
.plate-badge[data-fit="fits"] span { color: #6fbf8a; }
.plate-badge[hidden] { display: none; }
.plate-field { min-width: 0; }
.plate-field select { field-sizing: content; max-width: min(100%, 280px); padding: 3px 5px; border: 1px solid #303842; border-radius: 4px; background: #181d23; color: #b6c0cb; font: 9px var(--mono); cursor: pointer; }
.plate-field select:focus-visible { outline: 1px solid var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.render-canvas:active { cursor: grabbing; }
/* A middle- or right-button drag never sets :active, so panning states its own cursor. */
.render-canvas.panning, .render-canvas.panning:active { cursor: grabbing; }
.empty-state { position: absolute; z-index: 2; left: 50%; top: 48%; transform: translate(-50%, -50%); text-align: center; color: var(--muted); animation: arrive .45s ease both; }
.empty-state img { width: 58px; opacity: .28; filter: grayscale(1); }
.empty-state h1 { margin: 12px 0 3px; color: #d3d8dd; font-size: 22px; letter-spacing: -.04em; }
.empty-state p { margin: 0 0 17px; font-size: 10px; }
kbd { font: 9px var(--mono); }
.empty-state button { border: 1px solid #567b36; border-radius: 3px; background: #23311c; color: #9dd36c; padding: 8px 13px; cursor: pointer; }
/* World axes are drawn as real geometry in the WebGL scene (MeshViewport.drawAxes),
   so they orbit and zoom with the model; no screen-space gizmo overlay here. */
.view-hint { position: absolute; z-index: 3; left: 50%; bottom: 13px; transform: translateX(-50%); display: grid; gap: 3px; justify-items: center; color: #4f5964; font: 8px var(--mono); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.view-hint span { color: #78838f; margin-left: 8px; }.view-hint div span:first-child { margin-left: 0; }
/* Below this the hint cannot fit between the grid readout and the zoom cluster,
   and with a plate badge up it would run into that too; the gestures it lists
   are the standard ones anyway. */
@container viewer (max-width: 460px) { .view-hint { display: none; } }
.viewport:has(.plate-badge:not([hidden])) .view-hint { display: none; }
.viewport-fab { position: absolute; z-index: 3; right: 12px; bottom: 12px; display: grid; border: 1px solid #303842; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.viewport-fab button { width: 27px; height: 27px; border: 0; border-bottom: 1px solid #303842; background: #1d232a; color: #909aa5; cursor: pointer; font: 16px var(--mono); }
.viewport-fab button:last-child { border: 0; }.viewport-fab button:hover { color: #fff; background: #2a323c; }.viewport-fab svg { width: 14px; }
/* Section view: one compact floating strip at the top of the viewport, sized in
   itself (clamped to the pane) so it works at any layout width. */
.slicer-panel { position: absolute; z-index: 4; top: 10px; left: 50%; transform: translateX(-50%); width: min(360px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: 1px solid #303842; border-radius: 4px; background: rgba(24,29,35,.88); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.slicer-panel[hidden] { display: none; }
.slicer-axes { flex: none; display: flex; border: 1px solid #303842; border-radius: 3px; overflow: hidden; }
.slicer-axes button { width: 24px; height: 24px; border: 0; border-right: 1px solid #303842; background: #1d232a; color: #909aa5; font: 600 10px var(--mono); cursor: pointer; }
.slicer-axes button:last-child { border-right: 0; }
.slicer-axes button:hover { color: #fff; background: #2a323c; }
.slicer-axes button[data-slice-axis="x"][aria-checked="true"] { color: #fff; background: #7a2f2b; }
.slicer-axes button[data-slice-axis="y"][aria-checked="true"] { color: #fff; background: #3e6a29; }
.slicer-axes button[data-slice-axis="z"][aria-checked="true"] { color: #fff; background: #2b5580; }
.slicer-panel input[type="range"] { flex: 1; min-width: 60px; height: 24px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.slicer-panel output { flex: none; min-width: 7ch; color: #b6c0cb; font: 10px var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.slicer-flip { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #303842; border-radius: 3px; background: #1d232a; color: #909aa5; cursor: pointer; }
.slicer-flip:hover { color: #fff; background: #2a323c; }
.slicer-flip[aria-pressed="true"] { color: var(--blue); border-color: #2b5580; }
.slicer-flip svg { width: 15px; height: 15px; }
.slicer-axes button:focus-visible, .slicer-flip:focus-visible, .slicer-panel input:focus-visible { outline: 1px solid var(--blue); outline-offset: 1px; }
/* Touch: bigger targets, still one row. */
@media (pointer: coarse) {
  .slicer-axes button, .slicer-flip { width: 34px; height: 34px; }
  .slicer-panel input[type="range"] { height: 34px; }
}
.render-overlay { position: absolute; z-index: 6; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(15,18,22,.76); backdrop-filter: blur(3px); }
.render-overlay[hidden] { display: none; }
.render-overlay b { margin-top: 15px; font-size: 11px; }.render-overlay span { margin-top: 4px; color: var(--dim); font: 8px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
/* The elapsed clock is the overlay's proof of life, so it is the one element here that
   reads at a glance. Tabular figures keep the tenths digit from shifting the line as it
   ticks — jitter reads as noise, a steady counter reads as progress. */
.render-overlay #renderElapsed { margin-top: 7px; color: #c6cdd5; font: 12px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .04em; text-transform: none; }
.render-overlay .render-note { max-width: 300px; margin-top: 9px; color: var(--dim); font: 9px/1.6 var(--mono); text-align: center; }
.render-overlay .render-note[hidden] { display: none; }
.overlay-cancel { margin-top: 14px; padding: 6px 14px; border: 1px solid #3a434e; border-radius: 3px; background: #1d232b; color: #c6cdd5; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .1em; cursor: pointer; }
.overlay-cancel:hover { border-color: var(--red); color: var(--red); }
.overlay-cancel:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* Failure panel. It sits under the render overlay in the stack (z 5 vs 6) so a
   retry's spinner covers it, and it is only as wide as the message needs — the
   viewport behind it stays orbitable while the user decides what to do. */
.render-failure { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 28px)); display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 18px 20px 15px; border: 1px solid #6d2f2a; border-radius: 5px; background: rgba(26,20,20,.96); box-shadow: 0 12px 34px rgba(0,0,0,.45); text-align: center; animation: arrive .25s ease both; }
.render-failure[hidden] { display: none; }
.render-failure i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #3a201d; color: #e8756a; font: 12px var(--mono); font-style: normal; }
.render-failure b { color: #f0d8d5; font-size: 13px; letter-spacing: -.02em; }
.render-failure p { margin: 0; max-width: 100%; max-height: 92px; overflow: auto; color: #c2a9a6; font: 9px/1.6 var(--mono); overflow-wrap: anywhere; }
.render-failure small { color: var(--dim); font: 8px/1.5 var(--mono); }
.render-failure-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 2px; }
.render-failure-actions button { padding: 6px 12px; border-radius: 3px; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .1em; cursor: pointer; }
.failure-report { border: 1px solid #7c3a33; background: #35211e; color: #f0b3ac; }
.failure-report:hover { border-color: var(--red); color: #fff; }
.failure-ghost { border: 1px solid #3a434e; background: #1d232b; color: #c6cdd5; }
.failure-ghost:hover { border-color: #566270; color: #fff; }
.render-failure-actions button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.render-failure-actions button.copied { border-color: #567b36; color: #9dd36c; }

.spinner { display: flex; gap: 4px; }.spinner i { width: 5px; height: 21px; background: var(--green); animation: pulse .8s ease-in-out infinite; }.spinner i:nth-child(2) { animation-delay: .12s; }.spinner i:nth-child(3) { animation-delay: .24s; }

.customizer .pane-header { padding-left: 12px; color: #b9c0c8; font-size: 10px; }.customizer .pane-header button { margin-left: auto; border: 0; background: transparent; color: var(--dim); font-size: 18px; cursor: pointer; padding: 7px 11px; }
.customizer-body { padding: 13px 12px; height: calc(100% - 34px); overflow: auto; background: #161b21; }
.customizer-empty { margin: 10px; padding: 24px 14px; border: 1px dashed #303842; text-align: center; color: var(--dim); }.customizer-empty span { color: #6e7884; font: 20px var(--mono); }.customizer-empty p { line-height: 1.5; font-size: 9px; }
.custom-field { padding: 8px 0 11px; border-bottom: 1px solid #292f38; }.custom-field label { display: flex; justify-content: space-between; color: #abb3bd; font: 9px var(--mono); margin-bottom: 7px; }.custom-field input[type="range"] { width: 100%; accent-color: var(--yellow); }.custom-field input[type="number"] { width: 64px; border: 1px solid var(--line); background: #101419; color: #d6dce2; padding: 4px 5px; font: 10px var(--mono); }

.console-header { padding: 0 8px 0 2px; }.console-tabs { height: 100%; display: flex; }.console-tabs span { min-width: 14px; display: inline-grid; place-items: center; border-radius: 9px; background: #303843; margin-left: 4px; font-size: 8px; }.console-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }.console-actions button { border: 0; background: transparent; color: var(--dim); font-size: 9px; cursor: pointer; }.console-output { height: calc(100% - 34px); overflow: auto; padding: 10px 13px; background: #11151a; font: 10px/1.6 var(--mono); white-space: pre-wrap; }.console-output > div { display: grid; grid-template-columns: 69px 1fr; }.console-output .timestamp { color: #46505b; margin-right: 12px; }.console-output .info { color: #91a0ae; }.console-output .success { color: var(--green); }.console-output .error { color: #ec7f78; }.console-output .warning { color: var(--yellow); }

.status-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 9px; border-top: 1px solid #28303a; background: #171c22; color: #717b86; font: 9px var(--mono); user-select: none; }.status-bar > div { display: flex; align-items: center; gap: 7px; }.status-ready { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }.status-ready.busy { background: var(--yellow); animation: blink 1s infinite; }.status-ready.error { background: var(--red); }.status-right { gap: 17px !important; }
/* Independence notice. This is a clean-room reimplementation, so the
   non-affiliation statement has to be on screen rather than buried in a
   tooltip; the status strip is the only chrome that is always visible. It is
   the shrinkable item here, so a narrow window elides it instead of pushing
   the cursor/render readouts off the row. */
.status-attribution { flex: 0 1 auto; min-width: 0; margin: 0 12px; }
.status-attribution > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-attribution a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.status-attribution a:hover { color: var(--ink); border-color: var(--line-hot); }
.status-attribution a:focus-visible { outline: 1px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

.objects-title { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 9px 13px 8px; border-bottom: 1px solid #282f38; background: linear-gradient(125deg, #1b2229, #14191e); }
.objects-title h2 { margin: 1px 0 0; font-size: 13px; letter-spacing: -.02em; }.eyebrow { color: #59636e; font: 7px var(--mono); letter-spacing: .17em; text-transform: uppercase; }
.objects-bulk { display: flex; align-items: center; gap: 2px; }
.objects-bulk .visibility-toggle { width: 22px; height: 22px; }
.objects-bulk .visibility-toggle svg { width: 13px; height: 13px; }
.objects-bulk .visibility-toggle:disabled { opacity: .35; cursor: default; background: transparent; border-color: transparent; color: #8a95a1; }
.objects-bulk .object-count { margin-left: 4px; }
.object-count { min-width: 24px; height: 20px; display: grid; place-items: center; border: 1px solid #343d47; border-radius: 10px; color: #78838e; font: 8px var(--mono); }
.object-list { overflow: auto; padding: 7px; }
.objects-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 18px 7px; border: 1px dashed #2b333c; padding: 22px 10px; color: #59636e; text-align: center; font-size: 9px; line-height: 1.45; }
.objects-empty i { width: 25px; height: 25px; border: 1px solid #46515d; transform: rotate(30deg) skew(-8deg); opacity: .65; }
.object-row { position: relative; display: grid; grid-template-columns: 25px minmax(0,1fr) 22px 9px; align-items: center; gap: 6px; min-height: 39px; margin-bottom: 3px; border: 1px solid transparent; border-radius: 3px; background: #171d23; color: #aab3bc; padding: 3px 6px 3px 5px; cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; }
.object-row:hover { background: #1e252d; border-color: #303a44; }.object-row.selected { background: linear-gradient(90deg, rgba(85,169,232,.15), #1b2229); border-color: #3d617b; box-shadow: 2px 0 var(--blue) inset; }.object-row.hidden-object { opacity: .43; }.object-row.intersecting { border-color: rgba(228,102,95,.55); box-shadow: 2px 0 var(--red) inset; }
.visibility-toggle { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #8a95a1; cursor: pointer; padding: 0; transition: color .15s, background .15s, border-color .15s; }
.visibility-toggle svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; pointer-events: none; }
.visibility-toggle:hover { background: #262e38; border-color: #384250; color: #eaeff4; }
.visibility-toggle:focus-visible { outline: 0; border-color: var(--blue); color: #eaeff4; }
.hidden-object .visibility-toggle { color: #6a7480; }.hidden-object .visibility-toggle:hover { color: #d3dae1; }
.object-copy { min-width: 0; }.object-copy b { display: block; overflow: hidden; color: #c9cfd5; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }.object-copy small { color: #59636e; font: 7px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.object-swatch { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 7px rgba(241,196,76,.25); }
/* The swatch is the object's own colour from color(), the same one the viewport
   draws it in; uncoloured objects keep OpenSCAD's default yellow. */
.object-swatch.custom { background: var(--swatch); box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 0 7px color-mix(in srgb, var(--swatch), transparent 60%); }
/* Present on every row but quiet until the row is in play, so ten parts do not
   read as ten call-to-action buttons. */
.object-export { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #6f7a86; padding: 0; cursor: pointer; opacity: .55; transition: opacity .15s, color .15s, background .15s, border-color .15s; }
.object-export svg { display: block; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; pointer-events: none; }
.object-row:hover .object-export, .object-row.selected .object-export, .object-export:focus-visible, .object-export[aria-expanded="true"] { opacity: 1; }
.object-export:hover { background: #262e38; border-color: #384250; color: var(--yellow); }
.object-export:focus-visible { outline: 0; border-color: var(--blue); color: #eaeff4; }.object-row.intersecting .object-swatch { box-shadow: 0 0 0 1.5px #12171c, 0 0 0 3px var(--red); }
.intersection-tool { border-top: 1px solid #2c343e; padding: 13px 12px 14px; background: #151a20; }.inspection-heading { display: flex; justify-content: space-between; align-items: center; }.inspection-state { color: #59636d; font: 7px var(--mono); text-transform: uppercase; letter-spacing: .07em; }.inspection-state.clear { color: var(--green); }.inspection-state.collision { color: var(--red); }.inspection-state.incomplete { color: #e0a64a; }
.intersection-tool h3 { margin: 5px 0 3px; color: #cbd1d7; font-size: 11px; }.intersection-tool > p { margin: 0 0 12px; color: #66717c; font-size: 8px; line-height: 1.5; }
.tolerance-field { display: flex; align-items: center; justify-content: space-between; color: #84909a; font-size: 8px; }.number-input { display: flex; align-items: center; width: 82px; height: 27px; border: 1px solid #343d47; border-radius: 3px; background: #0f1317; }.number-input:focus-within { border-color: #59748a; }.number-input input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #d8dde2; padding: 0 2px 0 7px; font: 9px var(--mono); }.number-input b { color: #56616c; font: 7px var(--mono); padding-right: 6px; }
.check-intersections { width: 100%; height: 31px; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; border: 1px solid #485d36; border-radius: 3px; background: linear-gradient(#26351f,#1d2918); color: #a8cf80; cursor: pointer; font-size: 9px; font-weight: 700; }.check-intersections:hover { border-color: #668449; filter: brightness(1.08); }.check-intersections:disabled { opacity: .45; cursor: wait; }.check-intersections span { width: 9px; height: 9px; border: 1px solid currentColor; transform: rotate(45deg); }
.intersection-results { max-height: 126px; overflow: auto; margin-top: 8px; }.inspection-empty { color: #515b65; font: 8px/1.4 var(--mono); text-align: center; padding: 5px; }.intersection-result { width: 100%; display: grid; grid-template-columns: 6px 1fr; gap: 7px; border: 0; border-top: 1px solid #292f37; background: transparent; padding: 7px 2px; text-align: left; cursor: pointer; }.intersection-result:hover { background: rgba(228,102,95,.06); }.intersection-result i { width: 5px; height: 5px; margin-top: 3px; border-radius: 50%; background: var(--red); }.intersection-result.clearance i { background: #f3a23c; }.intersection-result.clearance b { color: #e2b77a; }.intersection-result.unresolved i { background: transparent; box-shadow: 0 0 0 1px #8b96a3 inset; }.intersection-result.unresolved b { color: #a3acb6; }.intersection-result.active { background: rgba(228,102,95,.1); box-shadow: 2px 0 var(--red) inset; }.intersection-result.clearance.active { background: rgba(243,162,60,.09); box-shadow: 2px 0 #f3a23c inset; }.intersection-result b { display: block; color: #d29a96; font-size: 8px; }.intersection-result small { color: #646e78; font: 7px var(--mono); }

/* --- Sharing ------------------------------------------------------------ */
.share-popover { position: fixed; z-index: 30; width: 300px; padding: 10px; border: 1px solid #39424d; border-radius: 4px; background: #20262e; box-shadow: 0 13px 38px rgba(0,0,0,.45); }
.share-popover[hidden] { display: none; }
.share-popover > b { display: block; padding: 3px 2px 9px; color: #87919c; font: 8px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.share-link + .share-link { margin-top: 11px; padding-top: 11px; border-top: 1px solid #2a313b; }
.share-link label { display: block; margin-bottom: 5px; color: #dee3e9; font-size: 10px; }
.share-link > div { display: flex; gap: 5px; }
/* The link is the credential, so it is shown in the face credentials are read
   in, and it scrolls rather than wraps: a wrapped URL invites a partial copy. */
.share-link input { flex: 1; min-width: 0; border: 1px solid #39424d; border-radius: 3px; background: #171c23; color: #c7cdd4; padding: 5px 6px; font: 9px var(--mono); }
.share-link input:focus-visible { outline: 1px solid var(--blue); outline-offset: -1px; }
.share-link button { border: 1px solid #39424d; border-radius: 3px; background: #2a323c; color: #dee3e9; padding: 0 9px; font: 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.share-link button:hover { border-color: #4e6a86; background: #323b46; }
.share-link small { display: block; margin-top: 5px; color: var(--dim); font-size: 9px; line-height: 1.45; }

/* --- Read-only view ------------------------------------------------------ */
/* A full-width bar rather than a badge: "you cannot save here" has to be seen
   before someone types a paragraph into it, not discovered afterwards. */
.readonly-banner { display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-bottom: 1px solid #0a0d10; background: linear-gradient(#2c2a1d, #24231a); color: #ddd2a6; font-size: 10px; }
.readonly-banner[hidden] { display: none; }
.readonly-banner b { color: #f1e0a8; }
.readonly-banner button { margin-left: auto; border: 1px solid #6b6134; border-radius: 3px; background: #33301f; color: #f1e0a8; padding: 5px 10px; font: 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.readonly-banner button:hover { border-color: #97883f; background: #3f3b25; }
.readonly-banner button:focus-visible { outline: 1px solid var(--blue); outline-offset: 1px; }
/* The editor still scrolls, selects and copies — it just cannot be typed into,
   and says so by not taking the caret colour. */
body.read-only #codeEditor { caret-color: transparent; cursor: default; }
/* Nothing that writes to the workspace belongs on screen in a view nobody can
   write to. */
body.read-only #saveButton, body.read-only #mcpButton { display: none; }
/* `[hidden]` is only `display: none` at user-agent weight, which a class
   setting `display` outranks — the share button stayed on screen in a view
   that has nothing to share. */
.tool-button[hidden] { display: none; }

.export-popover { position: fixed; z-index: 20; min-width: 230px; padding: 8px; border: 1px solid #39424d; border-radius: 4px; background: #20262e; box-shadow: 0 13px 38px rgba(0,0,0,.45); }.export-popover[hidden] { display: none; }.export-popover > b { display: block; padding: 5px 8px 8px; color: #87919c; font: 8px var(--mono); text-transform: uppercase; letter-spacing: .12em; }/* The format column is sized for the longest label rather than for "STL", and the
   label never wraps: at 39px "STL \00b7 1" broke after the middle dot and the row
   grew a second line that read like a separate entry. */
.export-popover button { width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr); justify-content: initial; align-items: baseline; gap: 0 4px; border: 0; border-radius: 3px; background: transparent; color: #c7cdd4; padding: 8px; text-align: left; cursor: pointer; font-size: 10px; }.export-popover button:hover { background: #303944; color: #fff; }.export-popover button span { color: var(--yellow); font: 10px var(--mono); white-space: nowrap; }.export-popover button small { color: #77818c; font-size: 9px; }
.export-popover-hint { display: block; max-width: 214px; margin: 4px 8px 2px; padding-top: 7px; border-top: 1px solid #323a45; color: #66707b; font-size: 9px; line-height: 1.45; }
.export-popover-hint[hidden] { display: none; }
.object-export-popover { min-width: 210px; }

/* ---- Agent / MCP connection panel ------------------------------------- */
.agent-button { height: 32px; display: flex; align-items: center; gap: 8px; border: 1px solid #4a4634; border-radius: 4px; background: linear-gradient(#242a32, #1c2129); color: #ddd2a6; padding: 0 8px 0 10px; font-weight: 700; cursor: pointer; }
.agent-button:hover { border-color: #7a6d3c; background: linear-gradient(#2b323b, #21262e); color: #f4e6b6; }
.agent-button:active { transform: translateY(1px); }
/* Until the user has opened the MCP panel once, the button advertises itself:
   a bounce carries the eye, a glow pulse carries it in peripheral vision. Both
   stop permanently on the first click (see markAgentButtonSeen). */
.agent-button.unseen { animation: agentBounce 1.9s ease-in-out infinite, agentGlow 1.9s ease-in-out infinite; }
.agent-button.unseen:hover { animation: none; }
@keyframes agentBounce { 0%, 62%, 100% { transform: translateY(0); } 72% { transform: translateY(-5px); } 82% { transform: translateY(-2px); } 90% { transform: translateY(0); } }
@keyframes agentGlow { 0%, 55%, 100% { border-color: #4a4634; box-shadow: 0 0 0 0 rgba(241,196,76,0); } 72% { border-color: #b99a3d; box-shadow: 0 0 0 4px rgba(241,196,76,.16); } }
@media (prefers-reduced-motion: reduce) { .agent-button.unseen { animation: agentGlow 2.6s ease-in-out infinite; } }
.agent-button svg { width: 15px; height: 15px; color: var(--yellow); }
.agent-button kbd { border-left: 1px solid #4a4634; padding-left: 8px; color: #9a8f65; font: 9px var(--mono); }
.share-button { height: 32px; display: flex; align-items: center; gap: 8px; border: 1px solid #36404b; border-radius: 4px; background: linear-gradient(#242a32, #1c2129); color: #c7cdd4; padding: 0 10px; font-weight: 700; cursor: pointer; }
.share-button:hover { border-color: #4b5866; background: linear-gradient(#2b323b, #21262e); color: #fff; }
.share-button:active { transform: translateY(1px); }
.share-button[hidden] { display: none; }
.share-button svg { width: 15px; height: 15px; }

.mcp-modal { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 22px; }
.mcp-modal[hidden] { display: none; }
.mcp-scrim { position: absolute; inset: 0; background: rgba(6,8,11,.74); backdrop-filter: blur(2px); }
.mcp-dialog { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(960px, 100%); max-height: min(88vh, 780px); border: 1px solid #39424d; border-radius: 5px; background: var(--panel); box-shadow: 0 26px 70px rgba(0,0,0,.6); overflow: hidden; animation: mcpIn .18s ease both; }
/* Technical-drawing crop ticks: the panel reads as an instrument face, not a web modal. */
.mcp-dialog::before, .mcp-dialog::after { content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none; }
.mcp-dialog::before { top: 6px; left: 6px; border-top: 1px solid #6c6134; border-left: 1px solid #6c6134; }
.mcp-dialog::after { right: 6px; bottom: 6px; border-right: 1px solid #6c6134; border-bottom: 1px solid #6c6134; }
.mcp-head { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px 13px; border-bottom: 1px solid #0a0d10; box-shadow: 0 1px #2a313b inset; background: linear-gradient(#20262e, #1a1f26), repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 1px, transparent 1px 9px); }
.mcp-head-text .eyebrow { display: block; color: #8b7f4d; }
.mcp-head h2 { margin: 5px 0 0; font-size: 15px; letter-spacing: -.02em; }
.mcp-close { margin-left: auto; border: 0; background: transparent; color: var(--dim); font-size: 19px; line-height: 1; padding: 2px 4px; cursor: pointer; }
.mcp-close:hover { color: #fff; }
.mcp-body { overflow: auto; }
.mcp-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid #272e38; border-radius: 4px; background: #1b2027; padding: 11px; }
.mcp-label { color: #6c7681; font: 7px var(--mono); letter-spacing: .17em; text-transform: uppercase; }
.mcp-endpoint { display: flex; align-items: center; gap: 7px; border: 1px solid #313a45; border-radius: 3px; background: #0f1317; padding: 7px 8px; }
.mcp-endpoint b { flex: none; border: 1px solid #4d5f3a; border-radius: 2px; background: rgba(137,196,84,.1); color: var(--green); padding: 2px 4px; font: 7px var(--mono); letter-spacing: .1em; }
.mcp-endpoint code { min-width: 0; color: #dfe4ea; font: 9.5px var(--mono); overflow-wrap: anywhere; }
.mcp-id { display: block; border: 1px solid #313a45; border-radius: 3px; background: #0f1317; color: var(--yellow); padding: 7px 8px; font: 10px var(--mono); overflow-wrap: anywhere; }
.mcp-note { margin: 0; color: #77818c; font-size: 9px; line-height: 1.55; }
.mcp-note em { color: #a8b1bb; font-style: normal; font-family: var(--mono); font-size: 8.5px; }
.mcp-copy, .mcp-test { display: flex; align-items: center; justify-content: center; gap: 6px; height: 27px; border: 1px solid #3a4450; border-radius: 3px; background: #242b34; color: #c3cbd4; cursor: pointer; font: 9px var(--mono); letter-spacing: .04em; }
.mcp-copy:hover, .mcp-test:hover { border-color: #56636f; background: #2c343e; color: #fff; }
.mcp-copy i { width: 7px; height: 7px; border: 1px solid currentColor; position: relative; }
.mcp-copy i::after { content: ""; position: absolute; width: 5px; height: 5px; border: 1px solid currentColor; left: -4px; bottom: -4px; }
.mcp-copy.copied { border-color: #4d6b3c; background: rgba(137,196,84,.12); color: var(--green); }
.mcp-test { border-color: #4a5a68; color: #b9d3e6; }
.mcp-test i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mcp-test:disabled { opacity: .5; cursor: default; }
.mcp-status { display: flex; align-items: center; gap: 7px; color: #808a95; font-size: 9px; line-height: 1.5; }
.mcp-status i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #4d5762; }
.mcp-status[data-state="testing"] i { background: var(--yellow); animation: blink 1.1s infinite; }
.mcp-status[data-state="ok"] i { background: var(--green); box-shadow: 0 0 8px color-mix(in srgb, var(--green), transparent 35%); }
.mcp-status[data-state="ok"] { color: #a6c98a; }
.mcp-status[data-state="error"] i { background: var(--red); }
.mcp-status[data-state="error"] { color: #d99a95; }
.mcp-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 9px; margin: 0; border-top: 1px solid #272e38; padding-top: 8px; }
.mcp-facts[hidden] { display: none; }
.mcp-facts dt { color: #626c77; font: 7px var(--mono); letter-spacing: .12em; text-transform: uppercase; align-self: center; }
.mcp-facts dd { margin: 0; color: #c3cbd4; font: 9px var(--mono); overflow-wrap: anywhere; }
.mcp-facts dd b { margin-left: 4px; border: 1px solid #4d6b3c; border-radius: 2px; background: rgba(137,196,84,.1); color: var(--green); padding: 0 3px; font-size: 7px; letter-spacing: .1em; text-transform: uppercase; }

.mcp-verified { display: inline-flex; align-items: center; gap: 5px; color: #6f7a85; font: 8px var(--mono); letter-spacing: .06em; }
.mcp-verified a { color: #6f93b1; }
.mcp-verified a:hover { color: var(--blue); }
.mcp-snippet { border: 1px solid #2a323c; border-radius: 4px; background: #0f1317; overflow: hidden; }
.mcp-snippet-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #232a33; background: #191e25; padding: 6px 6px 6px 9px; }
.mcp-snippet-head b { color: #8f99a4; font: 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.mcp-snippet-head small { color: #5e6873; font: 8px var(--mono); overflow-wrap: anywhere; }
.mcp-snippet-head .mcp-copy { margin-left: auto; flex: none; height: 22px; padding: 0 7px; font-size: 8px; }
.mcp-snippet pre { margin: 0; padding: 10px 11px; overflow-x: auto; color: #ccd4dc; font: 9.5px/1.65 var(--mono); tab-size: 2; }
/* Config snippets must never re-wrap — a broken line is a broken paste. The briefing is
   prose, so it wraps instead of hiding its tail behind a scrollbar. */

.mcp-tools { grid-column: 1 / -1; padding-top: 4px; }
.mcp-tools-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 10px; }
.mcp-tools-count { color: #626c77; font: 8px var(--mono); letter-spacing: .06em; }
.mcp-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 7px; }
.mcp-tool { border: 1px solid #262d36; border-left: 2px solid #5c5330; border-radius: 3px; background: #1a1f26; padding: 8px 10px; }
.mcp-tool b { display: block; color: var(--yellow); font: 9.5px var(--mono); letter-spacing: -.01em; }
.mcp-tool span { display: block; margin-top: 3px; color: #808a95; font-size: 9px; line-height: 1.5; }
.mcp-tools-empty { grid-column: 1 / -1; border: 1px dashed #303842; border-radius: 3px; padding: 14px; text-align: center; color: var(--dim); font-size: 9px; }

/* Connect AI: a picker of agent tiles, then a short numbered walkthrough for the
   one picked. Everything technical sits behind "Show details" at the bottom. */
.connect-dialog { width: min(760px, 100%); }
.connect-body { display: block; }
.connect-picker { padding: 18px 18px 14px; }
.connect-picker[hidden], .connect-guide[hidden] { display: none; }
.connect-intro { max-width: 60ch; margin: 0 0 14px; color: #9aa4af; font-size: 12.5px; line-height: 1.6; }
.connect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
/* Each tile sits in an li so the list keeps its items without overriding the button role. */
.connect-grid > li { min-width: 0; display: flex; }
.connect-grid > li > .connect-tile { flex: 1; }
.connect-tile { min-width: 0; display: flex; align-items: center; gap: 10px; border: 1px solid #2a323c; border-radius: 8px; background: #1f252d; color: var(--ink); padding: 9px 10px; text-align: left; cursor: pointer; font: 600 12.5px var(--sans); transition: border-color .15s, background .15s, transform .15s; }
.connect-tile:hover { border-color: #56636f; background: #252c35; transform: translateY(-1px); }
.connect-tile:focus-visible, .connect-back:focus-visible, .connect-action:focus-visible, .connect-details summary:focus-visible, .connect-more summary:focus-visible { outline: 1px solid var(--blue); outline-offset: 2px; }
.connect-tile > span:last-child { min-width: 0; }
.connect-tile small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; font-weight: 400; line-height: 1.3; }
.connect-tile.last-used { border-color: #5c5330; }
.agent-logo { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #f2f3f5; overflow: hidden; }
.agent-logo img { width: 20px; height: 20px; object-fit: contain; }
.agent-logo.photo img { width: 100%; height: 100%; object-fit: cover; }
.connect-guide { display: grid; gap: 14px; padding: 14px 18px 18px; }
.connect-back { justify-self: start; border: 0; background: transparent; color: var(--muted); padding: 2px 0; cursor: pointer; font: 11.5px var(--sans); }
.connect-back:hover { color: var(--ink); }
.connect-guide-head { display: flex; align-items: center; gap: 12px; }
.connect-guide-head .agent-logo { width: 44px; height: 44px; border-radius: 10px; }
.connect-guide-head .agent-logo img { width: 26px; height: 26px; }
.connect-guide-head .agent-logo.photo img { width: 100%; height: 100%; }
.connect-guide-head h3 { margin: 0; color: #f1f3f5; font-size: 16px; letter-spacing: -.02em; }
.connect-guide-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.connect-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: connect-step; }
.connect-step { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 11px; counter-increment: connect-step; }
.connect-step::before { content: counter(connect-step); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(241,196,76,.14); color: var(--yellow); font: 600 11px var(--mono); }
.connect-step > div { min-width: 0; display: grid; gap: 7px; padding-top: 3px; }
.connect-step p { margin: 0; color: #cfd6de; font-size: 12.5px; line-height: 1.55; }
.connect-step p b { color: #f1f3f5; font-weight: 600; }
.connect-step p kbd, .connect-note kbd { border: 1px solid #3a4450; border-radius: 3px; background: #242b34; padding: 0 4px; font: 10.5px var(--mono); }
.connect-copybox { display: flex; align-items: flex-start; gap: 6px; border: 1px solid #313a45; border-radius: 6px; background: #0f1317; padding: 5px 5px 5px 10px; }
.connect-copybox pre { flex: 1; min-width: 0; max-height: 10.5em; margin: 0; padding: 5px 0; overflow: auto; color: #dfe4ea; font: 11px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.connect-copybox .mcp-copy { flex: none; height: 28px; padding: 0 10px; font-size: 9.5px; }
.connect-action { justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 34px; border: 1px solid #b78c24; border-radius: 6px; background: linear-gradient(#edc451, #d7a936); color: #211b0e; padding: 0 14px; font: 700 12px var(--sans); text-decoration: none; cursor: pointer; }
.connect-action:hover { filter: brightness(1.06); }
.connect-action.secondary { border-color: #3a4450; background: #242b34; color: #dfe4ea; font-weight: 600; }
.connect-note { margin: 0; border-left: 2px solid #5c5330; border-radius: 0 4px 4px 0; background: #1d2228; color: #a9b2bc; padding: 8px 11px; font-size: 11.5px; line-height: 1.55; }
.connect-note b { color: #dfe4ea; font-weight: 600; }
.connect-more summary, .connect-details summary { cursor: pointer; color: var(--muted); font: 11.5px var(--sans); list-style-position: inside; }
.connect-more summary:hover, .connect-details summary:hover { color: var(--ink); }
.connect-more[open] summary { margin-bottom: 10px; }
.connect-more > div { display: grid; gap: 10px; }
.connect-details { border-top: 1px solid #0d1014; box-shadow: 0 1px #262d36 inset; background: #161b21; padding: 11px 18px; }
.connect-details summary small { margin-left: 6px; color: var(--dim); font: 10px var(--mono); }
.connect-details summary small[data-state="ok"] { color: #a6c98a; }
.connect-details summary small[data-state="error"] { color: #d99a95; }
.connect-details-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; padding: 12px 0 6px; }


@media (max-width: 560px) {
  .connect-picker, .connect-guide { padding-left: 14px; padding-right: 14px; }
  .connect-details { padding-left: 14px; padding-right: 14px; }
  .connect-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connect-tile { padding: 8px; gap: 8px; font-size: 12px; }
  .connect-tile small { display: none; }
  .agent-logo { width: 30px; height: 30px; }
  .connect-copybox { flex-direction: column; align-items: stretch; }
  .connect-copybox .mcp-copy { height: 32px; }
}

@media (max-width: 860px) {
  .mcp-modal { padding: 10px; }
  .mcp-dialog { max-height: 94vh; }
  .mcp-head h2 { font-size: 13px; }
}

@keyframes mcpIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes pulse { 0%,100% { transform: scaleY(.45); opacity: .55; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes arrive { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
@keyframes sourceGlow { 0%,100% { background-color: rgba(241,196,76,.13); } 50% { background-color: rgba(241,196,76,.24); } }
@keyframes aiBadgeIn { from { opacity: 0; transform: translateX(6px); } }

/* The attribution sheds its second sentence, then the readouts beside it get out
   of the way, so the "not affiliated" clause survives down to a phone width
   instead of being ellipsed into meaninglessness. */
@media (max-width: 1320px) {
  .attribution-more { display: none; }
}

@media (max-width: 560px) {
  .status-right { display: none; }
}

/* The credits give way before the header can outgrow the window: the attribution
   links go first, GitHub and Report issues stay while they fit (all hide at 720px). */
@media (max-width: 1000px) { .brand-credit:nth-of-type(2) { display: none; } }
@media (max-width: 860px) { .brand-credit:nth-of-type(3) { display: none; } }

@media (max-width: 900px) {
  :root { --objects-width: 184px; }.customizer { position: fixed; z-index: 10; right: 0; top: 92px; bottom: 25px; box-shadow: -8px 0 25px rgba(0,0,0,.4); }.view-presets { display: none; }.sync-state { display: none; }
}

@media (max-width: 720px) {
  :root { --objects-width: 0px; }.objects-pane { display: none; }.workspace-identity { margin-left: 8px; }.brand { min-width: 0; }.brand-credit { display: none; }.url-hint { display: none; }
}

/* --- Landing page ---------------------------------------------------------
   "/" is a front door, not a workspace. The html class is set by an inline
   script before first paint and owned by app.js afterwards, so the editor shell
   and the landing page never show at once. */
.landing { display: none; }
html.landing-mode .landing { position: fixed; inset: 0; z-index: 1; display: block; overflow-y: auto; background: var(--void); }
html.landing-mode .app-shell { display: none; }
.landing-inner { width: min(1248px, 100%); margin: 0 auto; padding: 22px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.landing-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: -.2px; }
.landing-brand img { width: 24px; height: 24px; }
.landing-links { display: flex; gap: 16px; }
.landing-links a { color: #6c7580; font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; transition: color .15s; }
.landing-links a:hover { color: var(--ink); }
.landing a:focus-visible, .landing button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Hero: connection controls on the left, the finished result on the right.
   One yellow action; everything else stays quiet. */
.landing-hero { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 632px); justify-content: space-between; align-items: center; gap: 48px; padding: 48px 0 24px; }
.landing-pitch { display: grid; align-content: start; }
.landing-hero h1 { margin: 12px 0 0; color: #f1f3f5; font-size: 48px; font-weight: 700; line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
.landing-pitch > p { margin: 12px 0 0; color: #9aa3ad; font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.landing-actions { display: flex; margin-top: 16px; }
.landing-new { min-height: 44px; border: 0; background: none; color: var(--muted); padding: 0 2px; font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-hot); text-underline-offset: 5px; cursor: pointer; transition: color .15s, text-decoration-color .15s; }
.landing-new:hover { color: #fff; text-decoration-color: var(--muted); }
.landing-new:disabled { opacity: .6; cursor: progress; }
.landing-stats[hidden], .landing-stats [hidden] { display: none; }
.landing-stats b { color: #c9d0d7; font-weight: 600; font-variant-numeric: tabular-nums; }
.landing-agents { display: grid; gap: 12px; margin-top: 32px; }
.landing-agents > h2 { margin: 0; color: #e6e9ec; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.landing-agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.landing-agent-grid button { width: 100%; height: 38px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(26,31,38,.6); color: #c9d0d7; padding: 0 10px; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.landing-agent-grid button > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.landing-agent-grid button:hover { border-color: var(--line-hot); background: rgba(32,39,48,.95); color: #fff; }
/* The catch-all closes the grid as one full-width row instead of a lone orphan. */
.landing-agent-grid li:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.landing-agent-grid button[data-agent="other"] { justify-content: center; border-style: dashed; background: none; color: var(--muted); }
.landing-agent-grid button[data-agent="other"]:hover { color: #fff; }
/* Brand marks keep their own colours. The all-black ones are inverted so they
   read on the dark tile; Archestra's black square becomes a light one. */
.landing-agent-grid .agent-mark { flex: none; width: 18px; height: 18px; display: grid; place-items: center; }
.landing-agent-grid .agent-mark img { width: 100%; height: 100%; object-fit: contain; }
.landing-agent-grid .agent-mark:is([data-logo="amp"], [data-logo="archestra"], [data-logo="cursor"], [data-logo="grok"], [data-logo="hermes"], [data-logo="mcp"], [data-logo="openai"], [data-logo="opencode"]) img { filter: invert(1); opacity: .9; }
.landing-agent-grid .agent-mark[data-logo="opencode"] img { width: 80%; height: 80%; }
/* Amp's mark is a wide wordmark: let it overhang the 18px slot so it stays legible. */
.landing-agent-grid .agent-mark[data-logo="amp"] { width: 28px; margin: 0 -5px; }
.landing-agent-grid .agent-mark[data-logo="amp"] img { opacity: 1; }

.landing-showcase { display: grid; gap: 12px; margin: 0; }
.landing-video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #12161c; }
.landing-video video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; background: transparent; opacity: 0; transition: opacity .3s; }
.landing-video[data-state="ready"] video, .landing-video[data-state="playing"] video { opacity: 1; }
.landing-video[data-state="playing"] video { object-fit: contain; background: #0c0f13; }
.landing-video-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; color: #6f7a86; font-size: 13px; background:
  radial-gradient(ellipse 60% 55% at 50% 45%, rgba(241,196,76,.06), transparent 70%),
  linear-gradient(transparent 0 calc(100% - 1px), rgba(255,255,255,.035) 0) 50% 0 / 100% 32px,
  linear-gradient(90deg, transparent 0 calc(100% - 1px), rgba(255,255,255,.035) 0) 50% 0 / 32px 100%,
  #12161c; }
.landing-video-placeholder svg { width: 120px; color: #d7a936; }
.landing-video-play { position: absolute; left: 16px; bottom: 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: rgba(12,15,19,.78); color: #f1f3f5; padding: 0 18px 0 14px; font-size: 13px; font-weight: 600; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .15s, border-color .15s; }
.landing-video-play:hover { border-color: rgba(255,255,255,.32); background: rgba(12,15,19,.92); }
.landing-video-play i { width: 0; height: 0; border-left: 9px solid var(--yellow); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.landing-video:not([data-state="ready"]):not([data-state="loading"]) .landing-video-play { display: none; }
.landing-video[data-state="ended"] video { opacity: 1; object-fit: contain; background: #0c0f13; }
.landing-video[data-state="ended"]::after { content: ""; position: absolute; inset: 0; background: rgba(8,10,13,.6); }
.landing-video-replay { z-index: 1; }
.landing-video-replay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-height: 48px; display: none; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 24px; background: rgba(12,15,19,.82); color: #f1f3f5; padding: 0 22px 0 18px; font-size: 15px; font-weight: 700; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .15s, border-color .15s; }
.landing-video-replay:hover { border-color: rgba(255,255,255,.36); background: rgba(12,15,19,.94); }
.landing-video-replay i { width: 0; height: 0; border-left: 11px solid var(--yellow); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.landing-video[data-state="ended"] .landing-video-replay { display: inline-flex; }
.landing-touch-note { display: none; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.landing-missing { display: grid; gap: 6px; border: 1px solid #5a4632; border-radius: 4px; background: rgba(42,32,24,.7); padding: 12px 14px; color: #d9cfc4; }
.landing-missing[hidden] { display: none; }
.landing-missing b { font-size: 12px; }
.landing-missing p { margin: 0; color: #a99a8c; font-size: 11px; line-height: 1.5; }
.landing-missing code { color: #e2c368; font: 10px var(--mono); word-break: break-all; }
.landing-missing button { justify-self: start; margin-top: 4px; border: 1px solid #7d6332; border-radius: 3px; background: #2c2522; color: #e2c368; padding: 6px 10px; font-size: 11px; cursor: pointer; }
.landing-missing button[hidden] { display: none; }
.landing-recents, .landing-examples { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.landing-recents-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid #232a33; padding-bottom: 8px; }
.landing-recents-head h2 { margin: 0; color: #cfd6de; font-size: 12px; letter-spacing: -.01em; }
.landing-recents-head span { color: var(--dim); font: 9px var(--mono); letter-spacing: .06em; }
.landing-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.landing-list li { position: relative; }
.landing-open { width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid #262d36; border-radius: 4px; background: rgba(26,31,38,.88); color: inherit; padding: 6px 44px 6px 6px; text-align: left; font: inherit; cursor: pointer; transition: border-color .14s, background .14s; }
.landing-open:hover { border-color: #4e6a86; background: rgba(32,39,48,.95); }
.landing-thumb { width: 72px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 3px; background: #151a21; color: #3a434e; font: 16px var(--mono); }
.landing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.landing-thumb.empty { border: 1px dashed #2b323d; background: transparent; font-size: 12px; }
.landing-copy small i { color: #8b96a3; font-style: normal; }
.landing-copy { min-width: 0; display: grid; gap: 3px; }
.landing-copy b { overflow: hidden; color: #e2e7ec; font-size: 13px; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.landing-copy small { overflow: hidden; color: #6f7883; font: 10px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.landing-when { color: var(--dim); font: 9px var(--mono); white-space: nowrap; }
.landing-forget { position: absolute; top: 50%; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 3px; background: transparent; color: #6c7580; font-size: 16px; line-height: 1; transform: translateY(-50%); cursor: pointer; transition: color .12s, background .12s; }
.landing-forget:hover { background: #3a2226; color: #f0b6ba; }
.landing-more { display: flex; justify-content: center; }
.landing-more button { border: 1px solid #262d36; border-radius: 3px; background: transparent; color: #8b96a3; padding: 5px 12px; font: 10px var(--mono); letter-spacing: .04em; cursor: pointer; transition: color .12s, border-color .12s; }
.landing-more button:hover { border-color: #4e6a86; color: #cfd6de; }
.landing-empty { border: 1px dashed #2b323d; border-radius: 4px; padding: 18px 14px; color: var(--dim); font-size: 12px; text-align: center; }
.landing-draft .landing-thumb { color: var(--yellow); }
.landing-draft .landing-copy b { text-transform: none; }
.landing-draft .landing-open { padding-right: 14px; }
/* Three panels on how this differs from OpenSCAD. Each leads with a visual
   of the same height so the headings line up across the row. */
.landing-features { display: grid; gap: 18px; }
.landing-features > h2 { margin: 0; color: #e6e9ec; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.landing-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.landing-feature { display: grid; grid-template-rows: auto auto 1fr; align-content: start; border: 1px solid var(--line); border-radius: 6px; background: rgba(26,31,38,.6); padding: 8px 8px 20px; }
.landing-feature h3 { margin: 18px 12px 0; color: #f1f3f5; font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.landing-feature > p { margin: 6px 12px 0; color: #9aa3ad; font-size: 13.5px; line-height: 1.5; text-wrap: pretty; }
.landing-feature-visual { position: relative; height: 260px; overflow: hidden; border-radius: 4px; background: radial-gradient(120% 90% at 50% 0%, #1b222b, #12161c 70%); }
.feature-parts img { position: absolute; top: 10px; left: 96px; width: calc(100% - 104px); height: calc(100% - 20px); object-fit: contain; }
.feature-parts ul { position: absolute; top: 14px; left: 14px; display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.feature-parts li { display: flex; align-items: center; gap: 7px; height: 22px; border: 1px solid #2b323d; border-radius: 3px; background: rgba(16,19,24,.7); padding: 0 8px 0 7px; color: #b7c0ca; font: 10px var(--mono); }
.feature-parts li::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.feature-tools { display: grid; align-content: center; gap: 12px; padding: 18px 16px; }
.feature-call { overflow: hidden; color: #8b96a3; font: 11.5px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.feature-call b { color: var(--blue); font-weight: 500; }
.feature-tools ul { display: grid; gap: 7px; margin: 0; padding: 0 0 0 12px; border-left: 1px solid #2b323d; list-style: none; }
.feature-tools li { display: flex; align-items: baseline; gap: 8px; color: #c9d0d7; font: 11.5px var(--mono); }
.feature-tools li i { flex: none; width: 10px; color: var(--green); font-style: normal; font-weight: 700; }
.feature-tools li.warn, .feature-tools li.warn i { color: var(--yellow); }
.feature-tool-names { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.feature-tool-names span { border: 1px solid #2b323d; border-radius: 3px; padding: 3px 6px; color: #7f8a96; font: 10px var(--mono); }
.feature-link { display: grid; align-content: center; gap: 10px; padding: 18px 16px; }
.feature-url { display: flex; align-items: center; gap: 10px; min-width: 0; height: 40px; border: 1px solid #36404b; border-radius: 20px; background: #0f1216; padding: 0 14px 0 6px; }
.feature-url span { flex: none; border-radius: 14px; background: rgba(137,196,84,.14); color: var(--green); padding: 4px 9px; font: 600 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.feature-url.view span { background: rgba(85,169,232,.14); color: var(--blue); }
.feature-url code { min-width: 0; overflow: hidden; color: #7f8a96; font: 12px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.feature-url code b { color: #e6e9ec; font-weight: 500; }
.feature-link p { margin: 6px 0 0; color: var(--dim); font: 10px var(--mono); letter-spacing: .04em; text-align: center; }
.landing-foot { display: grid; gap: 4px; border-top: 1px solid #1f252d; padding-top: 14px; color: #535b65; font: 9px/1.6 var(--mono); }
.landing-foot a { color: #7c8590; }

@media (max-width: 1000px) {
  .landing-hero { grid-template-columns: minmax(0, 1fr); }
  .landing-pitch { max-width: 560px; }
  .landing-feature-grid { grid-template-columns: minmax(0, 1fr); }
  .landing-feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 8px; padding-bottom: 8px; }
  .landing-feature-visual { grid-row: 1 / 3; }
  .landing-feature h3 { margin-top: 16px; }
}
@media (max-width: 560px) {
  .landing-inner { padding: 16px 20px 32px; gap: 32px; }
  .landing-hero { padding: 24px 0 8px; gap: 32px; }
  .landing-hero h1 { font-size: 34px; }
  .landing-actions { justify-content: center; }
  .landing-agents { margin-top: 24px; }
  .landing-agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-agent-grid li:last-child:nth-child(3n + 1) { grid-column: auto; }
  .landing-agent-grid li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .landing-open { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
  .landing-thumb { width: 56px; height: 40px; }
  .landing-when { display: none; }
  .landing-features > h2 { font-size: 19px; }
  .landing-feature { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; padding-bottom: 18px; }
  .landing-feature-visual { grid-row: auto; }
  .landing-feature-visual.feature-parts { height: 240px; }
  .landing-feature-visual:is(.feature-tools, .feature-link) { height: auto; }
}

/* Where four or five columns do not fit, a group becomes one swipeable row
   rather than a grid that strands its last card alone on a row of its own. */
@media (max-width: 979px) {
  .example-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(176px, 30%); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: #2f3842 transparent; }
  .example-card { scroll-snap-align: start; }
  .example-card:hover { transform: none; }
}
@media (max-width: 560px) {
  .example-grid { grid-auto-columns: 44%; }
}

/* --- Phone layout -----------------------------------------------------------
   A phone gets a viewer, not an editor: the viewport fills the screen, the
   object list and the customizer open as bottom sheets, and the toolbar moves
   to the bottom edge where a thumb reaches it, carrying only what works without
   a keyboard — the sheets, Share and Export. MOBILE_MEDIA in app.js is this
   same query, so the gestures and sheets switch over exactly where the layout
   does. Everything here is scoped to the query; the desktop shell is untouched. */
.mobile-only { display: none; }
@media (any-pointer: coarse) {
  /* The canvas owns every touch on it: without this a pinch zooms the page and a
     drag scrolls it instead of turning the model. */
  .render-canvas { touch-action: none; }
}
@media (max-width: 760px) and (pointer: coarse), (pointer: coarse) and (max-height: 500px) {
  .app-shell { height: 100vh; height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px auto minmax(0, 1fr) auto; }
  .app-shell > .app-header { grid-row: 1; }
  .app-shell > .readonly-banner { grid-row: 2; }
  .app-shell > .workspace { grid-row: 3; }
  .app-shell > .toolbar { grid-row: 4; }
  .app-shell > .status-bar { display: none; }
  .app-header { padding: 0 10px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .brand { min-width: 0; }
  .brand-credit, .sync-state, .url-hint { display: none; }
  .workspace-identity { margin: 0 0 0 auto; }
  .engine-pill { margin-left: 8px; }

  .toolbar { gap: 8px; border-top: 1px solid #090b0e; border-bottom: 0; padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .toolbar > .tool-group, .toolbar > .tool-divider, .toolbar > .agent-button { display: none; }
  .mobile-only:not([hidden]) { display: flex; }
  .mobile-tool { height: 40px; align-items: center; gap: 8px; border: 1px solid #36404b; border-radius: 4px; background: #1d232b; color: #c7cdd4; padding: 0 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
  .mobile-tool b { min-width: 20px; border-radius: 10px; background: #2b333d; color: #9aa4af; padding: 2px 6px; font: 10px var(--mono); text-align: center; }
  .mobile-tool[aria-expanded="true"] { border-color: var(--blue); color: #fff; }
  .toolbar .tool-button { width: 40px; height: 40px; }
  .export-button { height: 40px; padding: 0 10px 0 12px; }
  .share-button { height: 40px; padding: 0 12px; }
  /* A 320px phone cannot fit the full row: the toolbar wraps rather than
     pushing Export past the edge, and below 400px Export goes icon-only (the
     label stays for screen readers) and the sheet buttons tighten up. */
  .toolbar { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
  .mobile-tool { min-width: 0; }

  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .editor-pane, .splitter, .console-pane { display: none; }
  .viewer-pane { grid-column: 1; grid-row: 1; }
  /* The viewport header shrinks to the one control a phone keeps — the section
     view — floating over the canvas's top-right corner. Projection, the
     edges/axes/ground toggles and the build-plate picker are desktop-only; the
     stored choices still apply. */
  .viewer-pane { position: relative; }
  .viewport-header { position: absolute; z-index: 5; top: 10px; right: 10px; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; }
  .viewport-header .view-mode, .viewport-options label { display: none; }
  .viewport-options { min-height: 0; margin: 0; }
  .viewport-options .pane-action { width: 44px; height: 44px; border: 1px solid #303842; background: #1d232a; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
  .viewport-options .pane-action:hover { background: #1d232a; }
  .viewport-options .pane-action[aria-pressed="true"] { border-color: #2b5580; }
  .slicer-panel { top: 10px; left: 10px; transform: none; width: auto; right: 64px; }
  #customizerButton, #emptyHint { display: none; }
  .view-hint { display: none; }
  /* Its own row, left-aligned above the grid readout: centred on one row with it,
     the two collide, and centred alone it runs under the zoom buttons at 320px. */
  .view-hint.touch-hint { display: grid; left: 12px; bottom: 44px; transform: none; justify-items: start; }
  .viewport:has(.plate-badge:not([hidden])) .view-hint.touch-hint { display: none; }
  .viewport-fab { right: 10px; bottom: 10px; }
  .viewport-fab button { width: 44px; height: 44px; font-size: 18px; }
  .viewport-fab svg { width: 17px; }
  .empty-state { width: min(300px, calc(100% - 32px)); }
  #emptyMobileHint { display: block; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
  #emptyMobileHint[hidden] { display: none; }

  /* Bottom sheets. Both panels stay in the DOM and keep every desktop behaviour
     (visibility toggles, per-object export, parameter sliders — all but the
     intersection check); only where they sit changes. */
  .objects-pane, .customizer, .customizer.closed { position: fixed; z-index: 26; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 72dvh; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; opacity: 1; border: 1px solid #303842; border-bottom: 0; border-radius: 12px 12px 0 0; background: #12171c; box-shadow: 0 -18px 50px rgba(0,0,0,.55); padding-bottom: env(safe-area-inset-bottom); transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  .customizer { height: auto; min-height: 40dvh; }
  .customizer[hidden] { display: none; }
  .customizer-body { height: auto; flex: 1; }
  .customizer .pane-header { flex: none; }
  body[data-mobile-sheet="objects"] .objects-pane, body[data-mobile-sheet="customizer"] .customizer { transform: none; visibility: visible; transition: transform .22s ease; }
  .sheet-handle.mobile-only { position: sticky; z-index: 2; top: 0; flex: none; width: 100%; height: 22px; justify-content: center; align-items: center; border: 0; background: inherit; cursor: pointer; }
  .sheet-handle::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: #3d4652; }
  .objects-title { flex: none; height: auto; padding: 4px 16px 12px; background: none; }
  .object-list { flex: none; overflow: visible; padding: 8px 10px; }
  .object-row { min-height: 52px; grid-template-columns: 40px minmax(0, 1fr) 40px 10px; font-size: 13px; }
  .object-row .visibility-toggle, .object-row .object-export { width: 40px; height: 40px; }
  /* The intersection/tolerance checker is a desktop inspection tool. */
  .intersection-tool { display: none; }
  .object-list { padding-bottom: 18px; }
  .mobile-sheet-scrim { position: fixed; z-index: 25; inset: 0; background: rgba(5,7,10,.5); }
  .mobile-sheet-scrim[hidden] { display: none; }

  /* Menus become action sheets along the bottom edge. Their inline left/top come
     from desktop anchoring and are overridden here. */
  .export-popover, .share-popover { z-index: 45; left: 8px !important; right: 8px; top: auto !important; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; min-width: 0; max-height: 80dvh; overflow-y: auto; }
  .export-popover button { min-height: 44px; align-items: center; font-size: 13px; }
  .export-popover-hint { max-width: none; }
  /* Above the bottom toolbar, which may wrap to two rows on the narrowest phones. */
  .export-toast { bottom: calc(112px + env(safe-area-inset-bottom)); }
  .export-toast-retry, .export-toast-close { height: 40px; }
  .export-toast-close { width: 40px; }

  /* The landing page keeps what works on a phone — recent designs and design
     links — and drops what only leads into the editor. */
  .landing-new, .landing-examples { display: none; }
  .landing-touch-note { display: block; }
}
@media (max-width: 400px) and (pointer: coarse) {
  .toolbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .mobile-tool { gap: 6px; padding: 0 9px; }
  .export-button { width: 40px; justify-content: center; padding: 0; }
  .export-button kbd { display: none; }
  .export-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .share-button { width: 40px; justify-content: center; padding: 0; }
  .share-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Model feedback: comments pinned to the model for the AI agent. Pins and the draft
   composer float over the canvas; the list is a panel beside the zoom cluster, and an
   agent's request_pointing hint rides a one-line banner across the top. */
.viewport.commenting .render-canvas { cursor: crosshair; }
/* In comment mode a mouse carries the next pin as its cursor: a ghost of the real pin,
   tip at the pointer, while the native cursor hides. A drag gets the grab hand back. */
.viewport.commenting.ghosting .render-canvas { cursor: none; }
.viewport.commenting .render-canvas:active { cursor: grabbing; }
.feedback-pin.ghost { z-index: 4; pointer-events: none; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.feedback-pin.ghost::after { content: none; }
.feedback-pins { position: absolute; z-index: 3; inset: 0; overflow: hidden; pointer-events: none; }
/* The square bottom-left corner is the tip: the element's origin sits exactly on the
   projected point and the body rises up and to the right of it, whatever its width. */
.feedback-pin { position: absolute; left: 0; top: 0; min-width: 22px; height: 22px; margin: -22px 0 0 0; display: grid; place-items: center; padding: 0 5px; border: 1.5px solid #101318; border-radius: 11px 11px 11px 0; background: var(--yellow); color: #101318; font: 700 10px var(--mono); box-shadow: 0 3px 10px rgba(0,0,0,.45); pointer-events: auto; cursor: pointer; }
.feedback-pin[hidden] { display: none; }
.feedback-pin.resolved { background: #5d6570; color: #e6e9ed; }
.feedback-pin.active { background: #fff; color: #101318; outline: 2px solid var(--yellow); }
.feedback-pin.behind:not(.active) { opacity: .45; }
/* A bigger hit area than the marker, for fingers, grown only away from the tip (up and
   right), so a click just below or left of an existing pin still lands on the model. */
.feedback-pin::after { content: ""; position: absolute; inset: -8px -8px 0 0; }
.feedback-pin.draft { background: var(--blue); color: #fff; pointer-events: none; }
/* One compact line: the hint and a way out. */
.feedback-banner { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 32px; padding: 2px 4px 2px 12px; border-bottom: 1px solid #36404b; background: #1b2027; }
.feedback-banner[hidden] { display: none; }
.feedback-banner.agent { border-bottom-color: #7a6a2c; background: #241f12; }
.feedback-banner b { min-width: 0; color: #e6e9ed; font-size: 12px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.feedback-banner.agent b { color: #f6dc8c; }
.feedback-banner .feedback-close { flex: none; }
.feedback-composer-actions { flex: none; display: flex; gap: 6px; }
.feedback-done, .feedback-cancel, .feedback-add { height: 28px; padding: 0 11px; border: 1px solid #36404b; border-radius: 3px; background: #1d232b; color: #c7cdd4; font-size: 11px; font-weight: 600; cursor: pointer; }
.feedback-done { border-color: #7a6a2c; background: #3a321a; color: #f6dc8c; }
.feedback-done:hover, .feedback-cancel:hover, .feedback-add:hover { filter: brightness(1.15); }
.feedback-done:disabled { opacity: .5; cursor: wait; }
.feedback-composer { position: absolute; z-index: 7; width: min(260px, calc(100% - 16px)); display: grid; gap: 6px; padding: 8px; border: 1px solid #36404b; border-radius: 5px; background: #161b21; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.feedback-composer[hidden] { display: none; }
.feedback-composer textarea { width: 100%; min-height: 64px; resize: vertical; border: 1px solid #303842; border-radius: 3px; background: #0f1317; color: var(--ink); padding: 6px 7px; font-size: 12px; line-height: 1.4; }
.feedback-composer textarea:focus { outline: 1px solid var(--blue); }
.feedback-composer small { color: var(--muted); font: 10px var(--mono); overflow-wrap: anywhere; }
.feedback-composer small:empty { display: none; }
.feedback-composer-actions { justify-content: flex-end; }
.feedback-toggle { position: relative; }
.feedback-toggle b { position: absolute; top: -5px; right: -6px; min-width: 13px; height: 13px; padding: 0 3px; border-radius: 7px; background: var(--yellow); color: #101318; font: 700 8px/13px var(--mono); text-align: center; pointer-events: none; }
.feedback-toggle b[hidden] { display: none; }
/* Drops from the top-right corner, under its toggle in the viewport header, and
   stops short of the zoom cluster; the agent banner is a strip above the viewport,
   so the two never meet. Shifts down when the section bar shares the top edge. */
.feedback-panel { position: absolute; z-index: 5; top: 8px; right: 8px; width: min(300px, calc(100% - 16px)); max-height: max(200px, calc(100% - 140px)); display: flex; flex-direction: column; border: 1px solid #36404b; border-radius: 5px; background: #13181e; box-shadow: 0 12px 34px rgba(0,0,0,.5); overflow: hidden; }
.feedback-panel[hidden] { display: none; }
.viewport:has(.slicer-panel:not([hidden])) .feedback-panel { top: 54px; max-height: max(200px, calc(100% - 186px)); }
.feedback-panel header { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px 12px; }
.feedback-panel h3 { margin: 0; color: #cbd1d7; font-size: 12px; }
.feedback-close { width: 26px; height: 26px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.feedback-close:hover { color: #fff; background: #222930; }
.feedback-tabs { display: flex; gap: 4px; padding: 0 10px 6px; border-bottom: 1px solid #262d36; }
.feedback-tabs button { height: 24px; padding: 0 8px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--muted); font-size: 10.5px; cursor: pointer; }
.feedback-tabs button[aria-selected="true"] { border-color: #36404b; background: #1d232b; color: #e6e9ed; }
.feedback-tabs b { color: var(--dim); font: 9px var(--mono); margin-left: 3px; }
.feedback-list { flex: 1; min-height: 0; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.feedback-item { border-bottom: 1px solid #222930; padding: 7px 10px; }
.feedback-item.active { background: rgba(241,196,76,.06); box-shadow: 2px 0 var(--yellow) inset; }
.feedback-item-main { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.feedback-item-main i { min-width: 20px; height: 18px; display: grid; place-items: center; border-radius: 9px 9px 9px 2px; background: var(--yellow); color: #101318; font: 700 9px var(--mono); font-style: normal; }
.feedback-item-main span { min-width: 0; display: grid; gap: 2px; }
.feedback-item-main b { color: #dfe3e8; font-size: 11.5px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.feedback-item-main small { color: var(--muted); font: 9px var(--mono); overflow-wrap: anywhere; }
.feedback-reply { margin: 6px 0 0 28px; padding: 5px 7px; border-left: 2px solid var(--blue); border-radius: 0 3px 3px 0; background: #18202a; color: #c2ccd6; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.feedback-reply span { display: block; color: var(--blue); font: 8px var(--mono); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; }
.feedback-item-actions { display: flex; gap: 10px; margin: 5px 0 0 28px; }
.feedback-item-actions button { border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 10px; cursor: pointer; text-decoration: underline; text-decoration-color: #3a434e; text-underline-offset: 3px; }
.feedback-item-actions button:hover { color: #fff; }
.feedback-empty { padding: 14px 12px; color: var(--dim); font-size: 11px; line-height: 1.5; }
.feedback-add { margin: 8px 10px 10px; }
@media (max-width: 760px) and (pointer: coarse), (pointer: coarse) and (max-height: 500px) {
  /* Below the viewport on phones: the floating section button owns the top corner. */
  .feedback-banner { order: 2; min-height: 44px; border-bottom: 0; border-top: 1px solid #36404b; }
  .feedback-banner.agent { border-top-color: #7a6a2c; }
  .feedback-done, .feedback-cancel, .feedback-add { height: 44px; padding: 0 14px; font-size: 13px; }
  .feedback-panel, .viewport:has(.slicer-panel:not([hidden])) .feedback-panel { top: 64px; left: 10px; right: 10px; width: auto; max-height: max(160px, calc(100% - 270px)); }
  .feedback-pin { min-width: 28px; height: 28px; margin: -28px 0 0 0; border-radius: 14px 14px 14px 0; font-size: 12px; }
  .feedback-composer { width: min(300px, calc(100% - 16px)); }
  .feedback-composer textarea { font-size: 16px; }
  .feedback-toggle b { top: -4px; right: -4px; }
  .feedback-close { width: 44px; height: 44px; }
  .feedback-tabs button { height: 44px; font-size: 12px; }
  .feedback-item-actions { gap: 18px; }
  .feedback-item-actions button { min-height: 44px; padding: 0 4px; font-size: 12px; }
  .feedback-item-main small { font-size: 10px; }
  .feedback-banner b { max-height: 4.1em; overflow-y: auto; }
}
