/* Formwork chrome: a light table. One pale surface with a recessed well of daylight for the
   canvas; what you hold floats over the well as a white pill, what you read sits on the surface
   with hairlines and space. One blue marks what is live. Tokens first; every rule below reaches
   for them and never for a raw value. */

@font-face { font-family: 'Space Grotesk'; font-weight: 300 700; src: url('/fonts/SpaceGrotesk.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 100 900; src: url('/fonts/DMSans.ttf') format('truetype'); }

:root {
  --c-surface: #fafbfc; --c-well: #eceef2; --c-white: #ffffff; --c-fill: #eef0f3; --c-fill-2: #e4e7ec;
  --c-line: rgba(18, 21, 26, .08); --c-line-strong: rgba(18, 21, 26, .14);
  --c-ink: #12151a; --c-ink-2: #626974; --c-ink-3: #8a93a1;
  --c-on-ink: #ffffff; --c-on-ink-2: rgba(255, 255, 255, .6); --c-on-ink-soft: rgba(255, 255, 255, .16);
  --c-field: rgba(18, 21, 26, .045);
  --c-blue: #1769ff; --c-blue-deep: #0f5ce4; --c-blue-soft: #eaf1ff; --c-blue-ring: rgba(23, 105, 255, .28);
  --c-green: #2ba56f; --c-green-soft: #e6f6ee; --c-red: #cb4e43; --c-red-soft: #fbeeec; --c-amber: #d9a21b;
  --f-display: 'Space Grotesk', 'DM Sans', system-ui, sans-serif; --f-ui: 'DM Sans', system-ui, sans-serif;
  --fs-micro: 10.5px; --fs-sm: 12px; --fs-base: 13px; --fs-md: 14px; --fs-title: 16px; --fs-h: 22px;
  --r-control: 6px; --r-panel: 8px; --r-card: 12px; --r-well: 14px; --r-pill: 999px;
  --shadow-pill: 0 6px 18px rgba(18, 21, 26, .08), 0 1px 3px rgba(18, 21, 26, .06);
  --shadow-menu: 0 16px 34px rgba(18, 21, 26, .12), 0 2px 6px rgba(18, 21, 26, .06);
  --shadow-blue: 0 6px 14px rgba(23, 105, 255, .24);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 55%);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --head-h: 52px; --left-w: 340px; --right-w: 272px; --inset: 10px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16' fill='none' stroke='%238a93a1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  color-scheme: light;
  --chat-scale: 1;
}

/* The same table by night: the surface goes to graphite, the well darker still, what floats is a
   shade lighter than what it floats over, ink turns to chalk, and the one blue brightens so it
   still reads as live. The pages themselves stay whatever the document says they are. */
:root[data-theme="dark"] {
  --c-surface: #17191d; --c-well: #0f1114; --c-white: #1e2127; --c-fill: #262a31; --c-fill-2: #2f343c;
  --c-line: rgba(255, 255, 255, .08); --c-line-strong: rgba(255, 255, 255, .15);
  --c-ink: #eef0f3; --c-ink-2: #a5adb9; --c-ink-3: #717985;
  --c-on-ink: #12151a; --c-on-ink-2: rgba(18, 21, 26, .62); --c-on-ink-soft: rgba(18, 21, 26, .14);
  --c-field: rgba(255, 255, 255, .07);
  --c-blue: #4d8bff; --c-blue-deep: #3577f2; --c-blue-soft: rgba(77, 139, 255, .14); --c-blue-ring: rgba(77, 139, 255, .36);
  --c-green: #3fbf83; --c-green-soft: rgba(63, 191, 131, .14); --c-red: #e0655a; --c-red-soft: rgba(224, 101, 90, .14); --c-amber: #e2b23a;
  --shadow-pill: 0 6px 18px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-menu: 0 16px 34px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-blue: 0 6px 14px rgba(77, 139, 255, .3);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 55%);
  color-scheme: dark;
}
/* Only the canvas: the bar and both panels fold away, and the well takes the window. */
.app.bare { grid-template-rows: 0 minmax(0, 1fr); grid-template-columns: 0 minmax(0, 1fr) 0; }
.app.bare .topbar, .app.bare .leftpanel, .app.bare .sidebar { display: none; }
.app.bare .stage { padding: 0; }
.app.bare .well { border-radius: 0; }
/* The chat's type, scaled as a whole so its hierarchy holds. */
.leftpanel { font-size: calc(var(--fs-base) * var(--chat-scale)); }
.leftpanel .feed, .leftpanel .compose { zoom: var(--chat-scale); }

/* ── base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body { font: 400 var(--fs-base)/1.45 var(--f-ui); font-variant-numeric: tabular-nums; background: var(--c-surface); color: var(--c-ink); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .38; cursor: default; }
input, textarea { user-select: text; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 5px; border: 3px solid transparent; background-clip: padding-box; }
*:hover::-webkit-scrollbar-thumb { background: rgba(18, 21, 26, .18); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0; }
.spacer { flex: 1; }
.hint { font-size: var(--fs-sm); color: var(--c-ink-3); line-height: 1.5; }
.eyebrow { font-size: var(--fs-micro); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.title { font-family: var(--f-display); font-weight: 600; letter-spacing: -.02em; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c-ink-3); flex: none; }
.dot.ok { background: var(--c-green); }
.dot.busy { background: var(--c-amber); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes rise { from { transform: translateY(4px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: var(--r-panel); color: var(--c-ink-2); font-weight: 500; white-space: nowrap; flex: none; transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease); }
.btn:hover:not(:disabled) { background: var(--c-fill); color: var(--c-ink); }
.btn.on { background: var(--c-fill); color: var(--c-ink); }
.btn.outline { background: var(--c-white); border: 1px solid var(--c-line-strong); color: var(--c-ink); box-shadow: 0 1px 2px rgba(18, 21, 26, .04); }
.btn.outline:hover:not(:disabled) { background: var(--c-white); border-color: rgba(18, 21, 26, .24); }
.btn.primary { background: var(--sheen), var(--c-blue); border: 1px solid var(--c-blue-deep); color: #fff; box-shadow: var(--shadow-blue), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.primary:hover:not(:disabled) { background: var(--sheen), var(--c-blue-deep); color: #fff; transform: translateY(-1px); }
.btn.primary:active:not(:disabled) { transform: translateY(0); }
.btn:active:not(:disabled), .tool:active:not(:disabled), .seg button:active, .select-btn:active { transform: scale(.97); }
.tool, .seg button, .select-btn { transition: background .14s var(--ease), color .14s var(--ease), transform .12s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease); }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.sm { height: 26px; padding: 0 8px; font-size: var(--fs-sm); }
.btn.sm.icon { width: 26px; }
.btn.link { height: auto; padding: 0; color: var(--c-blue); }
.btn.link:hover:not(:disabled) { background: none; text-decoration: underline; }
.btn.wide { justify-content: center; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--c-blue); color: #fff; font: 600 var(--fs-micro)/22px var(--f-ui); text-align: center; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 5px; border-radius: var(--r-pill); background: var(--c-white); border: 1px solid var(--c-line-strong); font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink-2); }
.pill:hover { color: var(--c-ink); }

/* ── shell: one surface, a well for the canvas ── */
.app { height: 100%; display: grid; grid-template-rows: var(--head-h) minmax(0, 1fr); grid-template-columns: var(--left-w) minmax(0, 1fr) 0; background: var(--c-surface); }
.app.with-inspector { grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w); }
.header { grid-column: 1 / -1; display: flex; align-items: center; gap: 2px; padding: 0 12px 0 14px; }
.leftpanel { grid-column: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: var(--inset); transition: none; animation: fromLeft .24s var(--ease); }
.stage { grid-column: 2; min-width: 0; padding: 0 var(--inset) var(--inset); position: relative; }
.app:not(.with-inspector) .stage { padding-right: var(--inset); }
.well { position: relative; height: 100%; overflow: hidden; border-radius: var(--r-well); background: var(--c-well); box-shadow: inset 0 0 0 1px rgba(18, 21, 26, .06), inset 0 1px 3px rgba(18, 21, 26, .05); }
.well canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.sidebar { grid-column: 3; min-height: 0; overflow: auto; overflow-x: hidden; display: flex; flex-direction: column; padding-bottom: var(--inset); animation: fromRight .24s var(--ease); }
.app:not(.with-inspector) .sidebar { display: none; }

