/* Blueprint Studio demo.

   Note on dynamic values: the server serves `style-src 'self'` with no
   `unsafe-inline`, which blocks every write to a style attribute — including
   `element.style.width`. Anything that changes at runtime is therefore driven by a
   class, or by a custom property on a rule the script inserts through CSSOM.
   The pane widths, the side panes' and the stage's own, are those properties. */

/* **Studio's design system, as CSS.** Every value in these two blocks is
   `app/DesignSystem.json` in blueprint-ios-studio, under the role this stylesheet has
   always called it, so the website and the Mac app draw one palette, one type scale and
   one set of control sizes. When Studio's file changes, these blocks change with it;
   nothing below them should hold a colour, a type size or a control size of its own.

   Two themes, one set of roles. Every chrome colour is a role rather than a literal —
   ink, surface, line, selection, the primary action, work in progress, or one of three
   states — so the dark theme is a second value per role and not a second stylesheet.

   The chrome is neutral grey so that the previewed app is the only strong colour on the
   page. Orange is reserved, as in Studio, for three things: the primary action
   (`--primary`), keyboard focus (`--focus`), and work in progress (`--activity`). A
   selection is none of them: a selected segment, row, tab or choice is a raised neutral
   fill, a neutral border and primary ink.

   The device preview is deliberately excluded. Its light and dark are the *built app's*
   appearance, chosen by the project's theme setting, and have nothing to do with which
   theme the person reading the website prefers. Those rules keep their literals, which are
   Studio's device colours. */
:root {
  color-scheme: light;
  /* Ink: Studio's text, textSecondary and textMuted. */
  --ink: #18181b;
  --ink-soft: #52525b;
  --muted: #67676f;
  /* Surfaces. The panes and the top bar are soft grey; white is kept for what sits on
     them — inputs, selected items, secondary buttons and raised cards. */
  --canvas: #ececef;
  --panel: #f4f4f5;
  --panel-muted: #ececef;
  --raised: #ffffff;
  --inset: #e9e9ec;
  --white: #ffffff;
  --chip: #e3e3e7;
  --stage-pane: #ececef;
  --stage-bg: #e5e5e8;
  --stage-dot: #d1d1d6;
  --line: #dadadf;
  --line-soft: #e4e4e7;
  --line-strong: #c9c9cf;
  --hover: rgba(24,24,27,.05);
  --pressed: rgba(24,24,27,.09);
  /* The primary action: Studio's accent1. White on its base measures 4.73:1. */
  --primary: #cf420b;
  --primary-hover: #bd3b09;
  --primary-pressed: #a93407;
  --on-primary: #ffffff;
  /* Selection: accent1's muted, line, strong and text, which Studio made neutral. */
  --selected-fill: #ffffff;
  --selected-line: #d1d1d6;
  --selected-line-strong: #a1a1aa;
  --selected-ink: #18181b;
  /* Keyboard focus: accent1's base, which clears 3.70:1 on the darkest light surface. */
  --focus: #cf420b;
  /* Work in progress: Studio's activity family — a queued or generating chat turn, and
     the line that travels round the View pane while one runs. */
  --activity: #ff5a1f;
  --activity-ink: #c2410c;
  --activity-wash: #ffede5;
  --activity-line: #ffd2c0;
  --stage-glow: rgba(255,90,31,.26);
  /* The three states: success, warning and danger. */
  --green: #2f8f5b;
  --ok-ink: #23744a;
  --ok-bg: #eaf5ef;
  --ok-line: #cde6d8;
  --warn-ink: #7a5c00;
  --warn-mark: #c99a00;
  --warn-bg: #fbf4d9;
  --warn-line: #f0e2a8;
  --danger: #d93036;
  --danger-hover: #c92a30;
  --on-danger: #ffffff;
  --bad-ink: #c42a31;
  --bad-bg: #fdeced;
  --bad-line: #f6c5c7;
  /* A note is information rather than a state, so it takes Studio's neutral family. */
  --note-ink: #52525b;
  --note-mark: #a1a1aa;
  --note-bg: #e3e3e7;
  --note-line: #d1d1d6;
  /* Studio's loadingIndicator: a progress ring that is not a chat turn is neutral. */
  --loading: #67676f;
  /* The brand mark is monochrome, and the account circle is neutral. */
  --brand: #18181b;
  --brand-hover: #27272a;
  --on-brand: #ffffff;
  --account: #3f3f46;
  --account-placeholder: #dedee2;
  /* Provider accents also preserve the identity of historical sources. Retained legacy
     colours do not advertise new attachments; new attachments use Figma. A house grey
     would say a node came from nowhere in particular. */
  --figma-blue: #0d99ff;
  --figma-ink: #075e9d;
  --figma-wash: #dcefff;
  --canva-purple: #7d2ae8;
  --adobe-red: #eb1000;
  --shadow-soft: rgba(0,0,0,.05);
  --shadow-menu: rgba(0,0,0,.14);
  --shadow-card: rgba(0,0,0,.08);
  --scrim: rgba(0,0,0,.4);
  /* Type: Studio's scale, each role a whole `font` value so a rule names a role rather
     than a size. Studio draws in the system face, so the page asks for it first. */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Inter, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --type-h1: 600 24px/30px var(--font-ui);
  --type-h2: 600 18px/24px var(--font-ui);
  --type-h3: 600 15px/20px var(--font-ui);
  --type-h4: 600 13px/18px var(--font-ui);
  --type-body: 400 13px/18px var(--font-ui);
  --type-label: 500 13px/18px var(--font-ui);
  --type-small: 400 12px/16px var(--font-ui);
  --type-small-strong: 500 12px/16px var(--font-ui);
  --type-caption: 400 11px/14px var(--font-ui);
  --type-caption-strong: 600 11px/14px var(--font-ui);
  --type-eyebrow: 600 10px/14px var(--font-ui);
  --type-mono: 400 12px/16px var(--font-mono);
  --eyebrow-tracking: .04em;
  /* Sizes: one control height, and Studio's radii. */
  --control-height: 28px;
  --icon-button: 28px;
  --radius-button: 7px;
  --radius-icon: 6px;
  --radius-badge: 5px;
  --radius-row: 8px;
  --radius-card: 12px;
  /* Motion, in Studio's seconds. */
  --motion-preview: .18s;
  --motion-disclosure: .16s;
  --motion-chat-text: .22s;
  --motion-working-fade: .28s;
  --motion-working-loop: 2.2s;
  --motion-result-pulse: .7s;
  --topbar-height: 62px;
  /* The three workspace columns are properties rather than literals so that collapsing
     a pane is one declaration on <body> instead of a rewrite of every breakpoint. */
  /* Each side pane opens at Studio's width and drags to Studio's ceiling: the rail at
     --rail-base and up to --rail-max, the detail pane at --detail-base and up to
     --detail-max. The room above the opening width is room the centre does not lose by
     default — a nested feature list, or a long connection row, can take it on purpose. */
  --rail-base: 246px;
  --rail-max: 310px;
  --detail-base: 300px;
  --detail-max: 390px;
  --rail-col: var(--rail-base);
  --stage-col: minmax(420px, 1fr);
  --detail-col: var(--detail-base);
  --pane-stub: 62px;
  font-family: var(--font-ui);
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ededf0;
  --ink-soft: #b4b4bc;
  --muted: #8e8e97;
  /* Ordered by lightness the way the light scale is: the page is the darkest thing on
     it, and a surface reads as raised by being lighter than what it sits on. */
  --stage-bg: #0b0b0d;
  --canvas: #111113;
  --stage-pane: #111113;
  --panel-muted: #141416;
  --panel: #18181b;
  --raised: #1f1f23;
  --white: #1f1f23;
  --inset: #222226;
  --chip: #26262b;
  --stage-dot: #1c1c20;
  --line: #2a2a30;
  --line-soft: #222226;
  --line-strong: #3f3f46;
  --hover: rgba(255,255,255,.06);
  --pressed: rgba(255,255,255,.1);
  --primary: #cf420b;
  --primary-hover: #d4450c;
  --primary-pressed: #bd3b09;
  --on-primary: #ffffff;
  /* A selected item is the lightest neutral in the theme, so it stands above the chip
     track it sits in. */
  --selected-fill: #34343a;
  --selected-line: #3a3a42;
  --selected-line-strong: #63636b;
  --selected-ink: #ededf0;
  /* accent1's base falls to 2.61:1 on a selected fill here, under the 3:1 a focus
     indicator owes, so the ring takes the activity orange, which clears 4.36:1 on every
     dark surface. */
  --focus: #ff6b33;
  --activity: #ff6b33;
  --activity-ink: #ff8a5c;
  --activity-wash: #33190f;
  --activity-line: #5c2a17;
  --stage-glow: rgba(255,107,51,.3);
  --green: #3dbe7e;
  --ok-ink: #5fd39a;
  --ok-bg: #13261c;
  --ok-line: #1f4030;
  --warn-ink: #f0c94a;
  --warn-mark: #e6b800;
  --warn-bg: #2b240b;
  --warn-line: #4a3e13;
  --danger: #f2555a;
  --danger-hover: #f46b6f;
  --on-danger: #18181b;
  --bad-ink: #ff7b7f;
  --bad-bg: #3a1517;
  --bad-line: #5e2225;
  --note-ink: #b4b4bc;
  --note-mark: #63636b;
  --note-bg: #26262b;
  --note-line: #3a3a42;
  --loading: #8e8e97;
  --brand: #ededf0;
  --brand-hover: #dcdce0;
  --on-brand: #18181b;
  --account: #d4d4d8;
  --account-placeholder: #2a2a30;
  --figma-ink: #8cccff;
  --figma-wash: #142c3e;
  --shadow-soft: rgba(0,0,0,.3);
  --shadow-menu: rgba(0,0,0,.55);
  --shadow-card: rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  font: var(--type-body);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, textarea, input, select { font: inherit; }
button { color: inherit; }
/* **A focus ring is a UI component, not a seam**, so it owes 3:1 under WCAG 2.2 SC
   1.4.11 rather than the nothing-in-particular a decorative hairline owes. The seams take
   --selected-line-strong, a neutral grey that measures about 2:1, and the ring takes
   --focus, Studio's orange, which clears 3.70:1 (light) and 4.36:1 (dark) against every
   surface either theme puts under it. The two are deliberately not merged: the seams
   should stay faint, and this should not. */
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { height: 100%; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  height: var(--topbar-height);
  display: grid;
  /* Sized to its own content. Tying this to the rail's width made the brand shrink to
     44px when the rail collapsed, which pushed the wordmark into the next column. */
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  /* Studio's toolbar is drawn on the same surface as the panes, in both themes. */
  color: var(--ink);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 50;
}
.brand { grid-column: 1; height: 100%; position: relative; display: flex; align-items: center; border-right: 1px solid var(--line); }
/* Studio's brand: the Home button, a hairline, then the room menu's label and chevron. */
.brand-home { height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; color: inherit; background: transparent; border: 0; cursor: pointer; }
.brand-home:hover { background: var(--hover); }
.brand-divider { width: 1px; height: 16px; background: var(--line); }
.brand-button { height: var(--control-height); display: flex; align-items: center; gap: 6px; margin: 0 8px; padding: 0 8px; color: inherit; background: transparent; border-radius: var(--radius-row); }
.brand-button:hover { background: var(--hover); }
.brand-button:hover .brand-product { color: var(--ink); }
.brand-button[aria-expanded="true"] { background: var(--pressed); }
.chevron { width: 8px; height: 8px; flex: 0 0 auto; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.brand .chevron { color: var(--ink-soft); }
.brand-menu {
  position: absolute; z-index: 60; top: calc(100% - 5px); left: 12px; width: 246px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 12px 32px var(--shadow-menu); animation: menu-in .13s ease;
}
.brand-menu button, .brand-menu a { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 8px; color: var(--ink); background: transparent; border-radius: var(--radius-row); text-align: left; text-decoration: none; }
.brand-menu button:hover, .brand-menu a:hover { background: var(--hover); }
.brand-menu button[aria-current="true"] { background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.brand-menu button[aria-current="true"] small { color: var(--ink-soft); }
.brand-menu b { font: var(--type-label); }
.brand-menu small { color: var(--muted); font: var(--type-caption); }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; color: var(--on-brand); background: var(--brand); border-radius: 8px 8px 8px 3px; font: var(--type-h3); }
.brand-name { font: var(--type-h3); letter-spacing: -.2px; }
/* "Studio" after a short rule, not a full-height one: Studio draws a 16-point divider. */
.brand-product { color: var(--muted); font: var(--type-label); white-space: nowrap; }

.top-context { grid-column: 2; display: flex; align-items: center; gap: 12px; margin-left: 16px; }
.build-readout { display: flex; flex-direction: column; }
.build-readout small { color: var(--muted); font: var(--type-eyebrow); letter-spacing: .06em; }
.build-readout strong { font: var(--type-label); }
/* Studio's build pill is neutral and carries no dot: the chrome stays grey. Its text is
   --ink-soft rather than Studio's textMuted, which measures 4.38:1 on the chip. */
.build-state { display: flex; align-items: center; gap: 6px; padding: 4px 8px; color: var(--ink-soft); background: var(--chip); border: 1px solid var(--line); border-radius: var(--radius-badge); font: var(--type-caption); }
.build-state i { display: none; }
/* Beside the build state, and shaped like it, because they answer the same shape of
   question about the same month: what it built, and what it cost. */
/* Price and period, in one control. The dot is what the month-status button used to be:
   present and lit while a month is running, absent while none is. */
/* A month that cost nothing is not a warning and not an achievement, so it stops
   announcing itself in the accent colour and simply reads as a number. */

.top-actions { grid-column: 3; display: flex; align-items: center; gap: 8px; padding-right: 16px; }
/* Appearance and the account sit apart from the actions, as Studio's toolbar sets them. */
.top-actions #theme-button { margin-left: 8px; }
.button, .avatar, .icon-button, .compact-button, .segmented button, .text-button, .modal-close,
.brand-button, .brand-menu button, .brand-menu a { border: 0; cursor: pointer; }
/* Studio's DesignButton: one 28-point height, a 7-point radius, a 1-point edge, and the
   hover and pressed tints laid over the fill rather than replacing it. The label is
   Studio's `studioLabel`, caption-strong; dialogs use body type (see .modal-actions). */
.button { height: var(--control-height); padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--radius-button); font: var(--type-caption-strong); white-space: nowrap; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.button:disabled { cursor: progress; }
/* Disabled, every role draws the same: muted ink on the chip, and no edge. */
.button:disabled, .button[aria-disabled="true"] { color: var(--muted); background: var(--chip); border-color: transparent; }
/* Primary: the one orange control in a group — Approve, Upload, a form's submit. */
.button-primary { color: var(--on-primary); background: var(--primary); }
.button-primary:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--primary-hover); }
.button-primary:active:not(:disabled):not([aria-disabled="true"]) { background: var(--primary-pressed); }
/* Secondary: Studio's raised neutral fill and neutral edge. */
.button-quiet { color: var(--ink); background-color: var(--selected-fill); border-color: var(--selected-line); }
.button-quiet:hover:not(:disabled):not([aria-disabled="true"]) { background-image: linear-gradient(var(--hover), var(--hover)); }
.button-quiet:active:not(:disabled):not([aria-disabled="true"]) { background-image: linear-gradient(var(--pressed), var(--pressed)); }
/* The account control.
   Two appearances on one button, and the difference is the whole gate: signed out
   it is a grey person-shaped placeholder, signed in it is the account's initials
   on the warm circle it always was. Initials while signed out would be a claim
   that somebody is, which is the one thing the control must not say. */
.account { position: relative; display: flex; align-items: center; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; margin-left: 2px; color: var(--on-brand); background: var(--account); border-radius: 50%; font: var(--type-caption-strong); }
.avatar.signed-out { color: var(--muted); background: var(--account-placeholder); }
.avatar.signed-out:hover { color: var(--ink-soft); }
/* The mark is an inline SVG rather than a glyph: a font emoji renders differently
   on every machine, and this one has to read as a silhouette at 18 pixels. */