/* header */
.wordmark { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 4px; border-radius: var(--r-panel); font: 600 var(--fs-title)/1 var(--f-display); letter-spacing: -.03em; color: var(--c-ink); }
a.wordmark:hover { background: var(--c-fill); }
.mark { flex: none; color: var(--c-ink); }
.head-sep { width: 1px; height: 18px; background: var(--c-line-strong); margin: 0 8px; flex: none; }
.doc-title { height: 32px; padding: 0 8px; border-radius: var(--r-panel); font: 600 var(--fs-md)/1 var(--f-display); letter-spacing: -.02em; color: var(--c-ink); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-title:hover:not(:disabled) { background: var(--c-fill); }
.doc-title-input { height: 32px; width: 300px; padding: 0 8px; border-radius: var(--r-panel); background: var(--c-white); border: 1px solid var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); outline: 0; font: 600 var(--fs-md)/1 var(--f-display); letter-spacing: -.02em; }
.save-state { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: var(--fs-sm); color: var(--c-ink-3); }
.save-state .tick { color: var(--c-green); display: inline-flex; animation: pop .26s var(--ease); }
.head-left, .head-right { display: flex; align-items: center; gap: 4px; }
.head-centre { flex: 1; min-width: 0; }

/* ── menus and popovers ── */
.pop-anchor { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 90; min-width: 220px; padding: 6px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-card); box-shadow: var(--shadow-menu); display: flex; flex-direction: column; gap: 1px; transform-origin: top left; animation: bloom .16s var(--ease); }
.menu.right { transform-origin: top right; left: auto; right: 0; }
.menu.up { transform-origin: bottom left; top: auto; bottom: calc(100% + 8px); }
@keyframes bloom { from { transform: scale(.96) translateY(-2px); opacity: 0; } }
.menu-item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 9px; border-radius: var(--r-control); color: var(--c-ink-2); text-align: left; white-space: nowrap; }
.menu-item:hover:not(:disabled), .menu-item.on { background: var(--c-blue-soft); color: var(--c-ink); }
.menu-item .meta { margin-left: auto; padding-left: 16px; font-size: var(--fs-sm); color: var(--c-ink-3); }
.swatch-row .field-name { font-size: var(--fs-sm); color: var(--c-ink-2); padding-left: 2px; }
.menu-rule { height: 1px; background: var(--c-line); margin: 4px 2px; }
.menu-title { padding: 7px 9px 5px; }
.menu .share { width: 300px; padding: 0 2px 2px; display: flex; flex-direction: column; gap: 8px; }
.menu .share .hint { padding: 0 7px; }
.row-left { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.text-input { flex: 1; min-width: 0; height: 30px; padding: 0 9px; background: var(--c-white); border: 1px solid var(--c-line-strong); border-radius: var(--r-panel); font-size: var(--fs-sm); color: var(--c-ink-2); outline: 0; }
.text-input:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }

/* ── left panel ── */
.segmented { display: flex; margin: 4px 14px 10px; padding: 3px; border-radius: var(--r-panel); background: var(--c-fill); flex: none; }
.segmented button { flex: 1; height: 28px; border-radius: var(--r-control); color: var(--c-ink-3); font-size: var(--fs-sm); font-weight: 500; transition: color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease); }
.segmented button:hover { color: var(--c-ink-2); }
.segmented button.on { background: var(--c-white); color: var(--c-ink); box-shadow: 0 1px 3px rgba(18, 21, 26, .1), 0 0 0 1px rgba(18, 21, 26, .04); }
.tab-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.panel-body .hint { padding: 0 2px; }
.panel-body > .btn { align-self: flex-start; }
.file-row { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: var(--r-control); color: var(--c-ink-2); font-size: var(--fs-sm); }
.file-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files { display: flex; flex-direction: column; gap: 2px; }

/* pages as thumbnails */

/* the feed */
.feed { flex: 1; min-height: 0; overflow: auto; padding: 4px 14px 8px; display: flex; flex-direction: column; gap: 2px; }
.feed > * { flex-shrink: 0; }
.empty { padding: 8px 2px; color: var(--c-ink-2); line-height: 1.5; display: flex; flex-direction: column; gap: 10px; }
.empty h3 { font: 600 var(--fs-h)/1.15 var(--f-display); letter-spacing: -.03em; color: var(--c-ink); }
.suggs { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.sugg { text-align: left; padding: 9px 12px; border-radius: var(--r-panel); background: var(--c-fill); color: var(--c-ink-2); font-size: var(--fs-sm); line-height: 1.4; transition: background .18s var(--ease), color .18s var(--ease); animation: rise .32s var(--ease) both; animation-delay: 100ms; }
.sugg:hover { background: var(--c-fill-2); color: var(--c-ink); }
.sugg:active { transform: scale(.985); }
.you { margin: 10px 0 6px; padding: 9px 12px; border-radius: 10px; background: var(--c-fill); color: var(--c-ink); line-height: 1.45; white-space: pre-wrap; user-select: text; position: relative; }
.assistant { padding: 6px 2px; line-height: 1.55; color: var(--c-ink-2); user-select: text; display: flex; flex-direction: column; gap: 6px; }
.assistant p { white-space: pre-wrap; }
.assistant strong { color: var(--c-ink); font-weight: 600; }
.assistant code { font-size: var(--fs-sm); background: var(--c-fill); padding: 1px 4px; border-radius: 3px; }
.step { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 3px 4px 3px 2px; border-radius: var(--r-control); color: var(--c-ink); font-size: var(--fs-sm); }
.step:hover { background: rgba(18, 21, 26, .035); }
.step .mark-done { flex: none; width: 15px; height: 15px; border-radius: 50%; background: var(--c-green); color: #fff; display: inline-flex; align-items: center; justify-content: center; animation: pop .3s var(--ease) .06s both; }
.step.failed .mark-done { background: var(--c-red); }
.step .tool-ic { flex: none; width: 24px; height: 24px; border-radius: var(--r-control); background: var(--c-fill); color: var(--c-ink-3); display: inline-flex; align-items: center; justify-content: center; }
.step .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.step .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.step .sub { font-size: var(--fs-micro); color: var(--c-green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.failed .sub { color: var(--c-red); }
.step .btn { opacity: 0; }
.step:hover .btn, .step .btn.done { opacity: 1; }
.step .btn.done { opacity: .4; }
.run-status { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; margin: 8px 0 4px; border-radius: var(--r-panel); background: var(--c-fill); font-size: var(--fs-sm); color: var(--c-ink-2); }
.run-status .meta { color: var(--c-ink-3); }
.run-status.error { background: var(--c-red-soft); color: var(--c-red); }
.spinner { width: 12px; height: 12px; border: 1.5px solid var(--c-line-strong); border-top-color: var(--c-blue); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.comments { padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; flex: none; }
.comment { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--c-ink-2); }
.pin { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--c-amber); color: #fff; font-size: var(--fs-micro); font-weight: 700; line-height: 18px; text-align: center; }
.comment .text { flex: 1; min-width: 0; }

/* the composer */
.compose { flex: none; padding: 8px 14px 0; display: flex; flex-direction: column; gap: 8px; }
.activity { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 26px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: var(--c-white); border: 1px solid var(--c-line-strong); color: var(--c-ink-2); font-size: var(--fs-sm); animation: rise .18s var(--ease); }
.activity .clock { margin-left: auto; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.activity .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: fade .18s var(--ease); }
.composer { background: var(--c-white); border: 1px solid var(--c-line-strong); border-radius: var(--r-card); box-shadow: 0 1px 2px rgba(18, 21, 26, .04); padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 8px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.composer:focus-within { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-ink-2); font-size: var(--fs-micro); font-weight: 500; }
button.chip:hover { color: var(--c-ink); border-color: var(--c-line-strong); }
.chip .cwd { width: 150px; background: none; border: 0; outline: 0; font-size: var(--fs-micro); color: var(--c-ink-2); }
.chip .cwd::placeholder { color: var(--c-ink-3); }
.composer textarea { background: none; border: 0; outline: 0; resize: none; padding: 2px 4px 0; min-height: 40px; max-height: 220px; font-size: var(--fs-md); line-height: 1.45; color: var(--c-ink); }
.composer textarea::placeholder { color: var(--c-ink-3); }
.composer .tools { display: flex; align-items: center; gap: 4px; }
.select { appearance: none; height: 26px; padding: 0 22px 0 9px; border: 1px solid var(--c-line); border-radius: var(--r-pill); background: var(--chevron) no-repeat right 7px center; color: var(--c-ink-2); font-size: var(--fs-micro); font-weight: 500; cursor: pointer; }
.select:hover:not(:disabled) { border-color: var(--c-line-strong); color: var(--c-ink); }
.send { width: 30px; height: 30px; border-radius: 50%; background: var(--sheen), var(--c-blue); border: 1px solid var(--c-blue-deep); color: #fff; box-shadow: var(--shadow-blue), inset 0 1px 0 rgba(255, 255, 255, .3); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: transform .18s var(--ease), background .18s var(--ease); }
.send:hover:not(:disabled) { background: var(--sheen), var(--c-blue-deep); transform: translateY(-1px); }
.send:disabled { background: var(--c-fill-2); border-color: transparent; color: var(--c-ink-3); box-shadow: none; opacity: 1; }
.send.stop { background: var(--c-ink); border-color: var(--c-ink); box-shadow: none; }
.chat-config { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: var(--fs-micro); color: var(--c-ink-3); }

/* ── inspector ── */
.insp-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px 14px; }
.insp-head .kind-ic { flex: none; width: 30px; height: 30px; border-radius: var(--r-panel); background: var(--c-fill); color: var(--c-ink-2); display: inline-flex; align-items: center; justify-content: center; }
.insp-head .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.insp-head .who strong { font: 600 var(--fs-base)/1.2 var(--f-display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-head .who span { font-size: var(--fs-micro); color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-head .acts { display: flex; gap: 0; }
.insp-section { padding: 12px 14px; border-top: 1px solid var(--c-line); display: flex; flex-direction: column; gap: 6px; }
.insp-section .eyebrow { margin: 0 0 3px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.field-row > * { min-width: 0; }
.field { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; min-width: 0; background: var(--c-white); border: 1px solid var(--c-line-strong); border-radius: var(--r-control); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 1px rgba(18, 21, 26, .03); transition: border-color .14s var(--ease), box-shadow .14s var(--ease); position: relative; }
.field:hover { border-color: rgba(18, 21, 26, .22); }
.field:focus-within { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.field > span { flex: none; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink-3); }
.field input, .field select { flex: 1; min-width: 0; width: 100%; padding: 0; background: none; border: 0; outline: 0; font-size: var(--fs-sm); color: var(--c-ink); }
.field input:disabled { color: var(--c-ink-3); }
.var-row { display: flex; align-items: center; gap: 8px; height: 26px; font-size: var(--fs-sm); }
.var-row .meta { color: var(--c-ink-3); }
.field select { appearance: none; font-weight: 500; cursor: pointer; background: var(--chevron) no-repeat right 2px center; padding-right: 14px; }
.field.block { height: auto; flex-direction: column; align-items: stretch; padding: 7px 8px; gap: 4px; }
.field.block textarea { background: none; border: 0; outline: 0; resize: vertical; min-height: 64px; font-size: var(--fs-sm); line-height: 1.45; color: var(--c-ink); }
.field.block input { font-weight: 500; }
.field.check { cursor: pointer; background: none; border-color: transparent; padding-left: 2px; }
.field.check:hover, .field.check:focus-within { border-color: transparent; box-shadow: none; }
.field.check input { flex: none; width: 14px; height: 14px; accent-color: var(--c-blue); cursor: pointer; }
.field.check > span { flex: 1; font-size: var(--fs-sm); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--c-ink-2); }
.swatch-row { display: flex; align-items: center; gap: 6px; height: 28px; }
.swatch-row > * { min-width: 0; }
.swatch-row .grow { flex: 1 1 0; }
.swatch { flex: none; width: 20px; height: 20px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(18, 21, 26, .14); overflow: hidden; }
.swatch input { width: 32px; height: 32px; margin: -6px; padding: 0; border: 0; background: none; cursor: pointer; }
.hex, .pct { height: 28px; min-width: 0; padding: 0 8px; background: var(--c-surface); border: 1px solid transparent; border-radius: var(--r-control); font-size: var(--fs-sm); color: var(--c-ink); outline: 0; }
.hex { flex: 1; }
.pct { width: 46px; text-align: right; }
.hex:hover, .pct:hover { border-color: var(--c-line-strong); }
.hex:focus, .pct:focus { border-color: var(--c-blue); background: var(--c-white); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.swatch-row .fill-kind { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--c-ink-2); display: inline-flex; align-items: baseline; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── what floats over the well ── */
.tool-rail { position: absolute; z-index: 20; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-pill); box-shadow: var(--shadow-pill); }
.tool { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-2); transition: background .18s var(--ease), color .18s var(--ease); }
.tool:hover:not(:disabled) { background: var(--c-fill); color: var(--c-ink); }
.tool.on { background: var(--c-blue-soft); color: var(--c-blue); }
.rail-sep { width: 1px; height: 18px; background: var(--c-line-strong); margin: 0 4px; }
.rail-caret { width: 14px; height: 34px; margin-left: -3px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-control); color: var(--c-ink-3); }
.rail-caret:hover { color: var(--c-ink); }
.zoom { position: absolute; z-index: 20; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 1px; padding: 3px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-pill); box-shadow: var(--shadow-pill); }
.zoom .btn { height: 26px; }
.zoom .btn.icon { width: 26px; border-radius: 50%; }
.zoom .pct { width: 46px; text-align: center; font-size: var(--fs-sm); font-weight: 500; line-height: 26px; color: var(--c-ink); background: none; border: 0; padding: 0; }
.zoom .dims { font-size: var(--fs-micro); color: var(--c-ink-3); padding: 0 8px; margin-right: 2px; border-right: 1px solid var(--c-line-strong); }
.stage-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: var(--fs-sm); color: var(--c-ink-3); }
.error-toast { position: absolute; z-index: 40; top: 12px; left: 50%; transform: translateX(-50%); max-width: 70%; padding: 7px 12px; border-radius: var(--r-panel); background: var(--c-white); border: 1px solid var(--c-red); color: var(--c-red); font-size: var(--fs-sm); box-shadow: var(--shadow-pill); }
.viewing { position: absolute; z-index: 20; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 14px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-pill); box-shadow: var(--shadow-pill); color: var(--c-ink-2); font-size: var(--fs-sm); }
.well .ime { position: absolute; width: 2px; height: 2px; padding: 0; border: 0; margin: 0; opacity: .01; resize: none; overflow: hidden; outline: none; pointer-events: none; }
.comment-box { position: absolute; z-index: 30; width: 292px; padding: 8px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-card); box-shadow: var(--shadow-menu); display: flex; flex-direction: column; gap: 8px; }
.comment-box textarea { min-height: 64px; resize: none; padding: 8px; background: var(--c-surface); border: 1px solid var(--c-line-strong); border-radius: var(--r-panel); outline: 0; color: var(--c-ink); }
.comment-box textarea:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.comment-box .row { display: flex; justify-content: flex-end; gap: 6px; }
.agent-cursor { position: absolute; z-index: 60; left: 0; top: 0; pointer-events: none; color: var(--c-blue); display: flex; align-items: flex-start; gap: 4px; will-change: transform; }
.agent-cursor svg.arrow { filter: drop-shadow(0 1px 3.5px rgba(0, 0, 0, .85)); }
.agent-cursor .tag { display: inline-flex; align-items: center; background: var(--c-ink); color: var(--c-on-ink); font-weight: 500; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.agent-cursor .tag .mark { color: var(--c-on-ink); }
@keyframes breathe { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(2px, 3px); } }

/* ── dialogs ── */
.sheet { position: fixed; inset: 0; z-index: 80; background: rgba(18, 21, 26, .28); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; animation: fade .16s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.dialog { width: 440px; max-width: calc(100vw - 32px); padding: 22px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-well); box-shadow: var(--shadow-menu); display: flex; flex-direction: column; gap: 12px; animation: rise .18s var(--ease); }
.dialog h2 { font: 600 var(--fs-h)/1.2 var(--f-display); letter-spacing: -.03em; }
.dialog h2 .muted { font: 400 var(--fs-base)/1 var(--f-ui); color: var(--c-ink-3); letter-spacing: 0; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack > span { font-size: var(--fs-sm); color: var(--c-ink-3); }
.stack input, .stack select { height: 34px; padding: 0 10px; background: var(--c-white); border: 1px solid var(--c-line-strong); border-radius: var(--r-control); outline: 0; }
.stack input:focus, .stack select:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.stack strong { font-weight: 500; }
.dialog .row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.dialog .big { font: 600 30px/1 var(--f-display); letter-spacing: -.03em; }
.error-text { color: var(--c-red); font-size: var(--fs-sm); }
.auth { height: 100%; display: flex; align-items: center; justify-content: center; background: var(--c-well); overflow: auto; padding: 32px 16px; }
.auth .dialog { width: 380px; }
.auth .wordmark { padding: 0; margin-bottom: 2px; }

/* ── home ── */
.home { height: 100%; overflow: auto; padding: 36px 48px 64px; background: var(--c-surface); }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; max-width: 1200px; margin: 0 auto 28px; animation: rise .3s var(--ease); }
.home-head h1 { margin-top: 18px; font: 600 32px/1.05 var(--f-display); letter-spacing: -.035em; }
.home-head .sub { margin-top: 6px; color: var(--c-ink-3); }
.home-head .actions { display: flex; align-items: center; gap: 6px; }
.recent { max-width: 1200px; margin: -8px auto 28px; }
.recent .eyebrow { margin-bottom: 8px; }
.recent-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 12px; }
.recent-row { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-control); color: var(--c-ink-2); text-align: left; min-width: 0; }
.recent-row:hover { background: var(--c-blue-soft); color: var(--c-ink); }
.recent-row .name { flex: 0 0 auto; max-width: 55%; font-weight: 500; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row .where { flex: 1 1 0; min-width: 0; color: var(--c-ink-3); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row .when { margin-left: auto; padding-left: 12px; color: var(--c-ink-3); font-size: var(--fs-sm); white-space: nowrap; }
.doc-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 26px 20px; }
.doc-card { display: flex; flex-direction: column; gap: 9px; animation: rise .36s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); cursor: pointer; }
.doc-card .pic { aspect-ratio: 16 / 9; background: var(--c-white); border-radius: var(--r-panel); overflow: hidden; box-shadow: 0 0 0 1px var(--c-line-strong), 0 2px 6px rgba(18, 21, 26, .05); transition: box-shadow .18s var(--ease), transform .18s var(--ease); position: relative; }
.doc-card:hover .pic { box-shadow: 0 0 0 1px var(--c-line-strong), 0 10px 26px rgba(18, 21, 26, .12); transform: translateY(-2px); }
.doc-card .pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.doc-card .name { font: 500 var(--fs-md)/1.3 var(--f-display); letter-spacing: -.01em; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card .when { font-size: var(--fs-sm); color: var(--c-ink-3); }
.home .empty { max-width: 480px; margin: 0 auto; padding-top: 40px; }

/* ── settings ── */
.dialog.settings { width: 780px; height: 580px; max-height: calc(100vh - 32px); padding: 0; flex-direction: row; gap: 0; overflow: hidden; }
.settings-nav { width: 196px; flex: none; padding: 18px 10px; border-right: 1px solid var(--c-line); background: var(--c-surface); display: flex; flex-direction: column; gap: 2px; }
.settings-nav .eyebrow { padding: 0 10px 10px; }
.nav-item { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px; border-radius: var(--r-panel); color: var(--c-ink-2); text-align: left; width: 100%; font-weight: 500; }
.nav-item:hover { background: var(--c-fill); color: var(--c-ink); }
.nav-item.on { background: var(--c-blue-soft); color: var(--c-blue); }
.settings-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px 26px; }
.settings-head h2 { font: 600 var(--fs-h)/1.2 var(--f-display); letter-spacing: -.03em; }
.settings-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 26px 26px; display: flex; flex-direction: column; gap: 14px; animation: fade .16s var(--ease); }
.pref { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
/* The designers, each with a light for its state, what it is connected with, and what it brings. */
.designers { display: flex; flex-direction: column; margin-bottom: 4px; }
.designer-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.designer-row .dot { margin-top: 7px; width: 8px; height: 8px; }
.designer-row .models { color: var(--c-ink-2); }
.designer-row .btn { margin-top: 2px; }
.menu-title .meta.link { cursor: pointer; color: var(--c-blue); }
.pref:last-child { border-bottom: 0; }
.pref-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pref-text strong { font-weight: 500; }
.pref-text span { font-size: var(--fs-sm); color: var(--c-ink-3); line-height: 1.45; word-break: break-all; }
.switch { appearance: none; width: 36px; height: 22px; border-radius: var(--r-pill); background: var(--c-fill-2); position: relative; cursor: pointer; flex: none; transition: background .18s var(--ease); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-white); box-shadow: 0 1px 3px rgba(18, 21, 26, .2); transition: transform .18s var(--ease); }
.switch:checked { background: var(--c-blue); }
.switch:checked::after { transform: translateX(14px); }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.shortcut { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 34px; border-bottom: 1px solid var(--c-line); font-size: var(--fs-sm); color: var(--c-ink-2); }
.keys { display: inline-flex; align-items: center; gap: 3px; }
.keys .gesture { margin-left: 4px; font-size: var(--fs-micro); color: var(--c-ink-3); }
kbd.key { display: inline-block; min-width: 22px; padding: 2px 6px; border: 1px solid var(--c-line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--c-white); font: 500 var(--fs-micro)/1.3 var(--f-ui); color: var(--c-ink); text-align: center; }