.avatar-mark { width: 18px; height: 18px; display: none; }
.avatar.signed-out .avatar-mark { display: block; }
.avatar-mark svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.avatar-initials { display: block; }
.avatar.signed-out .avatar-initials { display: none; }

.account-menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: 260px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 12px 32px var(--shadow-menu); animation: menu-in .13s ease;
}
/* Studio's account form: the name as a heading, the email, the role as a neutral badge,
   and the note. */
.account-card .account-name { color: var(--ink); font: var(--type-h4); overflow-wrap: anywhere; }
.account-card .account-email { margin: 0; color: var(--ink-soft); font: var(--type-body); overflow-wrap: anywhere; user-select: text; }
.account-card .account-role { align-self: flex-start; padding: 4px 8px; color: var(--ink-soft); background: var(--chip); border-radius: var(--radius-badge); font: var(--type-caption-strong); }
.account-card .account-note { margin: 0; color: var(--muted); font: var(--type-small); }
.account-copy { margin: 0; color: var(--muted); font: var(--type-small); }
.account-menu .button { width: 100%; }

/* A refused entry keeps its title and dims, because the reason it is refused is
   the useful part, as every refused control here does. */
.brand-menu button[aria-disabled="true"] { opacity: .5; }
.brand-menu button[aria-disabled="true"]:hover { background: transparent; }

/* The sign-in failure, rendered in the dialog where the person is looking. */
/* Studio's form error: danger ink on the danger wash. */
.field-error { margin: -8px 0 16px; padding: 12px; color: var(--bad-ink); background: var(--bad-bg); border-radius: var(--radius-button); font: var(--type-small); }
/* Studio's toolbar icon button: a hairline edge, muted until hovered. */
.topbar .icon-button { width: var(--icon-button); height: var(--icon-button); color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-icon); font-size: 12px; }
.topbar .icon-button:hover { color: var(--ink); background: var(--hover); }

/* -------------------------------------------------------------- workspace */

.workspace {
  height: calc(100vh - var(--topbar-height));
  display: grid;
  grid-template-columns: var(--rail-col) var(--stage-col) var(--detail-col);
}
.feature-rail, .stage-pane, .detail-pane { min-height: 0; min-width: 0; }

/* Collapsing is a column width and a swapped child, not a hidden pane: the strip that
   remains carries the identity of what was closed and any flag it was showing. */
body.rail-collapsed { --rail-col: var(--pane-stub); }
body.detail-collapsed { --detail-col: var(--pane-stub); }
/* Studio's collapsed rail: a muted strip holding its centred expand control. */
.pane-stub { display: none; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0 0; background: var(--panel-muted); }
/* The resizer survives collapsing, because dragging a closed pane back open is the
   quickest way to reopen it. */
body.rail-collapsed .feature-rail > :not(.rail-stub):not(.pane-resizer) { display: none; }
body.rail-collapsed .rail-stub { display: flex; }
body.detail-collapsed .detail-pane > :not(.detail-stub):not(.pane-resizer) { display: none; }
body.detail-collapsed .detail-stub { display: flex; }

/* A grip on the pane's own edge. 7px wide with a 1px line drawn inside it, so the target
   is comfortable while the seam stays a hairline. */
.feature-rail, .detail-pane { position: relative; }
.pane-resizer { position: absolute; top: 0; bottom: 0; width: 9px; z-index: 35; cursor: col-resize; }
.feature-rail > .pane-resizer { right: -4px; }
.detail-pane > .pane-resizer { left: -4px; }
.pane-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background .12s ease; }
/* Hover and drag are decoration and keep the hairline; focus is the indicator and takes
   the ring colour, for the same 3:1 reason as the outline rule above. */
.pane-resizer:hover::after, .pane-resizer.dragging::after { background: var(--selected-line-strong); }
.pane-resizer:focus-visible::after { background: var(--focus); }
.pane-resizer:focus-visible { outline: none; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing * { cursor: col-resize !important; }
/* A drag that crosses the preview must not lose its pointer to the frame's document. */
body.resizing iframe { pointer-events: none; }

/* Big enough to hit. Studio's toggles are its `sidebar.left` and `sidebar.right` symbols;
   SF Symbols cannot ship in a web page, so the icons are drawn here in the same shape. */
.pane-toggle { width: var(--icon-button); height: var(--icon-button); flex: 0 0 auto; display: grid; place-items: center; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-icon); cursor: pointer; }
.pane-toggle:hover { background: var(--hover); }
.pane-toggle:active { background: var(--pressed); }
.pane-icon { width: 18px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.detail-stub { border-left: 1px solid var(--line); }
.rail-project-row { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.rail-project-row .project-picker { min-width: 0; }

/* ------------------------------------------------- left rail: the features */

.feature-rail { display: flex; flex-direction: column; background: var(--panel-muted); border-right: 1px solid var(--line); }
.rail-project { flex: 0 0 76px; display: flex; align-items: center; padding: 0 16px; position: relative; z-index: 30; border-bottom: 1px solid var(--line); }
/* Studio's project menu is plain: no box and no mark, the name flush under the PROJECT
   label in neutral ink, and its chevron beside the name. */
.project-picker {
  min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0;
  color: inherit; background: transparent; border: 0; border-radius: var(--radius-icon);
  text-align: left; cursor: pointer;
}
.project-picker .project-monogram { display: none; }
.project-picker-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.project-picker-copy small { color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); }
.project-picker-copy strong { overflow: hidden; color: var(--ink); font: var(--type-h3); white-space: nowrap; text-overflow: ellipsis; }
.project-picker .chevron { align-self: flex-end; width: 7px; height: 7px; margin: 0 2px 9px 2px; color: var(--ink-soft); }
.project-monogram { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-row); font: var(--type-caption-strong); }
.project-monogram.roam { color: #503825; background: #f5b982; }
.project-monogram.cedar { color: #265446; background: #bfe3d3; }
.project-monogram.ledger { color: #48465a; background: #d7d2e5; }

.picker-menu {
  position: absolute; top: calc(100% - 4px); left: 8px; right: 8px; z-index: 40;
  padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 12px 32px var(--shadow-menu);
  animation: menu-in .13s ease;
}
@keyframes menu-in { from { transform: translateY(-4px); opacity: 0; } }
.picker-menu-head { padding: 8px 8px 6px; color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; }
.picker-option { width: 100%; display: block; padding: 8px; overflow: hidden; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-row); font: var(--type-label); text-align: left; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
/* Studio's empty stage: one title, one sentence and one action over the canvas. */
.stage-empty { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: 24px; background: var(--stage-pane, var(--panel-muted)); }
.stage-empty-card { max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.stage-empty-card strong { color: var(--ink); font: var(--type-h3); }
.stage-empty-card p { margin: 0; color: var(--muted); font: var(--type-small); }
.stage-empty-card .button { margin-top: 8px; }
.stage-empty-spinner, .rail-spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--activity); border-radius: 50%; animation: form-saving-spin .8s linear infinite; }
.rail-spinner { display: block; margin: 12px; }
@media (prefers-reduced-motion: reduce) { .stage-empty-spinner, .rail-spinner { animation-duration: 2.4s; } }
body.stage-is-empty .stage-header, body.stage-is-empty .stage-controls, body.stage-is-empty .stage { display: none; }
/* Studio's note under the Gates heading. */
.icon-button.labelled { width: auto; padding: 0 8px; font: var(--type-caption-strong); }
.rail-note { margin: 0; padding: 0 12px 8px; color: var(--muted); font: var(--type-small); }
.picker-option:hover { background: var(--hover); }
.picker-option.selected { background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.picker-option.selected small { color: var(--ink-soft); }
.picker-option > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.picker-option strong { overflow: hidden; font: var(--type-label); white-space: nowrap; text-overflow: ellipsis; }
.picker-option small { color: var(--muted); font: var(--type-caption); }
.picker-check { color: var(--selected-ink); font-size: 12px; font-weight: 600; }
.picker-menu-foot { display: flex; justify-content: space-between; margin-top: 4px; padding: 8px 8px 4px; border-top: 1px solid var(--line); }

.rail-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 8px; }
/* Studio's group title: the selected kind in label type, with its Add action beside it. */
.rail-heading { min-height: var(--control-height); display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; padding: 0 8px; color: var(--ink); font: var(--type-label); }
.rail-hint { margin: 0 8px 8px; color: var(--muted); font: var(--type-small); }
/* `line-height: 1` is what centres the glyph rather than the line box it sits in. Without
   it the ellipsis rides above the middle of the button by half the leading, which is small
   enough to look like a mistake and large enough to see. */
.icon-button { width: var(--icon-button); height: var(--icon-button); display: grid; place-items: center; color: var(--ink); background: transparent; border-radius: var(--radius-icon); font-size: 16px; font-weight: 500; line-height: 1; }
.icon-button:hover { background: var(--hover); }
.icon-button:active { background: var(--pressed); }
.icon-button:disabled { color: var(--muted); background: transparent; cursor: default; }
.icon-button.bordered { color: var(--muted); border: 1px solid var(--line); background: transparent; }
.icon-button.bordered:hover { color: var(--ink); }

.feature-list { display: grid; gap: 4px; }
/* Studio's feature row: the name, and a badge saying whether it is approved. Hover lays
   the hover tint on; the selected row is the raised neutral fill with a neutral edge. */
.feature-item {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px; color: var(--ink); text-align: left;
  background: transparent; border: 0; border-radius: var(--radius-row); cursor: pointer;
}
.feature-item:hover { background: var(--hover); }
.feature-item.active { background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.feature-item strong { flex: 1 1 auto; min-width: 0; overflow: hidden; font: var(--type-small-strong); white-space: nowrap; text-overflow: ellipsis; }
.feature-item.active strong { color: var(--selected-ink); }
/* Studio's status badge: Approved is success, Draft is neutral. */
.feature-status { flex: 0 0 auto; padding: 4px 8px; color: var(--ink-soft); background: var(--chip); border-radius: var(--radius-badge); font: var(--type-caption-strong); }
.feature-status.approved { color: var(--ok-ink); background: var(--ok-bg); }

.rail-kinds { margin: 0 0 8px; }
.rail-kinds.segmented button { flex: 1 1 auto; min-width: 0; overflow: hidden; padding: 0 6px; white-space: nowrap; text-overflow: ellipsis; }
.feature-status.warning { color: var(--warn-ink); background: var(--warn-bg); }
/* The rail's context menu opens in place beneath its row, over the rows after it. */
.feature-list { position: relative; }
.rail-menu { position: absolute; left: 8px; right: 8px; top: auto; margin-top: 2px; min-width: 0; max-width: none; }
.menu-check.menu-icon { color: var(--ink-soft); }
.menu-item.destructive .menu-check.menu-icon { color: var(--bad-ink); }
.choice-heading { padding: 10px 2px 2px; color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); list-style: none; }
.setting-list .menu-row { align-items: center; }
.setting-list .menu-row .menu-control { grid-column: 2 / -1; justify-self: start; }
/* Studio's per-feature Authentication: its label over a segmented control, and a failed
   save in the warning colour beneath. */
.setting-list .segmented-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.setting-list .segmented-row > span { color: var(--muted); font: var(--type-small); }
.setting-list .segmented-row .row-warning { color: var(--warn-ink); font: var(--type-small); }
.group-features { margin-bottom: 12px; }
.setting-list .row-caption { display: block; margin-top: -4px; padding: 0 0 6px; color: var(--muted); font: var(--type-caption); }
/* Studio's Assets section in Inputs: title and Upload, then the newest assets. */
.asset-slot { display: grid; grid-template-columns: 1fr; gap: 6px; }
/* Studio's Inputs: an upload in flight, a refused upload, the contract's validation, and
   the caption under the slots. */
.slot-spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--activity); border-radius: 50%; animation: form-saving-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .slot-spinner { animation-duration: 2.4s; } }
.inputs-message { margin: 8px 0 0; padding: 8px 12px; color: var(--bad-ink); background: var(--bad-bg); border-radius: var(--radius-row); font: var(--type-small); }
.inputs-caption { margin: 8px 0 0; color: var(--muted); font: var(--type-caption); }
.input-slot .slot-explanation { color: var(--muted); font: var(--type-caption); }
.input-slot .slot-problem { color: var(--ink-soft); font: var(--type-caption); user-select: text; }
.file-state.bad { color: var(--bad-ink); background: var(--bad-bg); }
.asset-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-slot-head .slot-label { color: var(--ink); font: var(--type-label); }
.asset-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.asset-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.asset-row strong { overflow-wrap: anywhere; color: var(--ink); font: var(--type-small-strong); user-select: text; }
.asset-row small { color: var(--muted); font: var(--type-caption); }
.asset-empty, .asset-failure { margin: 0; color: var(--muted); font: var(--type-small); }
.asset-failure { color: var(--bad-ink); }
.asset-slot > .file-action { justify-self: start; }
#assets-modal .asset-list { max-height: min(60vh, 520px); overflow-y: auto; padding-right: 4px; }
.rail-empty { margin: 12px 8px; color: var(--muted); font: var(--type-small); }

/* The allowance card that sat at the foot of the rail is gone, along with its two meters.
   Both figures were also in the usage dialog, so what the card added was a second place
   for the same numbers to be read and a second place for them to fall out of step. They
   are now on the charge readout's own tooltip, beside the money they belong to. */
.text-button { padding: 0; color: var(--ink); background: transparent; font: var(--type-caption-strong); }
.text-button:hover { text-decoration: underline; }
.text-button.quiet { color: var(--muted); }

/* ----------------------------------------------- centre: the design stage */

.stage-pane { display: flex; flex-direction: column; background: var(--stage-pane); border-right: 1px solid var(--line); }
.stage-header { flex: 0 0 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: transparent; border-bottom: 1px solid var(--line); }
.eyebrow { margin-bottom: 2px; color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; }
.stage-title-line { display: flex; align-items: center; gap: 8px; }
.stage-title-line h1 { margin: 0; font: var(--type-h3); }
.version-chip { padding: 4px 8px; color: var(--ink-soft); background: var(--chip); border: 0; border-radius: var(--radius-badge); font: var(--type-caption-strong); }

/* What this look is drawn from, between what the feature is and what it owes. Amber when
   nobody has drawn it, which is the same amber the app-wide settings use for "pending" —
   in both cases it means a decision the build will make for you if you do not. */
.spec-chip { cursor: pointer; }
.spec-chip:hover { color: var(--selected-ink); background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.spec-chip.empty { color: var(--warn-ink); background: var(--warn-bg); }
.stage-header-actions { display: flex; align-items: center; gap: 12px; }

/* The same Secondary button at the same 28 points, for the panes' own actions. */
.compact-button { height: var(--control-height); padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink); background-color: var(--selected-fill); border: 1px solid var(--selected-line); border-radius: var(--radius-button); font: var(--type-caption-strong); white-space: nowrap; }
.compact-button:hover:not(:disabled) { background-image: linear-gradient(var(--hover), var(--hover)); }
.compact-button:active:not(:disabled) { background-image: linear-gradient(var(--pressed), var(--pressed)); }
.compact-button:disabled { color: var(--muted); background: var(--chip); border-color: transparent; }
.compact-button.active { color: var(--selected-ink); background-color: var(--selected-fill); border-color: var(--selected-line-strong); }

/* Keep each segment intact and wrap the groups and summary at narrow pane widths. */
.stage-controls { flex: 0 0 auto; min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 12px; background: var(--panel-muted); border-bottom: 1px solid var(--line); }
.preview-controls { flex: 0 1 auto; max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preview-controls > .segmented { flex-shrink: 0; }
/* The spec has no device, appearance, or state, so its controls leave rather than sit
   there inert — and the row says where they went. */
/* The node tally. It was a static sentence shown only in the spec view; it is now the
   count of how much of this screen somebody actually drew, which is worth reading in
   every view that can change it. */
.stage-controls-right { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; margin-left: auto; }
/* Studio's segmented control: a bordered chip-coloured group 28 points tall, its
   segments 20 points tall inside a 4-point inset. Unselected segments are secondary ink
   with the hover and pressed tints; the selected one is the raised neutral fill with a
   neutral edge and primary ink. The group's edge is an inset shadow so it takes no room. */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: var(--radius-button); box-shadow: inset 0 0 0 1px var(--line); }