/* the feed, folded and queued */
.steps-head { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 6px 0 2px; border-radius: var(--r-control); color: var(--c-ink-2); font-size: var(--fs-sm); text-align: left; width: 100%; }
.steps-head:hover { background: rgba(18, 21, 26, .035); color: var(--c-ink); }
.steps-head .label { flex: 1; }
.you .edit { position: absolute; right: 6px; top: 6px; opacity: 0; background: var(--c-white); }
.you:hover .edit { opacity: 1; }
.chip.live { border-color: var(--c-blue-ring); color: var(--c-blue); background: var(--c-blue-soft); }
/* A sentence about what could not be done, over the canvas for a moment. */
.canvas-note { position: absolute; z-index: 30; left: 50%; bottom: 72px; transform: translateX(-50%); max-width: min(560px, 80%); padding: 10px 16px; border-radius: var(--r-card); line-height: 1.45; background: var(--c-ink); color: var(--c-on-ink); font-size: var(--fs-sm); box-shadow: 0 6px 20px rgba(18, 21, 26, .18); animation: rise .2s var(--ease); }
/* A file chosen for the ask in hand: named, and taken out again by its own cross. */
.chip.file { max-width: 200px; padding-right: 2px; border-color: var(--c-blue-ring); color: var(--c-blue); background: var(--c-blue-soft); }
.chip.file .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.file .x { flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: inherit; opacity: .6; }
.chip.file .x:hover { opacity: 1; background: rgba(23, 105, 255, .14); }
/* A file in the library that this ask is about. */
.file-row.on { background: var(--c-blue-soft); color: var(--c-blue); }
.file-row .meta { flex: none; color: var(--c-ink-3); font-size: var(--fs-micro); font-variant-numeric: tabular-nums; }
.file-row.on .meta { color: inherit; opacity: .7; }
.empty-note { padding: 10px 8px; color: var(--c-ink-3); font-size: var(--fs-sm); }
.queued { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border-radius: var(--r-panel); background: var(--c-blue-soft); color: var(--c-blue); font-size: var(--fs-sm); }
.queued .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant ul, .assistant ol { padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }

/* ── sign in ── */
.auth-card { width: 400px; max-width: 100%; padding: 28px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-well); box-shadow: var(--shadow-menu); display: flex; flex-direction: column; gap: 14px; animation: rise .18s var(--ease); }
.auth-card .wordmark { padding: 0; align-self: flex-start; }
.auth-card h1 { font: 600 26px/1.15 var(--f-display); letter-spacing: -.035em; }
.auth-invite { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r-panel); background: var(--c-blue-soft); color: var(--c-blue); font-size: var(--fs-sm); line-height: 1.45; }
.auth-invite svg { flex: none; margin-top: 2px; }
.auth-links { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--c-ink-3); }
.auth-links .hint a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth-card .btn.link { font-size: var(--fs-sm); }

/* ── a select of our own ── */
.select-anchor.wide, .select-anchor.wide .select-btn { width: 100%; }
.select-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; height: 30px; padding: 0 8px 0 10px; border-radius: var(--r-control); background: var(--c-white); border: 1px solid var(--c-line-strong); color: var(--c-ink); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.select-btn:hover { border-color: rgba(18, 21, 26, .24); }
.select-btn.open { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.select-btn .select-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.select-btn .select-key { font-size: var(--fs-micro); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink-3); }
.select-btn > svg:last-child { color: var(--c-ink-3); flex: none; }
.select-anchor.up .menu { top: auto; bottom: calc(100% + 6px); }
.menu-item .check { width: 14px; display: inline-flex; color: var(--c-blue); flex: none; }
.menu-item .text { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.menu-item .text .hint { font-size: var(--fs-micro); }
.composer .select-btn { height: 26px; border-radius: var(--r-pill); font-size: var(--fs-micro); border-color: var(--c-line); color: var(--c-ink-2); }

/* ── people, movements ── */
.table { display: flex; flex-direction: column; border: 1px solid var(--c-line); border-radius: var(--r-panel); background: var(--c-white); overflow: hidden; }
.table-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-top: 1px solid var(--c-line); font-size: var(--fs-sm); }
.table-row:first-child { border-top: 0; }
.table-row.on { background: var(--c-blue-soft); }
.table-row.off { opacity: .55; }
.table-row .grow { flex: 1; min-width: 0; line-height: 1.35; }
.table-row .grow strong { font-weight: 500; color: var(--c-ink); }
.muted { color: var(--c-ink-3); }
.table-row .num { min-width: 64px; text-align: right; font-weight: 500; }
.table-row .num.neg { color: var(--c-ink-2); }
.table-row .num.pos { color: var(--c-green); }
.avatar.big { width: 40px; height: 40px; font-size: var(--fs-md); line-height: 40px; border-radius: 12px; }
.pill .muted { margin-left: 2px; font-weight: 400; }
.stack .text-input { height: 32px; }

/* ── the inspector's fields ── */
.field .key { flex: none; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink-3); display: inline-flex; align-items: center; min-width: 12px; }
.field .key.scrub { cursor: ew-resize; user-select: none; }
.field .key.scrub:hover { color: var(--c-blue); }
.field .suffix { flex: none; font-size: var(--fs-micro); color: var(--c-ink-3); }
.field.disabled { background: var(--c-surface); }
.field.block .key { margin-bottom: 2px; }
.seg { display: inline-flex; padding: 2px; gap: 1px; height: 28px; border-radius: var(--r-control); background: var(--c-fill); }
.seg button { flex: 1; min-width: 28px; border-radius: 4px; color: var(--c-ink-3); display: inline-flex; align-items: center; justify-content: center; transition: background .18s var(--ease), color .18s var(--ease); }
.seg button:hover { color: var(--c-ink); }
.seg button.on { background: var(--c-white); color: var(--c-ink); box-shadow: 0 1px 2px rgba(18, 21, 26, .12); }
.align-row { display: flex; align-items: center; gap: 2px; }
.align-row .gap { margin-left: auto; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; font-size: var(--fs-sm); color: var(--c-ink-2); cursor: pointer; }
.switch.sm { width: 30px; height: 18px; }
.switch.sm::after { width: 14px; height: 14px; }
.switch.sm:checked::after { transform: translateX(12px); }
.insp-head .who .name { font: 600 var(--fs-base)/1.2 var(--f-display); letter-spacing: -.01em; color: var(--c-ink); text-align: left; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; border-radius: 4px; }
.insp-head .who .name:hover { color: var(--c-blue); }
.insp-head .who .name-input { font: 600 var(--fs-base)/1.2 var(--f-display); border: 1px solid var(--c-blue); border-radius: 4px; padding: 1px 4px; outline: 0; width: 100%; }
.fill-row { display: flex; align-items: center; gap: 4px; }
/* An editor of several lines, a shadow or a stroke: its lines stack, each shrinking to the panel. */
.stack-row { display: flex; flex-direction: column; gap: 4px; }
.fill-row .field, .swatch-row > .field { flex: none; width: 68px; }
.fill-row > .lights-rows { flex: 1 1 0; min-width: 0; }
.light-row .swatch-row > .field { width: 60px; }
.fill-row .stops { display: flex; flex-direction: column; gap: 4px; padding-left: 26px; }
.fill-row .select-anchor.grow, .fill-row .select-anchor.grow .select-btn { flex: 1; min-width: 0; }
.swatch-row .swatch { display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-3); }
.swatch.grain { background: repeating-conic-gradient(#c8ccd2 0 25%, #eceef2 0 50%) 0 0 / 6px 6px; }
.swatch-anchor .menu { min-width: 0; padding: 10px; }
.picker { width: 232px; display: flex; flex-direction: column; gap: 10px; }
.picker-sv { position: relative; height: 140px; border-radius: var(--r-control); cursor: crosshair; touch-action: none; }
.picker-hue { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); cursor: ew-resize; touch-action: none; }
.picker .knob { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(18, 21, 26, .3), 0 1px 3px rgba(18, 21, 26, .3); transform: translate(-50%, -50%); pointer-events: none; }
.picker-hue .knob { top: 50%; }
.picker-row { display: flex; align-items: center; gap: 8px; }
.swatch.lg { width: 28px; height: 28px; border-radius: var(--r-control); }
.picker-vars { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--c-line); }
.var-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.var-swatch { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px; border-radius: var(--r-control); font-size: var(--fs-sm); color: var(--c-ink-2); text-align: left; }
.var-swatch:hover { background: var(--c-fill); color: var(--c-ink); }
.var-swatch.on { background: var(--c-blue-soft); color: var(--c-blue); }
.var-swatch .swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.var-swatch .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-anchor, .font-anchor .select-btn { width: 100%; }
.font-anchor .menu { width: 100%; min-width: 0; padding: 8px; }
.font-list { display: flex; flex-direction: column; gap: 6px; }
.font-items { max-height: min(400px, 56vh); overflow: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -2px; padding: 0 2px; }
.font-list .text-input { width: 100%; flex: none; }
.font-cats { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-control); background: var(--c-fill); flex: none; }
.font-cats button { flex: 1; height: 24px; border-radius: 4px; font-size: var(--fs-micro); font-weight: 500; color: var(--c-ink-3); transition: color .18s var(--ease), background .18s var(--ease); }
.font-cats button:hover { color: var(--c-ink); }
.font-cats button.on { background: var(--c-white); color: var(--c-ink); box-shadow: 0 1px 2px rgba(18, 21, 26, .12); }
.font-items .eyebrow { padding: 10px 9px 4px; }
.font-items .hint { padding: 6px 9px; }
.font-item { height: 34px; flex: none; }
.font-item .text { font-size: 15px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.font-item .meta { font-size: var(--fs-micro); text-transform: capitalize; }
.menu-form { display: flex; align-items: center; gap: 6px; padding: 2px 4px 4px; }
.menu-form .text-input { width: 64px; flex: none; }
.panel-body.tight { padding: 4px 6px 12px; gap: 0; }

/* ── layers ── */
.layers { display: flex; flex-direction: column; }
.layer { display: flex; align-items: center; gap: 4px; height: 28px; padding-right: 4px; border-radius: var(--r-control); color: var(--c-ink-2); font-size: var(--fs-sm); cursor: default; position: relative; user-select: none; padding-left: 6px; animation: fade .16s var(--ease); }
.layer:hover { background: rgba(18, 21, 26, .04); color: var(--c-ink); }
.layer.on { background: var(--c-blue-soft); color: var(--c-ink); }
.layer.hidden .name, .layer.hidden .ic { opacity: .45; }
.layer .caret { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-3); flex: none; border-radius: 3px; }
.layer .caret svg { transition: transform .16s var(--ease); }
.layer.open > .caret svg { transform: rotate(90deg); }
.layer .ic { display: inline-flex; color: var(--c-ink-3); flex: none; }
.layer .ic.component { color: #7c3aed; }
.layer.on .ic { color: var(--c-blue); }
.layer .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer .name .tag { margin-left: 6px; font-size: var(--fs-micro); color: var(--c-ink-3); }
.layer .rename { flex: 1; min-width: 0; height: 22px; padding: 0 4px; border: 1px solid var(--c-blue); border-radius: 4px; outline: 0; font-size: var(--fs-sm); }
.layer .acts { display: inline-flex; gap: 0; opacity: 0; }
.layer:hover .acts, .layer .act.on { opacity: 1; }
.layer .act { width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-3); }
.layer .act:hover { background: var(--c-fill); color: var(--c-ink); }
.layer .act.on { color: var(--c-ink-2); }
.layer.drop-before::before, .layer.drop-after::after { content: ''; position: absolute; left: 8px; right: 4px; height: 2px; background: var(--c-blue); border-radius: 1px; }
.layer.drop-before::before { top: -1px; }
.layer.drop-after::after { bottom: -1px; }
.layer.drop-inside { box-shadow: inset 0 0 0 1.5px var(--c-blue); }

/* ── tooltips ── */
.tip { position: fixed; z-index: 200; transform: translate(-50%, 0); display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 7px; background: var(--c-ink); color: var(--c-on-ink); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(18, 21, 26, .18); animation: tip .12s var(--ease); }
.tip.above { transform: translate(-50%, -100%); animation: tipAbove .12s var(--ease); }
.tip kbd { font: 500 var(--fs-micro)/1 var(--f-ui); color: var(--c-on-ink-2); background: var(--c-on-ink-soft); padding: 2px 5px; border-radius: 4px; }
@keyframes tip { from { opacity: 0; transform: translate(-50%, 2px); } }
@keyframes tipAbove { from { opacity: 0; transform: translate(-50%, calc(-100% - 2px)); } }

/* ── the panels' edges, and the panels gone ── */
.resizer { position: absolute; top: 0; bottom: 0; width: 10px; z-index: 15; cursor: col-resize; touch-action: none; }
.resizer.left { left: -5px; }
.resizer.right { right: -5px; }
.resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); border-radius: 1px; background: transparent; transition: background .14s var(--ease); }
.resizer:hover::after, .resizer:active::after { background: var(--c-blue); }
.app.bare { grid-template-columns: 0 minmax(0, 1fr) 0; }
.app.bare .leftpanel, .app.bare .sidebar { display: none; }
.app.bare .stage { padding-left: var(--inset); }
.layer .guide { flex: none; width: 14px; height: 100%; position: relative; }
.layer .guide::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 1px; background: var(--c-line); }
.layer.on .guide::before { background: rgba(23, 105, 255, .25); }
.send, .btn.primary { will-change: transform; }