.segmented button { min-height: 20px; padding: 0 12px; color: var(--ink-soft); background: transparent; border-radius: 3px; font: var(--type-body); white-space: nowrap; }
.segmented button:hover:not([aria-disabled="true"]):not(:disabled) { background: var(--hover); }
.segmented button:active:not([aria-disabled="true"]):not(:disabled) { background: var(--pressed); }
.segmented button.active, .segmented button[aria-pressed="true"] { color: var(--selected-ink); background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
/* A device or appearance the project's app-wide settings exclude is offered as refused
   rather than hidden: the reason is the setting, and the reason is worth reading. Studio
   dims the whole segment and keeps its colours. */
.segmented button[aria-disabled="true"] { opacity: .48; cursor: not-allowed; }

/* The mark that says "this look was inferred". It sits on the option rather than on the
   control, because a warning on the whole segment leaves you clicking all four to find
   out which one it meant. A dot, not a triangle: one of these per look across three controls
   is a lot of shouting, and the sentence beneath the row is where the count lives. */
.segmented button { position: relative; }
.icon-segment button { padding: 0 10px; font-size: 15px; line-height: 1; }
/* Two rectangles rather than two glyphs: ▯ and ▭ are one font substitution away from
   being the same shape, and the difference between them is the whole control. */
.orient-mark { display: block; margin: 0 auto; border: 1.5px solid currentColor; border-radius: 2px; }
.orient-mark.upright { width: 10px; height: 14px; }
.orient-mark.across { width: 14px; height: 10px; }
/* Studio's preview menus (`StudioPreviewMenuView`): a bordered 28-point control showing
   the current value, opening a list with a check on the selected item. An item the
   settings refuse is dimmed and says how to enable it beneath its title; a note under the
   selected item explains a forced value. Sections and a destructive item follow dividers. */
.menu-control { position: relative; flex: 0 0 auto; }
.menu-control:empty { display: none; }
.menu-button { height: var(--control-height); display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 10px; color: var(--ink); background: var(--chip); border: 0; border-radius: var(--radius-button); box-shadow: inset 0 0 0 1px var(--line); font: var(--type-body); white-space: nowrap; cursor: pointer; }
.menu-button:hover:not(:disabled) { background-image: linear-gradient(var(--hover), var(--hover)); }
.menu-button:active:not(:disabled) { background-image: linear-gradient(var(--pressed), var(--pressed)); }
.menu-button[aria-expanded="true"], .menu-button.selected { color: var(--selected-ink); background-color: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.menu-button:disabled { color: var(--muted); cursor: not-allowed; }
.menu-button .menu-chevron { width: 7px; height: 7px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .7; }
.menu-button .orient-mark { margin: 0; }
.menu-popover { position: absolute; top: calc(100% + 4px); left: 0; z-index: 45; min-width: 200px; max-width: 320px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 12px 32px var(--shadow-menu); animation: menu-in .13s ease; }
.stage-controls-right .menu-popover { left: auto; right: 0; }
.menu-item { width: 100%; display: grid; grid-template-columns: 16px 1fr; align-items: start; gap: 6px; padding: 6px 8px; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-row); font: var(--type-body); text-align: left; cursor: pointer; }
.menu-item:hover:not([aria-disabled="true"]), .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item[aria-disabled="true"] { cursor: not-allowed; }
.menu-item[aria-disabled="true"] .menu-item-title { color: var(--muted); }
.menu-item .menu-check { color: var(--selected-ink); font: var(--type-caption-strong); line-height: 18px; }
.menu-item-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-item-note { color: var(--ink-soft); font: var(--type-caption); white-space: normal; }
.menu-item.destructive .menu-item-title { color: var(--bad-ink); }
.menu-section { padding: 6px 8px 2px 30px; color: var(--muted); font: var(--type-caption-strong); }
.menu-divider { height: 1px; margin: 4px 2px; background: var(--line); }
/* The Bars and tabs menu's mark: a frame with a bar along its top and a dock along its
   bottom, each drawn only while that element is on. */
.chrome-mark { width: 14px; height: 12px; display: block; border: 1.5px solid currentColor; border-radius: 2px; box-sizing: border-box; position: relative; }
.chrome-mark.bar::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 1.5px; background: currentColor; }
.chrome-mark.tabs::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 1.5px; height: 2px; border-radius: 1px; background: currentColor; }
.appearance-mark { font-size: 14px; line-height: 1; }
/* Bars and tabs over the design (`containers.js` draws inside), and a container design's
   chrome alone, both starting where the design does, below the status bar. The design moves
   below the bars and stops above a tab bar, which approximates Studio's content safe area. */
.preview-chrome, .container-stage, .group-stage { position: absolute; inset: 24px 0 0; z-index: 9; pointer-events: none; }
.stage.is-landscape.is-iphone :is(.preview-chrome, .container-stage, .group-stage) { top: 18px; }
.stage.is-mac :is(.preview-chrome, .container-stage, .group-stage),
.stage.is-landscape.is-duo :is(.preview-chrome, .container-stage, .group-stage),
.stage.is-duo_closed :is(.preview-chrome, .container-stage, .group-stage) { top: 0; }
.preview-chrome > *, .container-stage > *, .group-stage > * { pointer-events: auto; }
.device-screen.has-chrome .embed-frame { margin-top: var(--chrome-top, 0px); margin-bottom: var(--chrome-bottom, 0px); }
.draft-chip { padding: 4px 8px; color: var(--ink-soft); background: var(--chip); border: 0; border-radius: var(--radius-badge); font: var(--type-caption-strong); }


/* The launch bar that reported when a launch modal fires is gone: a gate's floors are the
   Minimum versions row and its own spec, a variant's status and geo are its chip in the
   rail and the Campaigns tab that edits them, and the bar was a third copy in the one view
   that is about the design rather than the schedule. */

/* The one place every multi-stage job reports itself. */
/* The invented-stage job strip that used to run across the foot of the page is gone
   with `runJob`; a build's real progress is drawn into its Activity row. */

.stage {
  flex: 1; min-height: 0; position: relative;
  /* `margin: auto` on the child centres without clipping the top edge the way
     `place-items: center` does once the device outgrows the stage. */
  display: flex; overflow: auto;

  /* **One edge is measured and the other is computed, because a frame is a shape.**
     The device used to carry a width *and* a height, and the breakpoints below only
     ever moved the height — so a short window drew the iPhone at 253×344, which is
     3:4, an iPad's proportions under the iPhone's label. What the frame declares now
     is the hardware it is a picture of and how much room the window gives it; the
     short edge falls out of the two.

     The points are the devices' own: 402×874 for the phone, 669×951 for the open
     iPhone Duo's inner screen, and 1032×1376 for the tablet. Which hardware those are
     is deliberately not written in the interface — the segment buttons say "iPhone",
     "iPhone Duo" and "iPad" and nothing more — because a model number on screen is a
     claim that dates, and the frame is a picture of a current device rather than of a
     named one. The numbers were 393×852 and 820×1180, a generation behind on both
     counts; before that the frame measured 360×548, which was a tablet's proportions
     under the phone's label.

     Two budgets rather than one because a short window and a narrow one are different
     constraints, and `min()` takes the tighter of the two whichever order the queries
     below happen to match in. */
  --device-w: 402;
  --device-h: 874;
  --stage-tall: 548px;
  --stage-wide: 548px;
  --device-fit: min(var(--stage-tall), var(--stage-wide));
  /* Studio's zoom multiplies the fitted frame; Fit is 1. */
  --device-long: calc(var(--device-fit) * var(--device-zoom, 1));
  /* Square on all four sides: the spec's gap to the right edge is the same value as its
     gap to the top and the bottom, so the document sits in an even frame. */
  padding: 0;
  background-color: var(--stage-bg);
}

/* Studio's three panes, left to right: Chat, View, and Specs. Each is toggled on its own
   by the pane segment; the class on the stage pane says which are showing.

   Chat and Specs open at a share of the stage and are dragged from there; a dragged width
   is `--chat-pane-w` or `--spec-pane-w`, and an undragged one falls back to the share.
   Whichever pane fills the rest — View, or Specs without it — has a basis of zero, so it
   holds its floor and the two sized panes give back width before the stage overflows. */