/* ── the inspector, quiet: fields are fills, edges appear on hover and focus ── */
.insp-title { font-size: 11.5px; font-weight: 600; color: var(--c-ink); letter-spacing: -.005em; }
.sidebar .insp-section { padding: 10px 12px 12px; gap: 6px; }
.sidebar .insp-section .row-between { min-height: 24px; margin-bottom: 2px; }
/* A header that adds: the whole row is the button, and its label never selects as text. */
.insp-headpop { display: flex; width: 100%; }
.insp-headrow { width: 100%; padding: 0; margin: 0 -4px; padding: 0 4px; border-radius: var(--r-control); text-align: left; user-select: none; -webkit-user-select: none; color: inherit; }
.insp-headrow:hover { background: var(--c-fill); }
.insp-headrow:hover .btn.icon { color: var(--c-ink); }
.insp-headrow .btn.icon { pointer-events: none; }
.insp-title { user-select: none; -webkit-user-select: none; }
.sidebar .field, .sidebar .hex, .sidebar .pct, .sidebar .select-btn, .sidebar .seg { background: var(--c-field); border-color: transparent; box-shadow: none; }
.sidebar .field:hover, .sidebar .hex:hover, .sidebar .pct:hover, .sidebar .select-btn:hover { border-color: var(--c-line-strong); background: var(--c-field); }
.sidebar .field:focus-within, .sidebar .hex:focus, .sidebar .pct:focus, .sidebar .select-btn.open { background: var(--c-white); border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.sidebar .field.disabled { background: transparent; border-color: transparent; }
.sidebar .field.disabled input { color: var(--c-ink-3); }
.sidebar .field.disabled:hover { border-color: transparent; }
.sidebar .field .key { font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--c-ink-3); min-width: 12px; }
.sidebar .field.block .key { margin-bottom: 0; }
.sidebar .select-btn .select-key { font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.sidebar .seg button.on { background: var(--c-white); box-shadow: 0 1px 2px rgba(18, 21, 26, .12), 0 0 0 1px rgba(18, 21, 26, .05); }
.sidebar .insp-head { padding: 10px 8px 10px 12px; }
.sidebar .align-row .btn.icon { width: 28px; height: 28px; color: var(--c-ink-2); }
.sidebar .align-row .btn.icon:hover { color: var(--c-ink); }
.sidebar .toggle-row { min-height: 26px; }
.sidebar .fill-row .field { background: var(--c-field); }
.sidebar .fill-row .swatch { box-shadow: inset 0 0 0 1px rgba(18, 21, 26, .12); }
.sidebar .field.block textarea { min-height: 56px; }
.grain-row .field { flex: 1; width: auto; min-width: 0; }
.sidebar .swatch-row .hex { flex: 1; min-width: 0; }

/* Motion. Everything that enters rises a few pixels into place; a step lands with its check; the
   pill under the tabs slides; the plane on the send button flies; nothing bounces. The canvas has
   its own: nodes fade in, the camera glides, a selection's outline comes up. A preference against
   motion turns all of it off. */
.segmented, .seg { position: relative; }
.segmented > button, .seg > button { position: relative; z-index: 1; }
.segmented button.on, .seg button.on, .sidebar .seg button.on { background: none; box-shadow: none; }
.segmented .ind { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; border-radius: var(--r-control); background: var(--c-white); box-shadow: 0 1px 3px rgba(18, 21, 26, .1), 0 0 0 1px rgba(18, 21, 26, .04); transition: transform .24s var(--ease), opacity .12s; }
.seg .ind { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 0; border-radius: 4px; background: var(--c-white); box-shadow: 0 1px 2px rgba(18, 21, 26, .12), 0 0 0 1px rgba(18, 21, 26, .05); transition: transform .2s var(--ease), opacity .12s; }
.feed > * { animation: rise .22s var(--ease); }
.steps-head .mark-done { animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.empty > h3, .empty > p { animation: rise .32s var(--ease) both; }
.empty > p { animation-delay: 50ms; }
.sugg:nth-child(2) { animation-delay: 150ms; }
.sugg:nth-child(3) { animation-delay: 200ms; }
.queued, .comments .comment { animation: rise .22s var(--ease); }
.send svg { transition: transform .18s var(--ease); }
.send:hover:not(:disabled) svg { transform: translate(1px, -1px); }
.send.sent svg { animation: fly .42s var(--ease); }
@keyframes fly { 0% { transform: none; opacity: 1; } 42% { transform: translate(12px, -12px); opacity: 0; } 50% { transform: translate(-8px, 8px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.agent-cursor > * { animation: cursorIn .3s var(--ease); }
@keyframes cursorIn { from { opacity: 0; transform: scale(.7); } }
.doc-card .pic img, .page-pic img { animation: fade .3s var(--ease); }
@keyframes fromLeft { from { opacity: 0; transform: translateX(-8px); } }
@keyframes fromRight { from { opacity: 0; transform: translateX(8px); } }
.sidebar .insp-head, .sidebar .insp-section { animation: fade .16s var(--ease); }
.tool-rail, .zoom { animation: rise .3s var(--ease); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

.menu-item:has(.text .hint) { height: auto; min-height: 32px; padding-top: 6px; padding-bottom: 6px; }
.menu.ctx { position: fixed; top: auto; left: auto; z-index: 120; min-width: 196px; }
.menu-item kbd.meta { font-family: inherit; font-size: var(--fs-micro); letter-spacing: .04em; }
.menu-item.danger { color: var(--c-red); }
.menu-item.danger:hover:not(:disabled) { background: var(--c-red-soft); color: var(--c-red); }
.menu-item:disabled { opacity: .4; }
.comment .btn.sm.icon { color: var(--c-ink-3); }

/* Variables: a name reads as a token; a bound field shows the token and what it stands for. */
.token { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px 0 5px; border-radius: 5px; background: rgba(18, 21, 26, .06); color: var(--c-ink); font-size: var(--fs-sm); font-weight: 500; line-height: 1; white-space: nowrap; }
.token svg { color: var(--c-ink-3); }
.bound { flex: 1; min-width: 0; height: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 0 2px; text-align: left; overflow: hidden; }
.bound .resolved, .select-label .resolved { color: var(--c-ink-3); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-label .resolved { margin-left: 6px; }
.var-row .field { width: 104px; flex: none; margin-left: auto; }

/* Fills: one row per fill; a gradient edits behind its swatch on a strip of stops. */
.swatch-row .bound .resolved { display: none; }
.swatch-row .kind .meta { color: var(--c-ink-3); font-size: var(--fs-micro); }
.grad-editor { width: 232px; display: flex; flex-direction: column; gap: 10px; }
.grad-editor .picker-row .field { flex: 1; min-width: 0; }
.grad-editor .picker-row .select-anchor.wide { flex: 1.4; }
.grad-bar { position: relative; height: 16px; margin: 4px 7px 6px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(18, 21, 26, .14); background-size: 100% 100%, 10px 10px; cursor: copy; }
.grad-knob { position: absolute; top: 50%; width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(18, 21, 26, .35), 0 1px 3px rgba(18, 21, 26, .3); transform: translate(-50%, -50%); cursor: ew-resize; background-clip: padding-box; }
.grad-knob.on { box-shadow: 0 0 0 2px var(--c-blue), 0 1px 3px rgba(18, 21, 26, .3); }
.grad-knob:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--c-blue), 0 0 0 4px var(--c-blue-ring); }
.swatch[style*="gradient"] { background-size: 100% 100%, 8px 8px; }

.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.swatch.fx { display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-3); background: var(--c-fill); }
.fill-row .swatch-row .select-anchor.grow .select-btn { padding-right: 6px; }

.dot-sep { margin: 0 5px; color: var(--c-ink-3); }

/* Variables: modes as chips, rows by kind, a bind on any number field, a detach on a bound one. */
.vars { display: flex; flex-direction: column; gap: 10px; }
.vars .insp-title-row { min-height: 24px; }
.var-modes { display: flex; flex-wrap: wrap; gap: 4px; }
.chip.mode { height: 24px; padding: 0 2px 0 9px; gap: 2px; cursor: default; }
.chip.mode > button:first-child { height: 100%; padding: 0 5px 0 0; color: inherit; font: inherit; }
.chip.mode.on { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-on-ink); }
.chip.mode .x { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: inherit; opacity: .5; }
.chip.mode .x:hover { opacity: 1; background: var(--c-on-ink-soft); }
.chip.mode:not(.on) .x:hover { background: var(--c-fill-2); }
.chip.mode.naming { padding-right: 8px; }
.chip.mode .rename { height: 18px; width: 72px; border: 0; background: none; outline: 0; font-size: var(--fs-micro); }
button.chip.mode { padding-right: 9px; }
.var-group { display: flex; flex-direction: column; gap: 4px; }
.var-group .eyebrow { padding: 4px 0 2px; }
.var-row .swatch-row { flex: none; width: 128px; margin-left: auto; }
.var-row .swatch-row .hex, .var-row .swatch-row .bound-wrap { flex: 1; min-width: 0; }
.var-row.inherited .field, .var-row.inherited .swatch-row { opacity: .55; }
.var-row.naming .rename { flex: 1; min-width: 0; height: 24px; padding: 0 6px; border: 1px solid var(--c-blue); border-radius: var(--r-control); outline: 0; font-size: var(--fs-sm); }
.var-row .rename { flex: 1; min-width: 0; height: 24px; padding: 0 6px; border: 1px solid var(--c-blue); border-radius: var(--r-control); outline: 0; font-size: var(--fs-sm); }
.bound-wrap { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 2px; height: 100%; }
.bound-wrap .bound { flex: 1; }
.unbind { flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-3); opacity: 0; }
.bound-wrap:hover .unbind, .field:focus-within .unbind { opacity: 1; }
.unbind:hover { background: var(--c-fill-2); color: var(--c-ink); }
.bind-anchor { flex: none; display: inline-flex; margin-left: 2px; position: absolute; right: 3px; top: 50%; transform: translateY(-50%); margin: 0; }
.field .bind { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-3); opacity: 0; transition: opacity .15s var(--ease); }
.field:hover .bind, .field:focus-within .bind, .bind-anchor .menu ~ * .bind { opacity: 1; }
.field .bind:hover { background: var(--c-fill-2); color: var(--c-ink); }
.bind-anchor .menu { min-width: 160px; }

.var-row .var-name-btn { flex: 1; min-width: 0; text-align: left; padding: 0 2px; font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-row .var-name-btn:hover { color: var(--c-blue); }

/* Home: a search, a menu on each card, and a confirmation before a delete. */
.home-search { width: 220px; height: 32px; flex: none; }
.doc-card .more { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--c-white); box-shadow: 0 1px 3px rgba(18, 21, 26, .18); color: var(--c-ink-2); display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s var(--ease); }
.doc-card:hover .more, .doc-card:focus-within .more { opacity: 1; }
.doc-card .more:hover { color: var(--c-ink); }
.doc-card .rename { height: 24px; padding: 0 6px; border: 1px solid var(--c-blue); border-radius: var(--r-control); outline: 0; font: 500 var(--fs-md)/1.3 var(--f-display); }
.dialog.confirm { width: 380px; }
.btn.danger { background: var(--c-red); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #c8283a; color: #fff; }
/* The bind button sits over the field's right edge and takes no width from the number. */


/* The welcome: three numbered steps in a new document. */
.welcome { display: flex; flex-direction: column; gap: 12px; padding: 8px 2px; color: var(--c-ink-2); line-height: 1.5; }
.welcome h3 { font: 600 var(--fs-h)/1.15 var(--f-display); letter-spacing: -.03em; color: var(--c-ink); }
.welcome .steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; padding: 4px 0 0; margin: 0; }
.welcome .steps li { position: relative; padding-left: 30px; display: flex; flex-direction: column; gap: 6px; }
.welcome .steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-ink); color: var(--c-on-ink); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.welcome .steps strong { color: var(--c-ink); font-weight: 600; }
.welcome .steps li > span { font-size: var(--fs-sm); color: var(--c-ink-3); line-height: 1.45; }
.welcome .row-left { display: flex; gap: 6px; }
.welcome .row-left .text-input { flex: 1; min-width: 0; }
.welcome .suggs { margin-top: 2px; }

/* The organisation page: a left nav, a wide main, tables with heads, a few numbers up top. */
.org { height: 100%; overflow: auto; background: var(--c-surface); display: flex; flex-direction: column; }
.org-head { display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-bottom: 1px solid var(--c-line); }
.org-head .wordmark { padding: 4px 6px; }
.org-head .btn.link { color: var(--c-ink-2); display: inline-flex; align-items: center; gap: 6px; }
.pill.static { cursor: default; }
.org-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; max-width: 1240px; width: 100%; margin: 0 auto; padding: 28px 24px 64px; }
.org-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; align-self: start; }
.org-title { padding: 6px 10px 16px; }
.org-title h1 { font: 600 22px/1.15 var(--f-display); letter-spacing: -.03em; }
.org-title .muted { display: block; margin-top: 4px; font-size: var(--fs-sm); }
.org-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.org-main h2 { font: 600 var(--fs-h)/1.15 var(--f-display); letter-spacing: -.03em; }
.org-section { display: flex; flex-direction: column; gap: 10px; }
.org-section h3 { font: 600 var(--fs-md)/1.2 var(--f-display); letter-spacing: -.01em; }
.org-section.danger { padding: 14px 16px; border: 1px solid var(--c-red-soft); border-radius: var(--r-card); background: rgba(217, 48, 66, .03); align-items: flex-start; }
.org-toolbar { display: flex; align-items: center; gap: 8px; }
.org-toolbar .text-input { flex: 1; min-width: 0; max-width: 360px; }
.org-toolbar .at { color: var(--c-ink-3); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-card); }
.stat-label { font-size: var(--fs-micro); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-3); }
.stat-value { font: 600 26px/1.1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-note { font-size: var(--fs-sm); color: var(--c-ink-3); }
.table.grid .table-row, .table.grid .table-head { display: grid; align-items: center; gap: 12px; }
.table.grid.people .table-row, .table.grid.people .table-head { grid-template-columns: minmax(200px, 2fr) 120px 100px 110px 120px 32px; }
.table.grid.invites .table-row, .table.grid.invites .table-head { grid-template-columns: minmax(180px, 2fr) 100px 120px 90px 100px 120px; }
.table.grid.usage .table-row, .table.grid.usage .table-head { grid-template-columns: minmax(180px, 2fr) 70px 100px minmax(120px, 1fr); }
.table-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-3); border-bottom: 1px solid var(--c-line); }
.table-head .grow { flex: 1; }
.table-head .num { min-width: 64px; text-align: right; }
.table .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .who > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .num { font-variant-numeric: tabular-nums; }
.table .bar { display: flex; align-items: center; gap: 8px; }
.table .bar i { display: block; height: 6px; min-width: 2px; border-radius: 3px; background: var(--c-blue); flex: none; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .02em; background: var(--c-fill); color: var(--c-ink-2); white-space: nowrap; }
.badge.role-owner { background: var(--c-ink); color: var(--c-on-ink); }
.badge.role-admin { background: var(--c-blue-soft); color: var(--c-blue); }
.badge.current { background: var(--c-blue); color: #fff; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-card); }
.plan.on { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.plan strong { font: 600 var(--fs-md)/1.2 var(--f-display); }
.plan ul { margin: 6px 0 10px; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); color: var(--c-ink-2); }
.plan .btn, .plan .badge { align-self: flex-start; margin-top: auto; }
@media (max-width: 900px) { .org-body { grid-template-columns: 1fr; } .org-nav { position: static; flex-direction: row; flex-wrap: wrap; } .plans { grid-template-columns: 1fr; } }

/* The brand on the organisation page, and the two buttons under a document's own. */
.brand-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.welcome .steps li.done::before { content: '✓'; background: var(--c-green); }

/* The model menu: a search, the models by provider, an effort off each model to the right. */
.model-menu .menu { min-width: 280px; padding: 6px; overflow: visible; }
.menu-search { height: 30px; margin: 2px 2px 6px; padding: 0 9px; border: 1px solid var(--c-line); border-radius: var(--r-control); background: var(--c-surface); font-size: var(--fs-sm); outline: 0; width: calc(100% - 4px); }
.menu-search:focus { border-color: var(--c-blue); background: var(--c-white); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.menu-scroll { position: relative; max-height: 380px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.menu-group { display: flex; flex-direction: column; gap: 1px; padding-bottom: 6px; }
.menu-group .menu-title .meta { margin-left: 8px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--c-ink-3); }
.menu-group.off .menu-item { color: var(--c-ink-3); cursor: default; }
.menu-group.off .menu-item:hover { background: none; }
.menu-item.model { cursor: pointer; }
/* The model menu floats over the window so the effort list has room beside it. */
.model-float { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.model-float > * { pointer-events: auto; }
.model-panel { position: fixed; top: auto; right: auto; width: 280px; max-width: calc(100vw - 16px); transform-origin: bottom left; }
.model-panel .menu-scroll { max-height: min(52vh, 420px); }
.model-panel .menu-item.model { padding-right: 6px; }
.model-panel .menu-item.model > svg:last-child { margin-left: auto; color: var(--c-ink-3); flex: none; }
.model-panel .menu-item.beside { background: var(--c-fill); color: var(--c-ink); }
.model-sub { position: fixed; top: auto; left: auto; width: 208px; transform-origin: top left; }

/* Pages in the layer tree: a picture, a number, the size; the layers of a page open beneath it. */
.layer.page { height: auto; padding: 5px 6px 5px 4px; gap: 8px; margin-top: 2px; }
.layer.page .page-pic { flex: none; width: 64px; background: var(--c-white); border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--c-line-strong); display: block; }
.layer.page .page-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.layer.page.on .page-pic { box-shadow: 0 0 0 2px var(--c-blue); }
.layer.page .page-name { display: flex; flex-direction: column; gap: 1px; white-space: normal; }
.layer.page .page-name > span:first-child { color: var(--c-ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer.page .page-name .num { color: var(--c-ink-3); font-weight: 600; }
.layer.page .page-name .tag { margin: 0; font-size: var(--fs-micro); color: var(--c-ink-3); }
.add-page { padding: 10px 8px 4px; }

/* The brand on the organisation page: the essentials, and the door to the design system. */
.system { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.system-cover { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-panel); overflow: hidden; background: var(--c-fill); box-shadow: inset 0 0 0 1px var(--c-line); }
.system-cover > img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.system-cover .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.system-cover .empty img { height: 28px; width: auto; opacity: .7; }
.system-cover:hover { box-shadow: inset 0 0 0 1px var(--c-blue), 0 0 0 3px var(--c-blue-ring); }
.system-facts { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.system-logo img { height: 28px; width: auto; display: block; }
.system-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.system-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 5px; border-radius: var(--r-pill); background: var(--c-white); border: 1px solid var(--c-line); font-size: var(--fs-sm); text-transform: capitalize; }
.system-chip i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(18, 21, 26, .12); }
.system-chip .muted { text-transform: none; font-variant-numeric: tabular-nums; }
.system-faces { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; align-items: baseline; }
.system-faces .muted { font-size: var(--fs-sm); }

/* Fill rows: the swatch, the value and the opacity in one box; the eye and the minus beside it. */
.fill-row.off .swatch-row.boxed { opacity: .45; }
.swatch-row.boxed { flex: 1; min-width: 0; padding: 0 0 0 4px; background: var(--c-white); border: 1px solid var(--c-line-strong); border-radius: var(--r-control); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 1px rgba(18, 21, 26, .03); gap: 4px; transition: border-color .14s var(--ease), box-shadow .14s var(--ease); }
.swatch-row.boxed:hover { border-color: rgba(18, 21, 26, .22); }
.swatch-row.boxed:focus-within { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.swatch-row.boxed .hex { background: none; border: 0; box-shadow: none; padding: 0 4px; height: 26px; }
.swatch-row.boxed .field { width: 58px; height: 26px; padding: 0 6px 0 4px; border: 0; border-left: 1px solid var(--c-line); border-radius: 0; background: none; box-shadow: none; margin-left: auto; }
.swatch-row.boxed .field input { text-align: right; }
.swatch-row.boxed .select-anchor.grow .select-btn { border: 0; background: none; box-shadow: none; height: 26px; }
.fill-row .btn.icon.on { color: var(--c-ink-3); }
/* The plan page: packs as cards, what costs what, the movements on the ledger. */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pack { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-card); }
.pack-credits { font: 600 22px/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pack strong { margin-top: 8px; font-weight: 600; }
.pack .btn { align-self: flex-start; margin-top: 10px; }
.pack.quiet { background: var(--c-surface); }
.pack .hint { margin-top: 10px; }
.table.costs .num { min-width: 96px; color: var(--c-ink-2); }
.table-row .num.plus { color: var(--c-green); }
.org-toolbar h3 { margin: 0; }
.org-toolbar .grow { flex: 1; }

/* The feed: the designer's head on a turn, the pages a step touched as pictures, files dropped on the chat. */
.turn-who { display: inline-flex; align-items: center; gap: 5px; margin: 10px 0 0 2px; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-3); }
.step.with-pics { align-items: flex-start; padding-top: 6px; }
.step.with-pics .mark-done, .step.with-pics .tool-ic { margin-top: 2px; }
.step-pics { display: flex; gap: 6px; margin-top: 6px; }
.step-pic { width: 92px; aspect-ratio: 16 / 9; padding: 0; border-radius: 5px; overflow: hidden; background: var(--c-fill); box-shadow: inset 0 0 0 1px var(--c-line); cursor: pointer; transition: box-shadow .14s var(--ease), transform .14s var(--ease); }
.step-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.step-pic:hover { box-shadow: 0 0 0 2px var(--c-blue); transform: translateY(-1px); }
.feed.dropping, .compose.dropping { box-shadow: inset 0 0 0 2px var(--c-blue); border-radius: var(--r-panel); background: var(--c-blue-soft); }

.stage-note.gone { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stage-note.gone strong { font: 600 var(--fs-md)/1.2 var(--f-display); color: var(--c-ink); }
.stage-note.gone .btn { margin-top: 8px; }

/* The conversation's past: a dated divider where the day changes, who asked when it was not you, a way to clear it. */
.feed-day { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-3); }
.feed-day::before, .feed-day::after { content: ''; flex: 1; height: 1px; background: var(--c-line); }
.you .chips { margin-top: 8px; }
.you .chip { height: 22px; font-size: var(--fs-micro); }
.you .chip.file { padding-right: 9px; }
.you .by { display: block; margin-bottom: 2px; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink-3); }
/* The chat in view above the feed, and the list of the earlier ones. */
.chat-head { flex: none; display: flex; align-items: center; gap: 4px; margin: -4px 14px 4px; }
.chat-pick { flex: 1; min-width: 0; position: relative; }
.chat-title { width: 100%; height: 28px; padding: 0 6px 0 8px; border-radius: var(--r-control); display: inline-flex; align-items: center; gap: 6px; color: var(--c-ink); font-size: var(--fs-sm); font-weight: 500; text-align: left; transition: background .18s var(--ease); }
.chat-title:hover, .chat-title.open { background: var(--c-fill); }
.chat-title .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title > svg { color: var(--c-ink-3); flex: none; }
.chat-pick .menu { width: 300px; max-width: calc(100vw - 32px); }
.chat-row { min-height: 40px; height: auto; padding: 5px 6px 5px 9px; cursor: default; }
.chat-row .text { flex: 1; min-width: 0; }
.chat-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .del { flex: none; width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink-3); opacity: 0; transition: opacity .18s var(--ease), background .18s var(--ease); }
.chat-row:hover .del, .chat-row .del:focus-visible { opacity: 1; }
.chat-row .del:hover { background: var(--c-red-soft); color: var(--c-red); }
.menu-note { padding: 8px 9px 10px; white-space: normal; }
/* Something held over the canvas: a ring and a line saying where it will land. */
.canvas-drop { position: absolute; inset: 8px; z-index: 30; border-radius: var(--r-panel); border: 2px dashed var(--c-blue); background: rgba(23, 105, 255, .05); display: grid; place-items: center; pointer-events: none; animation: fade .16s var(--ease); }
.canvas-drop span { padding: 8px 14px; border-radius: var(--r-pill); background: var(--c-white); border: 1px solid var(--c-line-strong); box-shadow: var(--shadow-menu); font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink); }
/* A step opens to show the command it ran and what came back. */
.step.opens { cursor: default; }
.step.opens:hover { background: rgba(18, 21, 26, .035); }
.step.shown { flex-wrap: wrap; background: rgba(18, 21, 26, .035); }
.step-more { flex-basis: 100%; margin: 4px 0 2px 33px; padding: 8px 10px; border-radius: var(--r-control); background: var(--c-white); border: 1px solid var(--c-line); font: 400 var(--fs-micro)/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--c-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; user-select: text; }
/* What the designer is doing, on the canvas, while a run is alive. */
/* The first move on the home screen: the kind, the ask, and three ways in from something that exists. */
/* The composer is the first thing on the home screen and stands in the middle of it: its own
   measure, centred on the same axis as the heading and the grid of cards. */