.stage-canvas { width: 100%; height: 100%; margin: 0; display: flex; align-items: stretch; gap: 0; min-height: 0; }
.chat-pane, .stage-devices, .spec-panel, .stage-seam { display: none; }
.show-chat .chat-pane { display: flex; flex-direction: column; flex: 0 1 var(--chat-pane-w, clamp(240px, 30%, 340px)); min-width: 240px; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.show-design .stage-devices { display: flex; flex-direction: column; flex: 1 1 0; min-width: 220px; min-height: 0; position: relative; overflow: hidden; background-color: var(--stage-bg); background-image: radial-gradient(circle at 1px 1px, var(--stage-dot) 1px, transparent 0); background-size: 14px 14px; }
/* The device scrolls inside the frame rather than the frame scrolling, so the activity
   layer over it stays on the pane's edge. `margin: auto` centres without clipping the top
   and left edges the way centring alignment does once the device outgrows the pane. */
.stage-scroll { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; overflow: auto; padding: 26px; }
.stage-scroll > .device-column { margin: auto; }
/* Studio's canvas footer: the look's logical size, then zoom out, the scale, zoom in and
   Fit. One readout for the canvas. */
/* Studio's "Not designed" badge: a warning status badge at the top of the canvas. */
.look-badge { position: absolute; top: 12px; left: 50%; z-index: 4; transform: translateX(-50%); padding: 4px 8px; color: var(--warn-ink); background: var(--warn-bg); border-radius: var(--radius-badge); font: var(--type-caption-strong); white-space: nowrap; }
.canvas-footer { flex: 0 0 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; background: var(--stage-pane, var(--panel-muted)); border-top: 1px solid var(--line); position: relative; z-index: 3; }
.canvas-size { color: var(--muted); font: var(--type-caption); white-space: nowrap; }
.canvas-zoom { display: inline-flex; align-items: center; gap: 4px; }
.canvas-zoom-label { min-width: 36px; color: var(--ink-soft); font: var(--type-caption-strong); font-variant-numeric: tabular-nums; text-align: center; }
.canvas-zoom .icon-button:disabled { color: var(--muted); cursor: not-allowed; }
.canvas-zoom .icon-button[aria-pressed="true"] { color: var(--selected-ink); background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }

/* Studio's stage activity. While a chat message sends and its turn is queued or
   generating, a thin orange line travels round the View pane's edge — a comet's tail on a
   turning conic gradient, cut to a ring by the mask — and fades in and out. When a settled
   turn changes the displayed design, the edge pulses orange once, with a glow, as the new
   design appears. Both are drawn on a layer that takes no pointer and no accessibility
   role: the turn's own badge is what says it is running. */
@property --working-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.stage-activity { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.stage-activity::before, .stage-activity::after { content: ""; position: absolute; inset: 0; opacity: 0; }
.stage-activity::before {
  padding: 1.5px;
  background: conic-gradient(from var(--working-angle), transparent 0 60%, var(--activity) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity var(--motion-working-fade) ease-out;
}
.stage-activity.is-working::before { opacity: 1; animation: stage-working var(--motion-working-loop) linear infinite; }
@keyframes stage-working { to { --working-angle: 360deg; } }
.stage-activity::after { box-shadow: inset 0 0 0 1.5px var(--activity), inset 0 0 24px 0 var(--stage-glow); }
.stage-activity.is-landing::after { animation: stage-landing var(--motion-result-pulse) ease-out; }
@keyframes stage-landing { from { opacity: 1; } to { opacity: 0; } }
.show-spec .spec-panel { display: flex; flex-direction: column; flex: 0 1 var(--spec-pane-w, clamp(220px, 26%, 290px)); min-width: 220px; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.show-spec:not(.show-design) .spec-panel { flex: 1 1 0; }
.show-chat:not(.show-design):not(.show-spec) .chat-pane { flex: 1 1 auto; }

/* The pane resizer's grip, as a flex item: 9px to hit, and margins that give the 9px back
   so the seam takes no width from either side. Each grip's hairline lands on its own
   pane's border. A seam is drawn only while there is a neighbour to trade width with —
   and Specs gives up its seam when it is the pane that fills. */
.stage-seam { flex: 0 0 9px; position: relative; z-index: 9; cursor: col-resize; }
.chat-seam { margin: 0 -4px 0 -5px; }
.spec-seam { margin: 0 -5px 0 -4px; }
.stage-seam::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background .12s ease; }
.stage-seam:hover::after, .stage-seam.dragging::after { background: var(--selected-line-strong); }
.stage-seam:focus-visible::after { background: var(--focus); }
.stage-seam:focus-visible { outline: none; }
.show-chat.show-design .chat-seam, .show-chat.show-spec .chat-seam { display: block; }
.show-spec.show-design .spec-seam { display: block; }
/* A group has no design of its own, no source and no specifications: the stage shows its
   preview (`groups.js`) with the device, orientation and appearance controls. */
body.aggregate-open .spec-panel,
body.aggregate-open .spec-seam,
body.aggregate-open .chat-seam,
body.aggregate-open #stage-spec-chip { display: none; }

.device-column { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 9px; }

/* The phone and tablet shell is hardware, so it keeps one dark colour in both themes, as in
   Studio: deviceShell, deviceShellLine and deviceBezel. Its shadow is Studio's elevation
   shadow, which is a theme value. Geometry changes ease over Studio's preview transition. */
.device-wrap { padding: 7px; border: 1px solid #2e2e33; border-radius: 33px; background: #1c1c1f; box-shadow: 0 8px 48px var(--shadow-card); }
.device { width: calc(var(--device-long) * var(--device-w) / var(--device-h)); height: var(--device-long); display: flex; flex-direction: column; overflow: hidden; position: relative; color: #000000; background: #ffffff; border: 6px solid #1f1f22; border-radius: 29px; transition: width var(--motion-preview) ease-in-out, height var(--motion-preview) ease-in-out, border-radius var(--motion-preview) ease-in-out; }
.device-top { flex: 0 0 24px; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 0 10px; position: relative; z-index: 4; color: #000000; background: #ffffff; font: 600 8px/10px var(--font-ui); }
.device-top > span:last-child { text-align: right; }
.device-island { width: 67px; height: 17px; justify-self: center; background: #0b0b0c; border-radius: 12px; }
.device-screen { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #ffffff; }
.device-home { width: 34%; height: 3px; position: absolute; z-index: 8; bottom: 4px; left: 50%; transform: translateX(-50%); background: #000000; border-radius: 3px; }

/* What a design tool leaves around the node you have open: its attribution, and nothing
   else. This layer used to draw the selection too — an accent rectangle inset from the
   screen, handles at its corners — and inside a device frame that rectangle read as a
   border the design itself had, which is a line nobody drew. One set of rules for three
   tools: what changes between them is --design-accent, set on the device screen. */
/* A design tool draws this label above the frame; the device screen clips, so it sits just
   inside the frame instead. */
.device-screen.design-figma { --design-accent: var(--figma-blue); background-image: radial-gradient(circle at 1px 1px, #dcdce0 1px, transparent 0); background-size: 8px 8px; }
.device-screen.design-canva { --design-accent: var(--canva-purple); background-color: #f1eef7; }
.device-screen.design-adobe { --design-accent: var(--adobe-red); background-color: #eaeaec; }
.embed-frame { position: absolute; inset: 0; z-index: 7; background: #ffffff; }
.embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* A pinned Figma frame is width-driven, like the screen it will become. Preserve its
   aspect ratio and let a tall frame continue below this layer; the device screen is the
   viewport, so height never scales the design down or adds letterboxing. */
.embed-frame img { width: 100%; height: auto; display: block; }
/* An export is the screen itself, so it sits under the app's chrome (6) and under the
   state overlay (5) — a node held as a file still previews its loading, empty, and
   failure states, exactly as one held as an address does. */
/* An upgrade gate's export is a modal: it covers the app's chrome and carries the dim
   that says a screen is still underneath. */

/* The three demo apps are three products, not one product recoloured, so the accent,
   the kicker, and the display face are all properties the project sets. */
.device-screen {
  --app-accent: #a65e45;
  --app-kicker: #9a7462;
  --app-strong: #40524d;
  --app-link: #8e6251;
  --app-avatar: #efb48c;
  --app-avatar-ink: #5b3829;
  --app-display: Georgia, serif;
}

/* The default is the bar along the bottom and nothing above, which is what every one of
   the thirteen fixtures was drawn against. The five rules below are the other combinations
   a root can produce: no bottom bar, one row of top chrome, two rows, and the two together.
   Each is a class the renderer sets from the aggregates it just drew, because the page
   cannot see them. One row of chrome is 26px and two are 51px, borders included. */
@keyframes page-in { from { opacity: .5; transform: translateX(4px); } }
/* A splash is a mark on a ground and nothing else. Everything a launch screen is tempted
   to add — a message, a bar, a version — is a thing a person is being asked to read while
   they wait, and the whole claim of this screen is that they are not waiting. */
.splash-face { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; }
.splash-mark { color: var(--app-accent); font-size: 30px; line-height: 1; }
.splash-face b { color: var(--app-strong); font-family: var(--app-display); font-size: 15px; font-weight: 560; letter-spacing: -.03em; }

.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.app-header > div { min-width: 0; }
.app-header small { color: var(--app-kicker); font-size: 5px; font-weight: 820; letter-spacing: .13em; }
.app-header h3 { margin: 3px 0 0; color: #202825; font-family: var(--app-display); font-size: 15px; font-weight: 560; letter-spacing: -.035em; }
.app-avatar { width: 25px; height: 25px; display: grid; place-items: center; color: var(--app-avatar-ink); background: var(--app-avatar); border-radius: 50%; font-size: 8px; font-weight: 800; }
.app-header.simple { margin-bottom: 10px; }
.app-header.simple h3 { font-size: 20px; }
.app-header.simple > button { width: 24px; height: 24px; display: grid; place-items: center; color: white; background: var(--app-strong); border: 0; border-radius: 50%; font-size: 15px; }
.hero-trip { height: 155px; position: relative; overflow: hidden; color: white; background: #385458; border-radius: 13px; box-shadow: 0 7px 15px rgba(39,59,61,.18); }
.trip-art { height: 100%; position: absolute; inset: 0; overflow: hidden; background: linear-gradient(150deg, #466d72 0%, #7da5a2 53%, #f4b175 100%); }
.art-sun { width: 32px; height: 32px; position: absolute; top: 23px; right: 28px; background: #f4df9a; border-radius: 50%; box-shadow: 0 0 26px rgba(255,226,147,.42); }
.art-hill { position: absolute; bottom: -20px; border-radius: 55% 55% 0 0; transform: rotate(-8deg); }
.art-hill.one { width: 230px; height: 85px; left: -55px; background: #183f3e; }
.art-hill.two { width: 190px; height: 70px; right: -65px; bottom: -17px; background: #4b694d; transform: rotate(8deg); }
.hero-trip-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; background: linear-gradient(to top, rgba(13,36,36,.78), transparent 68%); }
.trip-kicker { font-size: 5px; font-weight: 820; letter-spacing: .14em; }
.hero-trip h4 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.hero-trip p { margin: 1px 0 7px; color: rgba(255,255,255,.8); font-size: 6px; }
.traveler-row { display: flex; align-items: center; }
.traveler-row > span, .mini-people i { width: 17px; height: 17px; display: grid; place-items: center; margin-right: -4px; color: #4c3a31; background: #f1c4a7; border: 1.5px solid white; border-radius: 50%; font-size: 5px; font-style: normal; font-weight: 750; }
.traveler-row > span:nth-child(2), .mini-people i:nth-child(2) { background: #c0d7dc; }
.traveler-row > span:nth-child(3), .mini-people i:nth-child(3) { background: #e9d7ab; }
.traveler-row b { margin-left: auto; color: white; font-size: 6px; }
.app-section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 12px 1px 6px; }
.app-section-title h4 { margin: 0; font-family: var(--app-display); font-size: 10px; font-weight: 600; }
.app-section-title span { color: var(--app-link); font-size: 6px; font-weight: 700; }
.booking-card { height: 51px; display: grid; grid-template-columns: 30px 27px 1fr auto; align-items: center; gap: 5px; padding: 6px; background: white; border: 1px solid #ebe9e1; border-radius: 9px; box-shadow: 0 3px 10px rgba(33,43,39,.05); }
.booking-time { height: 35px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8d5b47; background: #f7e6db; border-radius: 6px; font-size: 5px; font-weight: 750; }
.booking-time b { font-size: 11px; line-height: 1; }
.booking-icon { width: 24px; height: 24px; display: grid; place-items: center; color: #364946; background: #e7eeea; border-radius: 6px; font-size: 10px; }
.booking-card > span:nth-child(3) { display: flex; flex-direction: column; gap: 3px; }
.booking-card strong { font-size: 7px; }
.booking-card small { color: #8b9390; font-size: 5px; }
.booking-arrow { color: #a3aaa7; font-size: 14px; }
.glance-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.glance-grid span { height: 39px; display: flex; flex-direction: column; justify-content: center; padding: 0 9px; background: #f0f0ea; border-radius: 8px; }
.glance-grid b { font-family: Georgia, serif; font-size: 10px; }
.glance-grid small { color: #858d89; font-size: 5px; }
.app-search { height: 29px; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 0 9px; color: #9aa19e; background: #eeeeea; border-radius: 8px; font-size: 6px; }
.app-search span { font-size: 13px; line-height: 1; }
.app-search.filled { background: white; border: 1px solid #e7e6df; }
.filter-chips, .category-row { display: flex; gap: 5px; margin-bottom: 10px; }
.filter-chips span { padding: 5px 9px; color: #6f7874; background: #efefe9; border-radius: 12px; font-size: 6px; font-weight: 650; }
.filter-chips span.selected { color: white; background: var(--app-strong); }
.trip-list-card { height: 112px; display: grid; grid-template-columns: 47% 1fr; overflow: hidden; margin-bottom: 8px; background: white; border: 1px solid #e7e6df; border-radius: 11px; }
.mini-art { position: relative; overflow: hidden; background: linear-gradient(150deg, #4c777a, #d99d69); }
.mini-art .art-sun { width: 23px; height: 23px; top: 18px; right: 17px; }
.mini-art .art-hill.one { width: 145px; height: 55px; left: -35px; bottom: -12px; }
.mini-art .art-hill.two { width: 100px; height: 42px; right: -30px; bottom: -9px; }
.mini-art > strong { position: absolute; z-index: 3; left: 7px; bottom: 7px; padding: 3px 5px; color: white; background: rgba(21,38,36,.64); border-radius: 8px; font-size: 5px; }
.trip-list-card > div:last-child { padding: 14px 9px; }
.trip-list-card small { color: #a26f59; font-size: 5px; font-weight: 800; letter-spacing: .08em; }
.trip-list-card h4 { margin: 3px 0; font-family: Georgia, serif; font-size: 14px; font-weight: 600; }
.trip-list-card p { margin: 0 0 8px; color: #858e8a; font-size: 5px; }
.mini-people { display: flex; }
.kyoto-card { height: 105px; }
.kyoto-card .mini-art { background: linear-gradient(150deg, #514a6d, #b89cad); }
.moon { width: 25px; height: 25px; position: absolute; top: 17px; right: 18px; background: #f4e2bd; border-radius: 50%; }
.gate { width: 55px; height: 45px; position: absolute; bottom: 0; left: 24px; border: 7px solid #452e35; border-bottom: 0; }
.gate::before { content: ""; width: 72px; height: 5px; position: absolute; top: -11px; left: -15px; background: #452e35; border-radius: 2px; }
.trip-tip { display: flex; align-items: center; gap: 7px; padding: 8px; color: #626d68; background: #eef2e5; border-radius: 8px; font-size: 6px; }
.trip-tip > span { width: 22px; height: 22px; display: grid; place-items: center; color: #596d25; background: #dff0a5; border-radius: 6px; }
.trip-tip p { margin: 0; line-height: 1.5; }
.map-toggle { padding: 5px 8px; color: #fff; background: var(--app-strong); border-radius: 12px; font-size: 6px; font-weight: 700; }
.category-row { justify-content: space-between; }
.category-row span { width: 31%; padding: 7px 3px; color: #7b8480; background: #f0f0ea; border-radius: 8px; text-align: center; font-size: 6px; }
.category-row b { margin-right: 3px; }
.category-row .selected { color: #754b3b; background: #f6e3d7; }
.feature-place { overflow: hidden; background: white; border: 1px solid #e5e4de; border-radius: 11px; }
.place-art { height: 112px; overflow: hidden; position: relative; background: #d8b995; }
.tile { position: absolute; background: #7d98a8; transform: rotate(28deg); }
.tile-one { width: 140px; height: 80px; top: -20px; left: -35px; }
.tile-two { width: 120px; height: 120px; right: -45px; bottom: -55px; background: #c76e5a; }
.plant { width: 75px; height: 75px; position: absolute; left: 91px; top: 18px; background: #4a735b; border-radius: 70% 20% 70% 20%; transform: rotate(20deg); box-shadow: -33px 18px 0 #62836d, 35px 15px 0 #355f4d; }
.place-art > b { position: absolute; left: 8px; top: 8px; padding: 4px 6px; color: #4e3e32; background: #f3e6c9; border-radius: 8px; font-size: 5px; }
.place-copy { padding: 8px 9px 9px; }
.place-copy small { color: #a26c56; font-size: 5px; font-weight: 800; letter-spacing: .08em; }
.place-copy h4 { margin: 2px 0; font-family: Georgia, serif; font-size: 12px; }
.place-copy p { margin: 0 0 4px; color: #7d8582; font-size: 5px; }
.place-copy > span { color: #56625d; font-size: 5px; font-weight: 650; }
.place-row { height: 39px; display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 7px; border-top: 1px solid #ecece6; }
.place-thumb { width: 30px; height: 29px; background: linear-gradient(135deg, #7db1bb, #e7c7a0); border-radius: 6px; }
.place-thumb.rose { background: linear-gradient(135deg, #d69483, #754e76); }
.place-row > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.place-row strong { font-size: 6px; }
.place-row small { color: #8d9491; font-size: 5px; }
.place-row b { color: #7d8582; font-size: 9px; }
.profile-hero { display: flex; flex-direction: column; align-items: center; padding: 12px 0 8px; }
.profile-avatar { width: 57px; height: 57px; display: grid; place-items: center; color: #684433; background: linear-gradient(145deg, #f5cfb4, #e7a477); border: 3px solid white; border-radius: 50%; box-shadow: 0 2px 0 #d9d8d0, 0 7px 16px rgba(38,48,44,.12); font-family: Georgia, serif; font-size: 20px; }
.profile-hero h3 { margin: 8px 0 2px; font-family: Georgia, serif; font-size: 15px; }
.profile-hero p { margin: 0; color: #89918e; font-size: 6px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 5px 0 12px; overflow: hidden; background: #e2e2dc; border: 1px solid #e2e2dc; border-radius: 8px; }
.profile-stats span { display: flex; flex-direction: column; align-items: center; padding: 8px; background: white; }
.profile-stats b { font-family: Georgia, serif; font-size: 11px; }
.profile-stats small { color: #8e9692; font-size: 5px; }
.settings-group > small { display: block; margin: 0 0 4px 4px; color: var(--app-kicker); font-size: 5px; font-weight: 800; letter-spacing: .1em; }
.settings-group button { width: 100%; height: 36px; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 7px; padding: 0 7px; text-align: left; background: white; border: 0; border-bottom: 1px solid #ecece6; }
.settings-group button:first-of-type { border-radius: 8px 8px 0 0; }
.settings-group button:last-of-type { border: 0; border-radius: 0 0 8px 8px; }
.setting-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; font-size: 9px; }
.setting-icon.peach { color: #854f3a; background: #f6ddcf; }
.setting-icon.violet { color: #5c50a0; background: #e6e1f6; }
.setting-icon.mint { color: #39684d; background: #dfeee3; }
.setting-icon.sky { color: #3f6882; background: #dfebf1; }
.setting-icon.sand { color: #7a633e; background: #f0e6ce; }
.settings-group b { font-size: 6px; }
.settings-group i { color: #a6aca9; font-style: normal; font-size: 13px; }
.settings-group.second { margin-top: 12px; }
/* Navigation is drawn from the root feature down, so the chrome a screen wears is the
   aggregates between it and the root — a drawer bar above, a tab strip inside that, a bar
   along the bottom. Each row's presence is a class on .device-screen rather than a
   measurement, because the page below has to start under whatever is there and the policy
   refuses a style attribute. */
/* The two rows are deliberately the same height, and the bar's own border is inside that
   height. The renderer counts rows rather than measuring them — it sets top-h1 for either
   one row and top-h2 for both — so a drawer bar one pixel taller than a tab strip would
   put one row of the page underneath the chrome in exactly one of the two cases. 25 + 1
   is 26, twice is 51, and those are the two numbers the page and the overlay reserve. */
/* No limit on top tabs, so the strip scrolls rather than dividing itself into slivers.
   The scrollbar is hidden because a phone does not draw one. */

/* The open feature's own tab is emphasized; the rest are dimmed to show they are
   a different feature and out of scope for this screen. */

/* ------------------------------------------- Cedar Health: the clinical screens */

.step-pill { padding: 4px 7px; color: var(--app-strong); background: #e2f1ec; border-radius: 11px; font-size: 5px; font-weight: 780; letter-spacing: .04em; }
.intake-progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-bottom: 11px; }
.intake-progress span { height: 3px; background: #e4e7e3; border-radius: 3px; }
.intake-progress span.done { background: var(--app-accent); }
.form-card { display: grid; gap: 1px; overflow: hidden; margin-bottom: 8px; background: #e6e9e5; border: 1px solid #e6e9e5; border-radius: 9px; }
.form-card label { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; background: white; }
.form-card label.split { flex-direction: row; gap: 0; padding: 0; background: transparent; }
.form-card label.split > span { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; background: white; }
.form-card label.split > span:first-child { margin-right: 1px; }
.form-card small { color: #9aa39f; font-size: 5px; font-weight: 800; letter-spacing: .09em; }
.form-card b { font-size: 8px; font-weight: 650; }
.scan-card { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 8px 9px; background: #eef6f3; border: 1px dashed #b6d6cc; border-radius: 9px; }
.scan-icon { width: 26px; height: 26px; display: grid; place-items: center; color: white; background: var(--app-accent); border-radius: 7px; font-size: 11px; }
.scan-card > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.scan-card strong { font-size: 7px; }
.scan-card small { color: #7f918c; font-size: 5px; }
.scan-card > b { color: var(--app-accent); font-size: 6px; }
.consent-row { display: grid; grid-template-columns: 13px 1fr; align-items: start; gap: 7px; margin: 10px 1px; }
.checkbox { width: 13px; height: 13px; display: grid; place-items: center; color: white; background: var(--app-accent); border-radius: 4px; font-size: 7px; font-weight: 850; }
.consent-row p { margin: 0; color: #7b8582; font-size: 5px; line-height: 1.55; }
.primary-cta { width: 100%; height: 30px; color: white; background: var(--app-strong); border: 0; border-radius: 8px; font-size: 7px; font-weight: 750; }
.visit-hero { padding: 11px; color: white; background: linear-gradient(140deg, #14564c, #2c8878 78%, #59a892); border-radius: 12px; box-shadow: 0 7px 15px rgba(20,66,58,.2); }
.visit-badge { font-size: 5px; font-weight: 820; letter-spacing: .13em; }
.visit-hero h4 { margin: 4px 0 1px; font-size: 14px; font-weight: 720; letter-spacing: -.02em; }
.visit-hero p { margin: 0 0 9px; color: rgba(255,255,255,.78); font-size: 6px; }
.visit-actions { display: flex; align-items: center; gap: 8px; }
.visit-actions b { padding: 5px 9px; color: #14564c; background: white; border-radius: 7px; font-size: 6px; }
.visit-actions i { color: rgba(255,255,255,.82); font-size: 6px; font-style: normal; }
.visit-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 7px 8px; margin-bottom: 5px; background: white; border: 1px solid #e8eae5; border-radius: 9px; }
.visit-date { display: flex; flex-direction: column; align-items: center; padding: 4px 0; color: var(--app-strong); background: #e6f1ee; border-radius: 6px; font-size: 4.5px; font-weight: 780; }
.visit-date b { font-size: 10px; line-height: 1; }
.visit-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.visit-row strong { font-size: 7px; }
.visit-row small { color: #8c9491; font-size: 5px; }
.visit-tag { padding: 3px 5px; color: #64726e; background: #eef0ec; border-radius: 5px; font-size: 4.5px; font-weight: 750; }
.visit-tag.done { color: var(--app-accent); background: #e2f1ec; }
.visit-row.muted { background: #f6f7f4; }
.result-card { padding: 9px 10px; margin-bottom: 6px; background: white; border: 1px solid #e8eae5; border-radius: 10px; }
.result-head { display: flex; align-items: center; justify-content: space-between; }
.result-head strong { font-size: 8px; }
.result-flag { padding: 3px 5px; border-radius: 5px; font-size: 4.5px; font-weight: 800; letter-spacing: .05em; }
.result-flag.high { color: #9a4a35; background: #fbe4dd; }
.result-value { display: flex; align-items: baseline; gap: 3px; margin: 5px 0 7px; }
.result-value b { font-size: 19px; font-weight: 730; letter-spacing: -.04em; }
.result-value small { color: #7f8784; font-size: 7px; }
.result-value i { margin-left: auto; color: #9aa29f; font-size: 5px; font-style: normal; }
.range-bar { height: 4px; position: relative; overflow: hidden; background: linear-gradient(90deg, #dce6e2 0 62%, #f3ddd4 62%); border-radius: 4px; }
.range-fill { display: block; height: 100%; background: #c9704f; border-radius: 4px; }
.result-stamp { display: block; margin-top: 6px; color: #9aa29f; font-size: 5px; }
.result-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 8px 9px; margin-bottom: 5px; background: white; border: 1px solid #e8eae5; border-radius: 9px; }
.result-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.result-row strong { font-size: 7px; }
.result-row small { color: #8c9491; font-size: 5px; }
.result-row > b { font-size: 7px; font-weight: 700; }
.result-row i { padding: 3px 5px; border-radius: 5px; font-size: 4.5px; font-style: normal; font-weight: 750; }
.result-row i.ok { color: var(--app-accent); background: #e2f1ec; }
.doc-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 8px 9px; margin-top: 8px; background: #f5f7f4; border-radius: 9px; }
.doc-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--app-strong); background: #e3ebe7; border-radius: 6px; font-size: 10px; }
.doc-row > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.doc-row strong { font-size: 7px; }
.doc-row small { color: #8c9491; font-size: 5px; }
.doc-row > b { color: #a3aaa7; font-size: 11px; }

/* ------------------------------------------------ Ledger: the numeric screens */

/* Amounts line up column-wise, which is the whole reason a ledger looks like a ledger. */
.figure { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.balance-hero { padding: 12px; color: white; background: linear-gradient(145deg, #2f3557, #4b57c4 92%); border-radius: 12px; box-shadow: 0 8px 18px rgba(47,53,87,.22); }
.balance-hero > b { display: block; font-size: 20px; font-weight: 700; }
.delta { display: inline-block; margin-top: 4px; color: #bdf2d8; font-size: 6px; font-weight: 700; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 10px; }
.spark i { flex: 1; background: rgba(255,255,255,.34); border-radius: 2px 2px 0 0; }
.spark i:last-child { background: #d8dcff; }
.hero-stamp { display: block; margin-top: 8px; color: rgba(255,255,255,.72); font-size: 5px; }
.account-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 8px 9px; margin-bottom: 5px; background: white; border: 1px solid #e8e9e3; border-radius: 9px; }
.acct-mark { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font-size: 6px; font-weight: 820; }
.acct-mark.blue { color: #2f3f7a; background: #dee3fb; }
.acct-mark.mintish { color: #26614d; background: #d9f0e4; }
.acct-mark.violet { color: #5b3d80; background: #ebdff8; }
.acct-mark.sandish { color: #7a6033; background: #f4e7cc; }
.account-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-row strong { font-size: 7px; }
.account-row small { color: #8d9491; font-size: 5px; }
.account-row > b { font-size: 8px; font-weight: 700; }
.figure.in { color: #2d8a68; }
.day-label { margin: 9px 2px 5px; color: #99a19d; font-size: 5px; font-weight: 820; letter-spacing: .12em; text-transform: uppercase; }
.txn-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid #eeefe9; }
.txn-icon { width: 22px; height: 22px; display: grid; place-items: center; color: #5d6560; background: #eeefe9; border-radius: 7px; font-size: 9px; }
.txn-icon.warm { color: #8a5638; background: #f7e6d9; }
.txn-icon.violet { color: #5b3d80; background: #ebdff8; }
.txn-icon.mintish { color: #26614d; background: #d9f0e4; }
.txn-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.txn-row strong { font-size: 7px; }
.txn-row small { color: #8d9491; font-size: 5px; }
.txn-row > b { font-size: 7px; font-weight: 700; }
.txn-row.pending { opacity: .62; }
.budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-bottom: 11px; background: #e5e6e0; border: 1px solid #e5e6e0; border-radius: 9px; }
.budget-summary span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: white; }
.budget-summary b { font-size: 10px; font-weight: 720; }
.budget-summary small { color: #8d9491; font-size: 5px; }
.budget-row { margin-bottom: 9px; }
.budget-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.budget-top strong { font-size: 7px; }
.budget-top b { color: #7d8582; font-size: 6px; }
.budget-top b.over { color: #a8543f; }
.meter { height: 5px; overflow: hidden; background: #eaebe5; border-radius: 5px; }
.meter-fill { display: block; height: 100%; background: var(--app-accent); border-radius: 5px; }
.meter-fill.over { background: #cf6a4f; }
.chart-card { padding: 10px 10px 14px; background: white; border: 1px solid #e8e9e3; border-radius: 10px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; color: #8d9491; font-size: 5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.chart-head b { color: var(--ink); font-size: 7px; letter-spacing: -.02em; text-transform: none; }
.chart-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 5px; height: 62px; }
.chart-bars i { position: relative; background: #dfe1f5; border-radius: 3px 3px 0 0; }
.chart-bars i.current { background: var(--app-accent); }
/* A month still running is hatched rather than solid, because a full-height bar for a
   half-finished month is the most common way to misread this chart. */
.chart-bars i.partial { background: repeating-linear-gradient(135deg, var(--app-accent) 0 3px, #c9cff0 3px 6px); }
.chart-bars em { position: absolute; left: 0; right: 0; bottom: -9px; color: #9aa19e; font-size: 4.5px; font-style: normal; text-align: center; }
.cat-row { display: grid; grid-template-columns: 7px 1fr auto auto; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid #eeefe9; font-size: 6px; }
.cat-dot { width: 7px; height: 7px; border-radius: 50%; }
.cat-dot.one { background: #4b57c4; }
.cat-dot.two { background: #62a58c; }
.cat-dot.three { background: #d09257; }
.cat-dot.four { background: #b8bcc9; }
.cat-row b { font-size: 7px; font-weight: 700; }
.cat-row i { min-width: 18px; color: #9aa19e; font-size: 5px; font-style: normal; text-align: right; }
.profile-hero.compact { padding: 6px 0 10px; }
.profile-hero.compact .profile-avatar { width: 44px; height: 44px; font-size: 16px; }
.switch { width: 20px; height: 12px; position: relative; background: #d9dbd5; border-radius: 12px; }
.switch::after { content: ""; width: 9px; height: 9px; position: absolute; top: 1.5px; left: 2px; background: white; border-radius: 50%; }
.switch.on { background: var(--app-accent); }
.switch.on::after { left: 9px; }
.settings-foot { margin: 12px 0 0; color: #a3aaa7; font-size: 5px; text-align: center; }

/* Static fixture proportions. A width cannot be written at runtime under this CSP, and
   these never change at runtime, so they are classes rather than custom properties. */
.fill-4 { width: 4%; } .fill-38 { width: 38%; } .fill-68 { width: 68%; }
.fill-72 { width: 72%; } .fill-100 { width: 100%; }
.h-38 { height: 38%; } .h-46 { height: 46%; } .h-55 { height: 55%; } .h-61 { height: 61%; }
.h-70 { height: 70%; } .h-84 { height: 84%; } .h-100 { height: 100%; }

/* ------------------------------------------------ the screen nobody has drawn */

/* Studio's preview empty state: a title and a line of copy over the screen, with no tile,
   and the action beneath them. Its geometry is in § Studio parity below; this is its type
   and its colour.

   Literal colours rather than the studio's tokens: everything inside the device frame is
   the simulated app's palette, and a workspace token in here would repaint the phone when
   the workspace theme changed. They are Studio's text and textMuted for the preview's own
   appearance. */
.device-blank { font: inherit; }
/* The frame is the target, so the ring goes round the frame rather than inside it. */
.device-blank:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.device-blank .blank-mark { display: none; }
.device-blank strong { color: #18181b; font: 600 15px/20px var(--font-ui); }
.device-blank small { color: #67676f; font: 400 12px/16px var(--font-ui); }
.device-screen.dark .device-blank strong { color: #ededf0; }
.device-screen.dark .device-blank small { color: #8e8e97; }
/* Four corrections for the chrome the frame sits inside, because the frame covers the
   screen and not the bars around it. A node drawn alone wears none of them. */

/* ------------------------------------------------------------ launch modals */

/* Drawn over the screen the app opens on, and over the tab bar, because that is what a
   launch modal does: nothing behind it is reachable until it is answered. The screen
   underneath is a real one from this project, so the modal is seen in the place it
   actually appears rather than on a blank frame. */
/* The card that used to sit on this dim is gone with the fixture it was drawn from.
   A gate's copy is its *design*, so a card assembled from strings in the stylesheet
   and a strings table would be a preview of a screen nobody designed, shown in the
   frame whose job is to draw what the build will draw. What is left is the dim,
   which is the true part: this is a modal, and it opens over the app. */

/* The tablet: 1032×1376 points. Only the two numbers change — the frame, the
   breakpoints and the rotation are all written against them.

   The ratio moved further here than on the phone. 820×1180 is 0.695 and 1032×1376
   is exactly 0.750, so at the same measured edge the portrait frame gains about
   thirty pixels of width; `--stage-wide` below is what absorbs that in a narrow
   window. The corner radius grows with it — a radius tuned to the smaller frame
   reads as too sharp once the frame is wider, and the hardware's own corners are
   proportionally larger too. */
.stage.is-ipad { --device-w: 1032; --device-h: 1376; }
.stage.is-ipad .device { border-radius: 28px; }
.stage.is-ipad .device-island { width: 8px; height: 8px; border-radius: 4px; }

/* The open iPhone Duo: 669×951 points, the inner screen. It wears the phone's and the tablet's dark hardware shell at their scale, the tablet's
   28-point display corner and the phone's home indicator, and it has no Dynamic
   Island and no camera dot: the inner camera sits under the display. The island is
   hidden rather than removed so the status bar keeps its three columns and the
   battery keeps the right-hand one. Held sideways it has no top strip at all — see
   the side column at the end of this file. */
.stage.is-duo { --device-w: 669; --device-h: 951; }
.stage.is-duo .device { border-radius: 28px; }
.stage.is-duo .device-island { visibility: hidden; }
.stage.is-duo_closed { --device-w: 466; --device-h: 678; --status-column-width: calc(100% * 84 / 466); }
.stage.is-landscape.is-duo_closed { --status-column-width: calc(100% * 84 / 678); }
.stage.is-duo_closed .device { border-radius: 28px; }
.stage.is-duo_closed .device-island { order: -1; width: 14px; height: 14px; border-radius: 50%; }

/* ---------------------------------------------------------------- the Mac

   **A window, not a device**, and every difference below follows from that one
   sentence rather than from a taste about how Macs look.

   960×720 points is the window `ios-blueprint`'s Mac coordinator opens — the
   generated app's own default, on the same terms as the two hardware sizes
   above: the frame is a picture of what the build produces, and a number this
   file invented would be a second opinion about it.

   **The long edge is the width here, which is why the geometry is restated.**
   Everything above assumes portrait-tall hardware: `--device-long` *is* the
   height and the width falls out of the ratio. A window is landscape, so the
   budget has to be spent the other way round — the same swap the landscape block
   below performs, and the reason that block's rules now name `.is-iphone`
   explicitly instead of negating the iPad. A Mac is never `.is-landscape`: it
   has one orientation rather than a rotated one, and `deviceRotates` in `app.js`
   is what refuses the control. */
.stage.is-mac {
  --device-w: 960;
  --device-h: 720;
  --device-fit: min(var(--stage-wide), var(--stage-tall) * var(--device-w) / var(--device-h));
  --device-long: calc(var(--device-fit) * var(--device-zoom, 1));
}
.stage.is-mac .device {
  width: var(--device-long);
  height: calc(var(--device-long) * var(--device-h) / var(--device-w));
  /* A window has a hairline and a shadow rather than a bezel. Six pixels of
     black around a Mac window would be drawing hardware that is not there. */
  border-width: 1px;
  border-color: #c6c6cb;
  border-radius: 10px;
}
.stage.is-mac .device-wrap { padding: 0; border-color: var(--line); border-radius: 12px; background: var(--raised); }
/* The title bar. `ios-blueprint`'s Mac window is `fullSizeContentView` with its
   title hidden, so what is actually on screen is three lights over content that
   runs to the edge — no clock, no carrier, no home indicator. The two status-bar
   spans go rather than being emptied, which lets the grid collapse to one column
   and puts the lights where a Mac puts them. */
.stage.is-mac .device-top {
  flex-basis: 22px;
  grid-template-columns: 1fr;
  justify-items: start;
  padding: 0 9px;
  background: #ececee;
  border-bottom: 1px solid #e5e5ea;
}
.stage.is-mac .device-top > span:not(.device-island) { display: none; }
/* Three lights drawn as one element, because there is one element to draw them
   with and adding markup for a decoration would put a Mac's chrome in the HTML
   for every device. */
.stage.is-mac .device-island {
  width: 32px; height: 8px;
  justify-self: start;
  background: none;
  border-radius: 0;
  background-image:
    radial-gradient(circle 4px at 4px 50%, #ec6a5e 98%, transparent 0),
    radial-gradient(circle 4px at 16px 50%, #f4bf4f 98%, transparent 0),
    radial-gradient(circle 4px at 28px 50%, #61c554 98%, transparent 0);
}
.stage.is-mac .device-home { display: none; }
.stage.is-mac .device.dark .device-top { background: #2a2a2d; border-bottom-color: #38383a; }
.stage.is-mac .device.dark { border-color: #3a3a40; }

/* ------------------------------------------------------------- landscape

   The same device, turned: the long edge becomes the width and the short edge the
   height. A rotated frame also spends the window's *height* budget on its short side,
   so the same budget buys a longer frame — which is why `--device-long` is recomputed
   here rather than the two axes being swapped and left at that. The width budget still
   caps it, and past that the stage scrolls, as it does for any frame that outgrows it. */
/* `:not(.is-mac)` on both, because these two rules sit *after* the Mac block and
   carry the same specificity — so a frame wearing both classes would be given
   the rotated geometry rather than the window's. `app.js` never sets
   `is-landscape` on a Mac (`deviceRotates` refuses the control and the class is
   withheld), and this is here so the stylesheet is correct without depending on
   that: a rule that is only right because of what some other file does is a rule
   that breaks the day the other file changes. */
.stage.is-landscape:not(.is-mac) {
  --device-fit: min(var(--stage-tall) * var(--device-h) / var(--device-w), var(--stage-wide));
  --device-long: calc(var(--device-fit) * var(--device-zoom, 1));
}
.stage.is-landscape:not(.is-mac) .device {
  width: var(--device-long);
  height: calc(var(--device-long) * var(--device-w) / var(--device-h));
}
/* The island is on the left edge of a phone held sideways, not along the top of it.
   `.device-top` gives up `position: relative` so the pill anchors to the frame instead
   of to the 24px bar, and keeps its z-index, which it has as a flex item rather than
   from being positioned. The battery is pinned to the third column because an
   out-of-flow island leaves the grid with two items and three tracks. */
/* **`.is-iphone`, not "not the iPad".** These three draw the phone's island along
   the left edge of a frame held sideways, and they were written as a negation
   while there were two devices to negate between. A third device matches
   `:not(.is-ipad)` — so a Mac would have been given a phone's side-mounted
   Dynamic Island the moment it could be drawn landscape. Naming the device the
   rules are about is what stops the next one inheriting them. */
.stage.is-landscape.is-iphone .device-top { flex-basis: 18px; padding-left: 28px; position: static; }
.stage.is-landscape.is-iphone .device-top > span:last-child { grid-column: 3; }
.stage.is-landscape.is-iphone .device-island {
  width: 15px; height: 58px; position: absolute; left: 5px; top: 50%;
  transform: translateY(-50%); border-radius: 10px;
}

/* The screen's own surface, which the dark look never had. Every dark value below is on a
   descendant, so a screen with an opaque child in it looked right and one showing any of
   its own surface did not — the cream base came through as a halo the moment the empty
   frame's dashed box left a margin around itself. The `is-design` and `design-*` pairs
   below carry three classes and still win, which is why the tool backgrounds are unaffected. */
.device-screen.dark { background: #111113; }
.device.dark { background: #111113; }
.device.dark .device-top { color: #ffffff; background: #111113; }
.device.dark .device-home { background: #ffffff; }
.device-screen.dark .app-header h3, .device-screen.dark .app-section-title h4, .device-screen.dark .trip-list-card h4, .device-screen.dark .place-copy h4, .device-screen.dark .profile-hero h3, .device-screen.dark .glance-grid b, .device-screen.dark .splash-face b { color: #f4f5f1; }
.device-screen.dark .booking-card, .device-screen.dark .trip-list-card, .device-screen.dark .feature-place, .device-screen.dark .settings-group button, .device-screen.dark .profile-stats span { color: #edf0eb; background: #27312e; border-color: #35413d; }
.device-screen.dark .app-search, .device-screen.dark .filter-chips span, .device-screen.dark .category-row span, .device-screen.dark .glance-grid span { background: #2b3532; }
.device-screen.dark .place-row, .device-screen.dark .settings-group button { border-color: #37413e; }
.device-screen.dark .trip-tip { color: #cbd2ce; background: #29372d; }
.device-screen.dark.design-figma { background-image: radial-gradient(circle at 1px 1px, #2a2a30, transparent 0); }
.device-screen.dark.design-canva { background-color: #241f2c; }
.device-screen.dark.design-adobe { background-color: #232324; }
.device-screen.dark .embed-frame { background: #111113; }
/* Ledger is the project whose theme setting says "Light + dark", so its own surfaces
   need the dark half too — Cedar ships light only and the control says so. */
.device-screen.dark .account-row, .device-screen.dark .chart-card, .device-screen.dark .budget-summary span, .device-screen.dark .visit-row, .device-screen.dark .result-card, .device-screen.dark .result-row, .device-screen.dark .form-card label, .device-screen.dark .form-card label.split > span { color: #edf0eb; background: #27312e; border-color: #35413d; }
.device-screen.dark .budget-summary { background: #35413d; border-color: #35413d; }
.device-screen.dark .txn-row, .device-screen.dark .cat-row { border-color: #37413e; }
.device-screen.dark .meter, .device-screen.dark .txn-icon, .device-screen.dark .doc-row { background: #2b3532; }
.device-screen.dark .chart-bars i { background: #38425f; }
.device-screen.dark .settings-foot, .device-screen.dark .day-label { color: #7d8783; }
.device-screen.dark .switch { background: #414c48; }

/* ------------------------------------------------- centre: the feature spec */

.spec-panel { overflow: hidden; }
.spec-head { flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel-muted); }
.spec-documents { align-self: flex-start; }
.spec-head-row { min-height: var(--control-height); display: flex; align-items: center; gap: 8px; }
.spec-shared { flex: 1 1 auto; min-width: 0; color: var(--muted); font: var(--type-small); }
/* Studio's selected icon button: the raised neutral fill and a neutral edge. */
.spec-preview-toggle[aria-pressed="true"] { color: var(--selected-ink); background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.glasses-mark { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.spec-conflict { display: flex; flex-direction: column; gap: 8px; }
.spec-conflict p { margin: 0; color: var(--warn-ink); font: var(--type-small); }
.spec-conflict .compact-button { width: 100%; }
.spec-inherits { flex: 0 0 auto; margin: 0; padding: 8px 16px 0; color: var(--muted); font: var(--type-small); }


.compact-button.primary { color: var(--on-primary); background: var(--primary); border-color: transparent; }
.compact-button.primary:hover:not(:disabled) { background: var(--primary-hover); }
.compact-button.primary:active:not(:disabled) { background: var(--primary-pressed); }

/* The strip that ran under the stage is gone with the three steps it used to hold. What it
   still carried afterwards was the device, the appearance, and the draft count — the first
   two are controls directly above it and the third is the chip in the header, so the row
   was a third copy of two answers and a second copy of a third.

   Delivery is two controls in the top bar rather than two steps down here. The ordering the
   numbered steps used to carry is now in the controls' own disabled states: TestFlight is
   dead until there is a validated build, and the App Store is dead until TestFlight has
   taken it. */
.topbar .button.done, .topbar .button.done:hover { color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-line); }
.topbar .button:disabled { cursor: not-allowed; }
/* What a delivery carries, listed before it runs. It reuses the approve dialog's squash
   list, because it is the same shape of claim: these versions, and no others. */
/* Approve is a single control now, and it dims rather than disappears in both of the
   states it cannot run in: blocked by an incomplete setting, and done. */
#approve-button[aria-disabled="true"] { cursor: not-allowed; }

/* -------------------------------------- right rail: project and history */

.detail-pane { display: flex; flex-direction: column; background: var(--panel); }
/* Studio's inspector header: the same 76 points as the other two panel headers, holding
   its tabs as a segmented control that scrolls sideways, and the collapse control. */
.detail-tabs { flex: 0 0 76px; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
/* The strip scrolls and the collapse control does not, so a fifth tab cannot push the way
   out of the pane off the edge of it. */
.detail-tablist { flex: 0 1 auto; min-width: 0; display: flex; gap: 4px; padding: 4px; overflow-x: auto; scrollbar-width: none; background: var(--chip); border-radius: var(--radius-button); box-shadow: inset 0 0 0 1px var(--line); }
.detail-tablist::-webkit-scrollbar { display: none; }
.detail-tablist button { flex: 0 0 auto; min-height: 20px; padding: 0 12px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 3px; font: var(--type-body); white-space: nowrap; cursor: pointer; }
.detail-tablist button:hover { background: var(--hover); }
.detail-tablist button.active { color: var(--selected-ink); background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.detail-tabs .detail-toggle { margin-left: auto; }
.detail-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; }

.detail-block { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.detail-block.last { border-bottom: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.block-head h3 { margin: 0; font: var(--type-h4); }
.block-head span { color: var(--muted); font: var(--type-small); }
.block-note { display: flex; gap: 8px; margin: 12px 0 0; padding: 8px 12px; color: var(--note-ink); background: var(--note-bg); border-radius: var(--radius-row); font: var(--type-small); }
.block-note > span { color: var(--note-mark); }
/* The glyph is `.block-note > span`, so prose that has to be written from script
   needs an element of its own — and that element must not inherit the glyph's
   colour. Same shape, and same reason, as `.modal-note > .note-body` below. */
.block-note > .note-body { color: inherit; }

/* One slot per kind, each its own drop target. The dashed edge is what says a row is
   still a place to put something even when it already holds a file. */
.slot-list { margin-top: 0; }
.input-slot { grid-template-columns: 28px 1fr auto auto; }
.input-slot.empty { grid-template-columns: 28px 1fr auto; }
.input-slot.dragging { background: var(--selected-fill); border-color: var(--selected-line-strong); border-style: dashed; }
.input-slot .slot-label { color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; }
/* Drift is a report on the file above it, not a file of its own, so it is a note under
   the slot rather than a row beside it. */

.file-list, .setting-list, .activity-list, .version-list, .pin-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.file-list li { display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-row); }
.file-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-icon); font: var(--type-caption-strong); }
.file-icon { color: var(--ink-soft); background: var(--chip); }
.file-icon.image { font-size: 12px; }
/* With no project open the inspector holds Studio's one note, whichever tab is chosen. */
body.no-project .detail-panel:not(.detail-empty) { display: none; }
/* Studio's Connections: Apple, then Figma. Each is a heading with its status badge, what
   the connection is for, its actions at the trailing edge, its messages, and a caption. */
.connection-block { display: grid; gap: 12px; }
.connection-block[hidden] { display: none; }
.connection-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.connection-head h3 { margin: 0; font: var(--type-h4); }
.connection-badge { padding: 4px 8px; border-radius: var(--radius-badge); font: var(--type-caption-strong); white-space: nowrap; }
.connection-badge.neutral { color: var(--ink-soft); background: var(--chip); }
.connection-badge.success { color: var(--ok-ink); background: var(--ok-bg); }
.connection-badge.warning { color: var(--warn-ink); background: var(--warn-bg); }
.connection-copy { margin: 0; color: var(--ink-soft); font: var(--type-small); }
.connection-copy.body { font: var(--type-body); }
.connection-caption { margin: 0; color: var(--muted); font: var(--type-caption); }
.connection-message { margin: 0; padding: 8px 12px; border-radius: var(--radius-row); font: var(--type-small); user-select: text; }
.connection-message.warning { color: var(--warn-ink); background: var(--warn-bg); }
.connection-message.danger { color: var(--bad-ink); background: var(--bad-bg); }
.connection-progress { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font: var(--type-small); }
.connection-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* A connection's actions are Studio's Secondary buttons; a quiet one has no fill, and the
   primary one is the orange. */
.connection-actions .file-action { height: var(--control-height); display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--ink); background-color: var(--selected-fill); border: 1px solid var(--selected-line); border-radius: var(--radius-button); }
.connection-actions .file-action:hover:not(:disabled) { text-decoration: none; background-image: linear-gradient(var(--hover), var(--hover)); }
.connection-actions .file-action.quiet { background-color: transparent; border-color: transparent; }
.connection-actions .file-action.primary { color: var(--on-primary); background-color: var(--primary); border-color: transparent; }
.connection-actions .file-action.primary:hover:not(:disabled) { background-image: none; background-color: var(--primary-hover); }
.connection-actions .file-action:disabled { color: var(--muted); background: var(--chip); border-color: transparent; cursor: progress; }
.connection-actions .file-action:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.file-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-copy strong { overflow: hidden; font: var(--type-small-strong); white-space: nowrap; text-overflow: ellipsis; }
.file-copy small { color: var(--muted); font: var(--type-caption); }
.file-state { padding: 4px 8px; border-radius: var(--radius-badge); font: var(--type-caption-strong); white-space: nowrap; }
.file-state.ok { color: var(--ok-ink); background: var(--ok-bg); }
.file-state.warn { color: var(--warn-ink); background: var(--warn-bg); }
.file-action { padding: 0; color: var(--ink); background: transparent; border: 0; font: var(--type-caption-strong); cursor: pointer; }
.file-action:hover:not(:disabled) { text-decoration: underline; }


.setting-list { gap: 0; }
.setting-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.setting-list li:last-child { border-bottom: 0; }
.setting-list > li > span { color: var(--ink-soft); font: var(--type-small); }
.setting-list b { color: var(--ink); font: var(--type-small-strong); }
/* Studio's warning badge: a pending app-wide change is a decision the build will make for
   you, not a draft. */
.setting-list i { margin-left: 6px; padding: 4px 8px; color: var(--warn-ink); background: var(--warn-bg); border-radius: var(--radius-badge); font: var(--type-caption-strong); font-style: normal; }
.setting-list li.reason { grid-template-columns: 1fr; gap: 0; padding: 0 0 12px; }
.setting-list li.reason .field-label { margin: 0 0 8px; }
.setting-list li.reason .field-hint { margin: 0; }
.setting-list li.group { grid-template-columns: 1fr; padding: 16px 0 4px; border-bottom: 0; }
.setting-list li.group:first-child { padding-top: 0; }
.setting-list li.group .eyebrow { margin: 0; color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); }
.permission-list { margin-top: 4px; }

/* Studio's app-wide behavior: a caption and one growing field on the muted panel. */
.app-doc-caption { margin: 0 0 12px; color: var(--muted); font: var(--type-small); }
/* Studio's document field: the muted surface, a hairline and a 7-point radius. Focus takes
   the orange ring colour, because a hairline that only darkens is not a focus indicator. */
.app-doc-input {
  width: 100%; min-height: calc(6 * 18px + 24px); padding: 12px;
  color: var(--ink); background: var(--panel-muted); border: 1px solid var(--line); border-radius: var(--radius-button);
  font: var(--type-body); resize: vertical; field-sizing: content;
}
.app-doc-input:focus { outline: none; border-color: var(--focus); }
.app-doc-input:disabled { color: var(--muted); background: var(--chip); }
.app-doc-input::placeholder { color: var(--muted); }
.app-doc-actions { margin-top: 12px; }
.block-head span.pending { padding: 4px 8px; color: var(--warn-ink); background: var(--warn-bg); border-radius: var(--radius-badge); font: var(--type-caption-strong); }

.activity-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
/* Studio's job card on the muted panel. */
.app-doc-message { margin: 8px 0 0; }
.activity-build { margin: 0 0 12px; }
.activity-message { margin: 0 0 12px; }
.activity-card { display: grid; gap: 6px; padding: 10px 12px; background: var(--panel-muted); border-radius: var(--radius-row); font: var(--type-small); }
.activity-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.activity-head b { flex: 1 1 auto; min-width: 0; color: var(--ink); font: var(--type-label); }
.activity-time { color: var(--muted); font: var(--type-caption); font-variant-numeric: tabular-nums; }
.activity-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.activity-progress small { flex: 1 1 auto; min-width: 0; color: var(--ink-soft); font: var(--type-caption); }
.activity-card small { color: var(--muted); font: var(--type-caption); }
.activity-card .file-action { justify-self: start; height: var(--control-height); padding: 0 12px; background-color: var(--selected-fill); border: 1px solid var(--selected-line); border-radius: var(--radius-button); }
.activity-card .file-action:hover:not(:disabled) { text-decoration: none; background-image: linear-gradient(var(--hover), var(--hover)); }
.activity-card .file-action:disabled { color: var(--muted); background: var(--chip); border-color: transparent; }
.activity-failure { margin: 0; color: var(--bad-ink); font: var(--type-small); }
.status-chip.danger { color: var(--bad-ink); background: var(--bad-bg); }



/* --------------------------------------------------- opening the workspace */

/* The shell with neither section in it, shown while a reloaded `/studio` waits to
   be told whether it may have the Studio. It is the page's own canvas and one
   note, because the whole point of the state is that it claims nothing: see
   `openShell` in `app.js`. It fills what the top bar leaves, as the workspace does,
   so the bar does not move when the Studio replaces it; Home hides the bar and
   takes the whole viewport. */
.shell-opening {
  height: calc(100vh - var(--topbar-height));
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

/* ----------------------------------------------------------------- modals */

/* Studio presents a form or a dialog as a centred card over a black scrim at 40%, and
   cross-fades it in: no blur, no rise, and no shadow under the card. */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: var(--scrim); animation: backdrop-in .3s ease-in-out; }
/* The alert is raised over whatever dialog is open. */
.alert-backdrop { z-index: 110; }
@keyframes backdrop-in { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; position: relative; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); animation: modal-in .3s ease-in-out; }
@keyframes modal-in { from { opacity: 0; } }
/* Studio's close control is an icon button: no fill until hovered. */
.modal-close { width: var(--icon-button); height: var(--icon-button); position: absolute; top: 24px; right: 24px; color: var(--ink); background: transparent; border-radius: var(--radius-icon); font-size: 17px; line-height: 1; }
.modal-close:hover { background: var(--hover); }
/* Studio's saving form: a spinner beside the close button while a save is in flight. */
body.form-saving .modal-backdrop:not([hidden]) .modal::after { content: ""; position: absolute; top: 31px; right: 64px; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--activity); border-radius: 50%; animation: form-saving-spin .8s linear infinite; }
body.form-saving .modal-backdrop:not([hidden]) .modal-close { pointer-events: none; opacity: .48; }
@keyframes form-saving-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body.form-saving .modal-backdrop:not([hidden]) .modal::after { animation-duration: 2.4s; } }
/* Studio's empty-state tile: a 52-point square on the raised neutral fill. The upload and
   submission dialogs wear the brand mark's monochrome instead. */
.modal-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 16px; color: var(--selected-ink); background: var(--selected-fill); border-radius: var(--radius-card); font: 600 24px/1 var(--font-ui); }
.modal-icon.dark { color: var(--on-brand); background: var(--brand); }
.modal h2 { margin: 2px 40px 8px 0; font: var(--type-h1); }
/* A heading taking focus is an announcement target, not a control, so it is read out
   without also being ringed as though it were operable. */
.modal h2[data-modal-focus]:focus { outline: none; }
.modal > p { margin: 0 0 16px; color: var(--ink-soft); font: var(--type-body); }
/* The included-quantities strip under the price is gone. There is no quota beside the
   price — only the second price, which is a price and not a limit. The pair closes the
   block off between them. */
.modal-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 16px; padding: 8px 12px; color: var(--note-ink); background: var(--note-bg); border-radius: var(--radius-row); font: var(--type-small); }
.modal-note > span { width: 16px; height: 16px; display: grid; place-items: center; flex: 0 0 16px; color: var(--white); background: var(--ink-soft); border-radius: 50%; font: 600 10px/1 var(--font-ui); }
/* The prose half. It has to be one flex item and it has to be allowed to shrink, or a long
   path inside it sets the minimum width of the whole note. */
.modal-note > .note-body { flex: 1 1 auto; min-width: 0; width: auto; height: auto; display: block; background: none; color: inherit; border-radius: 0; font: inherit; }
.modal-note code { font-family: var(--font-mono); font-size: .95em; word-break: break-word; }
/* **The buttons fill the row, rather than being held against its right edge.** Every one
   of these rows is the same shape — a dismissal and one primary, or the primary alone —
   and right-aligning them left a gutter the width of the dialog, which reads as a third
   control somebody forgot to draw. Studio's footers give every action an equal share, so
   the `wide` class no longer buys the primary a larger one.

   Dialog buttons are Studio's: body type, the dismissal in the Cancel role (the muted
   surface and a hairline), a confirmation in the primary orange, and a destructive one in
   the primary role's danger colours. */
.modal-actions { display: flex; gap: 8px; }
.modal-actions .button { flex: 1 1 0; min-width: 0; font: var(--type-body); }
.modal-actions .button-quiet { background-color: var(--panel-muted); border-color: var(--line); }
.modal-actions .button-danger { color: var(--on-danger); background: var(--danger); border-color: transparent; }
.modal-actions .button-danger:hover:not(:disabled):not([aria-disabled="true"]) { color: var(--on-danger); background: var(--danger-hover); border-color: transparent; }
/* `progress` is the shared meaning of a disabled button here — something is running. A
   primary action that is waiting on the person to give it something is not working, it is
   refusing, and the cursor is the only place that distinction is free. */
.modal-actions .button:disabled { cursor: not-allowed; }
/* The approve dialog reports one number now, so it gets one cell rather than one cell and
   two thirds of a row of empty grid. */
/* Every feature, so the total can be checked rather than believed. What contributed reads
   at full strength and what did not is dimmed — dropping the rest would make a bill for
   two screens look like a bill for the app. */
/* Every cell is placed. Leaving the amount to auto-placement puts it in column one,
   because an item with a definite row is placed before the auto ones beside it. */
/* The bill is grouped the way the rail is, and everything the month did not touch is behind
   one press. A heading is a row of the same list rather than a thing between lists, so the
   hairline grid stays intact. */
.charge-toggle { width: 100%; display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: transparent; border: 0; color: var(--ink-soft); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; cursor: pointer; }
.charge-toggle:hover { background: var(--hover); }
.charge-toggle span { display: inline-block; transition: transform .16s ease; font-size: 11px; line-height: 1; }
.charge-head.open .charge-toggle span { transform: rotate(90deg); }
.charge-toggle b { font-weight: inherit; }
.charge-toggle i { margin-left: auto; color: var(--muted); font-style: normal; font: var(--type-caption); text-transform: none; }

.small-modal { width: min(480px, 100%); }

/* Studio's labelled field: an eyebrow over the input, 8 points apart. */
.field-label { display: block; margin: 12px 0 8px; color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); }
/* Which node this dialog edits, said before anything that edits it. */

/* Choosing a file is not committing it, so the control that chooses sits inline with the
   name of what was chosen and Save stays the only thing that commits. */
/* Studio's text field: 28 points on the panel's own surface, a hairline that darkens to the
   neutral edge on focus, and the orange ring for a keyboard. */
.text-field { width: 100%; height: var(--control-height); margin-bottom: 16px; padding: 0 12px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-button); font: var(--type-body); }
.text-field:focus { border-color: var(--selected-line-strong); }
.text-field:disabled { color: var(--muted); background: var(--chip); }
.text-field::placeholder { color: var(--muted); }
select.text-field { appearance: none; padding-right: 28px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 15px) 11px, calc(100% - 10px) 11px; background-size: 5px 5px; background-repeat: no-repeat; }
.field-hint { margin: -8px 0 16px; color: var(--muted); font: var(--type-small); }
.text-field.inline { height: var(--control-height); margin-bottom: 4px; font: var(--type-body); }
/* Names the concrete build a pending change is and is not in, so "free" and "not yet
   shipped" are one sentence rather than two claims the reader has to reconcile. It reads
   the same in a dialog and in the Campaigns tab, so the rule is not scoped to either. */
.pending-summary { margin: 0; padding: 8px 12px; color: var(--note-ink); background: var(--note-bg); border-radius: var(--radius-row); font: var(--type-small); }
.pending-summary.blocked { color: var(--bad-ink); background: var(--bad-bg); }
.modal p.pending-summary { margin: -4px 0 16px; }

.squash-list { display: grid; gap: 1px; margin: 0 0 16px; padding: 0; overflow: hidden; list-style: none; background: var(--line); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-row) var(--radius-row); }
.squash-list li { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; background: var(--raised); color: var(--ink-soft); font: var(--type-small); }
.squash-list li b { color: var(--ink); font-weight: 600; }
.squash-list li time { color: var(--muted); font: var(--type-caption); }
.squash-list li::before { content: "↳"; color: var(--muted); font-size: 12px; }
.squash-list li.empty { grid-template-columns: 1fr; text-align: center; color: var(--muted); }
.squash-list li.empty::before { content: none; }
/* An app-wide change riding into this build is listed beside the drafts, and marked
   apart from them, because it is the one entry that did not come from this feature. */
.squash-list li.carried { color: var(--warn-ink); background: var(--warn-bg); }
.squash-list li.carried b { color: var(--warn-ink); }
.squash-list li.carried::before { content: "⌾"; color: var(--warn-mark); }

.check-list { display: grid; gap: 1px; margin: 4px 0 16px; padding: 0; overflow: hidden; list-style: none; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-row); }
.check-list li { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 8px; padding: 8px 12px; background: var(--raised); color: var(--ink-soft); font: var(--type-small); }
.check-list li::before { content: "✓"; color: var(--green); font-weight: 700; }
.check-list li.blocked { color: var(--bad-ink); background: var(--bad-bg); }
.check-list li.blocked::before { content: "!"; color: var(--danger); }
/* A refusal names an alternative, so it wraps to several lines and the marker aligns to
   the first of them rather than to the middle of the block. */
#permission-unsupported li { align-items: start; }
#permission-unsupported b { color: var(--warn-ink); }

/* Three tools across one row, so the choice is read as a choice of three rather than as
   a default with two alternatives behind it. */
.wide-segment { margin-bottom: 4px; }
.wide-segment button { flex: 1; }

/* Six kinds do not fit on one row at a legible size, and shrinking the type until they
   do would trade a choice for a row of abbreviations. It wraps instead, three to a row:
   a basis of a third is what makes the second row line up under the first, rather than
   two buttons stretching across a width four of them just left. The control grows
   downward, which a dialog has room for and a line of text does not. */
.wrap-segment { flex-wrap: wrap; gap: 4px; }
.wrap-segment button { flex: 1 0 calc(33.333% - 4px); min-width: 0; padding: 0 6px; }
/* The hint's negative top margin is paid for by the field's bottom margin above it, so
   the tool with no field to fill puts it back. */

/* Soft beside hard rather than above it: the pair is one decision, and reading them in a
   column invites setting one and forgetting the other. */
.version-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 8px; }
.version-grid .field-label { margin-top: 8px; }
.version-grid .text-field.inline { margin-bottom: 0; }
.version-grid .text-field[aria-invalid="true"] { border-color: var(--danger); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
/* A setting choice: unselected it is a hairline on the panel, selected it is Studio's
   raised neutral fill, neutral edge and primary ink — with a tick, so the state is not
   carried by the edge alone. */
.chip-toggle { min-height: var(--control-height); padding: 0 12px; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 14px; font: var(--type-small-strong); }
.chip-toggle:hover { background: var(--hover); }
.chip-toggle[aria-pressed="true"] { color: var(--selected-ink); background: var(--selected-fill); border-color: var(--selected-line-strong); }
.chip-toggle[aria-pressed="true"]::before { content: "✓ "; font-weight: 600; }
/* A geo a campaign is still running in cannot simply be dropped, so the chip carries the
   consequence rather than the click carrying it silently. */
.chip-toggle small { margin-left: 4px; color: var(--muted); font: var(--type-caption); }

.campaign-list { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.campaign-list li { display: grid; gap: 8px; padding: 8px 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-row); }
.campaign-list li.blocked { background: var(--bad-bg); border-color: var(--warn-line); }
.campaign-empty { justify-items: center; padding: 24px 16px !important; background: var(--panel-muted) !important; border-style: dashed !important; border-color: var(--line-strong) !important; text-align: center; }
.campaign-empty strong { font: var(--type-label); }
.campaign-empty small { color: var(--muted); font: var(--type-small); }
/* The tab lives in a 420px pane, and the summary is the first thing read in it. */
#panel-campaigns .pending-summary { margin: 0; }

/* A radio group in everything but markup: exactly one option is chosen, and choosing is
   the whole of what the dialog does. */
.choice-list { display: grid; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.choice-option { width: 100%; display: grid; grid-template-columns: 1fr 16px; align-items: center; gap: 2px 8px; padding: 8px 12px; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-row); }
.choice-option:hover { background: var(--hover); }
.choice-option.selected { background: var(--selected-fill); border-color: var(--selected-line-strong); }
.choice-option.selected small { color: var(--ink-soft); }
.choice-option strong { grid-column: 1; font: var(--type-label); }
.choice-option small { grid-column: 1; grid-row: 2; color: var(--muted); font: var(--type-small); }
.choice-option.selected strong { color: var(--selected-ink); }
/* A native control inherits the product accent, as Studio's do from the screen root. */
.choice-option input[type="checkbox"] { grid-column: 2; grid-row: 1 / span 2; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.choice-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice-option:has(input:disabled) { opacity: .48; }
.choice-mark { grid-column: 2; grid-row: 1 / span 2; color: var(--selected-ink); font-size: 12px; font-weight: 600; text-align: right; }
.campaign-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.campaign-name strong { overflow: hidden; font: var(--type-small-strong); white-space: nowrap; text-overflow: ellipsis; }
.campaign-name small { color: var(--muted); font: var(--type-caption); }
.campaign-controls { display: flex; align-items: center; gap: 8px; }
.campaign-controls .segmented { flex: 1; min-width: 0; }
.campaign-controls .segmented button { flex: 1; min-width: 0; padding: 0 5px; font: var(--type-small); }
.campaign-geo {
  flex: 0 0 auto; height: var(--control-height); padding: 0 24px 0 10px; color: var(--ink); background-color: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-button); font: var(--type-small); appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 14px) 11px, calc(100% - 10px) 11px; background-size: 4px 4px; background-repeat: no-repeat;
}



/* ------------------------------------------------------------ responsive */

/* A short window trades the room the frame is given, not the frame's proportions:
   these move the budget and the device stays the shape of the hardware. */
@media (max-height: 1020px) { .stage { --stage-tall: 500px; } }
@media (max-height: 950px) { .stage { --stage-tall: 440px; } }
@media (max-height: 870px) { .stage { --stage-tall: 392px; } }
@media (max-height: 800px) { .stage { --stage-tall: 344px; padding: 16px; } }

@media (max-width: 1420px) {
  :root { --rail-base: 234px; --rail-max: 304px; --detail-max: 380px; --stage-col: minmax(380px, 1fr); }
}

@media (max-width: 1180px) {
  :root { --rail-base: 218px; --rail-max: 283px; --detail-max: 340px; --stage-col: minmax(0, 1fr); }
  .desktop-action { display: none; }
  /* 507px of long edge is the 234px-wide phone this rule used to set directly — and it
     reaches the iPad, which the old rule could not: `.stage.is-ipad .device` outranked
     it, so the tablet stayed 360px wide exactly where the column was tightest. */
  .stage { --stage-wide: 507px; }
  .build-state { display: none; }
}

/* Studio's narrow window: when every visible pane cannot fit, the content keeps the side
   pane last brought forward (`front-rail` or `front-detail`, set by `app.js`); the other
   leaves the arrangement until something brings it forward. Studio keeps the expand
   controls reachable, so the pane left out stays as its collapsed strip, whose toggle
   brings it forward. The Ship room keeps its navigator beside the page (ship-room.css).
   Below 761px the window is one pane at a time, in the next block. */
@media (max-width: 980px) {
  .brand-name { display: none; }
}
@media (min-width: 761px) and (max-width: 980px) {
  body:not(.ship-room-open).front-detail .workspace { grid-template-columns: var(--pane-stub) var(--stage-col) var(--detail-col); }
  body:not(.ship-room-open).front-rail .workspace { grid-template-columns: var(--rail-col) var(--stage-col) var(--pane-stub); }
  body:not(.ship-room-open).front-detail .feature-rail > :not(.rail-stub),
  body:not(.ship-room-open).front-rail .detail-pane > :not(.detail-stub) { display: none; }
  body:not(.ship-room-open).front-detail .rail-stub,
  body:not(.ship-room-open).front-rail .detail-stub { display: flex; }
}

@media (max-width: 760px) {
  body { overflow-y: auto; }
  .shell-opening { height: calc(100vh - 56px); }
  .topbar { height: 56px; grid-template-columns: 1fr auto; position: sticky; top: 0; }
  .brand { border-right: 0; }
  .top-context { display: none; }
  /* Too narrow for two panes: one at a time, the one in front. A side pane not in front
     stays as its strip beside it, so its toggle is always within reach. */
  .workspace { height: calc(100vh - 56px); grid-template-columns: var(--pane-stub) minmax(0, 1fr) var(--pane-stub); }
  body.front-one-rail .workspace { grid-template-columns: minmax(0, 1fr) var(--pane-stub); }
  body.front-one-detail .workspace { grid-template-columns: var(--pane-stub) minmax(0, 1fr); }
  body.front-one-rail .stage-pane, body.front-one-detail .stage-pane { display: none; }
  body:not(.front-one-rail) .feature-rail > :not(.rail-stub),
  body:not(.front-one-detail) .detail-pane > :not(.detail-stub) { display: none; }
  body:not(.front-one-rail) .rail-stub, body:not(.front-one-detail) .detail-stub { display: flex; }
  .pane-resizer { display: none; }
  .stage-controls { overflow-x: auto; }
  .modal { padding: 20px 16px; }
}

/* The full palette is applied by a `data-theme` attribute, which a deferred script can
   only set after parsing. These two properties are what a light flash is made of, so
   they follow the system preference in CSS and the rest catches up. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; background: #111113; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  /* Studio's Reduce Motion: the working line holds still as a whole ring, and the pulse
     keeps its fade, which moves nothing. */
  .stage-activity::before { background: var(--activity); }
  .stage-activity.is-landing::after { animation: stage-landing var(--motion-result-pulse) ease-out !important; }
}

/* --------------------------------------------------------------------------
   Resource states
   --------------------------------------------------------------------------

   Every pane with nothing in it draws one of these, and they are four rules
   rather than twenty because "still loading", "genuinely empty", "this endpoint
   is not built", and "that failed" are the only four things a pane can be
   saying. `renderResource` is the single writer.

   The unimplemented state is deliberately not styled as an error. It is the
   ordinary condition of a client that binds to its API's whole contract before
   the API has finished building it, and colouring it red would make a normal
   day look like an outage. */

.resource-note {
  margin: 0;
  padding: 12px 16px;
  font: var(--type-small);
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-row);
  background: var(--panel-muted);
}

.resource-note code {
  display: inline-block;
  margin-top: 6px;
  font: var(--type-mono);
  color: var(--muted);
  word-break: break-all;
}

.resource-note.is-loading {
  border-style: solid;
  color: var(--muted);
}

.resource-note.is-unimplemented {
  border-color: var(--line);
  color: var(--ink-soft);
}

/* The one that *is* a failure. Everything above is a state; this is a fault. */
.resource-note.is-error {
  border-style: solid;
  border-color: var(--bad-ink);
  color: var(--bad-ink);
  background: var(--bad-bg);
}

/* The stage's own note, which cannot live inside `.stage-canvas`: that element
   holds the device frame and the aggregate panel, and emptying it to write a
   sentence would destroy both. */
.stage-note {
  max-width: 420px;
  margin: auto;
}

/* The spec's fixed heading. Styled as the document's title rather than as a
   field, because it is not one: it is the feature's name, and the only way to
   change it is to rename the feature. */

.modal.markets-modal { width: min(720px, calc(100vw - 40px)); }
.market-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.market-sections > section { min-width: 0; }
.market-search { width: 100%; }
.market-count { margin: 8px 0; font: var(--type-small); color: var(--muted); }
.market-list { height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-row); padding: 4px; }
.market-option { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 2px 8px; min-height: 36px; padding: 6px 8px; border-radius: 6px; font: var(--type-body); cursor: pointer; }
.market-option:hover { background: var(--hover); }
.market-option:has(input:checked) { background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line); }
.market-option:has(input:checked) small { color: var(--ink-soft); }
.market-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.market-option small { grid-column: 2; color: var(--muted); font: var(--type-caption); }
.market-list > .field-hint { padding: 8px; }
@media (max-width: 560px) {
  .market-sections { grid-template-columns: 1fr; }
  .market-list { height: 180px; }
}

/* The spec field is the panel. No read mode, no Edit button, and no empty state:
   an empty spec is an empty box with a placeholder in it. */





/* Derived, not typed: the App Spec key a feature's name reduces to. Shown while
   naming one so it is never a surprise. */
.field-note {
  margin: 8px 0 0;
  font: var(--type-mono);
  color: var(--muted);
}

/* The spec field is the panel. No read mode, no Edit button, and no empty state:
   an empty spec is an empty box with a placeholder in it. */
.spec-editor {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
}

/* Studio's spec editor: monospaced 12/16 on the pane, with no field around it. */
.spec-input {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 0;
  font: var(--type-mono);
  color: var(--ink);
  background: transparent;
  border: 0;
  resize: none;
}

.spec-input:focus { outline: none; }
.spec-input:disabled { color: var(--muted); }
/* No `opacity` here. --muted is already the "this is secondary" signal, and multiplying
   it by .65 composited to 2.26:1 against the panel — a placeholder is text, and text owes
   4.5:1. The token on its own measures 5.10:1 on the panel. */
.spec-input::placeholder { color: var(--muted); }

/* The spec as a document rather than as its own source. The doc panel already borrows
   this and steps every size down one, which is why the sizes live here and not there.

   It is a button in the accessibility tree and it must not look like one: the whole
   point is that it reads as the finished text, and the only affordance it needs is the
   text cursor that says typing will happen here. */
.spec-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  color: var(--ink);
  font: var(--type-body);
  cursor: text;
}

/* Studio's Markdown: blocks 12 points apart, headings at the type scale in primary ink,
   code on the inset surface, a 3-point bar beside a quote, and links in the text colour
   with an underline. */
.spec-body:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.spec-body > :first-child { margin-top: 0; }
.spec-body h1, .spec-body h2, .spec-body h3, .spec-body h4, .spec-body h5, .spec-body h6 { margin: 0 0 12px; color: var(--ink); }
.spec-body h1 { font: var(--type-h1); }
.spec-body h2 { font: var(--type-h2); }
.spec-body h3 { font: var(--type-h3); }
.spec-body h4, .spec-body h5, .spec-body h6 { font: var(--type-h4); }
.spec-body p { margin: 0 0 12px; }
.spec-body strong, .spec-body b { font-weight: 700; }
.spec-body ul, .spec-body ol { margin: 0 0 12px; padding-left: 20px; }
.spec-body li { margin: 0 0 8px; }
.spec-body li::marker { color: var(--ink-soft); }
.spec-body code { background: var(--inset); font-family: var(--font-mono); font-size: .92em; }
.spec-body pre { margin: 0 0 12px; padding: 12px; overflow-x: auto; background: var(--inset); border-radius: 6px; font: 400 13px/18px var(--font-mono); }
.spec-body pre code { background: none; font-size: inherit; }
.spec-body blockquote { margin: 0 0 12px; padding: 0 0 0 12px; border-left: 3px solid var(--line); color: var(--ink-soft); }
.spec-body hr { margin: 12px 0; border: 0; border-top: 1px solid var(--line); }
.spec-body table { width: 100%; margin: 0 0 12px; border-collapse: collapse; }
.spec-body th, .spec-body td { padding: 4px 12px 4px 0; border-bottom: 1px solid var(--line-soft); text-align: left; font: var(--type-small); }
.spec-body th { font: var(--type-h4); }
.spec-body a { color: var(--ink); text-decoration: underline; }

/* Not written yet. The instruction keeps the field's own wording and loses its own
   emphasis, so it reads as a note about the document rather than as a draft of one. */
.spec-placeholder { color: var(--muted); }
.spec-placeholder p { margin: 0 0 8px; }
.spec-placeholder p:empty { margin: 0; height: 6px; }

/* ---------------------------------------------------------------- deleting

   The one destructive family in the workspace, and it is drawn in one place so
   that a control that removes something never wears the same clothes as one that
   changes it. `--bad-ink` and `--bad-bg` already carry a value under both themes —
   they are what a blocked check-list row uses — so nothing new is declared here. */

.danger-block { padding-top: 16px; border-top: 1px solid var(--line-soft); }
/* Archive feature: a heading that opens and closes the section, with the chevron at its
   trailing edge, pointing down while open. */
.archive-block .block-head { margin-bottom: 0; }
.archive-block .block-head h3 { flex: 1 1 auto; min-width: 0; }
.archive-disclosure { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0; color: inherit; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; }
.archive-disclosure .chevron { color: var(--muted); transform: translateX(-2px) rotate(-45deg); transition: transform var(--motion-disclosure) ease-in-out; }
.archive-disclosure[aria-expanded="true"] .chevron { transform: translateY(-2px) rotate(45deg); }
.archive-body { margin-top: 12px; animation: archive-open var(--motion-disclosure) ease-in-out; }
@keyframes archive-open { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .archive-disclosure .chevron { transition: none; } .archive-body { animation: none; } }
/* Studio's archive sentence: small, in textSecondary. */
.archive-copy { margin: 0 0 12px; color: var(--ink-soft); font: var(--type-small); }
.archive-actions { display: flex; justify-content: flex-end; }
/* Studio's `archivebox`, drawn in the same shape, before the action's title. */
.button-icon { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Studio's archive actions: the Secondary button in the danger family. A dialog's
   confirmation is the primary role in danger instead; see .modal-actions. */
.button-danger { color: var(--bad-ink); background-color: var(--bad-bg); border-color: var(--bad-line); }
.button-danger:hover:not(:disabled):not([aria-disabled="true"]) { background-image: linear-gradient(var(--hover), var(--hover)); }
/* Dimmed, and still pressable. Every refusal behind one of these names something
   the person can go and change, and `disabled` would swallow the press that asks. */
.button-danger[aria-disabled="true"] { color: var(--bad-ink); background: var(--bad-bg); border-color: var(--bad-line); cursor: default; opacity: .48; }

/* A consequence is a thing that will happen, not a thing that has been checked
   off. The tick `.check-list` draws would read as reassurance in a dialog whose
   whole job is to be read slowly. */
.consequence-list li::before { content: "\2022"; color: var(--muted); }
.modal-icon.danger { color: var(--bad-ink); background: var(--bad-bg); }

/* A service this workspace cannot reach. Dimmed rather than dropped, on the same
   terms as the usage dialog's free rows: a list that shows only what works reads
   as a list of everything. */

/* Refresh is unavailable when the workspace cannot read Figma. */
#design-sync-button[aria-disabled="true"] { cursor: not-allowed; }

/* Captured-source controls live outside the inert design canvas. */
.source-font-choice { display: flex; gap: 8px; align-items: center; font: var(--type-body); margin-top: 16px; }
#design-source-error { color: var(--bad-ink); font: var(--type-small); }


/* ------------------------------------------------------------ Studio parity */

/* Feature states: Populated, then “+”, then the optional states the feature has. */
.state-segment .state-add { padding: 0 8px; font-weight: 600; }
.state-segment .state-add:disabled { opacity: .48; cursor: not-allowed; }
.preview-controls { position: relative; }
.state-add-menu { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; min-width: 140px; display: flex; flex-direction: column; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-row); box-shadow: 0 12px 32px var(--shadow-menu); }
.state-add-menu[hidden] { display: none; }
.state-add-menu button { height: var(--control-height); padding: 0 10px; color: var(--ink); background: transparent; border-radius: var(--radius-icon); font: var(--type-body); text-align: left; }
.state-add-menu button:hover, .state-add-menu button:focus-visible { background: var(--hover); }

/* Chat / View / Specs are multi-select, so a pressed pane reads as selected. */
#pane-segment button:disabled { opacity: .48; cursor: not-allowed; }

/* Previous is a toggle: while it is on, the stage shows the last approved design, and the
   button wears Studio's selected Secondary — the neutral fill with the stronger edge. */
#previous-button.active { color: var(--selected-ink); background-color: var(--selected-fill); border-color: var(--selected-line-strong); }

/* A look change keeps the previous design, dimmed, until the next one is ready. No
   loading indicator is ever drawn over the preview. */
.embed-frame { transition: opacity var(--motion-preview) ease; }
.embed-frame.is-stale { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .embed-frame { transition: none; } }

/* The no-design placeholder: shown only when a look has no design. */
.device-blank { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; background: transparent; border: 0; cursor: default; }
.device-blank[hidden] { display: none; }
.device-blank .compact-button { margin-top: 4px; }
/* The placeholder's action is drawn in the preview's appearance, as the frame around it is,
   rather than in the workspace theme: Studio's Secondary for light and for dark. */
.device-screen:not(.dark) .device-blank .compact-button { color: #18181b; background-color: #ffffff; border-color: #d1d1d6; }
.device-screen.dark .device-blank .compact-button { color: #ededf0; background-color: #34343a; border-color: #3a3a42; }
.device-blank:hover, .device-screen.dark .device-blank:hover { background: transparent; }

/* Studio's frame on iPhone, iPhone Duo and iPad: the status bar overlays the screen, the
   design starts below it, and the design's canvas colour runs beneath the bar with no seam.
   A Mac draws its title bar above the content instead. */
.device-top { position: absolute; top: 0; left: 0; right: 0; height: 24px; background: transparent; }
.device.dark .device-top { background: transparent; }
.device-screen { background: var(--device-canvas, #ffffff); }
.device-screen.dark { background: var(--device-canvas, #111113); }
.embed-frame, .device-screen.dark .embed-frame { inset: 24px 0 0; background: transparent; }
.stage.is-landscape.is-iphone .device-top { height: 18px; position: absolute; }
.stage.is-landscape.is-iphone .embed-frame { top: 18px; }
.stage.is-mac .device-top { position: static; height: auto; }
.stage.is-mac .embed-frame { top: 0; }
/* The open iPhone Duo held sideways has no top strip. Its status items — the time, then
   the battery and signal — stack at the top of an 84-point column along the trailing edge,
   and the design runs to the screen's edge beneath it: the canvas fills the column, and the
   content keeps out of it through the 84-point trailing safe area (`SURFACES.duo.landscape`
   in design-tree.js). The column is a share of the screen's width rather than a pixel
   count, because the design is scaled to that width, so the two land on the same line at
   any size the frame is drawn. It sits above the design, which is drawn over the rest of
   the frame's chrome. */
.stage.is-landscape.is-duo .device-top,
.stage.is-duo_closed .device-top {
  left: auto; right: 0; bottom: 0; z-index: 8;
  width: var(--status-column-width, calc(100% * 84 / 951)); height: auto;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0 0;
}
.stage.is-landscape.is-duo .device-island { display: none; }
.stage.is-landscape.is-duo .embed-frame, .stage.is-duo_closed .embed-frame { top: 0; }

/* Content-fitting modals: no reserved height, capped to the viewport, errors pinned
   above equal-width footer actions. */
.fit-modal { width: min(480px, 100%); display: flex; flex-direction: column; gap: 12px; }
/* Studio's alert is narrower than its forms. */
.fit-modal[role="alertdialog"] { width: min(360px, 100%); }
.fit-modal h2 { margin: 0 40px 0 0; }
.modal-subtle { margin: 0; color: var(--muted); font: var(--type-small); }
.modal-error { margin: 0; padding: 12px; color: var(--bad-ink); background: var(--bad-bg); border-radius: var(--radius-button); font: var(--type-small); }
.modal-error[hidden] { display: none; }
.modal-actions.equal .button { flex: 1 1 0; }
.modal-actions[hidden] { display: none; }
.status-chip { align-self: flex-start; padding: 4px 8px; color: var(--ink-soft); background: var(--chip); border-radius: var(--radius-badge); font: var(--type-caption-strong); }
.source-variant-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.source-variant-actions[hidden] { display: none; }
.source-figma-fields { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.source-figma-fields[hidden] { display: none; }
.field-hint.warn { color: var(--warn-ink); }
.detail-rows { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.detail-rows li { display: flex; justify-content: space-between; gap: 12px; font: var(--type-small); }
.detail-rows span { color: var(--muted); }
.detail-rows b { min-width: 0; overflow: hidden; color: var(--ink); font-weight: 500; text-align: right; white-space: nowrap; text-overflow: ellipsis; }

/* Studio's Campaigns tab: the variants as the navigator draws a feature — its name, its
   status, and the selection — then the add action and the scheduling limit under a rule. */
.campaign-rows { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 4px; }
.campaign-rows:empty { display: none; }
.campaign-add { margin-bottom: 16px; }
.campaign-limit { padding-top: 12px; border-top: 1px solid var(--line); }
.campaign-limit strong { font: var(--type-label); }
.campaign-limit p { margin: 4px 0 0; color: var(--ink-soft); font: var(--type-small); }
.field-note.problem { color: var(--bad-ink); }