.start { margin: 8px auto 32px; display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.kinds { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.kind { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: var(--c-white); border: 1px solid var(--c-line-strong); color: var(--c-ink-2); font-size: var(--fs-sm); font-weight: 500; transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease); }
.kind:hover { color: var(--c-ink); border-color: rgba(18, 21, 26, .24); }
.kind.on { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-on-ink); }
.kind.on svg { color: var(--c-on-ink); }
.ask { background: var(--c-white); border: 1px solid var(--c-line-strong); border-radius: var(--r-card); box-shadow: 0 1px 2px rgba(18, 21, 26, .04); padding: 12px 12px 8px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.ask:focus-within { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-blue-ring); }
.ask textarea { width: 100%; min-height: 52px; border: 0; outline: 0; resize: none; background: none; font: 400 var(--fs-md)/1.5 var(--f-ui); color: var(--c-ink); }
.ask textarea::placeholder { color: var(--c-ink-3); }
.ask-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.ask-foot .hint { font-size: var(--fs-micro); color: var(--c-ink-3); }
.ask .send { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sheen), var(--c-blue); border: 1px solid var(--c-blue-deep); color: #fff; box-shadow: var(--shadow-blue); transition: transform .18s var(--ease), opacity .18s var(--ease); }
.ask .send:disabled { background: var(--c-fill-2); border-color: transparent; color: var(--c-ink-3); box-shadow: none; }
.ask .send:hover:not(:disabled) { transform: translateY(-1px); }
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.way { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border-radius: var(--r-card); background: var(--c-white); border: 1px solid var(--c-line); text-align: left; transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease); }
.way:hover:not(:disabled) { border-color: rgba(18, 21, 26, .2); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(18, 21, 26, .06); }
.way svg { color: var(--c-ink-3); }
.way strong { font-size: var(--fs-base); font-weight: 600; color: var(--c-ink); }
.way span { font-size: var(--fs-sm); color: var(--c-ink-3); line-height: 1.45; }
.from-site { display: flex; align-items: center; gap: 8px; }
.from-site .text-input { max-width: 320px; }
