/* ────────────────────────────────────────────────────────────
   Inter Variable — self-hosted, v2 design system primary face.
   Variable font: single file covers weights 100-900. Loaded
   from /fonts/InterVariable.woff2 (~344 KB, ships with deploy).
   Added 2026-05-26, Phase B.
   ──────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("./fonts/InterVariable.woff2") format("woff2-variations"),
       url("./fonts/InterVariable.woff2") format("woff2");
  font-feature-settings: "cv11", "ss01", "ss03";
}

/* ────────────────────────────────────────────────────────────
   Lucide icon helper (Phase B.2). Used with the SVG sprite at the
   top of <body> via <svg class="icon"><use href="#i-X"/></svg>.
   - Inherits text color via stroke="currentColor" on each <symbol>
   - Sizes to 1em by default so it scales with parent font-size
   - Variants: .icon.sm (0.875em), .icon.md (1.25em), .icon.lg (1.5em)
   ──────────────────────────────────────────────────────────── */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em; /* aligns icon to text baseline */
  flex-shrink: 0;
}
.icon.sm { width: 0.875em; height: 0.875em; }
.icon.md { width: 1.25em;  height: 1.25em; }
.icon.lg { width: 1.5em;   height: 1.5em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ────────────────────────────────────────────────────────────
   SVG Lab — design tokens (OKLCH, warm-tinted neutrals)
   ──────────────────────────────────────────────────────────── */
:root {
  /* ────────────────────────────────────────────────────────────
     v2 TOKEN REMAP (2026-05-26 — same-day pivot)
     The original warm-graphite oklch values are commented in each
     line. The active values are the v2 vibrant-dark palette — pink
     primary accent, near-black surfaces, mint as secondary accent
     (already applied to brand mark + BETA pill in Phase C earlier).
     This single edit propagates the new look through the WHOLE app
     because every component references these tokens by name.
     ──────────────────────────────────────────────────────────── */

  /* Surfaces — near-black scale, slightly warm */
  --bg:           #0B0B10;  /* was oklch(0.200 0.008 70) — warm graphite */
  --bg-deep:      #050507;  /* was oklch(0.155 0.008 70) */
  --panel:        #14141B;  /* was oklch(0.235 0.010 70) */
  --panel-2:      #1C1C25;  /* was #2C2C35 */
  --panel-3:      #26262F;  /* was oklch(0.315 0.012 70) */
  --panel-sunken: #050507;  /* was #1A1A22 */

  /* Structure — semi-transparent white lines for that "modern dark" feel */
  --line:        rgba(255, 255, 255, 0.06);
  --line-soft:   rgba(255, 255, 255, 0.10);
  --line-faint:  rgba(255, 255, 255, 0.04);

  /* Canvas backdrop dot grid (camera-synced via applyView()). A subtle light
     dot on the dark canvas — the "infinite drawing surface" look that Figma /
     tldraw / Miro use. The dots pan and scale with the camera. */
  --grid-dot:    rgba(255, 255, 255, 0.10);

  /* Text — neutral whites instead of warm-cream */
  --ink:         #F5F5F7;  /* was oklch(0.945 0.008 80) */
  --ink-2:       #A1A1AF;  /* was oklch(0.760 0.012 80) */
  --ink-3:       #8A8A99;  /* lightened 2026-05-29 → WCAG AA (#6B6B78 was ~3.4:1 on panels) */
  --ink-4:       #4B4B58;  /* was oklch(0.400 0.010 80) */

  /* Accents — primary palette pivoted to ELECTRIC LIME (#B5FF3A) per
     user reference 2026-05-26. Tool-active highlight, selection chrome,
     snap rings, slider thumbs, primary button state — all lime.
     Selection chrome uses AMBER (#F2D43D) for visual contrast against
     lime CTAs so a selected shape doesn't blend with an active tool. */
  --accent:      #B5FF3A;  /* electric lime — primary CTA */
  --accent-hi:   #C9FF66;  /* lighter lime — hover */
  --accent-lo:   #8FCC1F;  /* darker lime — pressed */
  --accent-soft: rgba(181, 255, 58, 0.18);
  --accent-glow: rgba(181, 255, 58, 0.40);
  --accent-ink:  #0B0B10;  /* dark text on bright lime button */

  /* Selection chrome — amber, distinct from primary lime */
  --select:      #F2D43D;
  --select-soft: rgba(242, 212, 61, 0.18);

  /* Danger */
  --danger:      #FF4D4D;
  --danger-soft: rgba(255, 77, 77, 0.18);

  /* Canvas — neutral dark surface (user direction: canvas stays clean) */
  --canvas-bg:   #0B0B10;
  --doc-bg:      #f7f3ec;  /* keep — this is the SVG document's background */

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;

  /* Radius */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 8px;
  --r-pill: 999px;

  /* Motion — single canonical timing scale (2026-05-29 consolidation).
     The legacy --t-* names and the DESIGN.md --dur-* names had drifted to
     different values (fast 110 vs 160, base 200 vs 240 …), so hover timing
     was inconsistent across the app. Both naming systems now resolve to ONE
     scale: snappy values tuned for a product tool. --dur-* alias --t-* below. */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-q:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press:  cubic-bezier(0.4, 0, 0.6, 1);
  --t-instant: 80ms;
  --t-fast:    130ms;
  --t-base:    200ms;
  --t-slow:    300ms;

  /* Elevation */
  --shadow-1: 0 1px 0 oklch(0 0 0 / 0.28), 0 1px 2px oklch(0 0 0 / 0.18);
  --shadow-2: 0 6px 16px oklch(0 0 0 / 0.36), 0 1px 0 oklch(0 0 0 / 0.40);
  --shadow-3: 0 14px 38px oklch(0 0 0 / 0.46), 0 2px 0 oklch(0 0 0 / 0.50);
  --inner-hi:    inset 0 1px 0 oklch(1 0 0 / 0.06);
  --inner-hi-2:  inset 0 1px 0 oklch(1 0 0 / 0.10);

  /* Focus ring */
  /* Keyboard focus ring: a 2px dark gap then a crisp solid-lime band. The
     outer band was --accent-soft (0.18 alpha) — too faint to read as a focus
     indicator. Solid lime gives a clearly visible ring for keyboard users. */
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* ────────────────────────────────────────────────────────────
     v2 DESIGN.md tokens (added 2026-05-26, Phase A)
     ----------------------------------------------------------------
     These are the new vibrant-dark token system per DESIGN.md.
     INTENTIONALLY UNUSED in Phase A — defined here so phases B-H can
     swap component usage from legacy tokens (--bg/--panel/--accent)
     to these new ones surgically, one section at a time.
     Do NOT delete the legacy tokens above; they stay until the full
     migration is done.
     ──────────────────────────────────────────────────────────── */

  /* Surfaces — 6-step near-black scale, slightly warm */
  --surface-0: #050507;
  --surface-1: #0B0B10;
  --surface-2: #14141B;
  --surface-3: #1C1C25;
  --surface-4: #26262F;
  --surface-5: #33333D;

  /* Text scale */
  --text-primary:   #F5F5F7;
  --text-secondary: #A1A1AF;
  --text-tertiary:  #8A8A99;  /* bumped from #6B6B78 (~3.5:1) → WCAG AA on panels (2026-05-29) */
  --text-inverse:   #0B0B10;

  /* Vibrant accent palette (extracted from reference image) */
  /* Legacy v2 tokens — DEFINED BUT UNUSED after 2026-05-26 lime pivot.
     Components that referenced these were swapped to lime/olive/amber.
     Kept here so any stray reference resolves to a known color. */
  --accent-mint:     #5DD5C9;
  --accent-violet:   #D459FA;
  --accent-pink:     #F25287;
  --accent-electric: #F02D71;
  /* --accent-lime: now defined below at #B5FF3A (electric lime, new primary) */
  --accent-amber:    #F2D43D;

  /* Soft accent tints (8% alpha — for backgrounds, hover surfaces) */
  --accent-mint-soft:     rgba( 93, 213, 201, 0.08);
  --accent-violet-soft:   rgba(212,  89, 250, 0.08);
  --accent-pink-soft:     rgba(242,  82, 135, 0.08);
  --accent-electric-soft: rgba(240,  45, 113, 0.08);
  /* --accent-lime-soft: redefined below at lime #B5FF3A */
  --accent-amber-soft:    rgba(242, 212,  61, 0.08);

  /* Semantic mappings — repointed to lime palette (2026-05-26).
     --color-info uses amber (distinct from primary lime), --color-pro
     uses olive (the secondary green from the new reference). */
  --color-primary: #B5FF3A; /* lime */
  --color-success: #B5FF3A; /* lime */
  --color-warning: #F2D43D; /* amber */
  --color-info:    #F2D43D; /* amber */
  --color-pro:     #6B8E3D; /* olive */
  --color-danger:  #FF4D4D;

  /* Brand gradients — pivoted to LIME → OLIVE → AMBER (2026-05-26).
     Replaces the previous mint→violet→pink combo per user direction
     "no pink/blue/purple, use the colors from the new reference image." */
  --gradient-brand: linear-gradient(135deg, #B5FF3A 0%, #6B8E3D 50%, #F2D43D 100%);
  --gradient-brand-soft: linear-gradient(135deg,
    rgba(181, 255,  58, 0.15) 0%,
    rgba(107, 142,  61, 0.15) 50%,
    rgba(242, 212,  61, 0.15) 100%);

  /* PRO badge gradients — also pivoted to lime variants. */
  --gradient-pro:      linear-gradient(135deg, #B5FF3A 0%, #F2D43D 100%);
  --gradient-pro-plus: linear-gradient(110deg,
    #B5FF3A 0%, #C9FF66 33%, #F2D43D 66%, #B5FF3A 100%);

  /* Typography stack — Inter loaded in Phase B via @font-face */
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, sans-serif;
  /* One canonical UI mono stack (2026-05-29). The app had three different
     hardcoded mono stacks (Cascadia / Source Code Pro / JetBrains); all UI
     mono now resolves here. System-first so it renders instantly with no
     web-font dependency or FOUT. (Source Code Pro stays a Text-tool content
     option, not a UI face.) */
  --font-mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono",
               "JetBrains Mono", Menlo, Consolas, monospace;

  /* Type sizes (size / line-height pairs — apply via shorthand) */
  --type-display-size: 32px;  --type-display-line: 40px;
  --type-h1-size:      24px;  --type-h1-line:      32px;
  --type-h2-size:      18px;  --type-h2-line:      24px;
  --type-h3-size:      14px;  --type-h3-line:      20px;
  --type-body-size:    13px;  --type-body-line:    18px;
  --type-small-size:   12px;  --type-small-line:   16px;
  --type-tiny-size:    11px;  --type-tiny-line:    14px;
  --type-mono-size:    12px;  --type-mono-line:    16px;

  /* Letter-spacing presets */
  --tracking-brand:   0.02em;
  --tracking-tight:  -0.01em;
  --tracking-caps:    0.06em;
  --tracking-default: 0;

  /* Spacing (4px base — new names alongside legacy --s-N) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius (new names alongside legacy --r-N) */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-2xl: 24px;
  --radius-pill: 999px;

  /* Elevation (new names alongside legacy --shadow-N) */
  --shadow-e1: 0 1px 2px 0 rgba(0,0,0,0.4);
  --shadow-e2: 0 4px 8px -2px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-e3: 0 8px 16px -4px rgba(0,0,0,0.5), 0 4px 8px -4px rgba(0,0,0,0.3);
  --shadow-e4: 0 16px 32px -8px rgba(0,0,0,0.6), 0 8px 16px -8px rgba(0,0,0,0.4);

  /* Accent glows for hover/pulse states */
  --shadow-glow-pink:   0 0 32px rgba(242,  82, 135, 0.35);
  --shadow-glow-violet: 0 0 32px rgba(212,  89, 250, 0.35);
  --shadow-glow-mint:   0 0 32px rgba( 93, 213, 201, 0.35);

  /* Lime-palette glows (post-pivot, 2026-05-26). */
  --shadow-glow-lime:   0 0 32px rgba(181, 255,  58, 0.40);
  --shadow-glow-amber:  0 0 32px rgba(242, 212,  61, 0.35);
  --shadow-glow-olive:  0 0 32px rgba(107, 142,  61, 0.40);

  /* Explicit lime + olive accent tokens for components that want to
     reference them by name. */
  --accent-lime:   #B5FF3A;
  --accent-olive:  #6B8E3D;
  --accent-lime-soft:  rgba(181, 255,  58, 0.18);
  --accent-olive-soft: rgba(107, 142,  61, 0.18);

  /* Glass system — for floating chrome (modals, popovers, tooltips).
     Used on translucent surfaces ONLY; structural surfaces stay solid. */
  --glass-base:       rgba(20, 20, 27, 0.65);
  --glass-strong:     rgba(20, 20, 27, 0.85);
  --glass-light:      rgba(255, 255, 255, 0.04);
  --glass-blur:       blur(24px) saturate(180%);
  --glass-blur-heavy: blur(40px) saturate(200%);
  --glass-border-top: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-border-all: 0 0 0 1px rgba(255, 255, 255, 0.06);

  /* Motion — new easing/duration tokens.
     --ease-out already exists above with the matching value; reusing it. */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-linear: linear;

  /* DESIGN.md duration names now alias the canonical --t-* scale above so the
     two systems can't drift apart again. --dur-page has no --t-* equivalent. */
  --dur-instant: var(--t-instant);
  --dur-fast:    var(--t-fast);
  --dur-base:    var(--t-base);
  --dur-slow:    var(--t-slow);
  --dur-page:    480ms;
}

/* ────────────────────────────────────────────────────────────
   Light theme — overrides all color tokens.
   Applied via class="theme-light" on <html> for the current page visit.
   Non-color tokens (spacing, radius, motion) stay in :root and
   do not need overriding.
   ──────────────────────────────────────────────────────────── */
.theme-light {
  color-scheme: light;

  /* Surfaces */
  --bg:           #F6F5F0;
  --bg-deep:      #ECEAE3;
  --panel:        #FFFFFF;
  --panel-2:      #F1EEE6;
  --panel-3:      #E8E4D9;
  --panel-sunken: #E8E4D9;

  /* Structure */
  --line:        rgba(20, 20, 27, 0.08);
  --line-soft:   rgba(20, 20, 27, 0.14);
  --line-faint:  rgba(20, 20, 27, 0.04);

  /* Canvas */
  --grid-dot:    rgba(20, 20, 27, 0.12);
  --canvas-bg:   #E8E4D9;

  /* Text */
  --ink:   #1A1A22;
  --ink-2: #4F4F58;
  --ink-3: #6E6E78;
  --ink-4: #A5A5B0;

  /* Accent — olive-lime for light mode */
  --accent:      #6FAE0E;
  --accent-hi:   #82C816;
  --accent-lo:   #5A8E0A;
  --accent-soft: rgba(111, 174, 14, 0.16);
  --accent-glow: rgba(111, 174, 14, 0.30);
  --accent-ink:  #FFFFFF;
  --accent-lime:       #6FAE0E;
  --accent-olive:      #5A8E0A;
  --accent-lime-soft:  rgba(111, 174, 14, 0.16);
  --accent-olive-soft: rgba( 90, 142, 10, 0.18);

  /* Selection chrome */
  --select:      #B8930D;
  --select-soft: rgba(184, 147, 13, 0.16);

  /* Danger */
  --danger:      #C73A3A;
  --danger-soft: rgba(199,  58,  58, 0.16);

  /* Elevation */
  --shadow-1:   0 1px 0 rgba(20,20,27,0.08), 0 1px 2px rgba(20,20,27,0.05);
  --shadow-2:   0 6px 16px rgba(20,20,27,0.08), 0 1px 0 rgba(20,20,27,0.06);
  --shadow-3:   0 14px 38px rgba(20,20,27,0.10), 0 2px 0 rgba(20,20,27,0.06);
  --inner-hi:   inset 0 1px 0 rgba(255,255,255,0.70);
  --inner-hi-2: inset 0 1px 0 rgba(255,255,255,0.85);
  --shadow-e1:  0 1px 2px 0 rgba(20,20,27,0.08);
  --shadow-e2:  0 4px 8px -2px rgba(20,20,27,0.10), 0 2px 4px -2px rgba(20,20,27,0.06);
  --shadow-e3:  0 8px 16px -4px rgba(20,20,27,0.12), 0 4px 8px -4px rgba(20,20,27,0.06);
  --shadow-e4:  0 16px 32px -8px rgba(20,20,27,0.14), 0 8px 16px -8px rgba(20,20,27,0.08);

  /* Glass (floating panels / modals) */
  --glass-base:       rgba(240, 237, 230, 0.80);
  --glass-strong:     rgba(240, 237, 230, 0.95);
  --glass-light:      rgba(20, 20, 27, 0.04);
  --glass-border-top: inset 0 1px 0 rgba(20, 20, 27, 0.06);
  --glass-border-all: 0 0 0 1px rgba(20, 20, 27, 0.08);

  /* v2 surface scale */
  --surface-0: #ECEAE3;
  --surface-1: #F6F5F0;
  --surface-2: #FFFFFF;
  --surface-3: #F1EEE6;
  --surface-4: #E8E4D9;
  --surface-5: #DDD9CE;

  /* v2 text scale */
  --text-primary:   #1A1A22;
  --text-secondary: #4F4F58;
  --text-tertiary:  #6E6E78;
  --text-inverse:   #F5F5F7;

  /* Semantic */
  --color-primary: #6FAE0E;
  --color-success: #6FAE0E;
  --color-warning: #B8930D;
  --color-info:    #B8930D;
  --color-pro:     #5A8E0A;
  --color-danger:  #C73A3A;
}

/* Light-mode component overrides — things that can't be fixed with token
   swaps alone because they use hardcoded dark values in the base rule. */
.theme-light .seg button.active {
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel-3) 100%);
  border-color: var(--line-soft);
  color: var(--ink);
}

/* ────────────────────────────────────────────────────────────
   Base
   ──────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  /* v2 design system: Inter as primary (Phase B). System-font fallbacks
     kick in only if the self-hosted Inter file fails to load — should
     never happen in production since the font ships with the deploy. */
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: 0.01em;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font-family: inherit; font-size: 12px; color: inherit; }
button { -webkit-appearance: none; }

/* Focus rings are applied per-component below — no global override that would
   force a uniform border-radius onto every focusable element. */
button:focus-visible,
input:focus-visible,
select:focus-visible,
.tool:focus-visible,
.swatch-none:focus-visible,
.actions button:focus-visible,
.file-btn:focus-visible,
.row.gap button:focus-visible,
#trace-preview-retry:focus-visible,
.zoom-pill button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.tool:focus-visible {
  /* tool buttons keep their own border-radius via inheritance */
  box-shadow: var(--ring);
}

/* Broad keyboard focus-ring fallback (2026-05-29): any interactive control not
   covered by a specific rule above still gets a visible ring. :where() keeps
   specificity at 0 so component-specific focus rules still win. */
:where(button, [role="button"], a[href], input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Disabled controls (2026-05-29): the selection-gated panel buttons used to look
   identical whether enabled or not. */
button:disabled, button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ────────────────────────────────────────────────────────────
   App grid
   Floating-panel layout (Phase C+, 2026-05-26): toolbar and
   properties panel get extra column width so they can float with
   margin and rounded corners inside their grid cells. Topbar +
   statusbar stay full-bleed (structural surfaces per DESIGN.md §5.3).
   ──────────────────────────────────────────────────────────── */
.app {
  display: grid;
  /* Positioning context for detached panels (2026-08-26). A detached toolbar
     or properties panel is taken out of the grid and floated over the canvas,
     with its left/top measured against this box. */
  position: relative;
  grid-template-columns: 68px 1fr 322px;
  grid-template-rows: auto 1fr 26px;
  grid-template-areas:
    "topbar topbar topbar"
    "toolbar canvas properties"
    "statusbar statusbar statusbar";
  height: 100vh;
  width: 100vw;
  /* Uniform field behind everything (matches the canvas tone). The floating
     panels are elevated cards a step lighter than this, so they read as clean
     rounded rectangles with no dark rectangle framing them. (2026-05-29) */
  background: var(--canvas-bg);
}

/* ────────────────────────────────────────────────────────────
   Topbar
   ──────────────────────────────────────────────────────────── */
.topbar {
  grid-area: topbar;
  background:
    linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  /* Hoist above sibling grid areas. The Pro extensions added animations that
     create stacking contexts on .properties / .canvas-area; without an
     explicit z-index here, dropdowns inside the topbar (Export menu) render
     beneath those siblings. Modal/banner z-indexes (100+) still win. */
  position: relative;
  z-index: 50;
}
.topbar-row {
  display: flex;
  align-items: center;
  padding: 8px var(--s-4);
  gap: var(--s-3);
  flex-wrap: wrap;
  min-height: 44px;
}
.topbar-row + .topbar-row {
  border-top: 1px solid var(--line);
  background: oklch(0 0 0 / 0.18);
  min-height: 38px;
  padding: 6px var(--s-4);
}

.row-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--ink-3);
  font-weight: 600;
  margin-right: var(--s-1);
}
.x-sep { color: var(--ink-3); font-size: 11px; }
.ctrl-sep { width: 1px; height: 18px; background: var(--line); margin: 0 var(--s-1); }

/* Brand */
.brand {
  display: flex; align-items: center; gap: 9px;
  padding-right: var(--s-3);
  margin-right: var(--s-1);
  border-right: 1px solid var(--line);
}
/* Brand mark icon — v2 (2026-05-26 lime pivot). Electric lime glow. */
.brand-mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-lime);
  filter: drop-shadow(0 0 8px rgba(181, 255, 58, 0.30))
          drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
  transition: filter var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-spring);
}
.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.05);
  filter: drop-shadow(0 0 14px rgba(181, 255, 58, 0.60))
          drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* Brand wordmark — refined tracking + gradient sweep on hover. */
.brand-name {
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: var(--tracking-brand);
  color: var(--text-primary);
  /* Solid wordmark (2026-05-29): dropped the background-clip:text gradient
     sweep on hover (decorative gradient-text). The mark stays a clean white
     wordmark and shifts to lime on hover — same accent, no gradient. */
  transition: color var(--dur-base) var(--ease-out);
}
.brand:hover .brand-name {
  color: var(--accent-lime);
}
.brand-name em {
  font-style: normal;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 6px;
}
/* .beta-badge rule removed 2026-05-31 — BETA badge swept from editor /
   profile / billing / email templates per "BETA is internal, not user-
   facing." Stays in changelog.html and internal docs. */

.canvas-controls { gap: 6px; }
.canvas-controls #doc-x,
.canvas-controls #doc-y {
  width: 64px;
}

/* Form-like control: select */
.ctrl-select {
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 5px 22px 5px 10px;
  border-radius: var(--r-2);
  font-size: 11px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition:
    border-color var(--t-fast) var(--ease-out),
    background-color var(--t-fast) var(--ease-out);
}
.ctrl-select:hover { background-color: var(--panel-2); border-color: var(--line-faint); }
.ctrl-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ctrl-select option { background: var(--panel); color: var(--ink); }

/* Field wrapper for input + label */
.field {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-sunken);
  padding: 4px 8px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  transition:
    border-color var(--t-fast) var(--ease-out),
    background-color var(--t-fast) var(--ease-out);
}
.field:hover { border-color: var(--line-faint); }
.field:focus-within {
  border-color: var(--accent);
  background: #1F1F28;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field span {
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.field input[type="number"], .field input[type="text"] {
  background: transparent;
  border: none; outline: none;
  width: 56px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.field input[type="color"] {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.field input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }
/* Disabled geometry inputs (2026-08-01) — X/Y/W/H/unit while the active
   artboard is locked. No generic input:disabled rule existed before this. */
.field input:disabled, .ctrl-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* The "show BG" — turn the checkbox into a soft pill toggle */
.field.checkbox {
  padding: 4px 10px 4px 8px;
  cursor: pointer;
  gap: 6px;
}
.field.checkbox input { margin: 0; accent-color: var(--accent); cursor: pointer; }

/* Artboard lock toggle (2026-08-01) — topbar control that prevents
   accidental move/resize drags on the artboard surface; shapes stay fully
   editable regardless of state. Same lime active-toggle language as the
   other on/off property buttons (compare .fill-invert-btn / .stroke-taper-
   btn below) so an ON lock reads as unmistakably "on". */
.ab-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-2);
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}
.ab-lock-btn svg { width: 14px; height: 14px; flex: none; display: block; }
.ab-lock-btn:hover:not(.active) { border-color: var(--line-faint); color: var(--ink); }
.ab-lock-btn.active {
  background: var(--accent-lime-soft, var(--accent-soft));
  color: var(--accent-lime, var(--accent));
  border-color: var(--accent-lime, var(--accent));
}

/* Undo/Redo — moved from the primary actions row into the Artboard row,
   next to Lock (2026-08-25). Same flat-panel register as .ab-lock-btn
   (panel-sunken surface, thin border, ink-3 label) so they read as
   artboard-row controls rather than primary actions. */
.ab-row-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--r-2);
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}
.ab-row-btn:hover { border-color: var(--line-faint); color: var(--ink); }

/* Action button group */
.actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
/* Premium rounded-rect language (2026-05-30 refresh — pill rolled back).
   Flat panel surfaces + soft border + lime halo on hover. Rounded
   rectangles (10px), NOT pills — pills are reserved for the profile
   page's chip language; the editor's buttons stay button-shaped. */
.actions button, .file-btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1px;
  height: 30px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition:
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    transform var(--t-instant) var(--ease-press);
  position: relative;
}
.actions button:hover, .file-btn:hover {
  background: var(--panel-3);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.actions button:active, .file-btn:active {
  transform: translateY(1px);
  background: var(--panel);
  box-shadow: none;
}
.actions .divider { width: 1px; height: 16px; background: var(--line); margin: 0 var(--s-1); }

/* Export — primary CTA. Solid lime pill, lime halo on hover. */
.actions button#btn-export {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}
.actions button#btn-export:hover {
  background: var(--accent-hi);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.actions button#btn-export:active {
  background: var(--accent-lo);
  box-shadow: none;
}

/* ────────────────────────────────────────────────────────────
   Toolbar (left) — floating "hanging rectangle" card (Phase C+, 2026-05-26)
   Lifted off the edges with margin, heavily rounded corners give the
   pill-at-top-and-bottom feel from the reference image.
   ──────────────────────────────────────────────────────────── */
.toolbar {
  grid-area: toolbar;
  /* Defined floating panel (2026-05-29): the toolbar used to be fully
     transparent with a transparent border, so the tools floated edgelessly
     in the dark gutter. It now has the working-surface tone + a hairline
     border so it reads as a contained card — same treatment as .properties
     and the canvas, separated by the dark gutter. */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 12px 4px 12px 12px;
  display: flex; flex-direction: column;
  padding: 6px 6px 14px;
  gap: 2px;
  align-items: center;
  position: relative;
  /* min-height: 0 lets the toolbar shrink inside its grid row so overflow can
     scroll on short viewports. Without it the grid item refuses to be smaller
     than its content and the last tools spill below the screen. */
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.toolbar::-webkit-scrollbar { width: 6px; }
.toolbar::-webkit-scrollbar-thumb {
  background: #36363F;
  border-radius: 8px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.toolbar::-webkit-scrollbar-thumb:hover { background: #424252; }
.toolbar::-webkit-scrollbar-track { background: transparent; }
.tool {
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: var(--r-2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition:
    background-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    transform var(--t-instant) var(--ease-press),
    border-color var(--t-fast) var(--ease-out);
}
.tool svg {
  width: 19px; height: 19px;
  display: block;
  pointer-events: none;
  transition: transform var(--t-base) var(--ease-out);
}
.tool:hover {
  background: #303038;
  color: var(--ink);
  border-color: var(--line-faint);
}
.tool:hover svg { transform: scale(1.04); }
.tool:active { transform: scale(0.94); }

.tool.active {
  /* Lime active-tool gradient (was warm gold). 2026-05-26 lime pivot. */
  background: linear-gradient(135deg, #B5FF3A 0%, #8FCC1F 100%);
  color: var(--accent-ink); /* dark text on bright lime */
  border-color: #6B8E3D;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 16px rgba(181, 255, 58, 0.40);
}
/* Active-tool right-edge indicator bar removed 2026-05-29 (user: "green on
   the right side ... gone"). The lime gradient fill alone marks the active
   tool now. */

.tool-sep {
  width: 22px; height: 1px;
  background: var(--line-soft);
  margin: 6px 0;
}

/* ────────────────────────────────────────────────────────────
   Canvas area
   ──────────────────────────────────────────────────────────── */
.canvas-area {
  grid-area: canvas;
  /* Dark frame tone (matches the page-tab strip + gutter). The lighter
     "workspace" --panel tone is now carried by #canvas's own background, so
     when #canvas's top-right cuts off cleanly under the strip, the small
     triangle behind it shows the dark strip color — not a light pocket.
     (2026-05-30) */
  background: var(--bg);
  /* Bottom corners + bottom-left rounding (2026-05-30 user request): parent
     clips its contents to this radius, so the dotted #canvas SVG below shows
     curved BR + BL corners. Top-left stays square (active page tab attaches
     flush). Top-right is rounded on #canvas directly — see #canvas rule — so
     the curve appears on the dotted area, not on the dark page-tab strip. */
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  /* Lift bottom edge to match the 12px gap the toolbar and properties panels
     have above the statusbar — all three panels now share the same bottom line. */
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  isolation: isolate;       /* contain the ::before z-index: -1 trick */
}
/* (Page-tab "comet" outline animation removed — 2026-05-30, user request.) */
#canvas {
  width: 100%; height: 100%; display: block; cursor: default;
  /* Camera-synced dot grid. applyView() (updateBackdropGrid) writes the live
     background-size and background-position inline on #canvas; the var()
     values below are only the defaults before the first view. Never drive
     this with custom properties on #canvas or :root: they inherit, so every
     pan step restyled the whole drawing (2026-10-19). The dots translate with the pan and scale with the zoom, so
     the dark canvas reads as a real movable drawing surface — the way Figma /
     tldraw / Miro render their backdrops. The SVG itself is transparent, so the
     dots sit on the canvas-area tone; the artboard paints over them. */
  /* Workspace tone now lives on #canvas (was on .canvas-area — moved 2026-05-30
     so the rounded-TR cut-off shows the dark strip behind it, not a light
     pocket). The dot grid layers on top via background-image. */
  background-color: var(--panel);
  background-image: radial-gradient(circle, var(--grid-dot) 1.1px, transparent 1.7px);
  background-size: var(--grid-step, 24px) var(--grid-step, 24px);
  background-position: var(--grid-x, 0px) var(--grid-y, 0px);
  /* Round the dotted canvas's top-right corner directly. The dark page-tab
     strip sits ABOVE #canvas, so the parent (.canvas-area) can't round this
     corner — rounding the parent would round the dark strip instead. By
     rounding #canvas itself, the curve appears where the dotted area meets
     the strip — visually matching the parent-clipped BR + BL corners on the
     same dotted area. 2026-05-30 user request. */
  border-top-right-radius: var(--radius-md);
}
#canvas.cursor-crosshair { cursor: crosshair; }
#canvas.cursor-pen { cursor: crosshair; }
#canvas.cursor-grab { cursor: grab; }
#canvas.cursor-grabbing { cursor: grabbing; }
#canvas.cursor-zoom { cursor: zoom-in; }
#canvas.cursor-zoom-out { cursor: zoom-out; }
#canvas.cursor-text { cursor: text; }
/* Zoom as a picture (M131, r5, 10 Nov 2026; app.js "Zoom as a picture").
   While a wheel or pinch zooms a big drawing, #canvas and the layers that
   mirror it are scaled by an inline transform on their own GPU layer, and
   the real zoom is drawn once the wheel stops. Only during that gesture:
   the edge a shrinking picture uncovers shows the canvas's own tone, and
   what is pinned over the canvas from the view hides until the real view
   places it again (the AI's cursor and flashes, the ▶ chip, Prototype menus,
   line tips and played parts, a chalk chart's controls, tooltips). */
/* At rest the canvas carries an identity transform, so a zoom gesture only
   changes its value: going from no transform to one, and back, made Chrome
   lay every SVG text out again (r5 measured: 20 to 30 ms on a desktop, a
   whole zoom step's worth on a laptop), at the gesture's start and end. Not
   with the classic rulers showing: they sit before the canvas without a
   z-index, and a transform would paint the canvas over them. */
html.ui-v2 #canvas, #rulers[hidden] ~ #canvas { transform: translate(0px, 0px); transform-origin: 0 0; }
html[data-view-zooming] .canvas-area { background-color: var(--panel); }
html[data-view-zooming] .ai-live-cursor,
html[data-view-zooming] .ai-live-flash,
html[data-view-zooming] #proto-chip,
html[data-view-zooming] #proto-line-tip,
html[data-view-zooming] #proto-pop,
html[data-view-zooming] .proto-trial,
html[data-view-zooming] .proto-deck-try,
html[data-view-zooming] .wb-chart-chip,
html[data-view-zooming] .svl-tip,
html[data-view-zooming] .wb-chart-tip { visibility: hidden !important; }

/* Zoom pill — v2 liquid glass (Phase C+, 2026-05-26). */
.zoom-pill {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-base);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 4px;
  display: flex; align-items: center; gap: 1px;
  box-shadow:
    var(--glass-border-top),
    var(--shadow-e3);
  font-size: 11px;
}
.zoom-pill button {
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
  letter-spacing: 0.02em;
}
.zoom-pill button:hover {
  background: #32323A;
  color: var(--ink);
}
.zoom-pill button:active { background: #1A1A22; }
.zoom-pill #zoom-level {
  min-width: 52px;
  text-align: center;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
  font-weight: 500;
}
.zoom-pill #zoom-out, .zoom-pill #zoom-in {
  font-size: 14px;
  font-weight: 400;
  padding: 4px 11px;
}

/* ────────────────────────────────────────────────────────────
   Properties (right) — floating card (Phase C+, 2026-05-26).
   Mirror of the toolbar: lifted off the edges with margin, rounded
   corners, subtle gradient + border + inner highlight + drop shadow.
   ──────────────────────────────────────────────────────────── */
.properties {
  grid-area: properties;
  /* Defined floating panel (2026-05-29) — see .toolbar. Working-surface tone
     + hairline border so the properties column has a clean contained edge
     instead of rows floating in the gutter. */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 12px 12px 12px 4px;
  padding: 0 0 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.properties::-webkit-scrollbar { width: 8px; }
.properties::-webkit-scrollbar-thumb {
  background: #36363F;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.properties::-webkit-scrollbar-thumb:hover { background: #424252; background-clip: padding-box; border: 2px solid transparent; }
.properties::-webkit-scrollbar-track { background: transparent; }

.prop-group {
  padding: 0 var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.prop-group:last-of-type { border-bottom: none; margin-bottom: 0; }
.prop-group h3 {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: var(--s-3);
  padding: var(--s-2) 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.prop-group h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-soft) 0%, transparent 100%);
}

/* Row */
.row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.row.gap { gap: 4px; margin-top: var(--s-2); }
.row.gap button,
#trace-preview-retry {
  flex: 1 1 calc(50% - 2px);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 8px;
  border-radius: var(--r-2);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition:
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    transform var(--t-instant) var(--ease-press),
    color var(--t-fast) var(--ease-out);
}
.row.gap button:hover,
#trace-preview-retry:hover {
  background: var(--panel-3);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.row.gap button:active,
#trace-preview-retry:active {
  background: var(--panel);
  transform: translateY(1px);
  box-shadow: none;
}

/* Color swatch row in stroke/fill */
.row > input[type="color"] {
  width: 40px; height: 32px; padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.row > input[type="color"]:hover { border-color: var(--line-faint); transform: translateY(-1px); }
.row > input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.row > input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }

/* No-stroke / no-fill swatch */
.swatch-none {
  width: 32px; height: 32px;
  border-radius: var(--r-2);
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition:
    background-color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}
.swatch-none:hover { border-color: var(--accent); color: var(--accent); }
.swatch-none::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px;
  top: 50%;
  height: 1.5px;
  background: var(--danger);
  transform: rotate(-30deg);
  pointer-events: none;
  border-radius: 1px;
}
.swatch-none.active {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}
.swatch-none.active::after { background: var(--danger); }

/* Slider row */
.slider-row {
  display: grid;
  grid-template-columns: 48px 1fr 52px;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.slider-row span {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 500;
}
.slider-row input[type="number"] {
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 4px 6px;
  color: var(--ink);
  width: 100%;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t-fast) var(--ease-out);
}
.slider-row input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Custom range slider */
.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  cursor: pointer;
  height: 18px;
}
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  /* Fluid fill: left of thumb is accent, right is sunken. --fill-pct is set by
     setRangeFill() in app.js whenever the value changes or selection syncs. */
  background: linear-gradient(
    to right,
    var(--accent)       0%,
    var(--accent)       var(--fill-pct, 0%),
    var(--panel-sunken) var(--fill-pct, 0%),
    var(--panel-sunken) 100%
  );
  border-radius: 999px;
  border: 1px solid var(--line);
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border: 1px solid var(--accent-lo);
  margin-top: -6px;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.5), var(--inner-hi-2);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
  cursor: grab;
}
.slider-row input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.12);
  box-shadow: 0 2px 6px var(--accent-glow), var(--inner-hi-2);
}
.slider-row input[type="range"]:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.06);
}
.slider-row input[type="range"]::-moz-range-track {
  height: 4px;
  background: linear-gradient(
    to right,
    var(--accent)       0%,
    var(--accent)       var(--fill-pct, 0%),
    var(--panel-sunken) var(--fill-pct, 0%),
    var(--panel-sunken) 100%
  );
  border-radius: 999px;
  border: 1px solid var(--line);
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border: 1px solid var(--accent-lo);
  cursor: grab;
}

/* Segmented control */
.seg {
  display: flex;
  gap: 1px;
  margin-top: var(--s-2);
  background: var(--panel-sunken);
  border-radius: var(--r-2);
  padding: 2px;
  border: 1px solid var(--line);
  align-items: center;
  position: relative;
}
.seg .seg-label {
  font-size: 9.5px;
  color: var(--ink-3);
  padding: 0 8px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  flex-shrink: 0;
}
.seg button {
  flex: 1;
  background: transparent;
  /* Transparent placeholder border so the active state can add a visible
     1px border without shifting adjacent buttons. 2026-05-30. */
  border: 1px solid transparent;
  color: var(--ink-2);
  padding: 5px 4px;
  cursor: pointer;
  border-radius: var(--r-1);
  font-size: 10.5px;
  font-weight: 500;
  transition:
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out);
}
.seg button:hover { color: var(--accent); background: var(--accent-soft); }
.seg button.active {
  /* Matches the topbar action buttons (Copy/Paste/Import/…): dark vertical
     gradient + hairline edge + inner highlight + soft outer shadow. So the
     currently-selected option in any segmented control reads as a real
     "pressed pill" of the same family as the topbar buttons. 2026-05-30.
     Radius matches Copy's (--r-2 = 6px) so the corner curvature is identical;
     --inner-hi-2 (10%) is used instead of --inner-hi (6%) so the raised
     highlight stays readable at the smaller seg height (24px vs 28px). */
  background: linear-gradient(180deg, #303038 0%, #26262F 100%);
  border-color: var(--line);
  border-radius: var(--r-2);
  color: var(--ink);
  box-shadow: var(--shadow-1), var(--inner-hi-2);
}

/* X/Y/W/H grid */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-1) 6px;
  margin-top: var(--s-3);
}
.grid2 .field { padding: 4px 8px; }
.grid2 .field input { width: 100%; font-size: 11px; }

/* Layers */
.layers-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.layers-head h3 { margin-bottom: 0; padding: var(--s-2) 0 6px; }
.layers-head h3::after { display: none; }
.layer-count {
  font-size: 10px;
  color: var(--ink-3);
  background: var(--panel-sunken);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

#layers {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 4px;
  border-top: 1px solid var(--line-faint);
  border-bottom: 1px solid var(--line-faint);
  background: oklch(0 0 0 / 0.10);
  border-radius: var(--r-1);
}
#layers::-webkit-scrollbar { width: 6px; }
#layers::-webkit-scrollbar-thumb { background: #32323A; border-radius: 6px; }
#layers::-webkit-scrollbar-track { background: transparent; }

#layers li {
  padding: 6px 8px 6px 14px;
  border-radius: 0;
  cursor: grab;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  position: relative;
  user-select: none;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
#layers li + li { border-top-color: oklch(0 0 0 / 0.18); }
/* Rows out of sight are skipped for style, layout and paint. The panel shows
   about 8 rows, and a 1,885-shape project has 1,885 rows of 10 elements each:
   81% of the page. Every layout after opening a project or switching Design /
   Prototype used to restyle and lay out all of them (200+ ms; owner report
   2026-10-19). Rows are 32 px tall: 18 px of content (the size below; the
   padding and borders are added to it), 12 px padding, 2 px borders;
   "auto" keeps a row's real size once it has been shown.
   Guarded by tests/layers-offscreen.test.cjs. */
#layers > li {
  content-visibility: auto;
  contain-intrinsic-size: auto 18px;
}

/* Group stripe */
#layers li.in-group::after {
  content: "";
  position: absolute;
  left: 4px; top: 5px; bottom: 5px;
  width: 3px;
  border-radius: 2px;
  background: var(--group-color, var(--accent));
  box-shadow: 0 0 6px color-mix(in oklch, var(--group-color, var(--accent)) 50%, transparent);
}
#layers li.in-group.group-first::after { border-top-left-radius: 2px; border-top-right-radius: 2px; }
#layers li.in-group.group-last::after  { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; }

#layers li:active { cursor: grabbing; }
#layers li.dragging {
  opacity: 0.45;
  background: var(--panel-sunken);
}
#layers li.drop-above::before,
#layers li.drop-below::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 0 8px var(--accent-glow);
}
/* Inside the row: a row skipped off screen clips what it paints outside itself. */
#layers li.drop-above::before { top: 0; }
#layers li.drop-below::after { bottom: 0; }

#layers li:hover {
  background: #32323A;
  color: var(--ink);
}
#layers li.selected {
  background: linear-gradient(90deg, var(--accent-soft) 0%, rgba(181, 255, 58, 0.06) 100%);
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 2px 0 0 var(--accent);
}
#layers li.selected .swatch { border-color: oklch(1 0 0 / 0.25); }

#layers li .swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid oklch(0 0 0 / 0.25);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.04);
}
#layers li .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
#layers li .lock-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  border-radius: var(--r-1);
  flex-shrink: 0;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
#layers li .lock-btn:hover {
  background: oklch(1 0 0 / 0.06);
  color: var(--ink);
}
#layers li .lock-btn.locked { color: var(--accent); }
#layers li.locked { opacity: 0.6; }
#layers li.locked .name { font-style: italic; }

#layers li .delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  border-radius: var(--r-1);
  flex-shrink: 0;
  opacity: 0;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
#layers li:hover .delete-btn:not(:disabled) { opacity: 1; }
#layers li:hover .delete-btn:disabled { opacity: 0.3; }
#layers li .delete-btn:not(:disabled):hover { background: oklch(1 0 0 / 0.06); color: var(--danger); }
#layers li .delete-btn:disabled { cursor: not-allowed; }

/* ────────────────────────────────────────────────────────────
   Statusbar
   ──────────────────────────────────────────────────────────── */
.statusbar {
  grid-area: statusbar;
  background: var(--panel);
  border-top: 1px solid var(--line);
  font-size: 11px;
  padding: 0 var(--s-4);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.statusbar #status::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  box-shadow: 0 0 6px var(--accent-glow);
  vertical-align: 1px;
  /* Static "ready" dot. The old infinite opacity pulse was idle decoration
     (and repainted forever); a status indicator doesn't need to breathe. */
}
.cursor-pos {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.statusbar-right {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.statusbar .version {
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  cursor: help;
  font-variant-numeric: tabular-nums;
}
.statusbar .version::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  vertical-align: 1px;
  opacity: 0.7;
}
.legal-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.legal-links a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}
.legal-links a:hover { color: var(--accent); }
.legal-links .sep { opacity: 0.5; }

/* ────────────────────────────────────────────────────────────
   Hint toast
   ──────────────────────────────────────────────────────────── */
/* Hint toast — v2 liquid glass (Phase C+, 2026-05-26). */
.hint {
  position: fixed;
  bottom: 60px;
  left: 80px; /* clear the 68px toolbar rail (2026-05-29) */
  background: var(--glass-base);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 11.5px;
  color: var(--ink-2);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out);
  max-width: 380px;
  line-height: 1.5;
  box-shadow:
    var(--glass-border-top),
    var(--shadow-e3);
  z-index: 50;
}
.hint.show { opacity: 1; transform: translateY(0); }
.hint strong {
  color: var(--accent);
  margin-right: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
/* .hint itself is pointer-events:none so it never blocks canvas hovers,
   but inline links inside hints (e.g. "Start over" in the restored-
   autosave hint) need to be clickable. */
.hint a {
  pointer-events: auto;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hint a:hover { color: var(--ink); }

/* ────────────────────────────────────────────────────────────
   Context menu
   ──────────────────────────────────────────────────────────── */
/* Context menu — v2 liquid glass (Phase C+, 2026-05-26). */
.ctx-menu {
  position: fixed;
  /* Below the modal layer (100) so a right-click menu never paints over an
     open dialog; above the rest of the chrome. Was 1000. */
  z-index: 99;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: 6px;
  min-width: 220px;
  box-shadow:
    var(--glass-border-top),
    var(--shadow-e3);
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  /* Elastic "bubble pop" entrance — overshoots past full size then settles. */
  animation: ctx-pop 240ms var(--ease-spring);
  transform-origin: top left;
}
@keyframes ctx-pop {
  from { opacity: 0; transform: scale(0.82); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: scale(1); }
}
.ctx-menu[hidden] { display: none; }
.ctx-menu button {
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 7px 12px;
  cursor: pointer;
  text-align: left;
  border-radius: var(--r-1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.ctx-menu button:hover {
  /* Text glows lime on hover (matches the universal hover language); a faint
     frosted lift marks the active row instead of a solid lime fill. */
  background: var(--glass-light);
  color: var(--accent-lime);
}
.ctx-menu button:hover .kbd { color: var(--accent-lime); opacity: 0.7; }
.ctx-menu button:disabled { color: var(--ink-4); cursor: default; }
.ctx-menu button:disabled:hover { background: transparent; color: var(--ink-4); }
.ctx-menu hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 4px 6px;
}
.ctx-menu .kbd {
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ────────────────────────────────────────────────────────────
   SVG overlay guides
   ──────────────────────────────────────────────────────────── */
#overlay .selbox {
  fill: none;
  stroke: var(--select);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 3;
}

/* Artboard resize chrome — drag the artboard's edges/corners to resize it.
   Lime, to set it apart from the amber shape-selection chrome. The frame is a
   thin lime outline; handles are dark squares with a lime ring (fill lime on
   hover). Shown only when the Select tool is active and nothing is selected. */
#overlay .ab-frame {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  opacity: 0.55;
  pointer-events: none;
}
/* Locked artboard frame (2026-08-01) — muted + dashed instead of lime-solid,
   so a locked artboard reads as "selected but not draggable" at a glance.
   No resize handles are drawn at all for a locked artboard (see
   renderArtboardChrome in app.js), so this frame is the only chrome shown. */
#overlay .ab-frame.locked {
  stroke: var(--ink-3);
  stroke-dasharray: 5 4;
  opacity: 0.7;
}
#overlay .ab-handle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
#overlay .ab-handle:hover { fill: var(--accent); }
#overlay .ab-guide {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 7 5;
  opacity: 0.9;
  pointer-events: none;
}
#overlay .ab-guide.center {
  stroke-dasharray: 2 4;
}

/* Artboard name labels (Figma/Paper style) — sit above each artboard. Click to
   select, drag to move, double-click to rename. The active artboard's label is
   lime; others are muted until hovered. */
#artboards .ab-label {
  fill: var(--ink-2);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: move;
  -webkit-user-select: none;
  user-select: none;
  transition: fill var(--t-fast) var(--ease-out);
}
#artboards .ab-label.active { fill: var(--accent); }
/* M131: the boards' dot grid is invisible below 35% zoom; skip painting its pattern. */
#artboards.ab-far .ab-grid { display: none; }
#artboards .ab-label:hover { fill: var(--accent-hi); }
#artboards .ab-label .ab-lock-status {
  fill: var(--danger);
  font-weight: 750;
  letter-spacing: 0.08em;
}
/* M129: "Home · Message": the screen it belongs to is dimmed, the part reads first. */
#artboards .ab-label .ab-label-parent { opacity: 0.55; }
#artboards .ab-label.ab-label-inside { fill: #FFFFFF; stroke: rgba(0, 0, 0, 0.82); paint-order: stroke; stroke-linejoin: round; }
#artboards .ab-label.ab-label-inside.active { fill: var(--accent); }
/* Artboard groups (2026-08-28): a dashed lasso drawn behind the artboards
   that share a group name, so a set reads as one unit on the canvas. Muted
   until the active artboard belongs to it, then lime like the rest of the
   artboard chrome. The label above it frames the whole group on click. */
#artboards .ab-group-frame {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 9 7;
  opacity: 0.45;
}
#artboards .ab-group-frame.active {
  stroke: var(--accent);
  opacity: 0.6;
}
/* Invisible fat stroke over the group frame: grab it anywhere along the
   dashed border to drag the whole group. Fill stays none so only the border
   line is hit-testable. */
#artboards .ab-group-grab {
  fill: none;
  stroke: transparent;
  cursor: move;
}
#artboards .ab-group-label {
  fill: var(--ink-3);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: move;
  -webkit-user-select: none;
  user-select: none;
  transition: fill var(--t-fast) var(--ease-out);
}
#artboards .ab-group-label.active { fill: var(--accent); }
#artboards .ab-group-label:hover { fill: var(--accent-hi); }

.artboard-rename-input {
  position: fixed;
  z-index: 130;
  box-sizing: border-box;
  padding: 2px 8px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 500 12px/1.4 var(--font-sans);
  letter-spacing: 0;
  outline: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.artboard-rename-input::selection {
  background: color-mix(in oklab, var(--accent) 45%, transparent);
}
#overlay .anchor {
  fill: white;
  stroke: var(--select);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
#overlay .anchor.smooth { fill: var(--select); }
#overlay .path-edit-line {
  fill: none;
  stroke: var(--select);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.95;
  pointer-events: none;
}
#overlay .handle-line {
  stroke: var(--select);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  fill: none;
}
#overlay .handle-dot {
  fill: var(--select);
  stroke: white;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
#overlay .resize {
  fill: white;
  stroke: var(--select);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
#overlay .preview {
  fill: rgba(242, 212, 61, 0.06);
  stroke: var(--select);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}
#overlay .pen-preview {
  fill: none;
  stroke: var(--select);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}
#overlay .snap-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  animation: snap-pulse 1.2s ease-in-out infinite;
}
#overlay .snap-dot {
  fill: var(--accent);
  vector-effect: non-scaling-stroke;
}

/* Rotation handle — small stem with a dot above the selection bbox. The dot
   is the grab target; the corner rings (rot-corner-zone) are invisible but
   pick up "just past the corner" drags. */
#overlay .rot-stem {
  stroke: var(--accent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.65;
}
#overlay .rot-handle {
  fill: var(--accent);
  stroke: white;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  cursor: grab;
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}
#overlay .rot-handle:hover {
  fill: var(--accent-hi);
}
#overlay .rot-corner-zone {
  /* invisible but pickable */
  cursor: grab;
}

/* While a rotation drag is active, every cursor in the document shows the
   "grabbing" state — keeps feedback consistent even when the pointer
   crosses out of the original handle bounds during the drag. */
body.cursor-rotating,
body.cursor-rotating * {
  cursor: grabbing !important;
}
@keyframes snap-pulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* ────────────────────────────────────────────────────────────
   Text properties section
   ──────────────────────────────────────────────────────────── */
.prop-text .field.full {
  width: 100%;
}
.prop-text .field.full > span {
  min-width: 32px;
}
.prop-text .field.full .ctrl-select {
  flex: 1;
  width: 100%;
}
textarea.text-content {
  width: 100%;
  min-height: 56px;
  max-height: 160px;
  resize: vertical;
  padding: var(--s-2) var(--s-3);
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  outline: none;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
  margin-bottom: var(--s-2);
}
textarea.text-content:hover { border-color: var(--line-faint); }
textarea.text-content:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Style toggle buttons (B / I / U) render their label glyph straight */
#text-style-seg button b,
#text-style-seg button i,
#text-style-seg button u {
  font-size: 13px;
  font-style: normal;
  text-decoration: none;
}
#text-style-seg button b      { font-weight: 700; }
#text-style-seg button i      { font-style: italic; font-family: 'Georgia', 'Times New Roman', serif; }
#text-style-seg button u      { text-decoration: underline; text-underline-offset: 2px; }

/* ────────────────────────────────────────────────────────────
   Inline text editor — textarea overlaid on the canvas while typing
   ──────────────────────────────────────────────────────────── */
.text-editor {
  position: absolute;
  z-index: 100;
  margin: 0;
  padding: 0;
  border: 1px dashed var(--accent);
  border-radius: 2px;
  outline: none;
  resize: none;
  overflow: hidden;
  background: oklch(1 0 0 / 0.04);
  color: inherit;
  white-space: pre;
  word-wrap: normal;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  caret-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  user-select: text;
}
.text-editor::selection { background: var(--accent-soft); }

/* ────────────────────────────────────────────────────────────
   Entrance reveal (2026-05-29: de-choreographed).
   The old version slid the topbar/toolbar/properties/statusbar in from
   four different directions with staggered delays — an orchestrated
   page-load sequence, which a product tool should not do (the register
   rule: "Product loads into a task; users don't want to watch it load").
   Replaced with a single quick whole-app opacity fade so first paint isn't
   a hard flash, but nothing moves and nothing staggers.
   ──────────────────────────────────────────────────────────── */
.app { animation: fade-in 180ms var(--ease-out) both; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Pro extensions — gradients, swatches, effects, alignment,
   booleans, components, autotrace, pages, rulers, modals
   ──────────────────────────────────────────────────────────── */

/* Split button + dropdown — pill-shaped split (2026-05-30 refresh).
   The two halves keep their rounded outer corners and share a hairline
   divider in the middle, so the pair reads as one continuous pill.
   Used for both #export-split and #user-menu. */
.split-btn { position: relative; display: inline-flex; }
.split-btn > button:not(.caret) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.split-btn .caret {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0 10px;
  border-left: 1px solid var(--line);
}
.split-btn .menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-3);
  box-shadow: var(--shadow-2); padding: 6px; min-width: 180px; z-index: 80;
  display: flex; flex-direction: column; gap: 2px;
}
.split-btn .menu button {
  text-align: left; padding: 7px 10px; font-size: 12px;
  background: transparent; border: none; color: var(--ink);
  border-radius: var(--r-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}
.split-btn .menu button:hover { background: var(--panel-2); color: var(--accent); }

/* Fill type segmented tabs */
.seg-tabs button { padding: 4px 8px; font-size: 11px; }

/* Gradient + pattern editors */
.gradient-editor, .pattern-picker {
  margin-top: 6px;
  padding: 8px; border: 1px dashed var(--line-soft); border-radius: var(--r-2);
  background: var(--panel-sunken);
  display: flex; flex-direction: column; gap: 6px;
}
.gradient-preview {
  height: 22px; border-radius: var(--r-1); border: 1px solid var(--line);
  cursor: pointer;
}
.gradient-editor .row.gap button.mini,
.gradient-editor .row.gap .field { font-size: 11px; }
.pattern-picker .grid-pats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.pattern-picker .pat-cell {
  width: 100%; aspect-ratio: 1/1; border: 1px solid var(--line);
  border-radius: var(--r-1); cursor: pointer; background-size: 14px 14px;
}
.pattern-picker .pat-cell.active {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* Eyedropper icon button */
/* Small text buttons in property rows. There was no bare .mini rule, so
   these fell back to the browser's default system button: a light
   ButtonFace behind the app's light text, which rendered "Apply" as white
   on white (measured 1.05:1). .swatches-head .mini is more specific and
   still wins for the swatch "+" button. */
.mini {
  padding: 2px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.mini:hover {
  background: var(--panel-3);
  border-color: var(--accent);
  color: var(--accent);
}

.mini-icon {
  padding: 3px 7px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-2); color: var(--ink-2); cursor: pointer;
  transition:
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}
.mini-icon:hover {
  background: var(--panel-3);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Swatches */
.swatches {
  margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line-faint);
}
.swatches-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); margin-bottom: 4px;
}
.swatches-head .mini {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: var(--r-1); width: 18px; height: 18px; cursor: pointer; line-height: 1;
}
.swatches-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px;
}
.swatch-chip {
  aspect-ratio: 1/1; border-radius: 3px; border: 1px solid var(--line);
  cursor: pointer; padding: 0;
}
.swatch-chip:hover { outline: 1px solid var(--accent); }
.swatch-chip.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.swatch-chip[data-removable]:active { transform: scale(0.95); }

/* Align row icons */
.align-row button {
  width: 30px; height: 26px; padding: 0;
  font-family: 'Segoe UI Symbol', sans-serif; font-size: 16px;
}

/* Pages strip — v2 redesign (Phase C). White-pill active tab + smooth
   hover transitions, matching the reference image's segmented control. */
.pages-strip {
  /* Tab strip for "round-out" tabs (Chris Coyier / Frontend Masters technique:
     https://frontendmasters.com/blog/modern-css-round-out-tabs/). Each tab is
     clip-path:shape()'d into a silhouette with rounded TOP corners and bottom
     corners that flare OUTWARD into the workspace below — a paper-tab look.
     The strip is just the dark chrome backdrop; no baseline border needed —
     the tabs' own flared feet visually land on the workspace. */
  display: flex; align-items: flex-end; gap: 2px;
  /* No left padding — the first tab sits flush against the strip's left edge,
     so its bottom-left flare merges directly into the workspace below (both
     are --panel) and the "notch" between toolbar and Page 1 disappears. */
  padding: 10px 14px 0 0; background: var(--bg);
  overflow-x: auto;
  position: relative; z-index: 2;
}
.page-tab {
  /* Round-out tabs — verbatim CSS clip-path:shape() from the Frontend Masters
     article (Block 8, the variablized recommended version). The shape begins
     at bottom-left and walks: flare-out curve up, vertical, top-left curve in,
     horizontal across the top, top-right curve in, vertical down, flare-out
     curve to bottom-right. Result: a tab silhouette with rounded TOP corners
     and bottom corners that flare OUTWARD — exactly like a Chrome paper tab. */
  --tabGirth: 10px;

  position: relative;
  display: inline-flex;           /* preserve internal text + dot + close-× alignment */
  align-items: center;
  padding: 7px 22px;              /* extra inline padding so text clears the bottom flares */
  /* Inactive: subtle midpoint between strip (--bg) and active tab (--panel) —
     visible silhouette, clearly behind the active tab. */
  background: color-mix(in srgb, var(--bg) 75%, var(--panel) 25%);
  border: none;                   /* clip-path replaces all border-based shaping */
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);

  /* Asymmetric round-out tab — Frontend Masters Block 8 with the LEFT-bottom
     flare removed. The tab's left edge is a straight vertical at x=0 from the
     bottom up to the rounded top-left corner — aligned with the workspace's
     left edge below (strip has padding-left:0), so the tab body sits flush
     against the dotted "pan" on the left. The RIGHT side keeps Block 8's
     outward flare — the tab still has its "pan-foot" curvature on the trailing
     side. Walk: straight up the left, curve into top-left, across the top,
     curve into top-right, straight down the right, flare out at bottom-right. */
  clip-path: shape(
    from bottom left,
    vline to var(--tabGirth),
    curve to var(--tabGirth) 0 with 0 0,
    hline to calc(100% - calc(var(--tabGirth) * 2)),
    curve to calc(100% - var(--tabGirth)) var(--tabGirth) with calc(100% - var(--tabGirth)) 0,
    vline to calc(100% - var(--tabGirth)),
    curve to 100% 100% with calc(100% - var(--tabGirth)) 100%
  );

  /* Fallback for engines without clip-path: shape() support — verbatim Block 9. */
  @supports not (clip-path: shape(from top left, hline to 0)) {
    padding-inline: 1rem;
    border-start-start-radius: var(--tabGirth);
    border-start-end-radius: var(--tabGirth);
  }
}
.page-tab:hover {
  background: color-mix(in srgb, var(--bg) 60%, var(--panel) 40%);
  /* Lime glow on hover — text turns accent + drop-shadow gives the
     "green light" feel the user asked for. drop-shadow respects clip-path,
     so the glow follows the round-out tab silhouette. */
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.page-tab.active {
  /* Active tab — visually MERGED with the dotted canvas below. The same
     camera-synced radial-gradient dot pattern (driven by --grid-step/x/y on
     #pages-strip, set in updateBackdropGrid) paints across the tab so the tab reads as a piece of the canvas
     lifted up into the strip — not a separate panel. The clip-path shape gives
     the rounded silhouette. A rotating lime conic-gradient "shine" traces the
     tab's perimeter (same mechanism as the feedback pill, clipped to the
     round-out silhouette), and an additional drop-shadow filter extends the
     glow OUTSIDE the silhouette into the canvas area below. */
  background:
    radial-gradient(circle, var(--grid-dot) 1.1px, transparent 1.7px) var(--grid-x, 0px) var(--grid-y, 0px) / var(--grid-step, 24px) var(--grid-step, 24px),
    var(--panel);
  color: var(--ink);
  font-weight: 600;
  isolation: isolate;       /* contain the ::before z-index:-1 trick */
  /* No glow animation here (removed 2026-09-26). A filter applies BEFORE
     clip-path, so the drop-shadow that used to "breathe" around this tab was
     clipped away by the tab's own silhouette: pixel diffs of the tab at the
     glow's peak and with no filter at all were identical. It still repainted
     every frame, which kept an idle editor busy for nothing. */
}
/* The two separate perimeter rings (tab + canvas) have been replaced by a
   SINGLE comet element (#page-comet) that travels a continuous compound
   path: tab left → top → right → (turn) → canvas top → right → bottom → left
   → (close) back to tab bottom-left → up the tab left again. The path is
   generated in JS (updatePageCometPath) based on the active tab's measured
   bounds + canvas-area's bounds, so one moving light reads as ONE continuous
   green shine flowing around the page's outline. (2026-05-29) */
.page-tab.active:hover {
  /* On hover, brighten the text — the conic shine already provides motion. */
  color: var(--accent);
}
/* Status slot — the green dot and the close × occupy ONE spot (browser-tab
   pattern). The dot shows by default; hovering the tab cross-fades the dot out
   and the × in, so the × lands exactly where the dot was. */
.tab-slot {
  /* Enlarged to a reliable hit target (was 13px — too small, clicks often
     fell through to the parent tab and switched pages instead of deleting).
     Now an 18px square so the × is comfortably clickable. */
  position: relative;
  width: 18px; height: 18px;
  margin-left: 8px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.tab-slot .page-dot {
  /* Retired from view (2026-09-21): the close × now shows at all times, so the
     dot would sit underneath it. The active tab is still distinct via its fill,
     perimeter shine and lime hover. Kept so the pulse can be restored by
     removing this one line. */
  display: none;
  /* The dot stays small + centered; pointer-events:none so clicks pass through
     to the × beneath. */
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  transition: opacity var(--dur-fast) var(--ease-out);
  pointer-events: none;
  /* Soft pulse — the green dot "breathes" so the active tab feels alive. */
  animation: page-dot-pulse 2.4s ease-in-out infinite;
}
@keyframes page-dot-pulse {
  /* Scale only: a looping box-shadow repaints the page every frame (2026-09-26). */
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.15); }
}
.tab-slot .x {
  /* The × fills the entire 18px slot — large click target. Text remains
     small and visually centered, but the click area covers the whole slot. */
  position: absolute;
  inset: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
  line-height: 1;
  border-radius: 50%;
  opacity: 0.55;         /* always visible so the close control is discoverable */
  color: var(--ink-2);
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.page-tab:hover .tab-slot .page-dot { opacity: 0; animation: none; }
.page-tab:hover .tab-slot .x { opacity: 0.9; }
.tab-slot .x:hover { opacity: 1 !important; color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.page-tab.active .tab-slot .x { color: var(--ink); }

.page-add {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--text-tertiary);
  /* Rounded RECTANGLE, not a pill (user request, repeated) — matches the
     page tab's 9px corner radius for a consistent shape language. */
  border-radius: 9px;
  padding: 6px 14px;
  /* Lift off the canvas so its bottom edge isn't kissing the dotted workspace
     below — user said it felt cramped. 6px gap keeps it visually contained
     in the strip while still aligned with the tabs' baseline area. */
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    border-style var(--dur-fast) var(--ease-out);
}
.page-add:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  border-style: solid;
}

/* Rulers */
.rulers {
  position: absolute; inset: 0; pointer-events: none;
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-3);
}
.ruler { position: absolute; background: var(--panel-sunken); border-color: var(--line-faint); }
.ruler-x { top: 0; left: 18px; right: 0; height: 18px; border-bottom: 1px solid; }
.ruler-y { top: 18px; left: 0; bottom: 0; width: 18px; border-right: 1px solid; }
.ruler-corner {
  position: absolute; top: 0; left: 0; width: 18px; height: 18px;
  background: var(--panel-sunken); border-right: 1px solid var(--line-faint);
  border-bottom: 1px solid var(--line-faint);
}
.canvas-area.has-rulers .ruler-x .tick,
.canvas-area.has-rulers .ruler-y .tick {
  position: absolute; color: var(--ink-3);
}

/* Code panel */
.code-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(380px, 100vw); background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 90;
  box-shadow: var(--shadow-3);
}
.code-panel-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.code-panel-head h3 { flex: 1; font-size: 12px; }
.code-panel-head button {
  padding: 4px 10px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-1); color: var(--ink); cursor: pointer;
}
.code-panel-head button.ghost { background: transparent; }
.code-panel textarea {
  flex: 1; resize: none; background: var(--bg-deep); color: var(--ink);
  font-family: var(--font-mono); font-size: 11px;
  padding: 10px; border: none; outline: none; white-space: pre;
}

/* Modals — v2 redesign (Phase C+, 2026-05-26).
   True liquid glass: heavy backdrop blur on the scrim AND on the card,
   visible top-edge highlight, deep shadow for depth. */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  animation: modal-scrim-in 240ms var(--ease-out);
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--glass-base);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow:
    var(--glass-border-top),
    var(--shadow-e4),
    0 0 80px rgba(0, 0, 0, 0.5);
  padding: 20px;
  min-width: 360px; max-width: 90vw;
  display: flex; flex-direction: column; gap: 12px;
  animation: modal-card-in 320ms var(--ease-spring);
}
@keyframes modal-scrim-in {
  from { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
  to   { opacity: 1; }
}
@keyframes modal-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 13px; }
.modal-head .ghost {
  background: transparent; border: none; color: var(--ink-3); cursor: pointer;
  font-size: 18px; line-height: 1;
}

.trace-preview-card {
  width: min(980px, 94vw);
  max-height: 92vh;
}
.trace-preview-meta {
  min-height: 18px;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.trace-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}
.trace-preview-grid figure {
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(220px, 44vh);
  gap: 6px;
  min-width: 0;
}
.trace-preview-grid figcaption {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.trace-preview-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  background:
    linear-gradient(45deg, rgba(255,255,255,0.055) 25%, transparent 25% 75%, rgba(255,255,255,0.055) 75%),
    linear-gradient(45deg, rgba(255,255,255,0.055) 25%, transparent 25% 75%, rgba(255,255,255,0.055) 75%);
  background-color: var(--bg-deep);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}
.trace-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.trace-preview-controls {
  display: grid;
  /* Quality takes the room; Retry is sized to its label (owner, 18 Nov: the
     full-width grey bar with white text was unreadable). */
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
#trace-preview-retry {
  min-width: 96px;
  padding: 8px 18px;
}
.trace-preview-footer {
  justify-content: flex-end;
}
.trace-preview-card.is-busy .trace-preview-frame,
.trace-preview-card.is-busy .trace-preview-footer {
  opacity: 0.55;
}
.trace-preview-card.is-busy button,
.trace-preview-card.is-busy select {
  pointer-events: none;
}

@media (max-width: 760px) {
  .trace-preview-grid,
  .trace-preview-controls {
    grid-template-columns: 1fr;
  }
  .trace-preview-grid figure {
    grid-template-rows: auto minmax(160px, 30vh);
  }
}

/* AI Generate — launcher button + centered modal (2026-07-04). */
#btn-ai-generate {
  display: inline-flex; align-items: center; gap: 6px;
}
#btn-ai-generate .icon { width: 14px; height: 14px; }
.pro-tick {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent-ink, #0B0B10);
  background: var(--accent, #B5FF3A);
  border-radius: var(--r-pill, 999px);
  padding: 1px 6px;
  margin-left: 2px;
}

.ai-generate-card {
  /* Compact until there is a result to show. The card only earns the extra
     width once Generate has been pressed (owner directive 2026-08-26): an
     empty right half on a 1080px card read as broken alignment. */
  width: min(560px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  transition: width 260ms var(--ease-out, cubic-bezier(0.2, 0.7, 0.3, 1));
}
.ai-generate-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-generate-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-generate-inputs textarea {
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--r-2);
  outline: none;
  transition: border-color var(--t-fast) var(--ease-out);
}
.ai-generate-inputs textarea:focus { border-color: var(--accent); }
.ai-generate-dropzone {
  border: 1px dashed var(--line-strong, rgba(255,255,255,0.18));
  border-radius: var(--r-3);
  padding: 16px;
  cursor: pointer;
  transition: border-color 130ms, background 130ms;
}
.ai-generate-dropzone:hover,
.ai-generate-dropzone:focus-visible {
  border-color: var(--accent, #B5FF3A);
  background: var(--accent-soft, rgba(181,255,58,0.08));
  outline: none;
}
.ai-generate-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--ink-2);
  font-size: 12.5px;
}
.ai-generate-dropzone-empty .icon { width: 20px; height: 20px; color: var(--ink-3); }
.ai-generate-dropzone-hint { font-size: 11px; color: var(--ink-4); }
.ai-generate-dropzone-preview {
  position: relative;
  display: flex;
  justify-content: center;
}
.ai-generate-dropzone-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--r-2);
}
.ai-generate-dropzone-preview .ghost {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2, #1C1C25);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}
.ai-generate-action-row {
  align-items: center;
  justify-content: space-between;
}
.ai-generate-upgrade-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
}
.ai-generate-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--danger, #FF6B6B);
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
  border-radius: var(--r-2);
  padding: 8px 12px;
}
.ai-generate-upgrade-note a { color: var(--accent, #B5FF3A); text-decoration: underline; }

/* The generated-SVG stage. Owner directive 2026-08-25: warm cream ground so
   dark artwork never disappears into the dark modal, and a finished, premium
   frame rather than the utilitarian checkerboard (which .trace-preview-frame
   still uses for auto-trace; these overrides win by coming later). */
.ai-generate-preview-frame {
  min-height: 220px;
  max-height: 40vh;
  padding: 22px;
  background: linear-gradient(180deg, #FBFAF4 0%, #F2EFE6 100%);
  border: 1px solid rgba(20, 20, 26, 0.18);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -14px 28px rgba(31, 29, 20, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}
.ai-generate-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(40vh - 44px);
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(31, 29, 20, 0.14));
}

/* Topbar CTA: the one lime button in row one, on purpose. */
.ai-generate-cta,
.topbar .actions button.ai-generate-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent, #B5FF3A);
  border: 1px solid rgba(0, 0, 0, 0.25);
  color: #10130A;
  font-weight: 700;
}
.topbar .actions button.ai-generate-cta:hover {
  background: var(--accent, #B5FF3A);
  filter: brightness(1.07);
  color: #10130A;
}
.ai-generate-cta .icon { width: 14px; height: 14px; }
.ai-generate-launcher { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.ai-generate-pause-note { font-size: 10px; line-height: 1.2; color: var(--ink-3); white-space: nowrap; }
.topbar .actions button.ai-generate-cta:disabled { opacity: .55; cursor: not-allowed; }
.ai-generate-preview-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.ai-generate-preview-actions { margin-top: 10px; }

/* Owner directive 2026-08-25: the whole tool visible in one rounded card,
   no scrolling. Wide screens go two-column (inputs left, result right) and
   the card widens to earn it; the cream stage absorbs the height budget so
   the meta line and the Discard/Regenerate/Add buttons never fall below the
   fold. Narrow screens keep the single column with the 40vh stage cap. */
@media (min-width: 900px) {
  .ai-generate-card.is-wide { width: min(1080px, 94vw); }
  .ai-generate-card.is-wide .ai-generate-body { flex-direction: row; align-items: stretch; gap: 22px; }
  .ai-generate-card.is-wide .ai-generate-inputs { flex: 0 0 38%; }
  .ai-generate-card.is-wide .ai-generate-preview { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .ai-generate-card.is-wide .ai-generate-preview-frame {
    min-height: 200px;
    max-height: calc(90vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .ai-generate-card.is-wide .ai-generate-preview-frame img {
    max-height: calc(90vh - 344px);
    width: auto;
    height: auto;
  }
  .ai-generate-card.is-wide .ai-generate-body .ai-generate-status {
    flex: 1;
    justify-content: center;
  }
}

.ai-generate-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}
.ai-generate-status .trace-spinner { margin-bottom: 12px; }
.ai-generate-status-text {
  font-size: 13px;
  color: var(--ink-2);
}

@media (max-width: 600px) {
  .ai-generate-card { width: 94vw; }
}

/* Gradient stop bar */
.gradient-bar {
  position: relative; height: 30px; border-radius: var(--r-1);
  border: 1px solid var(--line); cursor: copy;
}
.gradient-bar .stop {
  position: absolute; top: -2px; bottom: -2px; width: 10px;
  margin-left: -5px; border: 2px solid var(--ink); background: transparent;
  border-radius: 3px; cursor: ew-resize;
  box-shadow: 0 0 0 1px var(--bg-deep);
}
.gradient-bar .stop.active { border-color: var(--accent); }
.gradient-bar .stop .inner { position: absolute; inset: 2px; border-radius: 2px; }

/* Symbols list */
.symbols-list, .symbols-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px;
}
.symbol-tile {
  aspect-ratio: 1/1; border: 1px solid var(--line); border-radius: var(--r-2);
  background: var(--panel-sunken); padding: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.symbol-tile svg { width: 100%; height: 100%; }
.symbol-tile.active { outline: 2px solid var(--accent); }

/* Knife / eyedropper / add-anchor cursors */
.cursor-knife { cursor: crosshair; }
.cursor-eyedropper { cursor: copy; }

/* Knife stroke overlay */
.knife-stroke {
  stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3;
  fill: none; pointer-events: none;
}

/* Snap a few buttons to a compact size */
#bool-union, #bool-sub, #bool-int, #bool-xor,
#al-l, #al-cx, #al-r, #al-t, #al-cy, #al-b,
#dist-h, #dist-v { flex: 1; }

/* ────────────────────────────────────────────────────────────
   Examples modal
   ──────────────────────────────────────────────────────────── */
.examples-card { min-width: 560px; max-width: 720px; }
.examples-help {
  margin: 0 0 14px;
  color: var(--ink-3);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.example-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out);
}
.example-card:hover {
  border-color: var(--accent);
  background: oklch(from var(--panel-sunken) calc(l + 0.015) c h);
  transform: translateY(-1px);
}
.example-card .example-thumb {
  width: 100%;
  aspect-ratio: 3/2;
  background: oklch(from var(--bg) calc(l + 0.02) c h);
  border-radius: var(--r-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.example-card .example-thumb svg { width: 100%; height: 100%; display: block; }
.example-card .example-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.example-card .example-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* ────────────────────────────────────────────────────────────
   Onboarding modal — first-run, 4 panels, skippable
   ──────────────────────────────────────────────────────────── */
.onboarding-card {
  max-width: 480px;
  min-width: 360px;
  width: calc(100vw - 60px);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.onboarding-step {
  padding: 32px 32px 14px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.onboarding-step .onb-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.onboarding-step h2 {
  margin: 0;
  /* Was 'Lora' serif — a display serif in product UI chrome is off-system.
     The onboarding modal is UI, not content, so it uses the UI sans. */
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.onboarding-step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}
.onboarding-step ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-step li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}
.onboarding-step li .kbd {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: oklch(from var(--accent) l c h / 0.10);
  border: 1px solid oklch(from var(--accent) l c h / 0.3);
  border-radius: 4px;
  line-height: 1.3;
}
.onboarding-step li b {
  color: var(--ink);
  font-weight: 600;
}
.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line);
  gap: 12px;
}
.onboarding-skip {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-2);
  transition: color var(--t-fast) var(--ease-out);
}
.onboarding-skip:hover { color: var(--ink-2); }
.onboarding-dots {
  display: flex;
  gap: 6px;
}
.onboarding-dots .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: oklch(from var(--ink-3) l c h / 0.4);
  transition: background var(--t-fast) var(--ease-out);
}
.onboarding-dots .dot.active { background: var(--accent); }
/* The dots are steps you can click (Sarah's test video, 10 Nov 2026: "those
   4 dots at the bottom, you can't really move it forward"). Each dot is a
   button with a 22px target around it, and the forward button has an arrow. */
.onboarding-dots { gap: 12px; }
button.dot { appearance: none; -webkit-appearance: none; border: 0; padding: 0; margin: 0; position: relative; cursor: pointer; }
button.dot::before { content: ""; position: absolute; inset: -8px; }
button.dot:not(.active):hover { background: oklch(from var(--ink-2) l c h / 0.8); }
button.dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#onb-next.is-secondary::after { content: "→"; margin-left: 8px; }
.onboarding-nav {
  display: flex;
  gap: 8px;
}
.onboarding-back, .onboarding-next {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: var(--r-2);
  cursor: pointer;
  border: 1px solid var(--line);
  transition: border-color var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}
.onboarding-back {
  background: transparent;
  color: var(--ink-2);
}
.onboarding-back:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}
.onboarding-next {
  background: var(--accent);
  border-color: var(--accent);
  color: #0B0B10;
  font-weight: 600;
}
.onboarding-next:hover {
  background: oklch(from var(--accent) calc(l + 0.04) c h);
  border-color: oklch(from var(--accent) calc(l + 0.04) c h);
}

/* ────────────────────────────────────────────────────────────
   Feedback widget — floating pill bottom-right, expands to a panel
   ──────────────────────────────────────────────────────────── */
.feedback-widget {
  position: fixed;
  /* Bottom-right corner of the viewport (user request 2026-05-29) — was
     offset to right:334px to clear the properties panel; user prefers it
     in the true bottom-right corner, even if that sits over the panel. */
  right: 16px;
  bottom: 16px;
  z-index: 95;  /* below modals (100) so opening a modal still covers it */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.feedback-toggle {
  /* isolation creates a new stacking context so the ::before shine layer can
     sit BEHIND the pill content (z-index:-1) without escaping to behind
     other page content. */
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 11px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: 0 4px 12px oklch(0 0 0 / 0.28), 0 1px 0 oklch(0 0 0 / 0.18);
  cursor: pointer;
  overflow: hidden;     /* clip the shine to the pill silhouette */
  transition: color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
/* Rotating lime "shine" — a conic-gradient that sweeps around the pill's
   border, restored by user request (2026-05-29). The mask cuts a 1px-wide
   ring around the perimeter so only the border lights up, not the whole pill.
   `inset:-1px` extends past the pill so the conic continues smoothly across
   the rounded corners. */
.feedback-toggle::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--accent) 60deg,
    var(--accent-glow) 90deg,
    transparent 180deg,
    transparent 360deg
  );
  animation: feedback-shine 4s linear infinite;
}
/* Repaint the pill body OVER the conic so only the border-band remains lit. */
.feedback-toggle::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: var(--panel);
}
@keyframes feedback-shine {
  to { transform: rotate(360deg); }
}
.feedback-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent-soft);
}
.feedback-toggle svg { color: var(--accent); flex-shrink: 0; }

.feedback-panel {
  width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: 0 12px 28px oklch(0 0 0 / 0.40), 0 2px 0 oklch(0 0 0 / 0.18);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: feedback-pop 200ms var(--ease-out);
}
@keyframes feedback-pop {
  from { transform: translateY(8px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
.feedback-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.feedback-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.feedback-x {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--t-fast) var(--ease-out);
}
.feedback-x:hover { color: var(--ink); }
.feedback-help {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.feedback-email,
.feedback-panel textarea {
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--r-2);
  outline: none;
  transition: border-color var(--t-fast) var(--ease-out);
}
.feedback-email {
  resize: none;
  min-height: 0;
}
.feedback-panel textarea {
  min-height: 90px;
  max-height: 240px;
}
.feedback-email:focus,
.feedback-panel textarea:focus { border-color: var(--accent); }
.feedback-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.feedback-status {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  min-height: 1em;
}
.feedback-status.ok  { color: var(--accent); }
.feedback-status.err { color: #E04444; }
.feedback-submit {
  background: var(--accent);
  color: #0B0B10;
  border: none;
  border-radius: var(--r-2);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out);
}
.feedback-submit:hover {
  background: oklch(from var(--accent) calc(l + 0.04) c h);
}
.feedback-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Text-on-path sub-panel (revealed inside prop-text when textPathRef is set). */
.prop-sub {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-faint);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prop-sub-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 2px;
}

/* True mesh-gradient editor */
.mesh-hint {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-bottom: 10px;
}
#mesh-grid-seg .seg-label { margin-right: 6px; }
.mesh-grid-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
  align-items: stretch;
}
.mesh-grid {
  display: grid;
  gap: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 6px;
  aspect-ratio: 1 / 1;
}
.mesh-grid .mesh-node {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 4px;
  border: 2px solid rgba(0,0,0,0.35);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.mesh-grid .mesh-node:hover { transform: scale(1.08); border-color: var(--accent); }
.mesh-grid .mesh-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mesh-grid .mesh-node input[type="color"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; border: none;
}
.mesh-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background-color: var(--bg-deep);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 1 / 1;
  min-height: 120px;
}

/* ============================================================
   Auth (subsection 31) — sign-in button, modal, sign-up bar
   ============================================================ */

/* Topbar user-menu pill (2026-05-30 v2).
   Single-button pill matching profile.html's .account-trigger:
   one continuous border holding avatar + name + chevron. Replaces the
   prior split-btn pattern (which had a hairline divider between the
   name and the chevron). The chevron is intentionally larger here
   than profile.html's 10px because users reported it reading as too
   small in the editor topbar. */
.user-menu { position: relative; display: inline-flex; }
.user-menu .user-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 4px 12px 4px 4px;
  height: auto;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}
.user-menu .user-pill:hover { border-color: var(--line-soft); background: var(--panel-2); }
.user-menu .user-pill[aria-expanded="true"] { border-color: var(--accent); }
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-lo) 100%);
  color: var(--accent-ink);
  font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.user-menu .user-pill .user-name { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1; }
.user-menu .user-pill .user-chev { font-size: 14px; line-height: 1; color: var(--ink-3); }
#user-menu-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r-3); box-shadow: var(--shadow-2);
  padding: 6px; min-width: 200px; z-index: 80;
  display: flex; flex-direction: column; gap: 2px;
}
#user-menu-dropdown button {
  text-align: left; padding: 7px 10px; font-size: 12px;
  background: transparent; border: none; color: var(--ink);
  border-radius: var(--r-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}
#user-menu-dropdown button:hover { background: var(--panel-2); color: var(--accent); }
.menu-note {
  max-width: 230px;
  padding: 8px 10px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.35;
  border-bottom: 1px solid var(--line);
}

.cloud-save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
}
.actions .cloud-save-status {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-weight: 600;
}
.cloud-save-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}
.cloud-save-status.is-saving { color: var(--accent); }
.cloud-save-status.is-offline { color: #E04444; }
.cloud-save-status.is-online,
.cloud-save-status.is-saved { color: #7edc92; }
.cloud-save-status.is-error { color: #E04444; }
.cloud-save-status.is-local { color: var(--ink-3); }

/* Project size next to the save chip. The number is what the row costs in
   the cloud after gzip, not what the drawing feels like on the canvas. */
.cloud-save-size {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.cloud-save-size.is-warn { color: #E8B54A; border-color: #E8B54A55; }
.cloud-save-size.is-over { color: #E04444; border-color: #E0444455; }

/* Per-artboard size accounting (2026-09-20). The chip answers "how big",
   this answers "where". 64% of the document rescued from production was
   artwork sitting on no artboard at all, and nothing on screen said so. */
.cloud-size-wrap { position: relative; display: inline-flex; }
.cloud-save-size { font-family: inherit; }
.cloud-save-size[aria-haspopup="dialog"] { cursor: pointer; }
.cloud-save-size[aria-haspopup="dialog"]:hover { border-color: var(--line-soft); color: var(--ink-2); }
.cloud-save-size[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.cloud-save-size:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cloud-size-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  width: 300px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
}
.cloud-size-panel:focus { outline: none; }
.cloud-size-title {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.cloud-size-row { margin-bottom: 9px; }
.cloud-size-row:last-of-type { margin-bottom: 0; }
.cloud-size-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  margin-bottom: 4px;
}
.cloud-size-name {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cloud-size-row.is-loose .cloud-size-name { color: #E8B54A; }
.cloud-size-row.is-parent .cloud-size-name { color: var(--ink-3); }
.cloud-size-bytes { color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.cloud-size-bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}
.cloud-size-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.cloud-size-row.is-loose .cloud-size-bar i { background: #E8B54A; }
.cloud-size-row.is-parent .cloud-size-bar i { background: var(--ink-4); }
/* Your saves (owner's A2, 28 Oct; plain words since his second agent test
   video, 6 Nov): click the save status for one line on where the work
   stands and this window's last few saves, each with its time and what
   changed. Fixed to the chip, so the chip never moves in the topbar. */
.cloud-save-status.has-save-log { cursor: pointer; }
.cloud-save-status.has-save-log:hover { filter: brightness(1.15); }
.cloud-save-status.has-save-log:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cloud-save-status[aria-expanded="true"] { border-color: var(--accent); }
.cloud-size-panel.cloud-save-log-panel { position: fixed; right: auto; z-index: 140; width: 320px; padding: 14px 16px; }
.cloud-size-title.save-log-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.save-log-waiting { margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.save-log-wait { display: flex; align-items: baseline; gap: 8px; }
.save-log-wait::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--save-dot, var(--ink-3)); transform: translateY(-1px); }
.save-log-wait.is-ok { --save-dot: #7edc92; }
.save-log-wait.is-hold { --save-dot: #E8B54A; }
.save-log-wait.is-now, .save-log-wait.is-wait { --save-dot: var(--accent); }
.save-log-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.save-log-row { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.45; }
.save-log-row:last-child { border-bottom: 0; padding-bottom: 0; }
.save-log-time { flex: none; min-width: 64px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.save-log-what { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.save-log-row.is-failed .save-log-what, .save-log-row.is-refused .save-log-what,
.save-log-row.is-too-large .save-log-what, .save-log-row.is-retry .save-log-what { color: #E8B54A; }
.save-log-empty { padding: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.project-saved-by { color: var(--ink-3); }
/* Crash buffer (2026-09-20). A bar, never a modal: the drawing stays
   reachable while the user decides. */
.restore-bar {
  position: fixed;
  left: 50%;
  /* Above the hint toast (bottom: 60px) and the zoom bar, so nothing the user needs is covered while they decide. */
  bottom: 126px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 640px);
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  font-size: 12px;
  color: var(--ink);
}
.restore-bar-text { flex: 1 1 auto; line-height: 1.45; }
.restore-bar-yes,
.restore-bar-no {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--r-2, 8px);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.restore-bar-yes {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.restore-bar-yes:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.restore-bar-no {
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink-2);
}
.restore-bar-no:hover { color: var(--ink); border-color: var(--ink-3); }
.restore-bar-yes:focus-visible,
.restore-bar-no:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cloud-size-hint {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* Incremental cloud saves (2026-09-20). The error chip never says "failed"
   while a confirm probe is still possible, so it reads "Not saved: N
   artboards pending" and offers the one action that helps. */
.cloud-save-status.is-error { border-color: #E0444455; }
.cloud-save-retry {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #E0444455;
  border-radius: 10px;
  background: var(--panel-2);
  color: #E04444;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.cloud-save-retry:hover { border-color: #E04444; color: #ff6b6b; }

/* Auth modal — reuses .modal / .modal-card base */
.auth-card { max-width: 420px; }
.auth-lede {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
  margin: 4px 0 18px;
}
.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.auth-google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
#auth-github { margin-top: 8px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin: 18px 0;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.auth-label > span:first-child {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-3);
}
.auth-label input[type="email"] {
  padding: 9px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}
.auth-label input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-optin {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.45;
}
.auth-optin input { margin-top: 2px; flex-shrink: 0; }
.auth-turnstile:not(:empty) { margin: 4px 0; }
.auth-submit {
  padding: 10px 16px;
  background: var(--accent);
  color: #0B0B10;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.auth-submit:hover { filter: brightness(1.07); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-status {
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 12px 0 0;
  min-height: 1.2em;
  line-height: 1.4;
}
.auth-status.is-error { color: #E04444; }
.auth-status.is-success { color: #4CDD8B; }
.auth-fine-print {
  font-size: 11px;
  color: var(--ink-3);
  margin: 14px 0 0;
  line-height: 1.5;
}
.auth-fine-print a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.auth-fine-print a:hover { color: var(--accent); }

/* Sign-up suggestion bar — floating bottom-left card */
.signup-bar {
  position: fixed;
  bottom: 16px;
  /* Clear the 68px toolbar rail so the card floats over the canvas, not over
     the bottom tools (was left:16px, which covered Hand/Zoom). (2026-05-29) */
  left: 80px;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 14px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.32);
  z-index: 60;
  font-family: inherit;
  animation: signupBarIn 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes signupBarIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);  }
}
.signup-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.signup-bar-head strong {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.3;
}
.signup-bar-x {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 20px; height: 20px;
  flex-shrink: 0;
}
.signup-bar-x:hover { color: var(--ink); }
.signup-bar-msg {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 12px;
}
.signup-bar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.signup-bar-cta {
  flex: 1;
  padding: 7px 12px;
  background: var(--accent);
  color: #0B0B10;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.signup-bar-cta:hover { filter: brightness(1.07); }
.signup-bar-skip {
  padding: 7px 12px;
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}
.signup-bar-skip:hover { color: var(--ink); border-color: var(--ink-3); }

/* ============================================================
   My Projects modal (subsection 32)
   ============================================================ */
.projects-card {
  max-width: 460px;
  max-height: min(760px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
}
.projects-lede {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 4px 0 16px;
}
.projects-current {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.025);
}
.projects-current label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.project-name-edit {
  display: flex;
  gap: 8px;
}
.project-name-edit input {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.project-name-edit input:focus {
  outline: none;
  border-color: var(--accent);
}
.project-name-edit button {
  padding: 8px 10px;
  color: #0B0B10;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#project-name-help,
.projects-limit,
.limit-note {
  margin: 7px 0 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.4;
}
.projects-limit {
  margin: 0 0 10px;
}
.projects-limit.is-full {
  color: #ffbd66;
}
.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: min(300px, 34vh);
  min-height: 188px;
  overflow-y: auto;
  overflow-x: visible;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.projects-empty {
  padding: 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}
.project-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.project-row:last-child { border-bottom: none; }
.project-row.is-active { background: var(--bg-deep); }
.project-load {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
}
.project-load:hover { background: rgba(255,255,255,0.04); }
.project-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.project-meta {
  font-size: 11.5px;
  color: var(--ink-3);
}
.project-actions {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
}
.project-menu-toggle {
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 18px;
  letter-spacing: 0;
  cursor: pointer;
}
.project-menu-toggle:hover,
.project-menu-toggle[aria-expanded="true"] {
  color: var(--ink);
  background: rgba(255,255,255,0.045);
}
.project-menu {
  position: absolute;
  right: 8px;
  top: calc(100% - 6px);
  z-index: 5;
  min-width: 132px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-2);
}
.project-menu button {
  width: 100%;
  padding: 8px 9px;
  color: var(--ink-2);
  background: transparent;
  border: none;
  border-radius: 5px;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}
.project-menu button:hover {
  color: var(--ink);
  background: var(--panel-2);
}
.project-action-delete:hover {
  color: #ff7777;
  background: rgba(255,80,80,0.08);
}
.projects-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}
.projects-new {
  padding: 8px 14px;
  background: var(--accent);
  color: #0B0B10;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.projects-new:hover { filter: brightness(1.07); }
.projects-new:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: none;
}

.workspace-is-busy .app {
  pointer-events: none;
  user-select: none;
}
.workspace-busy {
  position: fixed;
  inset: 0;
  z-index: 118;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 14, 0.9);
  backdrop-filter: blur(2px);
}
.workspace-busy[hidden] {
  display: none;
}
.workspace-busy-card {
  width: min(430px, 100%);
  padding: 24px 26px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0,0,0,0.42);
  color: var(--ink);
  text-align: center;
}
.workspace-busy-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border: 3px solid rgba(181, 255, 58, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: traceSpin 780ms linear infinite;
}
.workspace-busy-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.workspace-busy-copy {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.workspace-busy-steps {
  display: grid;
  gap: 8px;
  margin: 16px auto 0;
  max-width: 340px;
  text-align: left;
}
.workspace-busy-steps[hidden] {
  display: none;
}
.workspace-busy-step {
  position: relative;
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.35;
}
.workspace-busy-step::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 999px;
  border: 1px solid rgba(181, 255, 58, 0.35);
  background: rgba(181, 255, 58, 0.08);
  box-shadow: 0 0 0 0 rgba(181, 255, 58, 0);
}
.workspace-busy-step.is-active {
  color: var(--ink);
}
.workspace-busy-step.is-active::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(181, 255, 58, 0.12);
}
.workspace-busy-step.is-done {
  color: var(--ink-2);
}
.workspace-busy-step.is-done::before {
  background: rgba(181, 255, 58, 0.55);
  border-color: rgba(181, 255, 58, 0.55);
}
.workspace-busy-step-name {
  display: block;
  font-weight: 700;
}
.workspace-busy-step-copy {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
}

/* ────────────────────────────────────────────────────────────
   "Work not saved" warning strip (Phase 1 funnel hardening).
   Anonymous users only; persists across reloads, dismissible per
   tab-session.
   ──────────────────────────────────────────────────────────── */
.save-warning {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 109;
  /* Neutral dark surface with a faint lime hint at the bottom edge —
     no more heavy green tint (2026-05-26 user feedback "lighter, less green"). */
  background: var(--panel);
  border-bottom: 1px solid rgba(181, 255, 58, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.save-warning strong { color: var(--ink); font-weight: 600; }
.save-warning-msg { flex: 1; }
.save-warning-cta {
  background: transparent;
  border: none;
  padding: 0;
  margin-left: 6px;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.save-warning-cta:hover { filter: brightness(1.15); }
.save-warning-xbtn {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 20px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
  transition: color var(--t-fast) var(--ease-out);
}
.save-warning-xbtn:hover { color: var(--ink); }
/* Push .app down by the warning's height when visible. Stack with the
   top of the viewport. A sibling selector, never body:has(): with a :has()
   anchored on body, every node the editor inserts or removes anywhere (a
   selection handle, a text being measured) made Chrome re-check the whole
   page, 1.3-1.5 ms each on a 1,885-shape project, so one click that hit-tests
   a few hundred texts froze for 2-3 s (owner report 2026-10-19). The warning
   is the element just before .app in index.html.
   Guarded by tests/layers-offscreen.test.cjs. */
.save-warning:not([hidden]) ~ .app { padding-top: 44px; }
.save-warning:not([hidden]) ~ .app .topbar { animation: none; }

/* ===== Auto-trace busy overlay (added 2026-05-26) =====
   Sits on top of the canvas, blocks pointer events so the user can't draw
   mid-trace, but leaves topbar + properties panel reachable (they're outside
   .canvas-area). Cancel aborts the remote request. */
.trace-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 14, 12, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeInOverlay 160ms var(--ease-out) both;
}
.trace-overlay.is-targeted {
  background: transparent;
  backdrop-filter: none;
  /* Centred on the canvas (owner, 18 Nov 2026): at the top it sat over the
     mode tabs and the toolbar. */
  align-items: center;
}
/* While a trace runs or its review is open, the selection's "Add to chat /
   Comment" bar is not for that moment (owner, 18 Nov 2026: it floated over
   the trace progress). html.trace-busy is set by app.js (section 20); no
   :has() on body, which re-styles the whole page on big projects
   (tests/layers-offscreen.test.cjs). */
html.trace-busy #chat-pick-bar {
  display: none !important;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.trace-overlay-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 28px 32px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  color: var(--ink, #eee);
}
.trace-overlay.is-targeted .trace-overlay-card {
  max-width: 360px;
  padding: 16px 18px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.28);
}
.trace-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(181, 255, 58, 0.18);
  border-top-color: var(--accent, #B5FF3A);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: traceSpin 720ms linear infinite;
}
.trace-overlay.is-targeted .trace-spinner {
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
}
@keyframes traceSpin { to { transform: rotate(360deg); } }
.trace-overlay-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.trace-overlay-meta {
  font-size: 12px;
  color: var(--ink-3, #8a8478);
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}
.trace-overlay-hint {
  font-size: 11.5px;
  color: var(--ink-3, #8a8478);
  line-height: 1.5;
  margin-bottom: 14px;
  opacity: 0.85;
}
.trace-overlay-steps {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
  text-align: left;
}
.trace-overlay-steps[hidden] {
  display: none;
}
.trace-overlay-step {
  position: relative;
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  color: var(--ink-3, #8a8478);
  font-size: 11.5px;
  line-height: 1.35;
}
.trace-overlay-step::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 999px;
  border: 1px solid rgba(181, 255, 58, 0.35);
  background: rgba(181, 255, 58, 0.08);
  box-shadow: 0 0 0 0 rgba(181, 255, 58, 0);
}
.trace-overlay-step.is-active {
  color: var(--ink, #eee);
}
.trace-overlay-step.is-active::before {
  background: var(--accent, #B5FF3A);
  border-color: var(--accent, #B5FF3A);
  box-shadow: 0 0 0 5px rgba(181, 255, 58, 0.12);
}
.trace-overlay-step.is-done {
  color: var(--ink-2, #c7c2b8);
}
.trace-overlay-step.is-done::before {
  background: rgba(181, 255, 58, 0.55);
  border-color: rgba(181, 255, 58, 0.55);
}
.trace-step-name {
  display: block;
  font-weight: 700;
}
.trace-step-copy {
  display: block;
  margin-top: 1px;
  color: var(--ink-3, #8a8478);
}
.trace-overlay-cancel {
  background: transparent;
  color: var(--ink, #eee);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 7px 18px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.trace-overlay-cancel:hover {
  background: rgba(181, 255, 58, 0.08);
  border-color: var(--accent, #B5FF3A);
}
#overlay .trace-target-fx {
  pointer-events: none;
}
#overlay .trace-target-veil {
  fill: var(--accent-soft);
  opacity: 0.38;
}
#overlay .trace-target-frame {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 8 6;
  animation: traceTargetPulse 900ms ease-in-out infinite alternate;
}
#overlay .trace-target-scan {
  stroke: var(--accent);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  opacity: 0.78;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
@keyframes traceTargetPulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* Auto-trace large-group summary row in the Layers panel (added 2026-05-26).
   When an auto-trace produces 20K+ shapes, renderLayers collapses them into
   ONE summary row instead of 20K <li>s (which would freeze the UI). The
   summary row shows count, swatch (gradient to distinguish from a normal
   shape swatch), and a trash button to delete the whole group. */
.layers li.layer-summary {
  font-style: italic;
  background: rgba(181, 255, 58, 0.04);
}
.layers li.layer-summary .name {
  color: var(--ink-2, #b9b1a3);
}
.layers li.layer-summary .swatch {
  border: 1px dashed rgba(181, 255, 58, 0.4);
}

/* ────────────────────────────────────────────────────────────
   Cursor follower glow (2026-05-26 — user request).
   A soft lime light that follows the pointer, mimicking the ambient
   green glow in the reference dashboard image. Uses mix-blend-mode
   so it brightens whatever is behind it instead of overlaying.
   Hidden under prefers-reduced-motion. Positioned by JS via inline
   transform — see app.js init block.
   ──────────────────────────────────────────────────────────── */
#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  /* Tightened to ~20% of original size per user request 2026-05-26 —
     glow now sits close to the cursor instead of bathing the whole area. */
  width: 120px;
  height: 120px;
  margin-left: -60px;
  margin-top: -60px;
  border-radius: 50%;
  pointer-events: none; /* never blocks interaction */
  /* z-index ladder (2026-05-29): topbar 50 · dropdowns 80 · code-panel 90 ·
     feedback 95 · cursor-glow 96 · ctx-menu 99 · modal 100 · save-warning 109 ·
     The glow sits *below* modals/menus so it never washes
     over dialog content (was 9999, painting over everything). */
  z-index: 96;
  background: radial-gradient(
    circle,
    rgba(181, 255, 58, 0.42) 0%,
    rgba(181, 255, 58, 0.21) 28%,
    rgba(181, 255, 58, 0)    62%
  );
  filter: blur(14px);
  mix-blend-mode: screen;
  will-change: transform;
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}
#cursor-glow.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  #cursor-glow { display: none; }
}

/* ────────────────────────────────────────────────────────────
   Universal hover lime — text + icons turn lime on hover for any
   interactive element (2026-05-26 user request). Specific component
   rules with stronger selectors still win where they exist (e.g. the
   Export button which has its own bg-shift hover).
   ──────────────────────────────────────────────────────────── */
button:hover,
button:hover svg.icon,
button:hover .icon,
a:hover,
.tool:hover,
.field:hover > span,
[role="button"]:hover {
  color: var(--accent-lime);
}
/* Icons inherit via currentColor on stroke — make explicit for sprite uses */
button:hover svg.icon use,
a:hover svg.icon use {
  color: var(--accent-lime);
}
/* Don't lime the text on a button that's ALREADY accent-bg
   (e.g. the Export primary button). Its text needs to stay dark for contrast.
   NOTE: .page-tab.active:hover is intentionally NOT in this list — the active
   page tab fills with --panel (NOT accent), so its hover text should turn
   lime like the rest of the UI, matching the toolbar icon hover behaviour. */
.actions button#btn-export:hover,
.feedback-submit:hover,
.signup-bar-cta:hover,
.projects-new:hover,
.auth-submit:hover,
.onboarding-next:hover {
  color: var(--accent-ink);
}

/* ────────────────────────────────────────────────────────────
   Invisible scrollbars (2026-05-26 user request).
   Hides the scrollbar UI everywhere while keeping scroll functional.
   Covers Chromium (::-webkit-scrollbar), Firefox (scrollbar-width),
   legacy Edge/IE (-ms-overflow-style). Wins over the per-panel
   scrollbar styling above thanks to specificity + display:none.
   ──────────────────────────────────────────────────────────── */
* {
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* legacy Edge / IE */
}
*::-webkit-scrollbar {          /* Chrome / Safari / modern Edge */
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

/* ────────────────────────────────────────────────────────────
   Responsive layout (2026-05-29 — user request: "make it responsive").
   The base layout is a fixed 3-column grid (68 / 1fr / 322) that
   overflows under ~960px and breaks badly below ~720px (the canvas
   gets squeezed to nothing and the side panels overflow off-screen).
   These queries progressively reclaim space, then stack to a single
   column on phones. CSS-only, no JS, no build. This stops the layout
   breaking when a window is resized or on tablets and phones.
   ──────────────────────────────────────────────────────────── */

/* Small laptops — trim the side panels so the canvas keeps room. */
/* A window about 1024 px wide: the topbar's actions never run past the
   edge (deep test E: the page scrolled 88 px sideways and stuck). The
   account shows as its initial; the actions wrap rather than overflow. */
@media (max-width: 1240px) {
  .user-menu .user-pill .user-name, .user-menu .user-pill .user-chev { display: none; }
  .user-menu .user-pill { padding: 4px; }
  .actions > button, .actions > div > button, .actions > .file-btn { padding: 0 10px; }
}
.actions { min-width: 0; max-width: 100%; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 64px 1fr 292px; }
  /* feedback widget stays at right:16px — user prefers bottom-right corner */
}

/* Tablets — narrower still; tighten the topbar rows. */
@media (max-width: 860px) {
  .app { grid-template-columns: 58px 1fr 248px; }
  .topbar-row { padding: 6px 10px; gap: var(--s-2); }
}

/* Phones — stack to one column. Toolbar becomes a horizontal scroll
   strip, canvas takes the middle, properties is a capped scrollable
   card below. Everything stays inside 100vh because body can't scroll
   (box-sizing:border-box keeps the banner padding-top from overflowing). */
@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(150px, 1fr) minmax(0, 36vh) 26px;
    grid-template-areas:
      "topbar"
      "toolbar"
      "canvas"
      "properties"
      "statusbar";
  }

  /* Toolbar: vertical card → horizontal scroll strip of tools. */
  .toolbar {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin: 8px 8px 0;
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 16px;
  }
  .toolbar .tool { flex: 0 0 auto; }
  /* Separators flip from horizontal lines to vertical dividers in a row. */
  .tool-sep { width: 1px; height: 22px; margin: 0 4px; }

  /* Properties: floating card below the canvas, scrolls internally. */
  .properties {
    margin: 8px 8px 0;
    border-radius: 16px;
  }

  /* Side panels are stacked (not on the left/right edges) at this width, so
     the floating widgets return to the normal viewport corners. */
  .feedback-widget { right: 16px; }
  .signup-bar { left: 16px; }
  .hint { left: 16px; }
}

/* Export artboard picker modal (2026-05-31).
   Multi-select: shown when >1 artboards. Pick any subset; export them. */
.scope-help {
  color: var(--ink-2);
  font-size: 13px;
  margin: 0 0 12px 0;
}
.scope-actions-row {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.link-btn {
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
  letter-spacing: -0.005em;
}
.link-btn:hover { color: var(--accent); }
.scope-list {
  max-height: 280px;
  overflow-y: auto;
  margin: 0 -4px 14px -4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scope-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.scope-item:hover { background: var(--panel-2); }
.scope-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}
.scope-item-name {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scope-item-dims {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.scope-item.is-active .scope-item-name::after {
  content: "active";
  margin-left: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}
.scope-footer { justify-content: flex-end; }
.scope-footer #scope-go:not(:disabled) {
  background: var(--accent);
  color: var(--accent-ink);
}
.scope-footer #scope-go:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* App-native confirm/prompt dialog (replaces window.confirm / prompt) */
.app-dialog-card { max-width: 440px; z-index: 1; }
#app-dialog { z-index: 1200; } /* above projects/export modals that can spawn it */
.app-dialog-message {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}
.app-dialog-input {
  width: 100%;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.app-dialog-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(181, 255, 58, 0.14));
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}
.app-dialog-btn {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.app-dialog-btn:hover { border-color: var(--accent); color: var(--accent); }
.app-dialog-btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink, #0b0b10);
}
.app-dialog-btn.primary:hover {
  background: var(--accent-hi, var(--accent));
  color: var(--accent-ink, #0b0b10);
}
.app-dialog-btn.primary.danger {
  background: #e04444;
  color: #fff;
}
.app-dialog-btn.primary.danger:hover { background: #f25555; color: #fff; }

/* Invert-fill toggle (2026-07-17): square-with-punched-hole icon. Paints the
   region OUTSIDE the shape instead of the inside — see the "companion path"
   feature in the PRO EXTENSIONS block of app.js. */
.fill-invert-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-2);
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  transition:
    background-color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    opacity var(--t-fast) var(--ease-out);
}
.fill-invert-btn .fill-invert-hole { fill: var(--panel-sunken); transition: fill var(--t-fast) var(--ease-out); }
.fill-invert-btn:hover:not(:disabled) { border-color: var(--accent-lime, var(--accent)); color: var(--accent-lime, var(--accent)); }
.fill-invert-btn.active {
  background: var(--accent-lime-soft, var(--accent-soft));
  color: var(--accent-lime, var(--accent));
  border-color: var(--accent-lime, var(--accent));
}
.fill-invert-btn.active .fill-invert-hole { fill: var(--accent-lime-soft, var(--accent-soft)); }
.fill-invert-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Per-end stroke taper controls (2026-07-20). Open strokes can taper at the
   start, end, or both; Length controls how much of the path is used. */
.stroke-taper-seg .seg-label {
  padding-right: 6px;
}
.stroke-taper-seg button {
  min-width: 0;
  padding-inline: 3px;
  font-size: 10px;
}
.stroke-taper-seg button.active:not([data-value="off"]) {
  border-color: var(--accent-lime, var(--accent));
  color: var(--accent-lime, var(--accent));
}
.stroke-taper-seg.is-disabled,
.stroke-taper-amount.is-disabled {
  opacity: 0.35;
}
.stroke-taper-seg button:disabled,
.stroke-taper-amount input:disabled {
  cursor: not-allowed;
}
.stroke-taper-amount {
  margin-top: var(--s-2);
}

/* The "Connect to AI" button and its pairing-code panel were removed on
   2026-09-26: the MCP no longer pairs with a tab (app.js sections 36, 38). */

/* ---------- Loud limit denial (2026-08-25): shared shake + red note used by
   the export scope modal, the export split-button popover, and AI Generate.
   See app.js PRO EXTENSIONS subsection "Loud limit denial". ---------- */
@keyframes limit-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.limit-shake { animation: limit-shake 400ms ease-in-out; }
.limit-denied-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--danger, #ff6b6b);
}
.limit-denied-note a { color: inherit; text-decoration: underline; }
.limit-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 90;
  width: max-content;
  max-width: 260px;
  margin-top: 0;
  background: var(--panel);
  border: 1px solid rgba(255, 77, 77, 0.35);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  padding: 8px 10px;
}

/* ---------- Export button when the plan's exports are spent (2026-08-26).
   The lime CTA turns red and breathes until an upgrade (or a new billing
   period) frees exports up again, so nobody spends an hour on artwork they
   cannot download. Set from app.js by updateExportQuotaAlert().
   The breath fades a layer's opacity instead of animating box-shadow, which
   repainted the whole page every frame (see the Upgrade button below). ---------- */
.actions .split-btn.is-quota-spent > button#btn-export {
  position: relative;
  isolation: isolate;
  background: var(--danger);
  color: #FFF3F3;
  border-color: transparent;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.30);
}
.actions .split-btn.is-quota-spent > button#btn-export::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 0 0 4px var(--danger-soft), 0 0 20px rgba(255, 77, 77, 0.70);
  opacity: 0;
  animation: export-quota-beam 2.6s ease-in-out infinite;
  will-change: opacity;
  pointer-events: none;
}
.actions .split-btn.is-quota-spent > button#btn-export:hover {
  background: var(--danger);
  color: #FFF3F3;
  border-color: transparent;
  box-shadow: 0 0 0 4px var(--danger-soft);
}
.actions .split-btn.is-quota-spent > button.caret {
  border-color: var(--danger-soft);
  color: var(--danger);
}
@keyframes export-quota-beam {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .actions .split-btn.is-quota-spent > button#btn-export::before { animation: none; }
}

/* ---------- Topbar Upgrade button (2026-08-31) ----------
   Shown only to signed-in free users. It mirrors the export-quota beam above,
   but in the brand lime with a silver sweep across the face, so it reads as an
   invitation rather than the red "you are blocked" state. The sweep and the
   beam both stop under prefers-reduced-motion.

   Compositor only (2026-09-26): both loops animate transform or opacity and
   nothing else. They used to animate box-shadow and left, which made the
   browser repaint and lay out the whole page every frame; with 500 shapes on
   the canvas that alone kept an idle editor about a quarter busy. The beam's
   peak glow now lives on ::before and fades in and out; the sweep moves with
   transform inside .btn-upgrade-sheen, which clips it to the button so the
   button itself no longer clips the glow. */
.actions .btn-upgrade {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  gap: 5px;
  box-shadow: 0 0 8px var(--accent-glow);
}
/* The beam's peak, faded in and out. inset -1px matches the border box, which
   is where the button's own shadow starts. */
.actions .btn-upgrade::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 20px var(--accent-glow);
  opacity: 0;
  animation: upgrade-beam 2.8s ease-in-out infinite;
  will-change: opacity;
  pointer-events: none;
}
/* The silver sweep is absolutely positioned, so it passes over the bolt and
   the label together rather than around them. */
.actions .btn-upgrade .icon {
  width: 14px;
  height: 14px;
  flex: none;
}
.actions .btn-upgrade:hover {
  background: linear-gradient(180deg, #DAFF8F, var(--accent-hi));
  color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 22px var(--accent-glow);
}
.actions .btn-upgrade-sheen {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
}
/* The silver pass. A skewed highlight swept across the button on the same
   cadence as the beam, which is what gives it the metallic read. It travels
   from left -60% to 130% of the button: 190% of the button is 475% of its
   own 40% width. */
.actions .btn-upgrade-sheen::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  transform: translateX(0) skewX(-20deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: upgrade-sheen 2.8s ease-in-out infinite;
  will-change: transform;
}
@keyframes upgrade-beam {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}
@keyframes upgrade-sheen {
  0%        { transform: translateX(0) skewX(-20deg); }
  55%, 100% { transform: translateX(475%) skewX(-20deg); }
}
@media (prefers-reduced-motion: reduce) {
  .actions .btn-upgrade::before { animation: none; }
  .actions .btn-upgrade-sheen::after { animation: none; opacity: 0; }
}
/* M126 (owner's sixth video, 30:07 and 1:14: it pulsed every second while he worked): the beam
   and the sweep play once, and only when app.js marks a calm moment (html.upgrade-nudge: no
   input for a while, at most once per visit). The rest of the time the button is still. */
html:not(.upgrade-nudge) .actions .btn-upgrade::before { animation: none; opacity: 0; }
html:not(.upgrade-nudge) .actions .btn-upgrade-sheen::after { animation: none; opacity: 0; }
html.upgrade-nudge .actions .btn-upgrade::before,
html.upgrade-nudge .actions .btn-upgrade-sheen::after { animation-iteration-count: 1; }

/* ---------- Usage panel (2026-08-25): topbar "Usage" button + dropdown.
   Mirrors .split-btn .menu positioning but is its own widget since it holds
   meters, not a button list. ---------- */
.usage-widget { position: relative; display: inline-flex; }
.usage-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 90;
  width: 260px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  padding: 12px;
}
.usage-panel-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.usage-panel-plan-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 700;
}
.usage-panel-plan-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-ink, #0b0b10);
  background: var(--accent);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.usage-meter { margin-bottom: 10px; }
.usage-meter:last-of-type { margin-bottom: 0; }
.usage-meter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 4px;
}
.usage-meter-label { color: var(--ink-2); }
.usage-meter-value { color: var(--ink); font-weight: 600; }
.usage-meter-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--panel-2, #1c1c25);
  overflow: hidden;
}
.usage-meter-fill { height: 100%; background: var(--accent); border-radius: inherit; }
.usage-meter.is-full .usage-meter-fill { background: var(--danger, #ff6b6b); }
.usage-meter-note { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.usage-panel-upgrade {
  display: block;
  text-align: center;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: var(--r-2);
  background: var(--accent);
  color: var(--accent-ink, #0b0b10);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.usage-panel-empty, .usage-panel-loading {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.usage-panel-empty a { color: var(--accent); text-decoration: underline; }

/* MCP usage in the Usage panel (2026-09-27): compact allowance, trial,
   top-up balance, top tools and projects, and a More link to /usage. */
.usage-panel { max-height: calc(100vh - 90px); overflow-y: auto; }
.usage-mcp {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.usage-mcp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.usage-mcp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  margin-bottom: 4px;
}
.usage-mcp-label { color: var(--ink-2); min-width: 0; }
.usage-mcp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-mcp-value { color: var(--ink); font-weight: 600; white-space: nowrap; }
.usage-mcp-list { margin-top: 8px; }
.usage-mcp-list-title { font-size: 10.5px; color: var(--ink-3); margin-bottom: 3px; }
.usage-mcp .usage-meter { margin-bottom: 8px; }
.usage-mcp-try-title { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.usage-mcp-try-text { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; margin-bottom: 6px; }
.usage-mcp-link { font-size: 12px; color: var(--accent); text-decoration: underline; }
/* The Usage panel sits inside the top bar's .actions, whose button look
   (padding, fill, border, 30px height) must not reach this text link. */
#usage-panel button.usage-mcp-link,
#usage-panel button.usage-mcp-link:hover,
#usage-panel button.usage-mcp-link:active {
  display: inline; height: auto; padding: 0; margin: 0;
  background: none; border: 0; box-shadow: none; transform: none;
  font: inherit; font-size: 12px; color: var(--accent); text-decoration: underline; cursor: pointer;
}
.usage-mcp-more {
  display: block;
  text-align: center;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.usage-mcp-more:hover { border-color: var(--accent); }

/* ────────────────────────────────────────────────────────────
   Fit menu (2026-08-26). The Fit button in the zoom pill opens
   this instead of firing one fixed framing.
   ──────────────────────────────────────────────────────────── */
.fit-menu {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  min-width: 236px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--glass-base);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-e3);
}
.fit-menu button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--r-2);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.fit-menu button:hover,
.fit-menu button:focus-visible { background: var(--surface-4, #26262F); outline: none; }
.fit-menu button:disabled { opacity: 0.45; cursor: default; }
.fit-menu button:disabled:hover { background: transparent; }
.fit-menu strong { font-size: 12px; font-weight: 600; }
.fit-menu em { font-size: 11px; font-style: normal; color: var(--ink-2); }

/* ────────────────────────────────────────────────────────────
   Floating artboard navigator (2026-08-26). Appears when a page
   holds more than one artboard. Draggable by its header.
   ──────────────────────────────────────────────────────────── */
.ab-nav {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 39;
  width: 188px;
  background: var(--glass-base);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-e3);
  font-size: 12px;
  color: var(--ink);
  user-select: none;
}
.ab-nav-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  cursor: grab;
}
.ab-nav.dragging .ab-nav-head { cursor: grabbing; }
.ab-nav-grip { color: var(--ink-2); font-size: 12px; line-height: 1; }
.ab-nav-title { font-weight: 600; letter-spacing: 0.01em; }
.ab-nav-count {
  margin-left: auto;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.ab-nav-collapse {
  background: transparent;
  border: none;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}
.ab-nav-collapse:hover { color: var(--ink); }
.ab-nav-body {
  padding: 0 5px 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ab-nav.collapsed .ab-nav-body { display: none; }
.ab-nav-list {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ab-nav-list::-webkit-scrollbar { width: 6px; }
.ab-nav-list::-webkit-scrollbar-thumb { background: var(--surface-5, #33333D); border-radius: 3px; }
.ab-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--r-2);
  padding: 6px 7px;
  cursor: pointer;
  color: var(--ink-2);
  font: inherit;
  overflow: hidden;
}
.ab-nav-item:hover { background: var(--surface-4, #26262F); color: var(--ink); }
.ab-nav-item.active { background: var(--surface-4, #26262F); color: var(--ink); font-weight: 600; }
.ab-nav-item .ab-nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: transparent;
  border: 1px solid var(--ink-2);
  flex: 0 0 auto;
}
.ab-nav-item.active .ab-nav-dot { background: var(--accent); border-color: var(--accent); }
.ab-nav-item .ab-nav-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ab-nav-item .ab-nav-lock { color: var(--ink-2); font-size: 10px; flex: 0 0 auto; }
.ab-nav-add {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--r-2);
  color: var(--ink-2);
  padding: 6px 7px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
.ab-nav-add:hover { color: var(--accent); border-color: var(--accent); }

/* ────────────────────────────────────────────────────────────
   Detachable panels (2026-08-26)

   The toolbar and the properties panel can be popped out of the grid
   and floated anywhere over the canvas, which hands their column back
   to the drawing surface. Detached they stay deliberately small: a
   capped height with the panel's own scrollbar, plus collapse-to-bar,
   so a floating panel never swallows the canvas it is meant to free up.

   No DOM is reparented on detach. The panel keeps its place in the
   markup and only changes how it is positioned, so every listener,
   selector and id keeps working in both states.
   ──────────────────────────────────────────────────────────── */
.panel-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  user-select: none;
  flex: 0 0 auto;
}
.properties .panel-bar { padding: 7px 10px 7px 14px; margin-bottom: 10px; }
.toolbar .panel-bar { width: 100%; justify-content: center; padding: 2px 0 6px; margin-bottom: 4px; }
/* No room for a label in a 68px tool strip. */
.toolbar .panel-grip, .toolbar .panel-bar-title { display: none; }
.panel-grip { color: var(--ink-3, var(--ink-2)); font-size: 11px; line-height: 1; }
.panel-bar-title {
  flex: 1 1 auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.panel-collapse, .panel-detach, .panel-orient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--r-2);
  color: var(--ink-2);
  cursor: pointer;
  padding: 3px;
  line-height: 1;
  font-size: 13px;
}
.panel-collapse:hover, .panel-detach:hover, .panel-orient:hover { color: var(--accent); background: var(--surface-4, #26262F); }
/* Collapsing and re-orienting only mean anything once the panel floats. */
.panel-collapse, .panel-orient { display: none; }
.detached .panel-collapse, .toolbar.detached .panel-orient { display: inline-flex; }
.detached .panel-detach svg { transform: rotate(180deg); }
.toolbar.detached.horizontal .panel-orient svg { transform: rotate(90deg); }
/* Three buttons have to fit across a tool strip, so trim their spacing. */
.toolbar .panel-bar { gap: 2px; }
.toolbar .panel-collapse, .toolbar .panel-detach, .toolbar .panel-orient { padding: 2px; }

.toolbar.detached, .properties.detached {
  position: absolute;
  grid-area: auto;
  z-index: 46;
  margin: 0;
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-e3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.properties.detached { width: 306px; }
.toolbar.detached { width: 68px; padding: 4px 4px 0; }

/* Floating tools, laid out across instead of down. Mirrors the phone
   layout's horizontal strip, so the tools keep one familiar shape. */
.toolbar.detached.horizontal {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  width: 520px;
  height: auto;
  max-height: none;
  padding: 4px 0 4px 4px;
  overflow-x: auto;
  overflow-y: hidden;
}
.toolbar.detached.horizontal .panel-bar {
  position: sticky;
  left: 0;
  top: auto;
  align-self: stretch;
  border-bottom: none;
  border-right: 1px solid var(--line);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  width: auto;
  margin: 0 4px 0 0;
  padding: 0 5px 0 2px;
}
.toolbar.detached.horizontal .tool { flex: 0 0 auto; }
.toolbar.detached.horizontal::-webkit-scrollbar { height: 6px; width: 6px; }
/* Grabbing the strip to scroll it beats the tools' own pointer cursor. */
.toolbar.detached.scroll-dragging,
.toolbar.detached.scroll-dragging .tool { cursor: grabbing; }
.toolbar.detached.horizontal .tool-sep { flex: 0 0 auto; width: 1px; height: 22px; margin: 0 4px; }

/* Resize grip. Sticky rather than absolute so it stays pinned to the panel
   edge while the panel's own content scrolls behind it. */
.panel-resize { display: none; }
.detached .panel-resize {
  display: block;
  position: sticky;
  bottom: 0;
  z-index: 4;
  flex: 0 0 auto;
  height: 10px;
  margin-top: auto;
  background: var(--panel);
  cursor: ns-resize;
}
.detached .panel-resize::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin: 4px auto 0;
  border-radius: 2px;
  background: var(--line);
}
.detached .panel-resize:hover::after { background: var(--accent); }
.toolbar.detached.horizontal .panel-resize {
  position: sticky;
  right: 0;
  bottom: auto;
  height: auto;
  width: 10px;
  align-self: stretch;
  margin: 0 0 0 auto;
  cursor: ew-resize;
}
.toolbar.detached.horizontal .panel-resize::after {
  width: 2px;
  height: 28px;
  margin: auto 4px;
}
.panel-bar { cursor: default; }
.detached .panel-bar { cursor: grab; }
.detached.dragging .panel-bar { cursor: grabbing; }
/* Collapsed: only the bar is left, so the panel parks as a small chip. */
.detached.collapsed { max-height: none; overflow: hidden; }
.detached.collapsed > *:not(.panel-bar) { display: none; }
.detached.collapsed .panel-bar { border-bottom: none; margin-bottom: 0; border-radius: var(--radius-md); }

/* Hand the emptied column back to the canvas. Scoped above the phone
   breakpoint, where the layout is a single stacked column and floating a
   panel over it would only get in the way. */
@media (min-width: 721px) {
  .app.tools-detached { grid-template-columns: 0 1fr 322px; }
  .app.props-detached { grid-template-columns: 68px 1fr 0; }
  .app.tools-detached.props-detached { grid-template-columns: 0 1fr 0; }
}
@media (max-width: 720px) {
  .panel-detach { display: none; }
  .properties .panel-bar, .toolbar .panel-bar { display: none; }
}

/* Artboard groups in the navigator (2026-08-28). Each group is a headed
   block: click the header to frame the whole group, × to ungroup. Rows carry
   a tick box (visible on hover, or once ticked) for building up a set. */
.ab-nav-group {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ab-nav-group.active { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ab-nav-group-head { display: flex; align-items: center; gap: 2px; }
.ab-nav-group-name {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: var(--r-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  padding: 5px 6px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ab-nav-group-name:hover { color: var(--accent); background: var(--surface-4, #26262F); }
.ab-nav-group.active .ab-nav-group-name { color: var(--accent); }
.ab-nav-group-count {
  margin-left: auto;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.ab-nav-group-ungroup {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: var(--r-2);
}
.ab-nav-group-ungroup:hover { color: var(--danger); background: var(--surface-4, #26262F); }
.ab-nav-row { display: flex; align-items: center; gap: 2px; }
.ab-nav-row .ab-nav-item { flex: 1 1 auto; min-width: 0; }
.ab-nav-check {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--bg);
  font-size: 9px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
}
.ab-nav-row:hover .ab-nav-check,
.ab-nav-check:focus-visible { opacity: 1; }
.ab-nav-check.on {
  opacity: 1;
  background: var(--accent);
  border-color: var(--accent);
}
.ab-nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px 0;
  border-top: 1px solid var(--line);
}
.ab-nav-selcount { color: var(--ink-2); font-size: 11px; margin-right: auto; }
.ab-nav-actions button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
}
.ab-nav-actions button:hover { color: var(--accent); border-color: var(--accent); }
#ab-nav-group { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }


/* Framed-in-another-site notice (2026-09-20). Shown only when the editor is
   loaded inside someone else's iframe, e.g. a BuildHop directory preview. */
.framed-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 34px 6px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.4;
}
.framed-notice a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.framed-notice a:hover { color: var(--accent-hi); }
.framed-notice-close {
  position: absolute;
  right: 8px;
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}
.framed-notice-close:hover { color: var(--ink); }

/* SVG Lab MCP panel (2026-09-23; codeless 2026-09-26). Reuses .modal /
   .modal-card; follows the auth modal's type scale and the lime accent. */
.mcp-card { width: min(560px, 94vw); max-height: 92vh; overflow-y: auto; }
.mcp-lede { color: var(--ink-2); font-size: 13px; line-height: 1.55; margin: 0; }
.mcp-status { font-size: 12.5px; color: var(--ink-2); margin: 0; min-height: 1.2em; line-height: 1.4; }
.mcp-status.is-ok { color: var(--accent); }
.mcp-status.is-error { color: #E04444; }
.mcp-card h4 {
  margin: 0; font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.mcp-key-panel {
  display: block;
  padding: 12px 14px; border: 1px solid var(--line-soft, rgba(255,255,255,0.1));
  border-radius: 8px; background: var(--panel-2);
}
.mcp-key-panel > summary {
  cursor: pointer; font-size: 12.5px; color: var(--ink-2); list-style-position: inside;
}
.mcp-key-panel > summary:hover { color: var(--ink); }
.mcp-key-panel[open] > summary { color: var(--ink); }
.mcp-key-panel > * + *:not(summary) { margin-top: 10px; }
.mcp-key-intro { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.mcp-key-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mcp-key-meta { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); text-align: right; }
.mcp-key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mcp-primary, .mcp-secondary, .mcp-danger {
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mcp-primary { background: var(--accent); color: var(--accent-ink, #0B0B10); border: none; }
.mcp-primary:hover:not(:disabled) { filter: brightness(1.07); }
.mcp-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-soft, rgba(255,255,255,0.14)); }
.mcp-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mcp-danger { background: transparent; color: var(--ink-2); border: 1px solid var(--line-soft, rgba(255,255,255,0.14)); }
.mcp-danger:hover:not(:disabled) { border-color: #E04444; color: #ff6b6b; }
.mcp-key-note { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.mcp-request { margin: 0; }
.mcp-request a.mcp-primary { display: inline-block; text-decoration: none; }
/* 2026-09-26: the plans link leads, the early access request follows. */
.mcp-request { display: flex; flex-wrap: wrap; gap: 8px; }
.mcp-request a.mcp-secondary { display: inline-block; text-decoration: none; }
.mcp-copy-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-deep, #07070B);
}
.mcp-copy-row.is-block { align-items: flex-start; }
.mcp-copy-text {
  flex: 1; min-width: 0; margin: 0;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--ink);
  white-space: pre-wrap; word-break: break-all; user-select: all;
}
.mcp-copy-btn {
  flex: none; padding: 5px 10px; border-radius: 5px; font-size: 12px; cursor: pointer;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-soft, rgba(255,255,255,0.14));
}
.mcp-copy-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mcp-copy-btn.is-copied { border-color: var(--accent); color: var(--accent); }
.mcp-guide { display: flex; flex-direction: column; gap: 8px; }
.mcp-guide p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.mcp-guide a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
.mcp-guide a:hover { color: var(--accent); }

/* "Early access" / "Requested" badge on the account menu's MCP item
   (2026-09-24). The item itself keeps full contrast: it is an invitation,
   not a disabled row. */
#btn-mcp { gap: 8px; }  /* the menu's buttons are already centred flex rows */
.menu-badge {
  flex: none; padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600; line-height: 1.4; letter-spacing: 0.02em;
  color: var(--accent); background: var(--accent-soft, rgba(181, 255, 58, 0.14));
  border: 1px solid rgba(181, 255, 58, 0.28);
}
.menu-badge.is-requested {
  color: var(--ink-2); background: transparent; border-color: var(--line-soft, rgba(255,255,255,0.14));
}

/* Universal hidden override — comes last to beat class rules that set display. */
/* MCP modal: connected apps (OAuth grants, 2026-09-24) */
.mcp-conn { margin-top: 14px; }
.mcp-conn h4 { margin: 0 0 8px; }
.mcp-conn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mcp-conn-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line, rgba(255,255,255,0.08)); border-radius: 8px; }
.mcp-conn-list li span { min-width: 0; overflow-wrap: anywhere; }
/* One row per app (2026-10-21): name, how many connections, Show and Disconnect. */
.mcp-conn-list li.mcp-conn-app { flex-wrap: wrap; }
.mcp-conn-app > span:first-child { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mcp-conn-app b { font-weight: 600; font-size: 13.5px; }
.mcp-conn-meta { color: var(--ink-3, #8A8A99); font-size: 12px; }
.mcp-conn-btns { display: flex; gap: 6px; flex: none; }
.mcp-conn-sub { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: grid; gap: 4px; }
.mcp-conn-list .mcp-conn-sub li { border: 0; padding: 6px 4px 6px 10px; background: rgba(255, 255, 255, 0.03); font-size: 12px; color: var(--ink-2, #B8B8C4); }
.mcp-conn-sub[hidden] { display: none; }
.mcp-conn-empty { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* ────────────────────────────────────────────────────────────
   SVG Lab MCP invitation (2026-09-26)
   First onboarding panel, the account-menu pointer, and the menu item's
   "request early access" state. Scripts: app.js sections 28 and 38.
   ──────────────────────────────────────────────────────────── */
.onboarding-modal.is-mcp-step .onboarding-card { max-width: 520px; }
.onboarding-modal.is-mcp-step .onboarding-step { padding-top: 22px; gap: 12px; }
.onb-shots {
  display: flex; justify-content: center; align-items: flex-end; gap: 12px;
  height: 172px; margin: 0 -32px 6px; padding: 18px 32px 0;
  overflow: hidden; position: relative;
  background:
    radial-gradient(120% 90% at 50% 100%, rgba(181, 255, 58, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  border-bottom: 1px solid var(--line);
}
.onb-shot {
  flex: none; width: 92px; padding: 4px; border-radius: 16px;
  background: #1C1C24;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset, 0 18px 30px -16px rgba(0, 0, 0, 0.9);
  transform: translateY(18px);
}
.onb-shot:nth-child(2) { width: 104px; transform: translateY(4px); }
.onb-shot:nth-child(1) { transform: translateY(26px) rotate(-5deg); }
.onb-shot:nth-child(3) { transform: translateY(26px) rotate(5deg); }
.onb-shot img { display: block; width: 100%; height: auto; aspect-ratio: 780 / 1688; border-radius: 12px; background: #F4EFE6; }
.onboarding-step .onb-note { font-size: 11.5px; color: var(--ink-3); }
.onboarding-next.is-secondary {
  background: transparent; border-color: var(--line); color: var(--ink-2); font-weight: 500;
}
.onboarding-next.is-secondary:hover {
  background: transparent; border-color: var(--ink-3); color: var(--ink);
}
a.onboarding-request { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
a.onboarding-request:hover { color: var(--accent-ink); }
@media (max-width: 520px) {
  /* The editor is wider than a phone, so the page itself scrolls sideways;
     pin the modal to the screen width instead of the page width. */
  .onboarding-modal { right: auto; bottom: auto; width: 100vw; height: 100vh; height: 100dvh; }
  .onboarding-card { min-width: 0; width: calc(100vw - 32px); }
  .onboarding-step { padding: 26px 22px 12px; min-height: 0; }
  .onb-shots { margin: 0 -22px 4px; padding: 16px 22px 0; height: 150px; }
  .onb-shot { width: 80px; }
  .onb-shot:nth-child(2) { width: 90px; }
  .onboarding-footer { flex-wrap: wrap; padding: 12px 16px 14px; }
  .onboarding-modal.is-mcp-step .onboarding-nav { order: -1; width: 100%; flex-direction: column-reverse; }
  .onboarding-modal.is-mcp-step .onboarding-nav > * { justify-content: center; text-align: center; padding: 10px 14px; font-size: 13px; }
}

/* Account-menu pointer: a callout under the account button. */
.mcp-pointer {
  position: fixed; z-index: 90; width: 280px; max-width: calc(100vw - 24px);
  padding: 14px 14px 12px;
  background: var(--panel); color: var(--ink);
  border: 1px solid rgba(181, 255, 58, 0.7);
  border-radius: var(--r-3);
  box-shadow: 0 0 0 4px rgba(181, 255, 58, 0.08), var(--shadow-2);
  animation: mcp-pointer-in 360ms var(--ease-out) both;
}
.mcp-pointer::before {
  content: ""; position: absolute; top: -8px; left: calc(var(--arrow-x, 50%) - 7px);
  width: 14px; height: 14px; transform: rotate(45deg); border-top-left-radius: 3px;
  background: var(--panel);
  border-left: 1px solid rgba(181, 255, 58, 0.7); border-top: 1px solid rgba(181, 255, 58, 0.7);
}
.mcp-pointer-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.mcp-pointer-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; vertical-align: 1px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(181, 255, 58, 0.18);
}
.mcp-pointer-body { margin: 0 0 12px; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.mcp-pointer-actions { display: flex; gap: 8px; }
.mcp-pointer-actions button {
  font: inherit; font-size: 12px; padding: 6px 12px; border-radius: var(--r-2); cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
}
.mcp-pointer-actions .mcp-pointer-go { background: var(--accent); border-color: var(--accent); color: #0B0B10; font-weight: 600; }
.mcp-pointer-actions .mcp-pointer-go:hover { color: #0B0B10; filter: brightness(1.06); }
.mcp-pointer-actions .mcp-pointer-close:hover { color: var(--ink); border-color: var(--ink-3); }
@keyframes mcp-pointer-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mcp-pointer { animation: none; } }

/* ────────────────────────────────────────────────────────────
   After MCP early access (2026-09-27, from 2026-10-03 07:00 UTC).
   The first-run panel's connect steps and the "Connect your AI" chip under
   the account button. Scripts: app.js sections 28a, 28 and 38.
   ──────────────────────────────────────────────────────────── */
/* The three example screens are shown whole on this panel (owner, 2026-09-27):
   no crop, no offsets past the edge. Height follows the widths below; the
   source images are 780 x 1688, so they stay sharp when scaled down. */
.onboarding-modal.is-mcp-after .onb-shots {
  flex: none; height: auto; align-items: center; gap: 14px;
  padding: 16px 32px 14px;
}
.onboarding-modal.is-mcp-after .onb-shot { width: 72px; transform: rotate(-4deg); }
.onboarding-modal.is-mcp-after .onb-shot:nth-child(2) { width: 82px; transform: none; }
.onboarding-modal.is-mcp-after .onb-shot:nth-child(3) { transform: rotate(4deg); }
/* The connect panel is taller than the early access one: keep the footer on
   screen on short laptop screens (smaller screens, then scroll the text). */
.onboarding-modal.is-mcp-after .onboarding-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
.onboarding-modal.is-mcp-after .onboarding-step { min-height: 0; overflow-y: auto; }
.onboarding-modal.is-mcp-after .onboarding-footer { flex: none; }
@media (max-height: 820px) {
  .onboarding-modal.is-mcp-after .onb-shots { padding: 12px 32px 10px; gap: 12px; }
  .onboarding-modal.is-mcp-after .onb-shot { width: 50px; padding: 3px; border-radius: 11px; }
  .onboarding-modal.is-mcp-after .onb-shot:nth-child(2) { width: 56px; }
  .onboarding-modal.is-mcp-after .onb-shot img { border-radius: 8px; }
}
@media (max-height: 700px) {
  .onboarding-modal.is-mcp-after .onboarding-step { gap: 8px; padding-top: 16px; padding-bottom: 6px; }
  .onboarding-modal.is-mcp-after .onb-shots { padding: 8px 32px 8px; }
  .onboarding-modal.is-mcp-after .onb-shot { width: 46px; }
  .onboarding-modal.is-mcp-after .onb-shot:nth-child(2) { width: 52px; }
  .onboarding-step ol.onb-connect { gap: 6px; }
}
@media (max-width: 520px) {
  .onboarding-modal.is-mcp-after .onb-shots { padding: 14px 22px 12px; }
  .onboarding-modal.is-mcp-after .onb-shot { width: 62px; }
  .onboarding-modal.is-mcp-after .onb-shot:nth-child(2) { width: 70px; }
}
.onboarding-modal.is-mcp-after .onboarding-step { gap: 10px; }
.onboarding-modal.is-mcp-after .onboarding-step > p:not(.onb-note) { font-size: 13.5px; }
.onboarding-step ol.onb-connect {
  margin: 2px 0 0; padding: 0; list-style: none; counter-reset: onb-connect;
  display: flex; flex-direction: column; gap: 8px;
}
.onboarding-step ol.onb-connect > li {
  counter-increment: onb-connect;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; padding-left: 30px;
  color: var(--ink-2); font-size: 13px; line-height: 1.5;
}
.onboarding-step ol.onb-connect > li::before {
  content: counter(onb-connect);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: rgba(181, 255, 58, 0.10); border: 1px solid rgba(181, 255, 58, 0.3);
}
.onb-copy-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 10px; border: 1px solid var(--line-soft, rgba(255,255,255,0.14)); border-radius: var(--r-2);
  background: var(--bg-deep, #07070B);
}
.onb-copy-row code {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink);
  user-select: all; overflow-wrap: anywhere;
}
.onb-copy {
  flex: none; padding: 4px 10px; border-radius: 5px; font: inherit; font-size: 12px; cursor: pointer;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-soft, rgba(255,255,255,0.14));
}
.onb-copy:hover, .onb-copy.is-copied { border-color: var(--accent); color: var(--accent); }
.onboarding-step .onb-free { font-size: 12px; color: var(--ink-2); }
.onboarding-step .onb-free a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
.onboarding-step .onb-free a:hover { color: var(--accent); }


/* The menu item while the account can still apply, and its highlight when
   the pointer opens the menu. */
#user-menu-dropdown #btn-mcp { white-space: nowrap; }
#user-menu-dropdown #btn-mcp.is-invite { color: var(--accent); }
#user-menu-dropdown #btn-mcp.is-spotlight {
  background: rgba(181, 255, 58, 0.12);
  box-shadow: 0 0 0 1px rgba(181, 255, 58, 0.45) inset;
}

/* ────────────────────────────────────────────────────────────
   AI presence on artboard groups (2026-09-26). An AI assistant working
   through the MCP holds an artboard group: a coloured frame on the group's
   lasso and a pill with the client's name ("Claude", "Codex", ...), its
   current step and Pause / Stop. Colours are Okabe-Ito based and avoid the
   lime accent, amber selection and red lock; colour is never the only cue
   (slot 2 is dashed, slot 3 dotted, and the pill always names the client).
   ──────────────────────────────────────────────────────────── */
:root {
  --presence-1: #56B4E9; /* sky */
  --presence-2: #D98CC4; /* orchid */
  --presence-3: #A3A8FF; /* periwinkle */
  --presence-ink: #0B0B10;
}
#ai-presence .ai-presence-frame {
  fill: none;
  stroke: var(--presence-1);
  opacity: 0.55;
}
#ai-presence .ai-presence-frame.slot-2 { stroke: var(--presence-2); }
#ai-presence .ai-presence-frame.slot-3 { stroke: var(--presence-3); }
#ai-presence .ai-presence-frame.is-active { opacity: 0.8; }
/* One breath per AI step (app.js aiBreath), never a loop: a looping
   animation costs a style pass every frame (measured 2026-09-26). */
#ai-presence .ai-presence-frame.is-breathing { animation: ai-presence-breathe 2.4s ease-in-out 1 both; }
@keyframes ai-presence-breathe {
  0% { opacity: 0.55; }
  40% { opacity: 1; }
  100% { opacity: 0.8; }
}
#ai-presence .ai-pill { cursor: default; }
#ai-presence .ai-pill-bg { fill: var(--presence-1); }
#ai-presence .ai-pill.slot-2 .ai-pill-bg { fill: var(--presence-2); }
#ai-presence .ai-pill.slot-3 .ai-pill-bg { fill: var(--presence-3); }
#ai-presence .ai-pill.is-ended .ai-pill-bg {
  fill: var(--surface-3, #1E1E26);
  stroke: var(--presence-1);
  stroke-width: 1;
}
#ai-presence .ai-pill.slot-2.is-ended .ai-pill-bg { stroke: var(--presence-2); }
#ai-presence .ai-pill.slot-3.is-ended .ai-pill-bg { stroke: var(--presence-3); }
#ai-presence .ai-pill-text {
  fill: var(--presence-ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  -webkit-user-select: none;
  user-select: none;
}
#ai-presence .ai-pill-name { font-weight: 650; }
#ai-presence .ai-pill.is-ended .ai-pill-text { fill: var(--ink, #EDEDF0); }
#ai-presence .ai-pill-dot { fill: var(--presence-ink); }
#ai-presence .ai-pill-dot.is-breathing { animation: ai-presence-pulse 1.2s ease-in-out 2; }
#ai-presence .ai-pill.is-idle .ai-pill-dot { opacity: 0.45; }
@keyframes ai-presence-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
#ai-presence .ai-pill-btn { cursor: pointer; outline: none; }
#ai-presence .ai-pill-btn rect { fill: rgba(11, 11, 16, 0.14); transition: fill var(--t-fast, 120ms) ease-out; }
#ai-presence .ai-pill-btn:hover rect,
#ai-presence .ai-pill-btn:focus-visible rect { fill: rgba(11, 11, 16, 0.28); }
#ai-presence .ai-pill-btn:focus-visible rect { stroke: var(--presence-ink); stroke-width: 1.5; }
#ai-presence .ai-pill.is-ended .ai-pill-btn rect { fill: rgba(237, 237, 240, 0.1); }
#ai-presence .ai-pill-btn text {
  fill: var(--presence-ink);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 650;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
#ai-presence .ai-pill.is-ended .ai-pill-btn text { fill: var(--ink, #EDEDF0); }
#overlay .ab-frame.ai-held { stroke: var(--presence-1); }
.ab-nav-item .ab-nav-ai {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--presence-1);
}
.ab-nav-item .ab-nav-ai.slot-2 { color: var(--presence-2); }
.ab-nav-item .ab-nav-ai.slot-3 { color: var(--presence-3); }
.ab-nav-item .ab-nav-ai svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}
.ab-nav-item.ai-held { box-shadow: inset 3px 0 0 var(--presence-1); }
.ab-nav-group-name.ai-held::after { content: " \2022 AI"; color: var(--presence-1); font-weight: 600; }
.ab-nav-group-ungroup:disabled { opacity: 0.3; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  #ai-presence .ai-presence-frame.is-breathing,
  #ai-presence .ai-pill-dot.is-breathing { animation: none; }
}

/* Watch mode (2026-09-26): while an AI assistant designs in this project,
   this tab only watches its artboards. One calm line at the top of the
   canvas, with Take over and Pause. */
.ai-watch-banner {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: rgba(11, 11, 16, 0.86);
  border: 1px solid var(--presence-1);
  color: var(--ink, #EDEDF0);
  font-family: var(--font-sans);
  font-size: 12.5px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.ai-watch-banner.slot-2 { border-color: var(--presence-2); }
.ai-watch-banner.slot-3 { border-color: var(--presence-3); }
.ai-watch-banner .ai-watch-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--presence-1);
}
.ai-watch-banner .ai-watch-dot.is-breathing { animation: ai-presence-pulse 1.2s ease-in-out 2; }
.ai-watch-banner.slot-2 .ai-watch-dot { background: var(--presence-2); }
.ai-watch-banner.slot-3 .ai-watch-dot { background: var(--presence-3); }
.ai-watch-banner .ai-watch-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-watch-banner .ai-watch-btn {
  flex: 0 0 auto;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(237, 237, 240, 0.18);
  background: rgba(237, 237, 240, 0.08);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ai-watch-banner .ai-watch-btn:hover,
.ai-watch-banner .ai-watch-btn:focus-visible { background: rgba(237, 237, 240, 0.16); outline: none; border-color: var(--presence-1); }
@media (prefers-reduced-motion: reduce) {
  .ai-watch-banner .ai-watch-dot.is-breathing { animation: none; }
}

/* Live watching (2026-10-15): the AI's cursor, what it is doing, and a feed
   of its last steps, while this tab watches (app.js section 41, live
   watching). The cursor moves with a transition; arrivals fade in. */
.ai-live-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 29;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  --ai-live-c: var(--presence-1);
}
.ai-live-cursor.slot-2 { --ai-live-c: var(--presence-2); }
.ai-live-cursor.slot-3 { --ai-live-c: var(--presence-3); }
.ai-live-cursor .ai-live-arrow { display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.ai-live-cursor .ai-live-arrow path { fill: var(--ai-live-c); stroke: #0B0B10; stroke-width: 1.2; stroke-linejoin: round; }
.ai-live-cursor .ai-live-tag {
  position: absolute;
  left: 16px;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--ai-live-c);
  color: #0B0B10;
  font-family: var(--font-sans);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.ai-live-cursor .ai-live-name { font-weight: 700; }
.ai-live-cursor .ai-live-what { opacity: 0.85; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.ai-live-cursor.is-thinking .ai-live-arrow { animation: ai-live-bob 1.6s ease-in-out infinite; }
@keyframes ai-live-bob { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(2px, -4px); } }
/* Opacity only: a CSS transform would replace a rotated shape's own transform attribute while it plays. */
#content .ai-live-arrive { animation: ai-live-arrive 0.7s ease-out; }
/* Only a start: it fades to the shape's own opacity (a ghost word stays faint). */
@keyframes ai-live-arrive { from { opacity: 0; } }
/* The build replay (2026-10-16): a new piece waits hidden until the cursor draws it; !important wins over the arrive animation. */
#content .ai-live-pending { opacity: 0 !important; }
.ai-live-flash {
  position: absolute;
  z-index: 28;
  pointer-events: none;
  border: 2px solid var(--presence-1);
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(86, 180, 233, 0.18);
  animation: ai-live-flash 1.3s ease-out forwards;
}
@keyframes ai-live-flash { 0% { opacity: 0; transform: scale(1.04); } 15% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.ai-live-feed {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 30;
  width: 290px;
  max-width: calc(100% - 32px);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(11, 11, 16, 0.9);
  border: 1px solid var(--presence-1);
  color: var(--ink, #EDEDF0);
  font-family: var(--font-sans);
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ai-live-feed.is-dragging { cursor: grabbing; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); }
.ai-live-feed.slot-2 { border-color: var(--presence-2); }
.ai-live-feed.slot-3 { border-color: var(--presence-3); }
.ai-live-feed .ai-live-head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ai-live-feed .ai-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--presence-1); animation: ai-presence-pulse 1.4s ease-in-out infinite; }
.ai-live-feed .ai-live-title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-live-feed .ai-live-time { font-variant-numeric: tabular-nums; opacity: 0.7; font-weight: 500; }
.ai-live-feed .ai-live-progress { margin: 4px 0 8px 16px; opacity: 0.75; }
.ai-live-feed .ai-live-steps { list-style: none; margin: 0; padding: 0 0 0 16px; display: grid; gap: 4px; }
.ai-live-feed .ai-live-steps li { display: flex; justify-content: space-between; gap: 8px; opacity: 0.6; }
.ai-live-feed .ai-live-steps li:first-child { opacity: 1; }
.ai-live-feed .ai-live-ago { opacity: 0.6; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.ai-live-feed .ai-live-empty { font-style: italic; }
.ai-live-feed .ai-live-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-left: 16px; }
.ai-live-feed .ai-live-follow { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ai-live-feed .ai-live-hide { padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(237, 237, 240, 0.18); background: rgba(237, 237, 240, 0.08); color: inherit; font: inherit; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .ai-live-cursor { transition: none; }
  .ai-live-cursor.is-thinking .ai-live-arrow, #content .ai-live-arrive, .ai-live-feed .ai-live-dot { animation: none; }
  .ai-live-flash { animation: ai-live-flash-still 1.3s linear forwards; }
  @keyframes ai-live-flash-still { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
}
@media (max-width: 640px) { .ai-live-feed { width: calc(100% - 32px); } }
/* Light mode (2026-10-30, seen in ChatGPT's light side panel): the banner and
   the live feed kept their dark glass while --ink turned dark, so their words
   were dark on dark. They take the light panel instead. */
html.theme-light .ai-watch-banner,
html.theme-light .ai-live-feed { background: rgba(255, 255, 255, 0.94); color: #1A1A22; box-shadow: 0 6px 24px rgba(20, 20, 27, 0.14); }
html.theme-light .ai-live-feed.is-dragging { box-shadow: 0 16px 40px rgba(20, 20, 27, 0.22); }
html.theme-light .ai-watch-banner .ai-watch-btn,
html.theme-light .ai-live-feed .ai-live-hide { border-color: rgba(20, 20, 27, 0.16); background: rgba(20, 20, 27, 0.05); }
html.theme-light .ai-watch-banner .ai-watch-btn:hover,
html.theme-light .ai-watch-banner .ai-watch-btn:focus-visible { background: rgba(20, 20, 27, 0.1); }

/* The presence overlay: its own layer above the canvas (see app.js
   aiPresenceLayer). Only the pills take the pointer. */
.ai-presence-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 5;
  will-change: transform;
  contain: strict;
}
.ai-presence-svg .ai-pill { pointer-events: all; }
.ai-presence-svg .ai-presence-frame { pointer-events: none; }

/* The size menu's phone and foldable names ("Galaxy Z Fold 7, open") are
   long; the closed menu stays compact so the artboard bar keeps one row on
   a 1440 px laptop (the open list still shows full names). */
#doc-preset { max-width: 116px; text-overflow: ellipsis; }

/* ===== Prototype mode (SVG-46, 2026-10-10) =====
   A workspace for app screens, in a vibe coder's words: screens, taps, goes
   to, back, play. Design tools step aside while it is on. */
.mode-switch { display: inline-flex; padding: 2px; border-radius: var(--r-pill); background: var(--panel-sunken); border: 1px solid var(--line-soft); }
/* The switch is the right panel's title (owner, 15 Oct: tabs on the panel,
   like Figma, so the top bar never wraps); Play and Share sit under it. */
.properties .panel-bar .panel-bar-title { display: none; }
.properties .panel-bar .mode-switch { flex: 1 1 auto; display: flex; }
.properties .panel-bar .mode-switch button { flex: 1 1 0; justify-content: center; }
/* A link the agent just made draws itself in from the part to its screen (owner's fifth agent test, 7 Nov 2026). */
.proto-link-draw { animation: proto-link-draw 0.6s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes proto-link-draw { from { stroke-dashoffset: var(--proto-len); } to { stroke-dashoffset: 0; } }
.proto-link-fade, .proto-link-pop { animation: proto-link-pop 0.3s ease-out both; }
@keyframes proto-link-pop { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .proto-link-draw, .proto-link-fade, .proto-link-pop { animation: none; } }
.proto-panel-actions { display: flex; gap: 6px; padding: 0 12px 10px; }
.proto-panel-actions > button { flex: 1 1 0; }
.proto-panel-actions:not(:has(> :not([hidden]))) { display: none; }
.properties.detached.collapsed .proto-panel-actions { display: none; }
/* The Prototype card (the right column) and the zoom bar move clear of the
   agent panel when it is docked on the right (owner's fifth video, R18).
   app.js (protoClearOfAgent) sets html.agp-docked-r and --agp-clear-r. */
@media (min-width: 721px) {
  html.ui-v2.agp-docked-r .properties:not(.ui2-floating) { right: var(--agp-clear-r, 10px); }
  html.ui-v2.agp-docked-r .zoom-pill { right: max(var(--ui2-inset-r, 10px), var(--agp-clear-r, 10px)); }
}
.mode-switch button { border: 0; background: transparent; color: var(--ink); opacity: 0.7; padding: 4px 10px; border-radius: var(--r-pill); font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.mode-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); opacity: 1; font-weight: 600; }
.mode-count { min-width: 16px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--ink); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.mode-switch button[aria-pressed="true"] .mode-count { background: var(--accent-ink); color: var(--accent); }
.proto-play-top { border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; cursor: pointer; }
/* Play names its screen (C1, C2) in two lines at most, cut, the whole name on a hover (M113, 8 Nov: three lines). */
.proto-panel-actions > #proto-play-top { flex: 2 1 auto; min-width: 0; white-space: normal; line-height: 1.2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-align: center; padding: 0 12px; border: solid transparent; border-width: 5px 0; max-height: calc(2.4em + 10px); } /* r4 M113: the border, not padding, keeps a third line from peeking under the clamp */
.proto-panel-actions > #proto-play-start { flex: 0 0 auto; white-space: nowrap; }
.proto-play-top:hover { background: var(--accent-hi); }
/* Prototype mode (SVG-46, owner design 11 Oct): the drawing is locked, the
   right panel is the animation presets, the left toolbar keeps Select and
   Hand. Selection chrome is drawn by #proto-layer, so #overlay (resize and
   rotate handles) is hidden. */
body.proto-mode .properties .prop-group:not(.proto-group) { display: none; }
body.proto-mode .toolbar .tool:not([data-tool="select"]):not([data-tool="hand"]),
body.proto-mode .toolbar .tool-sep,
body.proto-mode .toolbar > :not(.tool):not(.panel-bar) { display: none; }
body.proto-mode .canvas-controls > :not(#btn-undo):not(#btn-redo) { display: none; }
body.proto-mode #overlay { display: none; }
.proto-handle { cursor: crosshair; }
.proto-arrow-hit, .proto-arrow-core, .proto-chip-hit { cursor: pointer; }
/* On a screen the design takes the click beside a line (18 Oct); right on
   the line (its narrow core) the line takes it (B1, 24 Oct). */
.proto-arrows-inert .proto-arrow-hit { pointer-events: none; }
.proto-line-tip { position: absolute; z-index: 46; max-width: 320px; padding: 5px 9px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); color: var(--ink); font-size: 12px; line-height: 1.35; pointer-events: none; white-space: normal; }
.proto-group #proto-body { display: flex; flex-direction: column; gap: 10px; font-size: 12px; }
.proto-head .proto-title { font-size: 14px; font-weight: 700; }
.proto-head .proto-sub { opacity: 0.6; margin-top: 2px; }
.proto-label { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; opacity: 0.7; margin-bottom: 6px; }
.proto-note, .proto-count, .proto-link { opacity: 0.85; line-height: 1.45; }
.proto-note { opacity: 0.55; font-size: 11px; }
.proto-steps { margin: 0; padding-left: 18px; line-height: 1.5; opacity: 0.85; display: flex; flex-direction: column; gap: 3px; }
.proto-start { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proto-start select { flex: 1; min-width: 0; background: var(--panel-sunken); color: var(--ink); border: 1px solid var(--line-soft); border-radius: 6px; padding: 4px 6px; font: inherit; }
/* "After a while..." (D5): the screen in view goes on by itself. */
.proto-moveon { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 6px; }
.proto-moveon .proto-label { margin: 0; }
.proto-moveon-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.proto-moveon-line > span { flex: 0 0 auto; opacity: 0.8; }
.proto-moveon-line select { flex: 1; min-width: 0; background: var(--panel-sunken); color: var(--ink); border: 1px solid var(--line-soft); border-radius: 6px; padding: 4px 6px; font: inherit; }
.proto-moveon .proto-hows { margin: 0; }
.proto-player-note .proto-note-btn { margin-left: 6px; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; padding: 2px 8px; cursor: pointer; }
.proto-group button[data-act]:not(.proto-play-part) { border: 0; background: none; color: var(--accent); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.proto-play-part { border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 12px; cursor: pointer; align-self: flex-start; }
.proto-play-part:hover { background: var(--accent-hi); }
.proto-link strong { color: var(--accent); }
.proto-dot-icon { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); background: #0B0B10; vertical-align: -1px; }
.proto-warn { padding: 8px; border-radius: 8px; line-height: 1.45; background: var(--danger-soft); border: 1px solid var(--danger); }
.proto-dim { opacity: 0.45; }
.proto-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.proto-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px 6px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; }
.proto-card:hover { border-color: var(--accent-soft); }
.proto-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.proto-card.is-none .proto-card-name { opacity: 0.6; }
/* "It becomes…" cards say what they do in a second line (F2, slice 6). */
.proto-card-name small { display: block; font-size: 10px; font-weight: 400; opacity: 0.72; }
/* What a tile does, before it is applied (F5, slice 5: "Throws it away to the left"). */
.proto-card-does { font-size: 11px; line-height: 1.2; color: var(--ink-dim, var(--ink)); opacity: 0.75; text-align: center; padding: 0 3px; }
.proto-app-miss { display: block; margin-top: 4px; font-size: 11px; line-height: 1.35; color: var(--ink); opacity: 0.85; }
.proto-app-miss .proto-link-btn { margin-left: 4px; }
/* Each card shows its effect on a small button, over and over, so people
   pick by watching rather than by name. */
.proto-demo { position: relative; width: 52px; height: 30px; display: flex; align-items: center; justify-content: center; }
.proto-demo-btn { display: flex; align-items: center; justify-content: center; width: 38px; height: 15px; border-radius: 8px; background: #8E9AAF; color: #fff; font-size: 11px; line-height: 1; position: relative; overflow: visible; }
.proto-card[aria-pressed="true"] .proto-demo-btn { background: var(--accent); color: var(--accent-ink); }
.proto-demo i { position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -2px 0 0 -5px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25); opacity: 0; animation: proto-finger 2.2s infinite; pointer-events: none; }
@keyframes proto-finger { 0%, 12% { opacity: 0; transform: scale(1.4); } 20%, 36% { opacity: 1; transform: scale(1); } 46%, 100% { opacity: 0; transform: scale(1); } }
.fx-tap-press { animation: proto-d-press 2.2s infinite; }
@keyframes proto-d-press { 0%, 18%, 42%, 100% { transform: none; } 22%, 38% { transform: translateY(1.5px) scale(0.93); } }
.fx-tap-squish { animation: proto-d-squish 2.2s infinite; }
@keyframes proto-d-squish { 0%, 18%, 62%, 100% { transform: none; } 24%, 38% { transform: scale(0.82); } 47% { transform: scale(1.08); } 55% { transform: scale(0.97); } }
.fx-tap-dim { animation: proto-d-dim 2.2s infinite; }
@keyframes proto-d-dim { 0%, 18%, 48%, 100% { opacity: 1; } 22%, 38% { opacity: 0.4; } }
.fx-tap-ripple { overflow: hidden; }
.fx-tap-ripple::after { content: ""; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); transform: scale(0); opacity: 0; animation: proto-d-ripple 2.2s infinite; }
@keyframes proto-d-ripple { 0%, 20% { transform: scale(0); opacity: 0; } 22% { opacity: 0.7; } 60% { transform: scale(1.3); opacity: 0; } 100% { opacity: 0; } }
.fx-tap-pop { animation: proto-d-pop 2.2s infinite; }
@keyframes proto-d-pop { 0%, 18%, 62%, 100% { transform: none; } 24%, 36% { transform: scale(0.94); } 46% { transform: scale(1.2); } }
.fx-tap-bounce { animation: proto-d-bounce 2.2s infinite; }
@keyframes proto-d-bounce { 0%, 40%, 54%, 66%, 100% { transform: none; } 24%, 36% { transform: scale(0.96); } 47% { transform: translateY(-7px); } 60% { transform: translateY(-2.5px); } }
.fx-tap-wiggle { animation: proto-d-wiggle 2.2s infinite; }
@keyframes proto-d-wiggle { 0%, 40%, 70%, 100% { transform: none; } 45% { transform: rotate(-9deg); } 51% { transform: rotate(8deg); } 57% { transform: rotate(-5deg); } 63% { transform: rotate(3deg); } }
/* Looping previews only move or fade (tests/idle-animations): the glow,
   the lift's shadow, the like's red and the blur are static layers whose
   opacity is what animates. */
.fx-tap-glow::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 10px 3px rgba(181, 255, 58, 0.9); opacity: 0; animation: proto-d-glow 2.2s infinite; }
@keyframes proto-d-glow { 0%, 38%, 80%, 100% { opacity: 0; } 55% { opacity: 1; } }
.fx-tap-like { width: 22px; height: 22px; border-radius: 50%; background: transparent !important; color: #8E9AAF !important; font-size: 17px; animation: proto-d-like 2.2s infinite; }
.fx-tap-like::after { content: "\2665"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #e5484d; opacity: 0; animation: proto-d-like-red 2.2s infinite; }
@keyframes proto-d-like { 0%, 38% { transform: none; } 24%, 34% { transform: scale(0.85); } 44% { transform: scale(1.35); } 56%, 100% { transform: none; } }
@keyframes proto-d-like-red { 0%, 40% { opacity: 0; } 44%, 92% { opacity: 1; } 100% { opacity: 0; } }
.fx-tap-lift { animation: proto-d-lift 2.2s infinite; }
.fx-tap-lift::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35); opacity: 0; animation: proto-d-lift-shadow 2.2s infinite; }
@keyframes proto-d-lift { 0%, 15%, 75%, 100% { transform: none; } 28%, 62% { transform: translateY(-3px) scale(1.05); } }
@keyframes proto-d-lift-shadow { 0%, 15%, 75%, 100% { opacity: 0; } 28%, 62% { opacity: 1; } }
.fx-tap-none, .fx-open-none, .fx-always-none { opacity: 0.55; }
/* Entrances: hidden, arrive, stay, then fade for the next round. */
.fx-open-fadeIn { animation: proto-o-fade 2.4s infinite; }
@keyframes proto-o-fade { 0%, 12% { opacity: 0; } 34%, 88% { opacity: 1; } 100% { opacity: 0; } }
.fx-open-slideUp { animation: proto-o-up 2.4s infinite; }
@keyframes proto-o-up { 0%, 12% { opacity: 0; transform: translateY(10px); } 34%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
.fx-open-slideIn { animation: proto-o-in 2.4s infinite; }
@keyframes proto-o-in { 0%, 12% { opacity: 0; transform: translateX(14px); } 34%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
.fx-open-popIn { animation: proto-o-pop 2.4s infinite; }
@keyframes proto-o-pop { 0%, 12% { opacity: 0; transform: scale(0.5); } 28% { opacity: 1; transform: scale(1.1); } 36%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.fx-open-dropIn { animation: proto-o-drop 2.4s infinite; }
@keyframes proto-o-drop { 0%, 12% { opacity: 0; transform: translateY(-12px); } 28% { opacity: 1; transform: translateY(2px); } 36%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.fx-open-zoomIn { animation: proto-o-zoom 2.4s infinite; }
@keyframes proto-o-zoom { 0%, 12% { opacity: 0; transform: scale(1.5); } 34%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.fx-open-bounceIn { animation: proto-o-bounce 2.4s infinite; }
@keyframes proto-o-bounce { 0%, 12% { opacity: 0; transform: scale(0.3); } 24% { opacity: 1; transform: scale(1.15); } 30% { transform: scale(0.92); } 38%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
/* Chart entrances (18 Oct): a small line chart draws itself (a cover slides
   off it), bars rise, a dot travels along the line. Transform and opacity only. */
.proto-demo-chart .pd-line { position: absolute; left: 6px; top: 5px; width: 40px; height: 20px; overflow: visible; }
.proto-demo-chart .pd-line polyline { fill: none; stroke: #8E9AAF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.proto-card[aria-pressed="true"] .proto-demo-chart .pd-line polyline { stroke: var(--accent); }
.proto-demo-chart .pd-cover { position: absolute; left: 4px; top: 2px; width: 46px; height: 26px; background: var(--panel-sunken); transform-origin: right center; animation: proto-o-cover 2.4s infinite; }
@keyframes proto-o-cover { 0%, 10% { transform: scaleX(1); opacity: 1; } 50%, 88% { transform: scaleX(0); opacity: 1; } 89% { transform: scaleX(0); opacity: 0; } 90%, 100% { transform: scaleX(1); opacity: 0; } }
.proto-demo-chart .pd-dot { position: absolute; left: 5px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #8E9AAF; animation: proto-o-follow 2.4s infinite; }
.proto-card[aria-pressed="true"] .proto-demo-chart .pd-dot { box-shadow: 0 0 0 2px var(--accent); }
@keyframes proto-o-follow { 0%, 10% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 21.6% { transform: translate(10px, -7px); } 30.6% { transform: translate(19px, -4px); } 42% { transform: translate(28px, -12px); } 50%, 88% { transform: translate(36px, -9px); opacity: 1; } 100% { transform: translate(36px, -9px); opacity: 0; } }
.pd-bars { align-items: flex-end; gap: 3px; padding-bottom: 5px; box-sizing: border-box; }
.pd-bars b { width: 6px; border-radius: 2px 2px 0 0; background: #8E9AAF; transform-origin: center bottom; animation: proto-o-grow 2.4s infinite; }
.proto-card[aria-pressed="true"] .pd-bars b { background: var(--accent); }
.pd-bars b:nth-child(1) { height: 10px; } .pd-bars b:nth-child(2) { height: 16px; animation-delay: 0.1s; } .pd-bars b:nth-child(3) { height: 8px; animation-delay: 0.2s; } .pd-bars b:nth-child(4) { height: 20px; animation-delay: 0.3s; }
@keyframes proto-o-grow { 0%, 10% { transform: scaleY(0); opacity: 1; } 34%, 88% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
/* "When this screen opens" (18 Oct): the screen's entrances, in order. */
.proto-order { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--panel-sunken); border: 1px solid var(--line-soft); }
.proto-order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proto-order-head .proto-label { margin: 0; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
/* M113: the heading stays one line, cut, the whole name on a hover; the button stays inside the card. */
.proto-order-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-order-head .proto-order-here { flex: none; }
.proto-incoming > .proto-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-group button.proto-order-here[data-act], .proto-group button.proto-order-play[data-act] { border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 11px; font-weight: 700; padding: 4px 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.proto-group button.proto-order-here[data-act]:hover, .proto-group button.proto-order-play[data-act]:hover { background: var(--accent-hi); }
.proto-order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.proto-order-item { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); cursor: grab; }
.proto-order-item.is-over { border-color: var(--accent); }
.proto-order-item.is-dragging { opacity: 0.5; }
.proto-order-grip { opacity: 0.45; font-size: 13px; line-height: 1; }
.proto-order-n { min-width: 16px; height: 16px; border-radius: 50%; background: var(--line-faint); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.proto-group .proto-order-name { min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; text-align: left; padding: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-order-name span { display: block; font-weight: 400; font-size: 10px; opacity: 0.6; overflow: hidden; text-overflow: ellipsis; }
.proto-order-moves { display: inline-flex; gap: 2px; }
/* Each row's wait and real start (F13, 24 Oct), on the line of its effects. */
.proto-order-time { font-style: normal; }
.proto-order-time.is-waiting { font-weight: 700; }
.proto-group .proto-order-moves button { border: 0; border-radius: 5px; background: var(--panel-sunken); color: var(--ink); font-size: 9px; line-height: 1; padding: 4px 5px; cursor: pointer; }
.proto-group .proto-order-moves button:disabled { opacity: 0.3; cursor: default; }
.proto-group .proto-order-moves button:not(:disabled):hover { box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.proto-order-when { grid-column: 1 / -1; display: flex; gap: 3px; padding: 2px; border-radius: 7px; background: var(--panel-sunken); }
.proto-group .proto-order-when button { flex: 1; min-width: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; font-size: 10px; padding: 3px 2px; cursor: pointer; opacity: 0.75; white-space: nowrap; }
.proto-group .proto-order-when button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); opacity: 1; font-weight: 700; }
.proto-order-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.proto-order-back { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; opacity: 0.8; cursor: pointer; }
/* Which openings play the entrances (C5, slice 8): its own line under the box. */
.proto-order-back-says { flex-basis: 100%; font-size: 11px; opacity: 0.6; }
.proto-incoming { margin: 8px 0 4px; }
.proto-incoming-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.proto-incoming-list .proto-order-name { width: 100%; }
.proto-arrows-hide { margin-top: 6px; }
.proto-arrows-hide span { opacity: 0.65; }
.fx-always-pulse { animation: proto-a-pulse 1.1s ease-in-out infinite; }
@keyframes proto-a-pulse { 50% { transform: scale(1.12); } }
.fx-always-breathe { animation: proto-a-breathe 2.6s ease-in-out infinite; }
@keyframes proto-a-breathe { 50% { transform: scale(1.05); opacity: 0.75; } }
.fx-always-float { animation: proto-a-float 2.4s ease-in-out infinite; }
@keyframes proto-a-float { 50% { transform: translateY(-4px); } }
.fx-always-spin { width: 18px; height: 18px; border-radius: 50%; background: transparent !important; border: 3px solid #8E9AAF; border-top-color: transparent; animation: proto-a-spin 1.2s linear infinite; }
.proto-card[aria-pressed="true"] .fx-always-spin { border-color: var(--accent); border-top-color: transparent; }
@keyframes proto-a-spin { to { transform: rotate(360deg); } }
.fx-always-blink { animation: proto-a-blink 1.4s ease-in-out infinite; }
@keyframes proto-a-blink { 50% { opacity: 0.25; } }
/* The effect being tried, laid over the part on the canvas. */
.proto-trial { position: absolute; z-index: 5; pointer-events: none; overflow: visible; }
.proto-trial > svg { display: block; overflow: visible; }
/* A tap played in a phone over the canvas (C6): the canvas never moves. */
.proto-lp { position: absolute; z-index: 44; right: 16px; top: 56px; display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 12px; border-radius: 24px; background: #0d0e12; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08); max-width: calc(100% - 32px); }
.proto-lp-bar { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink); font-size: 12px; }
/* M117: the title wraps to a second line rather than cut the state's name. */
.proto-lp-title { flex: 1; min-width: 0; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.proto-lp-bar button { flex: none; border: 1px solid var(--line-soft); background: var(--panel); color: var(--ink); border-radius: var(--r-pill); padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.proto-lp-bar button[data-lp="again"] { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.proto-lp-stage { position: relative; overflow: hidden; border-radius: 18px; background: #fff; align-self: center; }
.proto-lp-stage > svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.proto-chip { position: absolute; z-index: 6; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; padding: 5px 11px; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); white-space: nowrap; }
.proto-chip:hover { background: var(--accent-hi); }
.proto-chip span { font-weight: 600; }
.proto-chip.is-away { opacity: 0; pointer-events: none; }
/* 20 Oct: a small square button just outside the part's corner; it plays
   the part's own animation only, and never covers the part. */
.proto-chip.is-dot { width: 22px; height: 22px; padding: 0; gap: 0; justify-content: center; border-radius: 6px; font-size: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 1.5px #0B0B10; }
.proto-play-row { display: flex; flex-wrap: wrap; gap: 6px; }
.proto-group button.proto-play-go { background: transparent; color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.proto-group button.proto-play-go:hover { background: var(--accent-soft); }
.proto-order-mini { font-size: 12px; line-height: 1.45; opacity: 0.9; }
.proto-order-sub { font-size: 11px; opacity: 0.7; line-height: 1.4; }
.proto-order.is-flash { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow 0.3s; }
/* Part records (2026-10-17): the way into a part, and its pieces. */
.proto-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 11px; opacity: 0.85; }
.proto-crumbs button { border: 0; background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.proto-crumbs button:hover { box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.proto-crumbs span { opacity: 0.5; }
.proto-pieces { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.proto-pieces button { border: 0; background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; border-radius: 6px; padding: 3px 8px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-pieces button:hover { box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.proto-pieces button[data-piece-part] { font-weight: 700; }
.proto-back-pill { position: absolute; z-index: 6; left: 14px; top: 14px; border: 1px solid var(--line-soft); border-radius: var(--r-pill); background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 13px; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.proto-back-pill:hover { border-color: var(--accent); }
.proto-pop { position: absolute; z-index: 45; min-width: 200px; max-width: 280px; max-height: min(70vh, 560px); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); color: var(--ink); font-size: 12px; }
.proto-pop > button { display: flex; justify-content: space-between; gap: 10px; border: 0; border-radius: 6px; background: var(--panel-sunken); color: var(--ink); font: inherit; text-align: left; padding: 7px 9px; cursor: pointer; }
.proto-pop > button:hover { box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.proto-pop > button span { opacity: 0.6; }
.proto-pop .proto-pop-danger { color: #FF6B6B; }
.proto-pop-title { font-weight: 700; margin-bottom: 4px; white-space: normal; overflow-wrap: anywhere; }
/* "Goes to…" (B4): a search and every screen with its picture. */
.proto-pop.proto-pop-pick { width: 300px; max-width: 300px; max-height: min(78vh, 620px); overflow: hidden; }
.proto-pick-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; flex: 1; padding-right: 2px; }
.proto-pick-list > button { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 6px; background: var(--panel-sunken); color: var(--ink); font: inherit; text-align: left; padding: 5px 8px; cursor: pointer; }
.proto-pick-list > button:hover, .proto-pick-list > button:focus-visible { box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.proto-pick-list > button[hidden] { display: none; }
.proto-pick-list > button span { opacity: 1; }
.proto-pick-list > button.is-now { box-shadow: 0 0 0 1px var(--accent) inset; }
.proto-pick-sub { margin-left: 18px; }
.proto-pick-thumb { flex: none; width: 30px; height: 52px; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.proto-pick-thumb > svg { display: block; width: 100%; height: 100%; }
.proto-pick-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.proto-pick-name small { font-size: 11px; opacity: 0.65; }
.proto-pop-note { font-size: 11px; opacity: 0.65; }
.proto-undo { pointer-events: auto; margin-left: 6px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; padding: 2px 10px; cursor: pointer; }
.proto-pop-label { opacity: 0.65; font-size: 11px; }
.proto-pop-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 4px; }
.proto-change { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; padding: 7px 2px 5px; cursor: pointer; }
.proto-change[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.proto-change-demo { position: relative; width: 34px; height: 22px; border-radius: 4px; background: #3a3f4b; overflow: hidden; }
.proto-change-demo b { position: absolute; inset: 0; background: #8E9AAF; }
.proto-change-slide b { animation: proto-c-slide 1.8s infinite; }
@keyframes proto-c-slide { 0%, 20% { transform: translateX(100%); } 50%, 100% { transform: none; } }
.proto-change-fade b { animation: proto-c-fade 1.8s infinite; }
@keyframes proto-c-fade { 0%, 20% { opacity: 0; } 50%, 100% { opacity: 1; } }
.proto-change-none b { animation: proto-c-none 1.8s steps(1) infinite; }
@keyframes proto-c-none { 0%, 35% { opacity: 0; } 36%, 100% { opacity: 1; } }
/* Settings of an applied preset (owner, 11 Oct): a drawer under its row. */
.proto-card { position: relative; }
.proto-card.is-adjustable::after { content: "\2699"; position: absolute; top: 3px; right: 5px; font-size: 10px; color: var(--accent); opacity: 0.85; }
.proto-drawer { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--panel-sunken); border: 1px solid var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }
.proto-drawer-head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.proto-drawer-head .proto-drawer-play { margin-left: auto; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 11px; padding: 3px 9px; cursor: pointer; }
.proto-drawer-head .proto-drawer-reset { border: 0; background: none; color: var(--ink); opacity: 0.6; font: inherit; font-size: 11px; cursor: pointer; text-decoration: underline; padding: 0; }
.proto-ctl { display: flex; align-items: center; gap: 8px; }
.proto-ctl-name { flex: 0 0 64px; opacity: 0.7; font-size: 11px; }
.proto-seg { flex: 1; display: flex; gap: 3px; padding: 2px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); }
.proto-seg button { flex: 1; min-width: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 11px; padding: 5px 2px; cursor: pointer; opacity: 0.75; }
.proto-seg button:hover { opacity: 1; background: var(--line-faint); }
.proto-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); opacity: 1; font-weight: 700; }
.proto-seg.is-arrows button { font-size: 14px; line-height: 1; }
.proto-seg.is-swatches { background: transparent; border: 0; gap: 6px; }
.proto-seg.is-swatches button { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--sw); opacity: 1; box-shadow: 0 0 0 1px var(--line-soft); }
.proto-seg.is-swatches button[aria-pressed="true"] { background: var(--sw); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.proto-seg.is-swatches button[data-v="text"] { background: var(--panel-sunken); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 22px; padding: 0; text-align: center; text-decoration: underline; text-underline-offset: 2px; }
/* Text cards: a word that does the effect. */
.proto-demo-text { width: 60px; }
.proto-demo-word { display: inline-flex; align-items: baseline; gap: 0; font-size: 12px; font-weight: 700; color: #C9D1DC; white-space: pre; position: relative; }
.proto-card[aria-pressed="true"] .proto-demo-word { color: var(--accent); }
.proto-demo-word b { display: inline-block; font-weight: inherit; }
.fx-text-typewriter b { opacity: 0; animation: proto-t-type 2.4s steps(1) infinite; }
.fx-text-typewriter b:nth-child(2) { animation-delay: 0.15s; } .fx-text-typewriter b:nth-child(3) { animation-delay: 0.3s; } .fx-text-typewriter b:nth-child(4) { animation-delay: 0.45s; } .fx-text-typewriter b:nth-child(5) { animation-delay: 0.6s; }
@keyframes proto-t-type { 0%, 10% { opacity: 0; } 11%, 90% { opacity: 1; } 100% { opacity: 0; } }
.fx-text-words b, .fx-text-letters b { opacity: 0; animation: proto-t-rise 2.4s infinite; }
.fx-text-letters b { animation-name: proto-t-drop; }
.fx-text-words b:nth-child(2) { animation-delay: 0.25s; }
.fx-text-letters b:nth-child(2) { animation-delay: 0.08s; } .fx-text-letters b:nth-child(3) { animation-delay: 0.16s; } .fx-text-letters b:nth-child(4) { animation-delay: 0.24s; } .fx-text-letters b:nth-child(5) { animation-delay: 0.32s; }
@keyframes proto-t-rise { 0%, 10% { opacity: 0; transform: translateY(6px); } 30%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes proto-t-drop { 0%, 10% { opacity: 0; transform: translateY(-6px); } 26%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.fx-text-blurIn { animation: proto-t-sharp 2.4s infinite; }
.fx-text-blurIn::after { content: "Hello"; position: absolute; left: 0; top: 0; filter: blur(3px); opacity: 0; animation: proto-t-blur 2.4s infinite; }
@keyframes proto-t-sharp { 0%, 22% { opacity: 0; } 40%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes proto-t-blur { 0%, 6% { opacity: 0; } 14% { opacity: 1; } 38%, 100% { opacity: 0; } }
.proto-demo-roll { display: inline-block; height: 15px; overflow: hidden; vertical-align: bottom; }
.proto-demo-roll b { display: block; height: 15px; line-height: 15px; text-align: center; animation: proto-t-roll 2.4s steps(1) infinite; }
@keyframes proto-t-roll { 0%, 15% { transform: translateY(0); } 16%, 30% { transform: translateY(-15px); } 31%, 45% { transform: translateY(-30px); } 46%, 100% { transform: translateY(-45px); } }
.fx-text-underline::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; border-radius: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; animation: proto-t-under 2.4s infinite; }
@keyframes proto-t-under { 0%, 15% { transform: scaleX(0); } 45%, 88% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
.fx-text-none { opacity: 0.55; }
/* Menus (owner, 11 Oct): start one from a part, pick its kind by its icon. */
.proto-starters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.proto-starter { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; text-align: left; }
.proto-starter:hover { border-color: var(--accent); }
.proto-ov-icon { position: relative; flex: 0 0 22px; width: 22px; height: 30px; border-radius: 4px; background: #3a3f4b; overflow: hidden; }
.proto-ov-icon i { position: absolute; background: #C9D1DC; border-radius: 2px; }
.proto-ov-dropdown i { left: 3px; top: 7px; width: 14px; height: 12px; }
.proto-ov-side i { left: 0; top: 0; width: 14px; height: 100%; border-radius: 0; }
.proto-ov-sheet i { left: 0; bottom: 0; width: 100%; height: 13px; border-radius: 3px 3px 0 0; }
.proto-ov-dialog i { left: 3px; top: 9px; width: 16px; height: 12px; }
.proto-starter:hover .proto-ov-icon i, .proto-change[aria-pressed="true"] .proto-ov-icon i { background: var(--accent); }
.proto-pop-row4 { grid-template-columns: repeat(2, 1fr); }
.proto-pop-row4 .proto-change { flex-direction: row; justify-content: flex-start; padding: 6px 8px; }
/* "Then also…" (round 2): what else a tap does, each said as a sentence;
   the parts it changes are outlined in blue on the canvas. */
.proto-then-list { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.proto-then-item { display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border-radius: 8px; background: var(--panel-sunken); border-left: 2px solid #7CC8FF; font-size: 12px; line-height: 1.4; }
.proto-then-item span { flex: 1; }
.proto-then-item button { border: 0; background: transparent; color: var(--ink); opacity: 0.6; cursor: pointer; font: inherit; padding: 0 2px; }
.proto-then-item button:hover { opacity: 1; color: #FF6B6B; }
/* Each interaction row plays and edits from where it is (B2, C7). */
.proto-then-item button.proto-then-play { flex: none; width: 20px; height: 20px; padding: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); opacity: 1; font-size: 9px; line-height: 20px; text-align: center; }
.proto-then-item button.proto-then-play:hover { background: var(--accent-hi); color: var(--accent-ink); }
.proto-then-item button.proto-then-edit { text-decoration: underline; text-underline-offset: 2px; }
.proto-then-item button.proto-then-edit:hover { color: var(--accent); }
.proto-into .proto-then-item { border-left-color: #F2B33D; }
.proto-link-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: 2px; vertical-align: middle; }
.proto-group .proto-play-part.proto-play-sm { padding: 2px 9px; font-size: 11px; }
.proto-link-group { border-left: 2px solid var(--accent); padding-left: 8px; }
.proto-then-ons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; }
.proto-then-ons button { border: 1px solid var(--line-soft); border-radius: var(--r-pill); background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; padding: 3px 8px; cursor: pointer; }
.proto-then-ons button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.proto-pop-soon { font-size: 11px; line-height: 1.4; opacity: 0.62; margin-bottom: 2px; }
.proto-then-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.proto-then-add button { border: 1px dashed rgba(124, 200, 255, 0.6); border-radius: var(--r-pill); background: transparent; color: #7CC8FF; font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.proto-then-add button:hover { background: rgba(124, 200, 255, 0.1); }
.proto-then-pick { margin: 4px 0; padding: 6px 8px; border-radius: 8px; background: rgba(124, 200, 255, 0.12); color: #7CC8FF; font-size: 12px; }
body.proto-picking #canvas { cursor: crosshair; }
.proto-pop-input { border: 1px solid var(--line-soft); border-radius: 6px; background: var(--panel-sunken); color: var(--ink); font: inherit; padding: 7px 9px; }
.proto-hows { margin-bottom: 6px; }
.proto-change-cover b { animation: proto-c-cover 1.8s infinite; }
@keyframes proto-c-cover { 0%, 20% { transform: translateY(100%); } 50%, 85% { transform: none; } 100% { transform: translateY(100%); } }
/* Morph (DESIGN 3.13, round 7): a card grows into the next screen; five ways in share the row. */
.proto-change-morph b { inset: 0 0 auto 0; height: 14px; transform-origin: 0 0; animation: proto-c-morph 1.8s infinite; }
@keyframes proto-c-morph { 0%, 20% { transform: translate(5px, 11px) scale(0.32, 0.5); } 55%, 100% { transform: none; } }
.proto-pop-row:has(> .proto-change:nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.proto-pop-row:has(> .proto-change:nth-child(5):last-child) .proto-change { font-size: 10.5px; padding-left: 1px; padding-right: 1px; }
.proto-morph { margin: -2px 0 8px; font-size: 12px; line-height: 1.4; }
.proto-morph-says { opacity: 0.85; margin-bottom: 4px; }
.proto-morph-pairs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.proto-morph-pair { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 1px 2px 1px 8px; border-radius: var(--r-pill, 999px); background: var(--panel-sunken); border: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.proto-morph-pair button { border: 0; background: none; color: inherit; opacity: 0.7; cursor: pointer; font: inherit; padding: 0 4px; }
.proto-morph-pair button:hover { opacity: 1; color: var(--accent); }
.proto-morph-offs { margin-bottom: 4px; opacity: 0.85; }
.proto-morph-hand summary { cursor: pointer; opacity: 0.8; }
.proto-morph-hand label { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.proto-morph-hand select { max-width: 100%; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--panel-sunken); color: var(--ink); font: inherit; padding: 4px 6px; }
/* What next, Make it feel alive, Check my app (owner, 12 Oct). */
.proto-next { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-bottom: 2px; }
.proto-group .proto-next button[data-act], .proto-group button.proto-alive-offer[data-act] { text-decoration: none; }
.proto-group .proto-next button[data-act] { color: var(--ink); font-weight: 600; padding: 6px 2px; }
.proto-group button.proto-alive-offer[data-act] { color: var(--ink); padding: 10px; }
.proto-next button { border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; font-weight: 600; padding: 6px 2px; cursor: pointer; white-space: nowrap; }
.proto-next button:hover { border-color: var(--accent); color: var(--accent); }
.proto-alive-offer { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border-radius: 10px; border: 1px solid var(--accent); background: linear-gradient(135deg, rgba(181, 255, 58, 0.14), rgba(181, 255, 58, 0.03)); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.45; cursor: pointer; }
.proto-alive-offer strong { color: var(--accent); }
.proto-alive-spark { font-size: 18px; }
.proto-alive { position: fixed; inset: 0; z-index: 8000; display: flex; align-items: center; justify-content: center; background: rgba(5, 5, 7, 0.72); padding: 20px; }
.proto-alive-box { width: min(880px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); color: var(--ink); }
.proto-alive-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.proto-alive-title { font-size: 18px; font-weight: 700; }
.proto-alive-sub { opacity: 0.7; font-size: 13px; margin-top: 4px; line-height: 1.45; }
.proto-alive-close { border: 0; background: none; color: var(--ink); font-size: 16px; cursor: pointer; opacity: 0.6; align-self: flex-start; }
.proto-alive-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.proto-alive-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel-sunken); color: var(--ink); font: inherit; cursor: pointer; }
.proto-alive-card:hover, .proto-alive-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; outline: none; }
.proto-alive-stage { display: block; width: 100%; aspect-ratio: 390 / 600; overflow: hidden; border-radius: 10px; background: #fff; margin-bottom: 6px; }
.proto-alive-stage svg { display: block; width: 100%; height: auto; }
.proto-alive-name { font-size: 15px; font-weight: 700; }
.proto-alive-hint { font-size: 12px; opacity: 0.7; }
.proto-alive-count { font-size: 11px; color: var(--accent); }
.proto-alive-card.is-on { border-color: var(--accent); }
.proto-alive-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #0B0B10; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.proto-prompt .proto-alive-box { width: min(760px, 100%); display: flex; flex-direction: column; }
.proto-prompt-text { width: 100%; min-height: 360px; height: 52vh; resize: vertical; box-sizing: border-box; padding: 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel-sunken); color: var(--ink); font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.proto-prompt-text:focus { outline: none; border-color: var(--accent); }
.proto-prompt-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.proto-prompt-size { font-size: 12px; opacity: 0.6; }
.proto-prompt-copy { border: 0; border-radius: 999px; background: var(--accent); color: #0B0B10; font: inherit; font-size: 13px; font-weight: 700; padding: 9px 18px; cursor: pointer; }
.proto-prompt-copy:hover { filter: brightness(1.06); }
.proto-remove { display: flex; gap: 12px; flex-wrap: wrap; margin-top: -4px; }
.proto-group .proto-remove button[data-act] { color: var(--ink); opacity: 0.6; font-size: 11px; }
.proto-group .proto-remove button[data-act]:hover { opacity: 1; color: var(--danger, #FF4D4D); }
.proto-alive-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
/* "It becomes…" cards (18 Oct): each shows its look change on a tiny
   control, over and over. */
.proto-demo-become > span { position: relative; display: flex; gap: 3px; align-items: center; }
.proto-demo-become i { display: block; width: 12px; height: 9px; border-radius: 5px; background: #8E9AAF; opacity: 0.55; }
.fx-become-selected i { background: var(--accent); opacity: 0.3; animation: proto-b-pick 3.3s infinite; }
.fx-become-selected i:nth-child(2) { animation-delay: 1.1s; }
.fx-become-selected i:nth-child(3) { animation-delay: 2.2s; }
@keyframes proto-b-pick { 0%, 30% { opacity: 1; } 34%, 100% { opacity: 0.3; } }
.fx-become-onoff { width: 30px; height: 15px; border-radius: 8px; background: #8E9AAF; }
.fx-become-onoff::before { content: ""; position: absolute; inset: 0; border-radius: 8px; background: var(--accent); opacity: 0; animation: proto-b-track 2.4s infinite; }
.fx-become-onoff i { position: absolute; z-index: 1; left: 2px; top: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; opacity: 1; animation: proto-b-knob 2.4s infinite; }
.fx-become-onoff i + i { display: none; }
@keyframes proto-b-track { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes proto-b-knob { 0%, 40% { transform: none; } 50%, 90% { transform: translateX(15px); } 100% { transform: none; } }
.fx-become-segment { width: 42px; height: 15px; border-radius: 5px; background: rgba(142, 154, 175, 0.35); padding: 2px; gap: 0; }
.fx-become-segment i { width: 12px; height: 11px; border-radius: 3px; background: transparent; }
.fx-become-segment i:first-child { position: absolute; left: 2px; top: 2px; background: var(--accent); opacity: 1; animation: proto-b-slide 3.3s infinite; }
@keyframes proto-b-slide { 0%, 26% { transform: none; } 33%, 60% { transform: translateX(13px); } 66%, 93% { transform: translateX(26px); } 100% { transform: none; } }
/* "When swiped or dragged" (step 7): a row sliding away, a knob on its track. */
.proto-demo-gesture > span { position: relative; display: block; width: 34px; height: 16px; }
.fx-gesture-swipeLeft i, .fx-gesture-swipeRight i { position: absolute; left: 0; right: 0; height: 6px; border-radius: 3px; background: #8E9AAF; opacity: 0.55; }
.fx-gesture-swipeLeft i:first-child, .fx-gesture-swipeRight i:first-child { top: 1px; background: var(--accent); opacity: 0.9; animation: proto-g-left 2.4s infinite; }
.fx-gesture-swipeRight i:first-child { animation-name: proto-g-right; }
.fx-gesture-swipeLeft i + i, .fx-gesture-swipeRight i + i { top: 9px; }
.fx-gesture-slider i:first-child { position: absolute; left: 0; right: 0; top: 7px; height: 3px; border-radius: 2px; background: #8E9AAF; opacity: 0.55; }
.fx-gesture-slider i + i { position: absolute; top: 3px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: proto-g-knob 2.4s infinite ease-in-out; }
@keyframes proto-g-left { 0%, 20% { transform: none; opacity: 0.9; } 55% { transform: translateX(-30px); opacity: 0; } 70% { transform: none; opacity: 0; } 100% { transform: none; opacity: 0.9; } }
@keyframes proto-g-right { 0%, 20% { transform: none; opacity: 0.9; } 55% { transform: translateX(30px); opacity: 0; } 70% { transform: none; opacity: 0; } 100% { transform: none; opacity: 0.9; } }
@keyframes proto-g-knob { 0%, 100% { transform: translateX(2px); } 50% { transform: translateX(22px); } }
/* Swipe up and down (round 4): a card leaving upwards or downwards. */
.fx-gesture-swipeUp i, .fx-gesture-swipeDown i { position: absolute; top: 2px; bottom: 2px; width: 14px; border-radius: 3px; background: #8E9AAF; opacity: 0.55; }
.fx-gesture-swipeUp i:first-child, .fx-gesture-swipeDown i:first-child { left: 2px; background: var(--accent); opacity: 0.9; animation: proto-g-up 2.4s infinite; }
.fx-gesture-swipeDown i:first-child { animation-name: proto-g-down; }
.fx-gesture-swipeUp i + i, .fx-gesture-swipeDown i + i { left: 18px; }
@keyframes proto-g-up { 0%, 20% { transform: none; opacity: 0.9; } 55% { transform: translateY(-14px); opacity: 0; } 70% { transform: none; opacity: 0; } 100% { transform: none; opacity: 0.9; } }
@keyframes proto-g-down { 0%, 20% { transform: none; opacity: 0.9; } 55% { transform: translateY(14px); opacity: 0; } 70% { transform: none; opacity: 0; } 100% { transform: none; opacity: 0.9; } }
.proto-swipe-reveal { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 6px; padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-soft); background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.proto-swipe-reveal::before { content: ""; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line-soft); }
.proto-swipe-reveal[aria-pressed="true"] { border-color: #FF3B30; }
.proto-swipe-reveal[aria-pressed="true"]::before { background: #FF3B30; border-color: #FF3B30; }
@media (prefers-reduced-motion: reduce) { .fx-gesture-swipeLeft i, .fx-gesture-swipeRight i, .fx-gesture-swipeUp i, .fx-gesture-swipeDown i, .fx-gesture-slider i { animation-play-state: paused; } .proto-card:hover .fx-gesture-swipeLeft i, .proto-card:hover .fx-gesture-swipeRight i, .proto-card:hover .fx-gesture-swipeUp i, .proto-card:hover .fx-gesture-swipeDown i, .proto-card:hover .fx-gesture-slider i { animation-play-state: running; } }
.proto-slider-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.proto-slider-f { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--ink-dim, #9aa0aa); }
.proto-slider-f input { width: 100%; min-width: 0; box-sizing: border-box; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; }
.proto-mates { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.proto-mate { display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--line-soft); font-size: 11px; }
.proto-mate.is-me { border-color: var(--accent); color: var(--accent); padding-right: 8px; }
.proto-mate button { border: 0; background: none; color: inherit; opacity: 0.55; font: inherit; font-size: 10px; cursor: pointer; padding: 0 3px; }
.proto-mate button:hover { opacity: 1; }
/* M118 (owner's video, 8 Nov: "Flips on and off" played while "Stays" was picked): only the picked look moves; another moves while the pointer rests on it. */
.proto-card:not([aria-pressed="true"]):not(:hover):not(:focus-visible) .fx-become-selected i,
.proto-card:not([aria-pressed="true"]):not(:hover):not(:focus-visible) .fx-become-onoff::before,
.proto-card:not([aria-pressed="true"]):not(:hover):not(:focus-visible) .fx-become-onoff i,
.proto-card:not([aria-pressed="true"]):not(:hover):not(:focus-visible) .fx-become-segment i:first-child { animation: none; }
@media (prefers-reduced-motion: reduce) { .fx-become-selected i, .fx-become-onoff::before, .fx-become-onoff i, .fx-become-segment i:first-child { animation-play-state: paused; } .proto-card:hover .fx-become-selected i, .proto-card:hover .fx-become-onoff::before, .proto-card:hover .fx-become-onoff i, .proto-card:hover .fx-become-segment i:first-child { animation-play-state: running; } }
/* "Make it work like an app" (18 Oct): each kind it found plays on the
   person's own design before anything changes. */
.proto-app-box { width: min(720px, 100%); }
.proto-app-list { display: flex; flex-direction: column; gap: 10px; }
.proto-app-row { display: grid; grid-template-columns: auto 132px 1fr; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel-sunken); cursor: pointer; }
.proto-app-row:has(input:checked) { border-color: var(--accent); }
.proto-app-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.proto-app-stage, .proto-app-icon { display: flex; align-items: center; justify-content: center; width: 132px; height: 72px; border-radius: 10px; background: #fff; overflow: hidden; }
.proto-app-icon { font-size: 26px; color: #16181d; }
.proto-app-stage svg { display: block; width: 100%; height: 100%; }
/* A screen that moves on by itself (D5): the next screen comes in over it. */
.proto-moveon-demo { position: relative; width: 100%; height: 100%; }
.proto-moveon-demo svg { position: absolute; inset: 0; }
.proto-app-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.proto-app-name { font-size: 14px; font-weight: 700; }
.proto-app-count { font-weight: 500; font-size: 12px; opacity: 0.65; margin-left: 4px; }
.proto-app-hint { font-size: 12px; opacity: 0.8; line-height: 1.4; }
.proto-app-ex { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Make it work's links, each with its words and where it goes; ✕ leaves one out (SVG-194). */
.proto-app-links { display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow-y: auto; margin: -4px 0 8px 162px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.proto-app-links[hidden] { display: none; }
.proto-app-link { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.5; min-width: 0; }
.proto-app-link-what { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proto-app-link-on { opacity: 0.55; white-space: nowrap; font-size: 11px; }
.proto-app-unlink { flex: none; border: 0; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; font: inherit; font-size: 11px; padding: 0 4px; border-radius: 6px; }
.proto-app-unlink:hover, .proto-app-unlink:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.1); }
@media (max-width: 720px) { .proto-app-links { margin-left: 0; } }
.proto-app-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.proto-app-note { margin-right: auto; font-size: 12px; opacity: 0.6; }
.proto-app-go { border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 700; padding: 8px 18px; cursor: pointer; }
.proto-app-go:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 720px) { .proto-app-row { grid-template-columns: auto 1fr; } .proto-app-stage, .proto-app-icon { display: none; } }

.proto-prompt-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.proto-prompt-zip { border: 1px solid var(--line-soft); border-radius: 999px; background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px; cursor: pointer; }
.proto-prompt-zip:hover { border-color: var(--accent); }
.proto-prompt-zip:disabled { opacity: 0.6; cursor: progress; }
.proto-field-host { overflow: visible; }
.proto-field { display: block; box-sizing: border-box; width: 100%; margin: 0; padding: 0; border: 0; outline: none; background: transparent; line-height: normal; caret-color: currentColor; -webkit-appearance: none; appearance: none; }
.proto-field::placeholder { color: var(--proto-ph); opacity: 1; }
/* The field is part of the design; the blinking caret shows where you type. */
.proto-field:focus, .proto-field:focus-visible { outline: none; box-shadow: none; }
/* Loading moments: Before it goes (right away, or a spinner first). */
.proto-waits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.proto-wait { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 11px; font-weight: 600; padding: 6px 2px; cursor: pointer; white-space: nowrap; }
.proto-wait:hover { border-color: var(--accent); }
.proto-wait[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.proto-wait-spin { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; box-sizing: border-box; }
.proto-wait:hover .proto-wait-spin, .proto-wait[aria-pressed="true"] .proto-wait-spin { animation: proto-wait-turn 0.8s linear infinite; }
@keyframes proto-wait-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .proto-wait-spin { animation: none !important; } }
.proto-pop-waits { margin-bottom: 6px; }
.proto-field::-webkit-search-cancel-button { display: none; }
@media (max-width: 720px) { .proto-alive-row { grid-template-columns: 1fr; } .proto-alive-stage { aspect-ratio: 390 / 420; } }
.proto-ok { color: var(--accent); line-height: 1.45; }
.proto-link-btn { border: 0; background: none; color: var(--accent); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; align-self: flex-start; }
/* Data lists, slice L2: a row's fields, words for the ones it lacks, its tags; what its page fills, each with its ✕. */
.proto-list-rows { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.proto-list-say { display: flex; align-items: center; gap: 6px; opacity: 0.8; }
.proto-list-in { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04); color: inherit; }
.proto-list-binds { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; align-items: center; }
.proto-list-bind { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 4px 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.proto-list-bind button { border: 0; background: none; color: inherit; opacity: 0.6; cursor: pointer; padding: 0 2px; font: inherit; }
.proto-list-bind button:hover { opacity: 1; }
.proto-sugg-all { padding: 8px; border-radius: 8px; background: rgba(242, 179, 61, 0.12); border: 1px solid rgba(242, 179, 61, 0.45); line-height: 1.45; }
.proto-sugg-all button, .proto-check-sug button { border: 0; background: none; color: #F2B33D; font: inherit; font-weight: 700; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.proto-checks { display: flex; flex-direction: column; gap: 6px; }
.proto-check { padding: 7px 8px; border-radius: 8px; background: var(--panel-sunken); border: 1px solid var(--line-soft); }
.proto-check-go { display: block; width: 100%; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; padding: 0; cursor: pointer; line-height: 1.4; }
.proto-check-go:hover { color: var(--accent); }
.proto-check.is-picked { border-color: var(--accent); }
.proto-sugg-all button + button { margin-left: 10px; }
.proto-check-sug { margin-top: 4px; font-size: 11px; opacity: 0.85; }
/* Tall screens scroll in Play; the tab bar stays pinned (owner, 12 Oct). */
.proto-scroll-frame { position: relative; height: 100%; max-width: 100%; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); background: #fff; transition: opacity 0.26s var(--ease-out), transform 0.32s var(--ease-out); }
.proto-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.proto-scroll::-webkit-scrollbar { display: none; }
.proto-player-stage .proto-scroll .proto-screen { display: block; width: 100%; height: auto; max-height: none; border-radius: 0; box-shadow: none; }
.proto-pinned { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; display: block; }
.proto-player-stage .proto-scroll-frame.proto-enter { opacity: 0.4; transform: translateX(60%); transition: none; }
.proto-player-stage .proto-scroll-frame.proto-enter-back { opacity: 0.4; transform: translateX(-60%); transition: none; }
.proto-player-stage .proto-scroll-frame.proto-enter-fade { opacity: 0; transition: none; }
/* A top bar pinned over a tall screen, and wide screens (a web page) that
   scroll in a desktop window sized by protoWideFit: the page keeps a
   readable size and can scroll sideways on a small stage (15 Oct). */
.proto-pinned.proto-pin-top { top: 0; bottom: auto; }
.proto-scroll-frame.proto-wide { flex: none; height: auto; max-width: none; }
.proto-wide .proto-scroll { overflow: auto; touch-action: pan-x pan-y; }
.proto-player-stage .proto-wide .proto-scroll .proto-screen { width: var(--proto-cw, 100%); max-width: none; touch-action: pan-x pan-y; }
.proto-wide .proto-pinned { right: auto; width: var(--proto-cw, 100%); }
/* The app video (owner, 12 Oct): the area (caption + phone) is what the
   recording cuts out of the tab; it takes the clip's shape while recording. */
.proto-player-area { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.proto-rec-caption { display: none; }
.proto-player-rec { border-color: rgba(255, 90, 90, 0.5) !important; }
.proto-player.is-recording .proto-player-rec { background: #E5484D !important; color: #fff !important; border-color: #E5484D !important; }
.proto-player.is-recording .proto-player-area { flex: none; align-self: center; margin: 0 auto 12px; height: calc(100vh - 76px); aspect-ratio: 9 / 16; padding: 7% 7% 6%; gap: 4%; box-sizing: border-box; background: radial-gradient(120% 70% at 50% 0%, rgba(181, 255, 58, 0.16), transparent 60%), linear-gradient(170deg, #1b1f27, #0B0B10 70%); }
.proto-player.is-recording.rec-wide .proto-player-area { aspect-ratio: 16 / 9; height: auto; width: min(calc(100vw - 32px), calc((100vh - 76px) * 16 / 9)); padding: 4% 6%; flex-direction: row; align-items: center; }
.proto-player.is-recording.rec-captions .proto-rec-caption { display: block; color: #fff; font-weight: 800; font-size: clamp(16px, 3.4vh, 40px); line-height: 1.15; text-align: center; letter-spacing: -0.01em; }
.proto-player.is-recording.rec-wide.rec-captions .proto-rec-caption { flex: 1; text-align: left; font-size: clamp(18px, 5vh, 56px); }
/* The Values panel (proto-engine slice 9): never in a recorded video. */
.proto-player.is-recording .proto-values { display: none !important; }
.proto-vars .proto-var { padding: 4px 0; }
.proto-vars .proto-var-fields { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.proto-vars .proto-var-f { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.proto-vars .proto-var-f input { width: 52px; }
/* Simulated sign-in (proto-engine slice 13, D12): the one code that works. */
.proto-signin-code .proto-signin-code-f { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin: 4px 0; }
.proto-signin-code input { width: 96px; font: inherit; font-size: 13px; letter-spacing: 0.12em; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
/* If (proto-engine slice 11): "Works only if…", "Shows only if…", a rule with if, the three pickers. */
.proto-if-block { padding: 6px 8px; margin: 4px 0; border-radius: 8px; background: var(--panel-sunken); border-left: 2px solid #F2B33D; }
.proto-if-says { font-size: 12px; line-height: 1.4; margin: 2px 0 4px; }
.proto-if-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0; }
.proto-if-edit select, .proto-if-edit input { font: inherit; font-size: 12px; max-width: 100%; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.proto-if-edit select[data-cond="thing"] { max-width: 190px; }
.proto-if-edit input[type="text"] { width: 120px; }
.proto-if-num { display: inline-flex; align-items: center; gap: 2px; }
.proto-if-num input { width: 52px; text-align: center; }
.proto-if-num button { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.proto-then-item button.proto-then-if { flex: none; font-size: 11px; text-decoration: underline; text-underline-offset: 2px; }
.proto-then-item button.proto-then-if:hover { color: #F2B33D; }
.proto-player.is-recording .proto-player-stage { flex: 1; padding: 0; min-height: 0; min-width: 0; }
.proto-player.is-recording.rec-wide .proto-player-stage { flex: 1.1; height: 100%; }
.proto-player.is-recording .proto-player-stage > .proto-screen, .proto-player.is-recording .proto-scroll-frame { border: 7px solid #0d0e12; border-radius: 34px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06); box-sizing: border-box; }
.proto-player.is-recording .proto-player-note:not(.is-ready) { display: none; }
/* App Store preview: the screen itself fills an 886 x 1920 frame. Apple does not allow device frames or backdrops. */
.proto-player.is-recording.rec-store .proto-player-area { aspect-ratio: 886 / 1920; padding: 0; gap: 0; background: #000; }
.proto-player.is-recording.rec-store .proto-player-stage > .proto-screen, .proto-player.is-recording.rec-store .proto-scroll-frame { border: 0; border-radius: 0; box-shadow: none; width: 100%; height: 100%; max-width: none; max-height: none; }
.proto-player.is-recording.rec-store .proto-rec-caption { display: none; }
.proto-rec-store-note { font-size: 12px; line-height: 1.45; opacity: 0.75; margin: 6px 0 2px; }
.proto-rec-store-no { font-size: 12px; line-height: 1.45; color: #F2B33D; margin: 4px 0 2px; }
.proto-rec-go:disabled { opacity: 0.45; cursor: not-allowed; }
.proto-rec-check.is-off { opacity: 0.45; }
.proto-player-note.is-ready { pointer-events: auto; }
.proto-player-note.is-ready a { color: var(--accent); font-weight: 700; margin-left: 6px; }
.proto-rec-menu { position: absolute; top: 50px; right: 16px; z-index: 3; width: 270px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-soft); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); color: var(--ink); font-size: 12px; display: flex; flex-direction: column; gap: 8px; }
.proto-rec-title { font-weight: 700; font-size: 14px; }
.proto-rec-sub, .proto-rec-note { opacity: 0.75; line-height: 1.45; }
.proto-rec-note { font-size: 11px; }
.proto-rec-label { opacity: 0.65; font-size: 11px; }
.proto-rec-seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.proto-rec-seg button { border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel-sunken); color: var(--ink); font: inherit; padding: 7px; cursor: pointer; }
.proto-rec-seg button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.proto-rec-check { display: flex; gap: 6px; align-items: center; }
.proto-rec-go { border: 0; border-radius: var(--r-pill); background: #E5484D; color: #fff; font: inherit; font-weight: 700; padding: 8px 12px; cursor: pointer; }
.proto-player { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; background: rgba(5, 5, 7, 0.94); }
.proto-player-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--ink); }
.proto-player-title { flex: 1; font-weight: 600; font-size: 13px; }
.proto-player-bar button { border: 1px solid var(--line-soft); background: var(--panel); color: var(--ink); border-radius: var(--r-pill); padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.proto-player-bar button:disabled { opacity: 0.35; cursor: default; }
/* Floats over the screen: a hint that pushed the screen down moved the
   buttons under the finger. */
.proto-player-note { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 6px 12px; border-radius: var(--r-pill); background: var(--panel); color: var(--ink); font-size: 12px; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
/* In the bar, outside the phone (C17, 24 Oct): it never covers the app. */
.proto-player-bar .proto-player-note { position: static; transform: none; flex: 0 1 auto; min-width: 0; max-width: 44%; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: none; border: 1px solid var(--line-soft); }
.proto-player-bar .proto-player-note.is-ready { white-space: normal; max-width: 60%; }
.proto-player-bar button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
/* Show links never covers the design (E2, round 7): each spot an outline on its own edge, its words beside the phone (protoLinkRail).
   Only a spot that does something (protoSpotDoes marks it .proto-link-spot, 8 Nov). */
.proto-show-links rect[data-ix-hit].proto-link-spot { fill: transparent !important; stroke: #B5FF3A; stroke-width: 1.5px; filter: drop-shadow(0 0 1px rgba(11, 11, 16, 0.95)); }
.proto-show-links rect[data-ix-hit].proto-link-spot.is-hot { stroke-width: 3px; }
/* A tap area with nothing drawn under it (M102, round 4: a state moved its part away). */
.proto-show-links rect[data-ix-hit].proto-link-stray { fill: rgba(255, 77, 77, 0.12) !important; stroke: #FF4D4D; stroke-width: 2px; stroke-dasharray: 5 3; }
.proto-link-rail { position: absolute; z-index: 3; pointer-events: none; }
.proto-link-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.proto-link-lines path { fill: none; stroke: rgba(181, 255, 58, 0.5); stroke-width: 1.25; }
.proto-link-lines circle { fill: #B5FF3A; stroke: none; }
.proto-link-lines path.is-hot { stroke: #B5FF3A; stroke-width: 2; }
.proto-link-tag { position: absolute; box-sizing: border-box; display: flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 999px; background: #14141B; border: 1px solid rgba(181, 255, 58, 0.4); color: #F2F2EE; font: 600 12px/1.3 Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; pointer-events: auto; cursor: default; }
.proto-link-tag .proto-link-of { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #B9BCC6; font-weight: 500; }
.proto-link-tag .proto-link-said { flex: none; color: #B5FF3A; }
.proto-link-tag.is-hot { border-color: #B5FF3A; background: #1B2310; }
.proto-link-rail.is-bar .proto-link-tag, .proto-link-rail.is-bar .proto-link-lines { display: none; }
.proto-player-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 16px 24px; overflow: hidden; }
/* Swipes in Play: horizontal moves reach the page as pointer events; vertical ones still scroll. */
.proto-player-stage { touch-action: pan-y; }
.proto-player-stage .proto-screen { max-width: 100%; max-height: 100%; height: 100%; width: auto; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); transition: opacity 0.26s var(--ease-out), transform 0.32s var(--ease-out); }
.proto-player-stage .proto-screen.proto-enter { opacity: 0.4; transform: translateX(60%); transition: none; }
.proto-player-stage .proto-screen.proto-enter-back { opacity: 0.4; transform: translateX(-60%); transition: none; }
.proto-player-stage .proto-screen.proto-enter-fade { opacity: 0; transition: none; }
/* The missed-tap hint (C19, 25 Oct): every spot that can be tapped, drawn on or off, gets a two-tone
   outline, a light line with a dark edge on both sides, that reads on any colour (the lime tint alone
   hardly showed on navy chips). */
.proto-screen.proto-flash [data-ix-layer] rect { fill: transparent !important; stroke: #B5FF3A; stroke-width: 2px; filter: drop-shadow(0 0 1px rgba(11, 11, 16, 0.95)) drop-shadow(0 0 0.5px rgba(11, 11, 16, 0.95)); }
@media (prefers-reduced-motion: reduce) {
  .proto-player-stage .proto-screen { transition: none; }
  .proto-demo-btn, .proto-demo i, .fx-tap-ripple::after, .proto-change-demo b, .proto-demo-word, .proto-demo-word b, .fx-text-underline::after, .fx-tap-glow::before, .fx-tap-like::after, .fx-tap-lift::after, .fx-text-blurIn::after { animation-play-state: paused; }
  .proto-card:hover .proto-demo-btn, .proto-card:hover .proto-demo i, .proto-card:hover .fx-tap-ripple::after { animation-play-state: running; }
}

/* ---- decks in Play (18 Oct, builder D): Previous / Next, the slide count,
   present full screen, the slide transition cards ---- */
.proto-player:not(.is-deck) .proto-deck-btn, .proto-player:not(.is-deck) .proto-deck-count { display: none; }
.proto-player:not(.is-presenter) #proto-deck-audience { display: none; }
.proto-player.is-deck #proto-player-back { display: none; }
.proto-deck-count { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink); opacity: 0.8; min-width: 54px; text-align: center; }
.proto-player-stage:focus { outline: none; }
.proto-player.is-deck .proto-player-stage { position: relative; cursor: pointer; }
.proto-player.is-present { background: #000; }
.proto-player.is-present .proto-player-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s; }
.proto-player.is-present .proto-player-bar:hover, .proto-player.is-present .proto-player-bar:focus-within { opacity: 1; }
.proto-player.is-present .proto-player-stage { padding: 0; }
.proto-player.is-present .proto-player-stage > .proto-screen, .proto-player.is-present .proto-deck-leaving > .proto-screen { border-radius: 0; box-shadow: none; }
.proto-deck { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin-bottom: 8px; border-radius: 10px; background: var(--panel-sunken); border: 1px solid var(--line-soft); }
.proto-deck .proto-label { margin: 2px 0 0; }
.proto-deck-ins { grid-template-columns: repeat(5, 1fr); }
.proto-deck-ins .proto-card { padding: 6px 1px 5px; }
.proto-deck-demo { width: 40px; height: 24px; overflow: hidden; border-radius: 4px; background: #5B6573; }
.proto-deck-demo i, .proto-deck-demo b { position: absolute; inset: 0; border-radius: 4px; }
.proto-deck-demo i { background: #8E9AAF; }
.proto-deck-demo b { background: #C9D1DC; }
.proto-card[aria-pressed="true"] .proto-deck-demo b { background: var(--accent); }
.proto-deck-demo i { opacity: 1; width: auto; height: auto; margin: 0; box-shadow: none; animation: none; }
.pdk-none b { animation: pdk-none 2.4s steps(1) infinite; }
.pdk-fade b { animation: pdk-fade 2.4s infinite; }
.pdk-push b { animation: pdk-push-in 2.4s infinite; } .pdk-push i { animation: pdk-push-out 2.4s infinite; }
.pdk-slide b { animation: pdk-push-in 2.4s infinite; }
.pdk-zoom b { animation: pdk-zoom-in 2.4s infinite; } .pdk-zoom i { animation: pdk-zoom-out 2.4s infinite; }
@keyframes pdk-none { 0%, 45% { opacity: 0; } 46%, 100% { opacity: 1; } }
@keyframes pdk-fade { 0%, 25% { opacity: 0; } 55%, 100% { opacity: 1; } }
@keyframes pdk-push-in { 0%, 25% { transform: translateX(100%); } 55%, 100% { transform: translateX(0); } }
@keyframes pdk-push-out { 0%, 25% { transform: translateX(0); } 55%, 100% { transform: translateX(-100%); } }
@keyframes pdk-zoom-in { 0%, 25% { opacity: 0; transform: scale(0.6); } 55%, 100% { opacity: 1; transform: scale(1); } }
@keyframes pdk-zoom-out { 0%, 25% { opacity: 1; transform: scale(1); } 55%, 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
  .proto-deck-demo i, .proto-deck-demo b { animation-play-state: paused; }
  .proto-card:hover .proto-deck-demo i, .proto-card:hover .proto-deck-demo b { animation-play-state: running; }
}

/* ---- decks (19 Oct, builder P): the presenter view (S), all slides (G),
   a slide by its number. The same rules in styles.css (Play) and
   prototype.css (the share link and website file). ---- */
.is-presenter { --pres-w: min(400px, 38vw); padding-right: var(--pres-w); }
.proto-presenter { position: absolute; top: 0; right: 0; bottom: 0; width: var(--pres-w, 38vw); z-index: 6; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: #101016; border-left: 1px solid var(--line-soft); color: var(--ink); overflow: auto; text-align: left; }
.proto-pres-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proto-pres-time { border: 1px solid var(--line-soft); background: transparent; color: var(--accent); border-radius: var(--r-pill); padding: 4px 14px; font: inherit; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.proto-pres-count { font-size: 12px; opacity: 0.75; font-variant-numeric: tabular-nums; text-align: right; }
.proto-pres-label { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.55; }
.proto-pres-next { flex: none; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 6px; background: #000; }
.proto-pres-next:empty { display: none; }
.proto-deck-thumb { display: block; width: 100%; height: 100%; }
.proto-pres-next-name { font-size: 12px; opacity: 0.8; }
.proto-pres-notes { flex: 1; min-height: 80px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 18px; line-height: 1.45; }
.proto-pres-notes.is-empty { font-size: 14px; opacity: 0.45; }
@media (max-width: 700px) {
  .is-presenter { padding-right: 0; padding-bottom: 42vh; }
  .proto-presenter { top: auto; left: 0; width: auto; height: 42vh; border-left: 0; border-top: 1px solid var(--line-soft); }
  .proto-pres-next { max-height: 22vh; }
}
.proto-deck-grid { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; overflow: auto; background: rgba(5, 5, 7, 0.96); color: var(--ink); text-align: left; }
.proto-deck-grid-head { font-size: 14px; font-weight: 600; }
.proto-deck-grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.proto-deck-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 6px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.proto-deck-tile[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.proto-deck-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.proto-deck-tile-pic { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #000; }
.proto-deck-tile-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.proto-deck-keys { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 4px 0 0; font-size: 12px; opacity: 0.8; }
.proto-deck-keys dt { font-weight: 700; }
.proto-deck-keys dd { margin: 0; }
.proto-deck-typed { position: absolute; left: 50%; bottom: 64px; z-index: 9; transform: translateX(-50%); padding: 8px 16px; border-radius: var(--r-pill); background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); pointer-events: none; }
/* The panel: Play as slides or screens, a slide's speaker notes (19 Oct). */
.proto-deck-as { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.proto-deck .proto-deck-as { margin-bottom: 0; }
.proto-deck-as > .proto-label { margin: 0; white-space: nowrap; }
.proto-deck-hand { font-size: 11px; opacity: 0.6; white-space: nowrap; }
.proto-deck-notes { width: 100%; min-height: 54px; resize: vertical; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.4; }
.proto-deck-notes:focus { outline: none; border-color: var(--accent); }
.proto-share-body .share-field.share-check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); cursor: pointer; }
.proto-share-body .share-field.share-check input { margin: 0; accent-color: var(--accent); }

/* ===== Prototype share + feedback (SVG-46, 2026-10-12) =====
   The Share button and dialog in the editor and the owner's feedback list.
   The public link has a viewer of its own: prototype.html + prototype.css. */
.proto-share-top { border: 1px solid var(--accent); border-radius: var(--r-pill); background: transparent; color: var(--accent); font: inherit; font-size: 12px; font-weight: 700; padding: 4px 12px; cursor: pointer; }
.proto-share-top:hover { background: var(--accent-soft); }
/* Share shows in Design mode too (owner, 30 Oct), but not on the Chalk Board,
   and in the ChatGPT panel editor only in Prototype mode, as before. */
body.wb-on #proto-share-top,
html[data-embed="chatgpt"] body:not(.proto-mode) #proto-share-top { display: none !important; }
.proto-share-card { width: min(440px, 92vw); min-width: 0; max-height: 86vh; overflow: auto; }
.proto-share-body { display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--ink); }
.proto-share-body .share-lede { margin: 0; color: var(--ink-2, var(--ink)); line-height: 1.5; }
.proto-share-body .share-note, .proto-share-body .share-meta { margin: 0; color: var(--ink-3); line-height: 1.45; }
.proto-share-body .share-err { margin: 0; color: #FF6B6B; }
.proto-share-body .share-field { display: flex; flex-direction: column; gap: 4px; color: var(--ink-3); }
.proto-share-body input[type="text"] { width: 100%; box-sizing: border-box; background: var(--panel-sunken); color: var(--ink); border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 9px; font: inherit; }
.proto-share-body select { width: 100%; box-sizing: border-box; background: var(--panel-sunken); color: var(--ink); border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 9px; font: inherit; }
.proto-share-body .share-signin-note { color: var(--ink); font-weight: 600; }
.proto-share-body .share-expired { color: #F2B33D; }
.proto-share-body .share-link { display: flex; gap: 6px; }
.proto-share-body .share-link input { flex: 1; min-width: 0; }
.proto-share-body .share-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.proto-share-body .share-hero { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.proto-share-body .share-hero .share-actions { align-items: center; }
.proto-share-body button, .proto-share-body .share-open { border: 1px solid var(--line-soft); background: var(--panel); color: var(--ink); border-radius: var(--r-pill); padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; }
.proto-share-body button:disabled { opacity: 0.5; cursor: default; }
.proto-share-body .share-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.proto-share-body .share-danger { color: #FF6B6B; margin-left: auto; }
.proto-share-body .ghost { background: transparent; border-color: transparent; color: var(--ink-3); padding: 4px 6px; }
.share-fb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.share-fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.share-fb-item { border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; background: var(--panel-sunken); }
.share-fb-item.is-focus { border-color: #FFB020; }
.share-fb-item.is-hidden { opacity: 0.5; }
.share-fb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; }
.share-fb-when { font-weight: 400; color: var(--ink-3); }
.share-fb-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: #FFB020; color: #0B0B10; font-size: 10px; font-weight: 700; }
.share-fb-text { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.share-fb-btns { display: flex; flex-wrap: wrap; gap: 4px; }
/* Replies, Done and "Changed since you shared" (18 Oct). */
.share-fb-item.is-resolved .share-fb-text { opacity: 0.65; }
.share-fb-reply { margin: 0 0 6px 8px; padding-left: 8px; border-left: 2px solid var(--line-soft); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.share-fb-replybox { display: flex; flex-direction: column; gap: 6px; margin: 0 0 6px; }
.share-fb-replybox textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel); color: inherit; }
.proto-share-body .share-changed { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #F2B33D; line-height: 1.45; }
/* The start screen goes nowhere (D5): one line, with the fix. */
.proto-share-body .share-stuck { margin: 0; color: #F2B33D; line-height: 1.45; }
.proto-share-body .share-stuck button { display: block; margin-top: 6px; }
.share-pin { cursor: pointer; }
/* 15 Oct: the link's QR code beside it, and the count of comments the owner
   has not seen yet on both Share buttons (amber, like the comment pins). */
.proto-share-body .share-link-qr { display: flex; align-items: flex-start; gap: 12px; }
.proto-share-body .share-link-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.proto-share-body .share-qr-cap { margin: 0; color: var(--ink-3); line-height: 1.45; }
.proto-share-body .share-qr-cap strong { display: block; color: var(--ink); font-weight: 600; }
.proto-share-body .share-qr { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 8px; overflow: hidden; background: #FFFFFF; }
.proto-share-body .share-qr svg { display: block; width: 100%; height: 100%; }
.proto-share-body .share-new { margin-left: 4px; padding: 1px 6px; border-radius: 8px; background: #FFB020; color: #0B0B10; font-size: 10px; font-weight: 800; }
.share-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 6px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: #FFB020; color: #0B0B10; font-size: 10px; font-weight: 800; line-height: 1; vertical-align: 1px; }

/* ---- Embed mode: the editor inside ChatGPT (2026-10-12) ----
   app.js sets data-embed="chatgpt" at /embed (server/editor-embed.js).
   The signed-out note sits over the canvas; checkout and upgrade controls
   are hidden below (OpenAI's plugin rules cover embedded pages). */
#embed-notice {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 9000;
  max-width: min(520px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 10px 16px; border-radius: 10px;
  background: var(--panel, #16161D); color: var(--text, #E9E9EE);
  border: 1px solid var(--accent, #B5FF3A); font: 13px/1.45 var(--font-sans, system-ui, sans-serif);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}
/* Checkout, upgrade, plans, sign-in and "connect to AI" controls (inventory
   2026-10-12; tests/editor-embed-commerce.json lists the same selectors). */
html[data-embed="chatgpt"] #open-in,
html[data-embed="chatgpt"] #open-in-menu,
html[data-embed="chatgpt"] .open-in-quick,
html[data-embed="chatgpt"] #btn-upgrade,
html[data-embed="chatgpt"] #btn-billing,
html[data-embed="chatgpt"] #btn-profile,
html[data-embed="chatgpt"] .usage-panel-upgrade,
html[data-embed="chatgpt"] #usage-mcp-more,
html[data-embed="chatgpt"] #usage-mcp-setup,
html[data-embed="chatgpt"] #usage-panel-signin,
html[data-embed="chatgpt"] #ai-generate-upgrade-note,
html[data-embed="chatgpt"] #ai-generate-unlock,
html[data-embed="chatgpt"] #btn-mcp,
html[data-embed="chatgpt"] #mcp-plans-link,
html[data-embed="chatgpt"] .mcp-pointer,
html[data-embed="chatgpt"] #onb-billing,
html[data-embed="chatgpt"] #onboarding-modal,
html[data-embed="chatgpt"] #signup-bar,
html[data-embed="chatgpt"] #save-warning-cta,
html[data-embed="chatgpt"] #btn-signin,
html[data-embed="chatgpt"] #auth-modal,
html[data-embed="chatgpt"] main.seo-content,
html[data-embed="chatgpt"] .framed-notice,
/* Footer links open new tabs or other pages, which ChatGPT's frame does not allow. */
html[data-embed="chatgpt"] .legal-links,
html[data-embed="chatgpt"] a[href*="/billing"],
html[data-embed="chatgpt"] a[href*="/pricing"],
html[data-embed="chatgpt"] a[href*="/plans"],
html[data-embed="chatgpt"] a[href*="/refund"],
html[data-embed="chatgpt"] a[href*="/mcp-server"],
html[data-embed="chatgpt"] a[href*="/mcp-early-access"],
html[data-embed="chatgpt"] a[href="/usage"] { display: none !important; }

/* ===== Whiteboard (2026-10-18) =====
   The canvas fills the window over the editor; only the board, what is
   drawn on it and the small toolbar remain. */
body.wb-on .canvas-area { position: fixed; inset: 0; z-index: 105; background: #0B0B10; }
body.wb-on #canvas { background: #0B0B10; }
body.wb-on .pages-strip,
body.wb-on .rulers,
body.wb-on .zoom-pill,
body.wb-on .fit-menu,
body.wb-on .ab-nav,
body.wb-on #grid-rect,
body.wb-on #canvas rect[fill="url(#grid)"],
body.wb-on #canvas .ab-label,
body.wb-on #canvas .ab-frame,
body.wb-on #canvas .ab-handle,
body.wb-on #canvas .ab-group-frame,
body.wb-on #canvas .ab-group-grab,
body.wb-on #canvas .ab-group-label,
body.wb-on #cursor-glow,
body.wb-on .statusbar,
body.wb-on .feedback-toggle,
body.wb-on .feedback-panel,
body.wb-on .signup-bar,
body.wb-on #hint { display: none !important; }
body.wb-on .text-editor {
  z-index: 107; border-color: transparent; background: transparent; box-shadow: none;
  caret-color: #B5FF3A; padding: 0;
}
#canvas.wb-eraser { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23F2F0EA' stroke-width='2'/%3E%3C/svg%3E") 12 12, crosshair !important; }

.wb-bar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 110;
  display: flex; align-items: center; gap: 2px; padding: 5px;
  background: rgba(20, 20, 27, 0.92); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, opacity 0.25s ease;
  width: max-content; max-width: calc(100vw - 16px); box-sizing: border-box; overflow-x: auto;
}
.wb-bar.is-tucked { transform: translate(-50%, calc(-100% - 20px)); opacity: 0; }
.wb-bar button {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  height: 36px; min-width: 36px; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; color: #A1A1AF; cursor: pointer; font: 600 12.5px Inter, system-ui, sans-serif;
}
.wb-bar button:hover { background: rgba(255, 255, 255, 0.06); color: #F5F5F7; }
.wb-bar button[aria-pressed="true"] { background: rgba(181, 255, 58, 0.16); color: #B5FF3A; }
.wb-bar .wb-ink { min-width: 30px; padding: 0; }
.wb-bar .wb-ink::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); }
.wb-bar .wb-ink[aria-pressed="true"] { background: rgba(255, 255, 255, 0.08); }
.wb-bar .wb-ink[aria-pressed="true"]::before { box-shadow: 0 0 0 2px #0B0B10, 0 0 0 4px var(--ink); }
.app-mode-switch { margin-left: 14px; flex: none; }
.wb-bar .wb-mode-switch { margin-left: 6px; flex: none; }
.wb-bar .wb-mode-switch button { height: 28px; min-width: 0; padding: 0 11px; border-radius: var(--r-pill); font-size: 12px; }
.wb-bar .wb-mode-switch button[aria-pressed="true"] { background: #B5FF3A; color: #0B0B10; }
/* Sign-in and export prompts stay reachable over the board. */
body.wb-on .modal { z-index: 111; }
.wb-sep { flex: none; width: 1px; height: 22px; margin: 0 5px; background: rgba(255, 255, 255, 0.1); }
.wb-bar { overflow: visible; }
.wb-bar .mode-switch { overflow: hidden; }
.wb-pull {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 110;
  width: 56px; height: 18px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.10); border-top: 0; border-radius: 0 0 10px 10px;
  background: rgba(20, 20, 27, 0.75); color: #A1A1AF; cursor: pointer; opacity: 0.55;
  transition: opacity 0.2s ease, height 0.2s ease;
}
.wb-pull:hover, .wb-pull:focus-visible { opacity: 1; height: 24px; color: #B5FF3A; }
.wb-note {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); z-index: 110;
  background: rgba(20, 20, 27, 0.92); color: #D7D5CF; border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px; padding: 8px 16px; font: 13px Inter, system-ui, sans-serif;
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none;
}
.wb-note.is-on { opacity: 1; transform: translate(-50%, 0); }
/* Above the bottom bar (Import, Export, the mode switch), never over it. */
.wb-note { bottom: 80px; max-width: calc(100vw - 48px); text-align: center; }
.wb-font-wrap { position: relative; flex: none; }
.wb-bar .wb-font-btn { font-size: 19px; font-weight: 400; color: #F5F5F7; min-width: 44px; }
.wb-font-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px; width: 372px;
  background: rgba(20, 20, 27, 0.97); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.wb-font-menu button {
  height: 52px; border: 0; border-radius: 8px; background: transparent; color: #F2F0EA;
  font-size: 22px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
}
.wb-font-menu button:hover { background: rgba(255, 255, 255, 0.06); }
.wb-font-menu button[aria-pressed="true"] { background: rgba(181, 255, 58, 0.16); color: #B5FF3A; }
/* Boards (owner, 21 Oct): which board this is, and a list to go to or delete one. */
.wb-boards-wrap { position: relative; flex: none; }
.wb-bar .wb-boards-btn { min-width: 104px; font-variant-numeric: tabular-nums; color: #F5F5F7; }
.wb-bar button:disabled { opacity: 0.35; cursor: default; background: transparent; }
.wb-board-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 2px; padding: 6px; width: 300px; max-height: 60vh; overflow-y: auto;
  background: rgba(20, 20, 27, 0.97); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.wb-board-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.wb-board-row.is-on { background: rgba(181, 255, 58, 0.12); }
.wb-board-menu .wb-board-row > button[data-wb-go] {
  flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; justify-content: flex-start;
  border: 0; border-radius: 8px; background: transparent; color: #F2F0EA; cursor: pointer; font: 600 13.5px Inter, system-ui, sans-serif; text-align: left;
}
.wb-board-menu .wb-board-row > button[data-wb-go]:hover { background: rgba(255, 255, 255, 0.06); }
.wb-board-n { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(255, 255, 255, 0.08); font-size: 12px; }
.wb-board-row.is-on .wb-board-n { background: #B5FF3A; color: #0B0B10; }
.wb-board-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-board-count { flex: none; color: #8A8A99; font-weight: 500; font-size: 12px; }
/* Round 4, CHALK-UI (the owner's sixth test video, 8 Nov 2026). */
/* M86: whole board names: a wider list, names wrap to two lines. */
.wb-board-menu { width: min(440px, calc(100vw - 32px)); }
.wb-board-menu .wb-board-row > button[data-wb-go] { height: auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
.wb-board-menu .wb-board-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* M90: the Chalk Board's own right-click menu, always inside the window. */
.wb-ctx-menu {
  position: fixed; z-index: 150; min-width: 220px; max-width: calc(100vw - 16px); overflow-y: auto; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 1px; padding: 6px;
  background: rgba(20, 20, 27, 0.98); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); font: 13px Inter, system-ui, sans-serif; color: #F2F0EA;
}
.wb-ctx-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex: none; height: 32px; padding: 0 10px;
  border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.wb-ctx-menu button:hover:not(:disabled), .wb-ctx-menu button:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.wb-ctx-menu button:disabled { opacity: 0.35; cursor: default; }
.wb-ctx-menu button.is-danger { color: #FF8A8A; }
.wb-ctx-menu kbd { font: 500 11px Inter, system-ui, sans-serif; color: #8A8A99; }
.wb-ctx-sep { flex: none; height: 1px; margin: 4px 6px; background: rgba(255, 255, 255, 0.08); }
.wb-ctx-title { padding: 4px 10px 2px; color: #8A8A99; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
/* M92: a locked piece: a faint dashed frame and a lock mark to click. */
#wb-ui-layer { pointer-events: none; }
#wb-ui-layer .wb-lockmark-frame { fill: none; stroke: rgba(242, 240, 234, 0.35); }
#wb-ui-layer .wb-lockmark-btn { pointer-events: auto; cursor: pointer; }
#wb-ui-layer .wb-lockmark-btn circle { fill: rgba(20, 20, 27, 0.92); stroke: rgba(242, 240, 234, 0.5); stroke-width: 1.2; }
#wb-ui-layer .wb-lockmark-btn path { stroke: #F2F0EA; }
#wb-ui-layer .wb-lockmark-btn rect { fill: #F2F0EA; }
#wb-ui-layer .wb-lockmark-btn:hover circle { stroke: #B5FF3A; }
/* M85: chalk dust where something is wiped. */
#wb-ui-layer .wb-dust-grain { fill: rgba(245, 242, 232, 0.9); }
#wb-ui-layer .wb-dust-smudge { fill: rgba(242, 240, 234, 0.5); filter: blur(10px); opacity: 0; }
/* M95: which boards a lettering is for. */
.wb-letter-scope {
  position: fixed; z-index: 120; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 12px;
  background: rgba(20, 20, 27, 0.98); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); color: #F2F0EA; font: 13px Inter, system-ui, sans-serif;
}
.wb-letter-scope-q { margin: 0 0 10px; font-size: 20px; line-height: 1.2; }
.wb-letter-scope-row { display: flex; gap: 6px; flex-wrap: wrap; }
.wb-letter-scope-row button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(181, 255, 58, 0.16); color: #B5FF3A; font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.wb-letter-scope-row button.is-quiet { background: transparent; color: #A1A1AF; }
.wb-letter-scope-row button:hover { filter: brightness(1.15); }
/* M88: what the Chalk Board is for, on an empty board. */
.wb-help {
  position: fixed; z-index: 105; width: min(560px, calc(100vw - 32px)); box-sizing: border-box; padding: 22px 24px 18px;
  background: rgba(16, 16, 22, 0.94); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5); color: #F2F0EA; font: 14px Inter, system-ui, sans-serif;
  pointer-events: none; /* a press on the card itself goes to the board: drawing starts there and the card steps aside */
}
.wb-help button { pointer-events: auto; }
.wb-help-h { margin: 0 0 4px; font: 400 34px/1.1 "Schoolbell", "Gochi Hand", cursive; color: #F2F0EA; }
.wb-help-sub { margin: 0 0 14px; color: #A1A1AF; line-height: 1.4; }
.wb-help-uses { display: flex; flex-direction: column; gap: 4px; }
.wb-help-use { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px; }
.wb-help-use:hover { background: rgba(255, 255, 255, 0.04); }
.wb-help-use-t { flex: 1; min-width: 0; line-height: 1.35; }
.wb-help-use-t b { display: block; font: 400 22px/1.15 "Schoolbell", "Gochi Hand", cursive; color: #B5FF3A; }
.wb-help-use-t span { color: #C9C7C0; font-size: 13px; }
.wb-help-use button { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(181, 255, 58, 0.16); color: #B5FF3A; font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; }
.wb-help-use button:hover { background: rgba(181, 255, 58, 0.26); }
.wb-help-foot { margin: 12px 0 0; color: #8A8A99; font-size: 12.5px; }
.wb-help-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #A1A1AF; font-size: 20px; line-height: 1; cursor: pointer; }
.wb-help-x:hover { background: rgba(255, 255, 255, 0.06); color: #F5F5F7; }
@media (max-width: 560px) { .wb-help-use { flex-wrap: wrap; } }
/* Chalk charts answer the pointer (owner's fifth test video, 7 Nov 2026): the
   part under it stays, the rest of its chart dims, a chalk label says its value. */
#content .wb-dim { opacity: 0.28; transition: opacity 0.18s ease; }
#content .wb-hot { opacity: 1; transition: opacity 0.18s ease; }
#canvas.wb-chart-hover { cursor: pointer; }
.wb-chart-tip {
  position: fixed; z-index: 140; pointer-events: none; max-width: 320px;
  padding: 6px 14px 7px; border-radius: 12px; border: 2px solid var(--tip, #F2F0EA);
  background: rgba(11, 11, 16, 0.94); color: var(--tip, #F2F0EA);
  font-family: 'Schoolbell', 'Gochi Hand', cursive; font-size: 24px; line-height: 1.15; white-space: normal; max-width: 380px; overflow-wrap: anywhere;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(4px) scale(0.96); transition: opacity 0.14s ease, transform 0.14s ease;
}
.wb-chart-tip.is-on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .wb-chart-tip, #content .wb-dim, #content .wb-hot { transition: none; } }
/* Round 4 (owner's sixth test video, 8 Nov 2026): a chart's own controls while
   the pointer is over it (Full board, Play, 2D or 3D), the chart shown on the
   whole board with Back, and Play for the board with when it plays in. */
.wb-chart-chip, .wb-focus-bar {
  position: fixed; z-index: 120; display: flex; gap: 2px; padding: 4px;
  background: rgba(11, 11, 16, 0.94); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.wb-chart-chip button, .wb-focus-bar button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 0; border-radius: 8px;
  background: transparent; color: #F2F0EA; cursor: pointer; font: 600 13px Inter, system-ui, sans-serif; white-space: nowrap;
}
.wb-chart-chip button:hover, .wb-focus-bar button:hover { background: rgba(181, 255, 58, 0.16); color: #B5FF3A; }
.wb-focus-bar button[data-wb-focus="back"] { background: rgba(181, 255, 58, 0.16); color: #B5FF3A; }
#canvas.wb-focus #content > :not(.wb-focus-on) { opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
#canvas.wb-focus-leaving #content > * { transition: opacity 0.3s ease; }
.wb-play-wrap { position: relative; display: flex; align-items: center; flex: none; }
.wb-bar .wb-play-btn { gap: 6px; color: #F5F5F7; padding-right: 6px; }
.wb-bar .wb-play-more { min-width: 26px; padding: 0 4px; }
.wb-play-menu {
  position: absolute; bottom: calc(100% + 10px); left: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px; width: 260px;
  background: rgba(20, 20, 27, 0.97); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.wb-play-head { padding: 6px 10px 4px; color: #A1A1AF; font: 500 12px Inter, system-ui, sans-serif; }
.wb-bar .wb-play-menu button { justify-content: flex-start; height: 38px; color: #F2F0EA; font-size: 13.5px; }
.wb-bar .wb-play-menu button[aria-checked="true"] { background: rgba(181, 255, 58, 0.16); color: #B5FF3A; }
@media (prefers-reduced-motion: reduce) { #canvas.wb-focus #content > *, #canvas.wb-focus-leaving #content > * { transition: none; } }
.wb-board-menu .wb-board-del {
  flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #A1A1AF; cursor: pointer;
}
.wb-board-menu .wb-board-del:hover:not(:disabled) { background: rgba(255, 107, 107, 0.14); color: #FF8A8A; }
.wb-board-menu .wb-board-del:disabled { opacity: 0.3; cursor: default; }
.wb-bar.wb-side { top: auto; left: auto; right: 14px; bottom: 14px; transform: none; }
.wb-bar.wb-side.is-tucked { transform: translateY(calc(100% + 20px)); opacity: 0; }
.wb-side .wb-mode-switch { margin-left: 4px; }
/* A stick of chalk while drawing on the board (owner, 7 Nov 2026: "it needs
   to look like a chalk", the white stick teachers wrote with). The tip, at
   the bottom left, is where the line starts. Space to pan keeps its hand. */
#canvas.wb-chalk-cursor:not(.cursor-grab):not(.cursor-grabbing) { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg transform='rotate(-45 16 16)'%3E%3Cpath d='M2.4 13.3L4 13.05L27.4 12.5Q29.3 12.6 29.4 14.3L29.5 17.8Q29.3 19.4 27.4 19.5L3.9 18.95L2.5 18.75Q1.2 18.2 0.9 16.9L1.1 16.1L0.8 15.3Q1.1 13.8 2.4 13.3Z' fill='%23F2F0EA' stroke='%230B0B10' stroke-opacity='.6' stroke-width='1'/%3E%3Cpath d='M27.3 12.9Q28.9 13 29 14.4L29.1 17.7Q28.9 19 27.3 19.1Z' fill='%23D3CFC5'/%3E%3Cpath d='M5 14.9h2.2M9.5 14.75h3.6M15.5 15h1.8M19 14.7h4.5M6.2 17.25h2.6M11.4 17.4h1.2M14.6 17.15h5.2M22.2 17.3h2.2' stroke='%23C9C5BB' stroke-width='.7' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='16.1' r='.45' fill='%23BDB9AF'/%3E%3Ccircle cx='13.6' cy='16.3' r='.35' fill='%23BDB9AF'/%3E%3Ccircle cx='20.4' cy='15.9' r='.4' fill='%23BDB9AF'/%3E%3Ccircle cx='24.8' cy='16.4' r='.35' fill='%23BDB9AF'/%3E%3Cpath d='M1.6 14.5Q2.5 13.9 3.3 14.1' stroke='%23FFFFFF' stroke-width='.7' stroke-linecap='round' fill='none'/%3E%3C/g%3E%3Ccircle cx='3' cy='29.5' r='.75' fill='%23F2F0EA' opacity='.7'/%3E%3Ccircle cx='7.4' cy='30.3' r='.5' fill='%23F2F0EA' opacity='.5'/%3E%3Ccircle cx='1.6' cy='26.4' r='.4' fill='%23F2F0EA' opacity='.5'/%3E%3C/svg%3E") 5 27, crosshair !important; }
/* Import on the board: two choices, then the editor's artboards (owner, 7 Nov 2026). */
.wb-import-menu, .wb-pick {
  position: fixed; z-index: 112; box-sizing: border-box;
  background: rgba(20, 20, 27, 0.97); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); font: 13px Inter, system-ui, sans-serif; color: #F2F0EA;
}
.wb-import-menu { display: flex; flex-direction: column; gap: 2px; padding: 6px; width: 272px; }
.wb-import-menu button, .wb-pick-row {
  display: flex; border: 0; border-radius: 8px; background: transparent; color: #F2F0EA; cursor: pointer; text-align: left; font: inherit;
}
.wb-import-menu button { flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; }
.wb-import-menu button:hover, .wb-import-menu button:focus-visible, .wb-pick-row:hover:not(:disabled), .wb-pick-row:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.wb-imp-t { font-weight: 600; font-size: 13.5px; }
.wb-imp-s { color: #8A8A99; font-size: 12px; }
.wb-pick { display: flex; flex-direction: column; width: 340px; max-width: calc(100vw - 16px); max-height: min(70vh, 560px); padding: 6px; }
.wb-pick-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 2px 10px; font-weight: 600; font-size: 14px; }
.wb-pick-x { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: #A1A1AF; cursor: pointer; }
.wb-pick-x:hover { background: rgba(255, 255, 255, 0.06); color: #F5F5F7; }
.wb-pick-note { padding: 2px 10px 8px; color: #8A8A99; font-size: 12px; line-height: 1.4; }
.wb-pick-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.wb-pick-row { align-items: center; gap: 12px; padding: 6px 8px; min-height: 56px; }
.wb-pick-row:disabled { opacity: 0.4; cursor: default; }
.wb-pick-thumb {
  flex: none; width: 76px; height: 46px; border-radius: 6px; overflow: hidden; display: block;
  background: #0B0B10; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.wb-pick-thumb svg { display: block; width: 100%; height: 100%; }
.wb-pick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wb-pick-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-pick-sub { color: #8A8A99; font-size: 12px; }
html.ui-v2 .wb-import-menu, html.ui-v2 .wb-pick { background: var(--ui2-surface, rgba(20, 20, 27, 0.97)); border: 0; box-shadow: var(--ui2-elev-dialog, 0 12px 32px rgba(0, 0, 0, 0.5)); border-radius: var(--ui2-r-md, 12px); }
@media (max-width: 760px) { .wb-bar { overflow-x: auto; } .wb-font-menu { position: fixed; top: 64px; width: min(372px, calc(100vw - 16px)); } }

/* A phone-width window (19 Oct, round 4 re-check): the page was 905 px wide
   at 375 px and the Design / Prototype switch could not be reached. The one
   column never grows past the window; a row too wide for it scrolls inside
   itself; the panel keeps its mode switch (its other bar buttons stay off). */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .app > * { min-width: 0; }
  .topbar-row { overflow-x: auto; }
  .properties .panel-bar { display: flex; }
  .properties .panel-bar > :not(.mode-switch) { display: none; }
  .statusbar { white-space: nowrap; overflow-x: auto; overflow-y: hidden; gap: 8px; }
  .statusbar #status { flex: 1 0 60%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .statusbar-right { flex: 0 0 auto; }
}

/* ===== 37. AI Generate: free to create, $3 to export (2026-10-19) ===== */
.aigen-offer {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 5, 7, 0.62); padding: 16px;
}
.aigen-offer-card {
  width: min(420px, 100%); background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-soft); border-radius: 14px; padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.aigen-offer-title { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.aigen-offer-body { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.aigen-offer-list { margin: 0 0 16px; padding-left: 18px; color: var(--ink); font-size: 13px; line-height: 1.7; }
.aigen-offer-list li::marker { color: var(--accent); }
.aigen-offer-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
/* 36g. Upgrade card at the free limits (2026-10-26): reuses the offer card. */
.upgrade-offer-price { margin: 0 0 16px; color: var(--ink); font-size: 14px; font-weight: 600; }
.upgrade-offer .aigen-offer-actions a.app-dialog-btn { text-decoration: none; display: inline-flex; align-items: center; }
/* "What stopped you?" after Not now (2026-10-27). */
.why-not-options { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.why-not-options .app-dialog-btn { justify-content: flex-start; text-align: left; width: 100%; }
.why-not-other { display: flex; gap: 6px; margin: 0 0 12px; }
.why-not-other[hidden] { display: none; }
.why-not-other input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel-sunken); color: var(--ink); font: inherit; font-size: 13px; }
/* Prototype animations that come with Starter (2026-10-26). */
.proto-card.is-locked { position: relative; }
.proto-card.is-locked .proto-demo { opacity: 0.55; }
.proto-card-lock { position: absolute; top: 4px; right: 4px; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(11, 11, 16, 0.72); color: var(--accent); }
/* M115: a paid card's note, under its row, with an X (never a window over the page). */
.proto-lock-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 6px 6px 6px 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--panel-sunken, rgba(255,255,255,0.04)); font-size: 12px; line-height: 1.35; }
.proto-lock-note-words { flex: 1 1 auto; min-width: 0; }
.proto-lock-note-go { flex: none; color: var(--accent); font-weight: 700; text-decoration: underline; }
.proto-lock-note-x { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; opacity: 0.7; }
.proto-lock-note-x:hover { opacity: 1; background: rgba(255,255,255,0.08); }
@media print {
  .aigen-print-locked #canvas-area, .aigen-print-locked #canvas { display: none !important; }
}

/* ===== Editor layout v2 (2026-10-19) =====
   Design 1 of the 19 Oct redesign, built in stages behind ?ui=2: index.html
   puts html.ui-v2 on the page before the first paint. Plan:
   docs/superpowers/plans/2026-10-19-editor-v2-build-plan.md.
   Every rule here is scoped to html.ui-v2, so without the switch nothing
   changes. Below 721px the editor keeps the stacked phone layout.
   Stage 1: a 64px top row with 40px controls and 14px text, Undo and Redo
   beside the brand. Stage 2: the labelled rail (Select, Shapes, Draw, Text)
   and one drawer at a time in place of the old tool column, which stays in
   the page, hidden, for the MCP and the keyboard. Stage 3a: AI and Uploads.
   Stage 3b: Icons. Stage 3c: Photos. Stage 4: Layers. Stage 5: the context bar. Stage 6: Details.
   Stage 7: the size and spacing pass. Stage 8: Help.
   Stage 9: special views (watch banner, embed). The owner review of
   20 Oct (black, round, glass, one row, movable panels) and the UI skills
   pass of the same day are the last two blocks. */
.ui2-rail, .ui2-drawer { display: none; }
@media (min-width: 721px) {
  html.ui-v2 .app {
    grid-template-columns: 88px auto minmax(0, 1fr) auto;
    grid-template-areas:
      "topbar topbar topbar topbar"
      "rail drawer canvas properties";
  }
  html.ui-v2 .app.props-detached { grid-template-columns: 88px auto minmax(0, 1fr) auto; }
  /* The old tool column: still pressed by the MCP (nativeToolButton) and the
     shortcut keys, never shown in the new layout. */
  html.ui-v2 .toolbar { display: none !important; }

  html.ui-v2 .ui2-rail {
    grid-area: rail;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-height: 0; padding: 8px 0 12px; overflow-y: auto;
    background: var(--bg-deep);
    border-right: 1px solid var(--line);
  }
  html.ui-v2 .ui2-rail-btn {
    width: 72px; min-height: 66px; padding: 8px 4px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    background: none; border: 0; color: var(--ink-2);
    font: 500 13.5px/1.2 var(--font-sans); cursor: pointer;
  }
  html.ui-v2 .ui2-rail-btn:hover { background: var(--panel-2); color: var(--ink); }
  html.ui-v2 .ui2-rail-btn.on { background: rgba(181, 255, 58, 0.14); color: var(--ink); }
  html.ui-v2 .ui2-rail-btn.on svg { color: var(--accent); }
  html.ui-v2 .ui2-rail-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  html.ui-v2 .ui2-drawer.open {
    grid-area: drawer;
    display: flex; flex-direction: column;
    width: 340px; min-height: 0;
    background: var(--panel);
    border-right: 1px solid var(--line);
  }
  html.ui-v2 .ui2-drawer-head { display: flex; align-items: center; gap: 8px; padding: 18px 16px 12px 20px; }
  html.ui-v2 .ui2-drawer-title { flex: 1; margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
  html.ui-v2 .ui2-drawer-close {
    height: 40px; padding: 0 12px;border: 0; background: none;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--ink-2); font: 500 14px var(--font-sans); cursor: pointer;
  }
  html.ui-v2 .ui2-drawer-close:hover { background: var(--panel-2); color: var(--ink); }
  html.ui-v2 .ui2-drawer-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 20px 24px; }
  html.ui-v2 .ui2-label { margin: 18px 0 10px; color: var(--ink-3); font-size: 14px; font-weight: 500; }
  html.ui-v2 .ui2-label:first-child { margin-top: 0; }
  html.ui-v2 .ui2-note { margin: 12px 0 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.5; }
  html.ui-v2 .ui2-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  html.ui-v2 .ui2-tiles.two { grid-template-columns: repeat(2, 1fr); }
  html.ui-v2 .ui2-tile {
    min-height: 92px; padding: 12px 6px;border: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: var(--panel-2); color: var(--ink-2);
    font: 500 14px/1.25 var(--font-sans); text-align: center; cursor: pointer;
  }
  html.ui-v2 .ui2-tile svg { width: 30px; height: 30px; }
  html.ui-v2 .ui2-tile:hover { background: var(--panel-3); color: var(--ink); }
  html.ui-v2 .ui2-tile.on { box-shadow: inset 0 0 0 2px var(--accent); color: var(--ink); }
  html.ui-v2 .ui2-tile:focus-visible,
  html.ui-v2 .ui2-wide:focus-visible,
  html.ui-v2 .ui2-font:focus-visible,
  html.ui-v2 .ui2-addtext:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  html.ui-v2 .ui2-key {
    display: inline-block; min-width: 22px; padding: 0 6px;
    border: 1px solid var(--line-soft); color: var(--ink-3);
    font: 500 12px/20px var(--font-sans); text-align: center;
  }
  html.ui-v2 .ui2-wide {
    width: 100%; margin-bottom: 8px; padding: 14px;border: 0;
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--panel-2); color: var(--ink); text-align: left; cursor: pointer;
    font-family: var(--font-sans);
  }
  html.ui-v2 .ui2-wide:hover { background: var(--panel-3); }
  html.ui-v2 .ui2-wide.on { box-shadow: inset 0 0 0 2px var(--accent); }
  html.ui-v2 .ui2-wide .ui2-ic { width: 40px; height: 40px;background: var(--bg); display: grid; place-items: center; flex: none; }
  html.ui-v2 .ui2-wide .ui2-ic svg { width: 22px; height: 22px; }
  html.ui-v2 .ui2-wide .ui2-txt { flex: 1; min-width: 0; }
  html.ui-v2 .ui2-wide b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
  html.ui-v2 .ui2-wide b .ui2-key { margin-left: auto; }
  html.ui-v2 .ui2-wide .ui2-desc { display: block; margin-top: 3px; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
  html.ui-v2 .ui2-addtext {
    width: 100%; margin-bottom: 8px; padding: 14px 16px;border: 0;
    background: var(--panel-2); color: var(--ink); text-align: left; cursor: pointer; font-family: var(--font-sans);
  }
  html.ui-v2 .ui2-addtext:hover { background: var(--panel-3); }
  html.ui-v2 .ui2-font {
    width: 100%; margin-bottom: 8px; padding: 12px 16px;border: 0;
    display: flex; align-items: baseline; gap: 10px;
    background: var(--panel-2); color: var(--ink); text-align: left; cursor: pointer;
  }
  html.ui-v2 .ui2-font:hover { background: var(--panel-3); }
  html.ui-v2 .ui2-font.on { box-shadow: inset 0 0 0 2px var(--accent); }
  html.ui-v2 .ui2-font .ui2-sample { flex: 1; min-width: 0; font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.ui-v2 .ui2-font .ui2-fname { color: var(--ink-3); font: 500 13px var(--font-sans); white-space: nowrap; }

  /* Stage 3a: the AI and Uploads drawers. */
  html.ui-v2 .ui2-wide .ui2-price { color: var(--ink-3); margin-top: 6px; }
  html.ui-v2 .ui2-drop {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 28px 18px;border: 2px dashed var(--line-soft);
    color: var(--ink-2); font-size: 14px; text-align: center;
  }
  html.ui-v2 .ui2-drop svg { width: 32px; height: 32px; color: var(--ink-3); margin-bottom: 4px; }
  html.ui-v2 .ui2-drop b { color: var(--ink); font-size: 15px; font-weight: 600; }
  html.ui-v2 .ui2-drop.over { border-color: var(--accent); background: rgba(181, 255, 58, 0.06); }
  html.ui-v2 .ui2-btn {
    margin-top: 10px; height: 42px; padding: 0 16px;border: 0;
    background: var(--panel-2); color: var(--ink); font: 500 14px var(--font-sans); cursor: pointer;
  }
  html.ui-v2 .ui2-btn:hover { background: var(--panel-3); }
  html.ui-v2 .ui2-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* Stage 3b: the Icons drawer. */
  html.ui-v2 .ui2-search { display: block; margin-bottom: 4px; }
  html.ui-v2 .ui2-search input {
    width: 100%; height: 46px; padding: 0 14px;
    border: 1px solid transparent; background: var(--bg); color: var(--ink);
    font: 400 14px var(--font-sans);
  }
  html.ui-v2 .ui2-search input::placeholder { color: var(--ink-3); }
  html.ui-v2 .ui2-search input:focus { outline: none; border-color: var(--accent); }
  html.ui-v2 .ui2-icon {
    min-height: 86px; padding: 12px 4px 10px;border: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: var(--panel-2); color: var(--ink-2);
    font: 500 13px/1.2 var(--font-sans); text-align: center; cursor: pointer;
  }
  html.ui-v2 .ui2-icon svg { width: 28px; height: 28px; color: var(--ink); }
  html.ui-v2 .ui2-icon:hover { background: var(--panel-3); color: var(--ink); }
  html.ui-v2 .ui2-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* Stage 4: the Layers drawer holds the re-homed artboard list and Layers
     section. In the drawer the artboard list is a plain list, not the
     floating, draggable glass card it is over the canvas. Layer rows keep
     their 18px content box (contain-intrinsic-size, layers-offscreen) and
     gain padding to reach 42px. */
  html.ui-v2 .ui2-drawer #ab-nav {
    position: static !important; inset: auto !important; width: auto !important; max-height: none !important;
    background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; box-shadow: none;font-size: 14px;
  }
  html.ui-v2 .ui2-drawer #ab-nav .ab-nav-head { display: none; }
  html.ui-v2 .ui2-drawer #ab-nav .ab-nav-body,
  html.ui-v2 .ui2-drawer #ab-nav .ab-nav-list { max-height: none; padding: 0; }
  html.ui-v2 .ui2-drawer #ab-nav .ab-nav-item { min-height: 42px; padding: 0 10px;font-size: 14px; }
  html.ui-v2 .ui2-drawer #ab-nav .ab-nav-add { width: 100%; height: 42px; margin-top: 8px;font-size: 14px; }
  html.ui-v2 .ui2-drawer #ab-nav .ab-nav-actions button { height: 40px; font-size: 14px; }
  html.ui-v2 .ui2-drawer .prop-group { padding: 0; margin: 0; border: 0; }
  html.ui-v2 .ui2-drawer .prop-group .layers-head { display: none; }
  html.ui-v2 .ui2-drawer #layers { max-height: none; margin: 0; border: 0; background: none;}
  html.ui-v2 .ui2-drawer #layers li { padding: 11px 10px 11px 14px; font-size: 14px; line-height: 18px;}

  /* Prototype mode lets only Select and Hand through (setTool blocks the
     rest); the rail follows. Chalk Board has its own bar. */
  /* Stage 5: the context bar over the canvas and its pop-ups. The artboard
     row now lives in the Size pop-up, so the second top row is gone. */
  html.ui-v2 .ui2-ctx {
    position: absolute; z-index: 40; left: 50%; top: calc(var(--strip-height, 0px) + 12px); transform: translateX(-50%);
    display: flex; align-items: center; gap: 4px; padding: 6px; max-width: calc(100% - 24px); overflow-x: auto;
    background: var(--panel); border: 1px solid var(--line-soft);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.75);
  }
  html.ui-v2 .ui2-ctx:empty { display: none; }
  html.ui-v2 body.proto-mode .ui2-ctx, html.ui-v2 body.wb-on .ui2-ctx { display: none; }
  html.ui-v2 .ui2-cbtn {
    height: 44px; padding: 0 14px;border: 0; background: none;
    display: inline-flex; align-items: center; gap: 8px; flex: none;
    color: var(--ink-2); font: 500 14px var(--font-sans); white-space: nowrap; cursor: pointer;
  }
  html.ui-v2 .ui2-cbtn svg { width: 18px; height: 18px; }
  html.ui-v2 .ui2-cbtn:hover, html.ui-v2 .ui2-cbtn.open { background: var(--panel-2); color: var(--ink); }
  html.ui-v2 .ui2-cbtn[aria-pressed="true"] { color: var(--accent); }
  html.ui-v2 .ui2-cbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  html.ui-v2 .ui2-cname { padding: 0 10px 0 12px; color: var(--ink-3); font: 500 14px var(--font-sans); white-space: nowrap; }
  html.ui-v2 .ui2-cval { min-width: 28px; text-align: center; color: var(--ink); font: 500 14px var(--font-sans); }
  html.ui-v2 .ui2-csep { width: 1px; height: 26px; background: var(--line-soft); margin: 0 4px; flex: none; }
  html.ui-v2 .ui2-sw { width: 22px; height: 22px;box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); flex: none; }
  html.ui-v2 .ui2-sw[data-none] { background: linear-gradient(135deg, transparent 45%, var(--danger) 45% 55%, transparent 55%), var(--bg); }
  html.ui-v2 .ui2-pop {
    position: fixed; z-index: 85; width: 340px; max-width: calc(100vw - 16px); padding: 16px;
    background: var(--panel); border: 1px solid var(--line-soft);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  }
  html.ui-v2 .ui2-swgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
  html.ui-v2 .ui2-swb { aspect-ratio: 1; min-height: 40px;border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
  html.ui-v2 .ui2-swb:hover { box-shadow: 0 0 0 2px var(--accent); }
  html.ui-v2 .ui2-poprow { display: flex; gap: 8px; align-items: center; }
  html.ui-v2 .ui2-poprow .ui2-btn { margin-top: 0; }
  html.ui-v2 .ui2-custom { flex: 1; height: 42px; padding: 0 12px;background: var(--panel-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); font: 500 14px var(--font-sans); cursor: pointer; }
  html.ui-v2 .ui2-custom input { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; }
  /* The re-homed artboard row, laid out as a form inside the Size pop-up. */
  html.ui-v2 .ui2-pop .canvas-controls { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; min-height: 0; border: 0; background: none; }
  html.ui-v2 .ui2-pop .canvas-controls .row-label, html.ui-v2 .ui2-pop .canvas-controls .ctrl-sep,
  html.ui-v2 .ui2-pop .canvas-controls #btn-fit-artboard, html.ui-v2 .ui2-pop .canvas-controls #btn-artboard-lock { display: none; }
  html.ui-v2 .ui2-pop .canvas-controls .field, html.ui-v2 .ui2-pop .canvas-controls .ctrl-select,
  html.ui-v2 .ui2-pop .canvas-controls input[type="number"] { height: 42px; font-size: 14px; }
  html.ui-v2 .ui2-pop .canvas-controls #doc-preset { flex: 1 1 100%; width: 100%; max-width: none; order: -1; }
  html.ui-v2 .ui2-pop .canvas-controls #doc-unit { flex: 0 0 auto; }
  html.ui-v2 .ui2-pop .canvas-controls label { font-size: 13.5px; }

  /* Stage 6: Details. The old right panel shows only when asked for (More)
     and in Prototype mode, as a docked 344px column in Style / Arrange /
     More tabs. Its own bar (title, collapse, detach) gives way to the tabs:
     detaching does not exist in the new layout. */
  html.ui-v2 .properties {
    display: none; width: 344px; margin: 0; border: 0; border-left: 1px solid var(--line);
    position: static; inset: auto;
  }
  html.ui-v2.ui2-details-open .properties, html.ui-v2 body.proto-mode .properties { display: flex; }
  html.ui-v2 .properties > .panel-bar, html.ui-v2 .properties > .panel-resize { display: none; }
  html.ui-v2 .ui2-dtabs {
    position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 12px 12px 8px;
    background: var(--panel); border-bottom: 1px solid var(--line);
  }
  html.ui-v2 .ui2-dtabs button {
    flex: 1; height: 40px;border: 0; background: none;
    color: var(--ink-3); font: 500 14px var(--font-sans); cursor: pointer;
  }
  html.ui-v2 .ui2-dtabs button:hover { color: var(--ink); background: var(--panel-2); }
  html.ui-v2 .ui2-dtabs button[aria-selected="true"] { background: var(--panel-2); color: var(--ink); }
  html.ui-v2 .ui2-dtabs .ui2-dclose { flex: none; padding: 0 12px; }
  html.ui-v2 body.proto-mode .ui2-dtabs button[data-ui2-dtab] { display: none; }
  html.ui-v2 .properties[data-ui2-tab="style"] > .prop-group:not([data-ui2-tab="style"]):not(#proto-group),
  html.ui-v2 .properties[data-ui2-tab="arrange"] > .prop-group:not([data-ui2-tab="arrange"]):not(#proto-group),
  html.ui-v2 .properties[data-ui2-tab="more"] > .prop-group:not([data-ui2-tab="more"]):not(#proto-group) { display: none; }
  /* Stage 9: one switch, Design | Prototype | Chalk Board (#ui2-modes). The
     two old switches stay in the page for their listeners and tests. */
  html.ui-v2 .topbar .app-mode-switch,
  html.ui-v2 .topbar #mode-switch { display: none !important; }
  html.ui-v2 .ui2-modes { flex: none; }
  html.ui-v2 .topbar .proto-panel-actions { flex: none; padding: 0; gap: 6px; }
  html.ui-v2 .topbar .proto-panel-actions > button { flex: none; height: 40px; padding: 0 16px; font-size: 14px; }
  /* The top row keeps one Play, named for its screen; "From the start"
     lives in the panel beside the start screen, and in the player. */
  html.ui-v2 .topbar .proto-panel-actions > #proto-play-top { white-space: nowrap; max-width: 176px; overflow: hidden; text-overflow: ellipsis; }
  html.ui-v2 .topbar .proto-panel-actions > #proto-play-start { display: none !important; }

  /* The File menu (New, Examples, Import, Clear canvas, re-homed). */
  html.ui-v2 .ui2-file { position: relative; flex: none; }
  html.ui-v2 .ui2-file-btn {
    height: 40px; padding: 0 12px;border: 1px solid transparent; background: none;
    display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font: 500 14px var(--font-sans); cursor: pointer; white-space: nowrap;
  }
  html.ui-v2 .ui2-file-btn:hover, html.ui-v2 .ui2-file-btn[aria-expanded="true"] { background: var(--panel-2); color: var(--ink); }
  html.ui-v2 .ui2-file-menu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 80; min-width: 230px; padding: 6px;
    display: flex; flex-direction: column; gap: 2px;
    background: var(--panel); border: 1px solid var(--line-soft);box-shadow: 0 24px 60px -24px rgba(0,0,0,.8);
  }
  html.ui-v2 .ui2-file-menu > button, html.ui-v2 .ui2-file-menu > label {
    height: 44px; padding: 0 14px;border: 0; background: none; text-align: left;
    display: flex; align-items: center; color: var(--ink); font: 500 14px var(--font-sans); cursor: pointer; white-space: nowrap;
  }
  html.ui-v2 .ui2-file-menu > button:hover, html.ui-v2 .ui2-file-menu > label:hover { background: var(--panel-2); }

  /* Stage 7: the size and spacing pass. Inside Details, the Size pop-up,
     the zoom pill, the page tabs and the footer: sentence-case 14px section
     titles instead of 9.5px capitals, 36px+ controls, 13.5px labels. The
     panel is an Operate surface, so it stays calm: one density held
     everywhere, colour only for state. */
  html.ui-v2 .properties { font-size: 14px; }
  html.ui-v2 .properties > .prop-group { padding: 6px 16px 18px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) h3 {
    font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0;
    color: var(--ink); margin-bottom: 12px; padding-top: 10px;
  }
  html.ui-v2 .properties > .prop-group:not(#proto-group) h3::after { display: none; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row { grid-template-columns: 76px 1fr 66px; margin-top: 10px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row span,
  html.ui-v2 .properties > .prop-group:not(#proto-group) label,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field span { font-size: 13.5px; text-transform: none; letter-spacing: 0; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) input[type="number"],
  html.ui-v2 .properties > .prop-group:not(#proto-group) input[type="text"],
  html.ui-v2 .properties > .prop-group:not(#proto-group) select,
  html.ui-v2 .properties > .prop-group:not(#proto-group) textarea { min-height: 36px; font-size: 14px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) input[type="color"] { min-width: 40px; min-height: 36px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg { margin-top: 10px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button { min-height: 34px; padding: 6px; font-size: 13.5px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg .seg-label { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; padding: 0 10px 0 8px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) button:not(.swatch-chip):not(.seg button) { min-height: 36px; font-size: 13.5px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatch-chip { min-width: 32px; min-height: 32px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) input[type="range"] { height: 32px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatches-head span { font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--ink-2); font-weight: 500; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatch-none { min-width: 36px; }
  html.ui-v2 .ui2-pop .canvas-controls label,
  html.ui-v2 .ui2-pop .canvas-controls .field span { font-size: 13.5px; text-transform: none; letter-spacing: 0; }
  html.ui-v2 .ui2-pop .canvas-controls .field.checkbox { min-height: 40px; padding: 0 12px;}
  html.ui-v2 .zoom-pill button { min-width: 40px; height: 40px; font-size: 14px; }
  html.ui-v2 .zoom-pill #zoom-level { min-width: 64px; }
  /* Stage 9: no footer row. The status line shows each new message for a few
     seconds over the bottom of the canvas (ui2-show, set in app.js), in the
     tool hint's style; the version is in the Help menu. */
  html.ui-v2 .app { grid-template-rows: auto 1fr; }
  html.ui-v2 .statusbar {
    position: fixed; left: 104px; bottom: 16px; z-index: 50; height: auto; max-width: min(560px, calc(100vw - 420px));
    padding: 10px 16px; border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--glass-base); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-border-top), var(--shadow-e3);
    font-size: 14px; line-height: 1.45; color: var(--ink-2); letter-spacing: 0;
    pointer-events: none; opacity: 0; transform: translateY(6px);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  }
  html.ui-v2 .statusbar.ui2-show { opacity: 1; transform: none; }
  html.ui-v2 .statusbar .statusbar-right { display: none; }
  html.ui-v2 .statusbar #status:empty { display: none; }
  html.ui-v2 .hint { left: 104px; bottom: 72px; font-size: 14px; }
  html.ui-v2 .signup-bar { left: 104px; }
  /* The last small text outside the panels. */
  html.ui-v2 .zoom-pill #zoom-level { font-size: 14px; }
  html.ui-v2 .cloud-save-status { font-size: 13px; }
  html.ui-v2 #btn-user { white-space: nowrap; }
  html.ui-v2 #user-email-short { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
  /* The signed-out save warning keeps its 44px height (.app's padding-top). */
  html.ui-v2 .save-warning { font-size: 14px; padding: 6px 14px; min-height: 44px; box-sizing: border-box; }
  html.ui-v2 .save-warning-cta { min-height: 32px; padding: 0 8px; }
  html.ui-v2 .save-warning-xbtn { min-width: 32px; min-height: 32px; }
  html.ui-v2 .feedback-toggle { min-height: 36px; font-size: 13px; padding-left: 14px; padding-right: 14px; }
  html.ui-v2 .ui2-help-menu .version { display: block; padding: 8px 12px 4px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line-soft); margin-top: 4px; }
  html.ui-v2 .page-tab .tab-name { font-size: 13.5px; }
  html.ui-v2 .page-add { min-height: 32px; font-size: 13.5px; }

  /* Stage 8: Help at the foot of the rail, holding the footer's links. */
  html.ui-v2 .ui2-rail-sp { flex: 1; }
  html.ui-v2 .ui2-help-menu {
    position: fixed; z-index: 85; width: 240px; padding: 6px;
    background: var(--panel); border: 1px solid var(--line-soft);box-shadow: 0 24px 60px -24px rgba(0,0,0,.8);
  }
  html.ui-v2 .ui2-help-menu .legal-links { display: flex; flex-direction: column; gap: 2px; }
  html.ui-v2 .ui2-help-menu .legal-links .sep { display: none; }
  html.ui-v2 .ui2-help-menu .legal-links a {
    min-height: 40px; padding: 0 12px;display: flex; align-items: center;
    color: var(--ink); font: 500 14px var(--font-sans); text-decoration: none;
  }
  html.ui-v2 .ui2-help-menu .legal-links a:hover { background: var(--panel-2); }

  /* Stage 9: special views. The AI watch banner sits under the context bar
     instead of on top of it. */
  html.ui-v2 .ai-watch-banner { top: calc(var(--strip-height, 0px) + 76px); }

  /* Layers stays: in Prototype mode the artboard list is the Screens list. */
  html.ui-v2 body.proto-mode .ui2-rail [data-ui2-drawer]:not([data-ui2-drawer="layers"]) { display: none; }
  html.ui-v2 body.proto-mode .ui2-drawer:not([data-open="layers"]) { display: none; }

  html.ui-v2 .topbar > .topbar-row:not(.canvas-controls) {
    min-height: 64px; padding: 0 16px; gap: 12px; flex-wrap: wrap;
  }
  /* A label never breaks inside its button; when the row is too full (signed
     in, the row also holds Saved, the project size, Upgrade and the account
     pill) it wraps whole buttons onto a second line instead. */
  html.ui-v2 .topbar > .topbar-row:not(.canvas-controls) :is(button, a, label, .brand-name, .user-name) { white-space: nowrap; }
  html.ui-v2 .topbar .actions { gap: 6px; }
  html.ui-v2 .topbar .actions button,
  html.ui-v2 .topbar .actions .file-btn,
  html.ui-v2 .topbar .actions .btn-upgrade,
  html.ui-v2 .ui2-history button,
  html.ui-v2 .ui2-modes button {
    height: 40px; font-size: 14px;
  }
  html.ui-v2 .topbar .actions button,
  html.ui-v2 .topbar .actions .file-btn,
  html.ui-v2 .topbar .actions .btn-upgrade,
  html.ui-v2 .ui2-history button { padding: 0 14px; }
  html.ui-v2 .topbar .actions .split-btn .caret { padding: 0 10px; }
  html.ui-v2 .ui2-modes button { padding: 0 16px; }
  html.ui-v2 .ui2-history { display: flex; gap: 4px; flex: none; }
  html.ui-v2 .ui2-history button {
    background: none; border: 1px solid transparent; color: var(--ink-2); font-weight: 500;
  }
  html.ui-v2 .ui2-history button:hover { background: var(--panel-2); color: var(--ink); }
}
/* Inside ChatGPT (embed mode): Help would only hold the footer links, which
   embed mode hides; the MCP card leads to a control embed mode hides too. Listed in tests/editor-embed-commerce.json. */
html[data-embed="chatgpt"] #ui2-help-btn,
html[data-embed="chatgpt"] [data-ui2-act="mcp"] { display: none !important; }
/* The top row carries the File menu, history, the mode switch, AI
   Generate, Export, Usage and the account: tighten it on laptop widths. */
@media (min-width: 721px) and (max-width: 1440px) {
  html.ui-v2 .topbar > .topbar-row:not(.canvas-controls) { padding: 0 12px; gap: 8px; }
  html.ui-v2 .topbar .actions { gap: 4px; }
  html.ui-v2 .topbar .actions button,
  html.ui-v2 .topbar .actions .file-btn,
  html.ui-v2 .topbar .actions .btn-upgrade,
  html.ui-v2 .ui2-history button { padding: 0 10px; }
  html.ui-v2 .ui2-modes button { padding: 0 12px; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  html.ui-v2 .ui2-drawer.open { width: 300px; }
  html.ui-v2 .properties { width: 300px; }
}
/* Owner review of 20 Oct (his recorded walkthrough of ?ui=2):
   - black only: no grey bars or panels anywhere in the new layout;
   - no sharp corners: every bar and button is fully round, every card and
     panel has a large radius, floating surfaces are glass;
   - one top row at laptop widths, with fewer things in it;
   - the drawer, Details and the context bar detach and move (app.js). */
@media (min-width: 721px) {
  html.ui-v2 {
    --panel: #0B0B10;
    --panel-2: #15151C;
    --panel-3: #1F1F29;
    --ui2-black: #07070A;
    --ui2-glass: rgba(16, 16, 22, 0.72);
    --ui2-glass-line: rgba(255, 255, 255, 0.09);
    --ui2-glass-blur: blur(22px) saturate(150%);
  }
  html.ui-v2 body { background: var(--ui2-black); }
  html.ui-v2 .app { background: var(--ui2-black); }

  /* The top row: black, one line, the mode switch in the middle. */
  html.ui-v2 .topbar { background: var(--ui2-black); border-bottom: 1px solid var(--line); }
  html.ui-v2 .topbar > .topbar-row:not(.canvas-controls) { flex-wrap: nowrap; padding: 0 14px; gap: 8px; }
  html.ui-v2 .ui2-modes { margin-left: auto; }
  html.ui-v2 .topbar .actions { margin-left: auto; flex-wrap: nowrap; }
  html.ui-v2 .ai-generate-launcher,
  html.ui-v2 .topbar .divider { display: none !important; }
  html.ui-v2 .topbar .cloud-save-size:not(.is-warn):not(.is-over) { display: none !important; }
  html.ui-v2 .ui2-modes { padding: 2px; background: var(--panel-2); border: 1px solid var(--line); }
  html.ui-v2 .ui2-modes button { height: 40px; }
  html.ui-v2 #usage-toggle { background: var(--panel-2); color: var(--ink); }
  html.ui-v2 .cloud-save-status { white-space: nowrap; }

  /* Menus and pop-ups: glass, round. */
  html.ui-v2 .menu,
  html.ui-v2 .usage-panel,
  html.ui-v2 .cloud-size-panel,
  html.ui-v2 .ui2-file-menu,
  html.ui-v2 .ui2-help-menu,
  html.ui-v2 .ui2-selmenu,
  html.ui-v2 .ui2-pop {
    background: var(--ui2-glass); -webkit-backdrop-filter: var(--ui2-glass-blur); backdrop-filter: var(--ui2-glass-blur);
    border: 1px solid var(--ui2-glass-line);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  }
  html.ui-v2 .menu { padding: 6px; }
  html.ui-v2 #user-menu-dropdown .btn-upgrade {
    display: flex; align-items: center; gap: 8px; height: 42px; margin: 0 0 6px; padding: 0 16px;
justify-content: flex-start;
  }
  html.ui-v2 .ui2-code-mark { display: inline-block; min-width: 28px; margin-right: 8px; color: var(--ink-3); font-family: var(--font-mono, monospace); }

  /* The rail: black, round tiles, the tool in use lit. */
  html.ui-v2 .ui2-rail { background: var(--ui2-black); border-right: 0; }
  html.ui-v2 .ui2-rail-btn { position: relative;}
  html.ui-v2 .ui2-rail-btn.armed svg { color: var(--accent); }
  html.ui-v2 .ui2-rail-btn.armed:not(.on) { color: var(--ink); }
  html.ui-v2 .ui2-more-mark {
    position: absolute; right: 9px; bottom: 9px; width: 0; height: 0;
    border-left: 5px solid transparent; border-bottom: 5px solid currentColor; opacity: 0.55;
  }
  html.ui-v2 .ui2-selmenu { position: fixed; z-index: 86; width: 300px; padding: 8px; }
  html.ui-v2 .ui2-selmenu .ui2-wide { margin-bottom: 4px; background: transparent; }
  html.ui-v2 .ui2-selmenu .ui2-wide:last-child { margin-bottom: 0; }
  html.ui-v2 .ui2-selmenu .ui2-wide:hover { background: rgba(255, 255, 255, 0.05); }

  /* Drawer and Details: islands with round corners, docked by default. */
  html.ui-v2 .ui2-drawer.open {
    margin: 8px 0 8px 0; border: 1px solid var(--line);overflow: hidden;
    background: var(--panel);
  }
  html.ui-v2 .properties { margin: 8px 8px 8px 0; border: 1px solid var(--line);background: var(--panel); }
  html.ui-v2 .ui2-dtabs { background: var(--panel); border-bottom: 1px solid var(--line); align-items: center; }
  html.ui-v2 .ui2-search input {padding: 0 18px; }

  /* Detached panels float in glass where they were dropped. */
  html.ui-v2 .ui2-grip {
    flex: none; width: 18px; height: 30px; margin: 0 2px 0 -2px;cursor: grab;
    background: radial-gradient(circle, var(--ink-3) 1.1px, transparent 1.6px) 0 0 / 6px 6px;
    opacity: 0.55;
  }
  html.ui-v2 .ui2-grip:hover { opacity: 1; }
  html.ui-v2.ui2-dragging, html.ui-v2.ui2-dragging * { cursor: grabbing !important; user-select: none !important; }
  html.ui-v2 .ui2-drawer-head, html.ui-v2 .ui2-dtabs { cursor: grab; }
  html.ui-v2 .ui2-drawer-head button, html.ui-v2 .ui2-dtabs button { cursor: pointer; }
  html.ui-v2 .ui2-dock {
    display: none; height: 36px; padding: 0 14px; border: 1px solid var(--line-soft); background: none;
    color: var(--ink-2); font: 500 13.5px var(--font-sans); cursor: pointer;
  }
  html.ui-v2 .ui2-dock:hover { color: var(--ink); background: var(--panel-2); }
  html.ui-v2 .ui2-floating .ui2-dock { display: inline-flex; align-items: center; }
  html.ui-v2 .ui2-drawer.ui2-floating,
  html.ui-v2 .properties.ui2-floating,
  html.ui-v2 .ui2-ctx.ui2-floating {
    position: fixed !important; z-index: 70; margin: 0 !important;
    background: var(--ui2-glass); -webkit-backdrop-filter: var(--ui2-glass-blur); backdrop-filter: var(--ui2-glass-blur);
    border: 1px solid var(--ui2-glass-line); box-shadow: 0 34px 90px -30px rgba(0, 0, 0, 0.95);
  }
  html.ui-v2 .ui2-drawer.ui2-floating .ui2-dtabs,
  html.ui-v2 .properties.ui2-floating .ui2-dtabs { background: transparent; }
  html.ui-v2 .ui2-ctx.ui2-floating { max-width: calc(100vw - 16px); }

  /* The context bar: one glass pill; AI Generate first and easy to spot. */
  html.ui-v2 .ui2-ctx {
padding: 6px 8px;
    background: var(--ui2-glass); -webkit-backdrop-filter: var(--ui2-glass-blur); backdrop-filter: var(--ui2-glass-blur);
    border: 1px solid var(--ui2-glass-line); box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
    scrollbar-width: none;
  }
  html.ui-v2 .ui2-ctx::-webkit-scrollbar { display: none; }
  html.ui-v2 .ui2-cname { padding: 0 6px 0 4px; }
  html.ui-v2 .ui2-cai {
    color: var(--accent-ink); font-weight: 600;
    background: linear-gradient(135deg, #D7FF7A 0%, var(--accent) 45%, #7BE38A 100%);
    box-shadow: 0 0 0 1px rgba(181, 255, 58, 0.35), 0 10px 28px -10px var(--accent-glow);
  }
  html.ui-v2 .ui2-cai svg { width: 18px; height: 18px; color: var(--accent-ink); }
  html.ui-v2 .ui2-cai:hover { color: var(--accent-ink); background: linear-gradient(135deg, #E4FF9C 0%, var(--accent-hi) 45%, #8FF09C 100%); }

  /* Zoom, hint, status line and Feedback: glass pills. */
  html.ui-v2 .zoom-pill {
    background: var(--ui2-glass); -webkit-backdrop-filter: var(--ui2-glass-blur); backdrop-filter: var(--ui2-glass-blur);
    border: 1px solid var(--ui2-glass-line);
  }
  html.ui-v2 .signup-bar {background: var(--ui2-glass); -webkit-backdrop-filter: var(--ui2-glass-blur); backdrop-filter: var(--ui2-glass-blur); border: 1px solid var(--ui2-glass-line); }

  /* Page tabs: round, on black. */
  html.ui-v2 .pages-strip { background: var(--ui2-black); }

  /* Help: a labelled menu, left-aligned, with the version at the foot. */
  html.ui-v2 .ui2-help-menu { width: 250px; padding: 8px; }
  html.ui-v2 .ui2-help-menu .legal-links { display: flex; align-items: stretch; text-align: left; }
  html.ui-v2 .ui2-help-menu .legal-links a {
    width: 100%; box-sizing: border-box; color: var(--ink);
    justify-content: flex-start; gap: 12px; text-align: left;padding: 0 14px;
  }
  html.ui-v2 .ui2-help-menu .legal-links a svg { flex: none; color: var(--ink-2); }
  html.ui-v2 .ui2-help-menu .legal-links a.ui2-hsmall { min-height: 40px; color: var(--ink-2); font-size: 13.5px; }
  html.ui-v2 .ui2-help-menu .ui2-hsep { display: block; height: 1px; margin: 6px 10px; background: var(--line-soft); }
  html.ui-v2 .ui2-help-menu .version { border-top: 1px solid var(--line-soft); padding: 10px 14px 4px; }

  /* Every dialog in the new layout: glass, round corners, round buttons. */
  html.ui-v2 .modal-card {
    background: var(--ui2-glass); -webkit-backdrop-filter: var(--ui2-glass-blur); backdrop-filter: var(--ui2-glass-blur);
    border: 1px solid var(--ui2-glass-line);
  }
}
@media (min-width: 721px) and (max-width: 1279px) {
  html.ui-v2 .topbar > .topbar-row:not(.canvas-controls) { padding: 0 10px; gap: 6px; }
  html.ui-v2 .brand-name { display: none; }
  html.ui-v2 #user-email-short { display: none; }
  /* The owner's window (about 1150px), signed in, with Upgrade back in the
     row: a long status ("Saved 2 minutes ago") ends in an ellipsis; its
     full words are its tooltip. */
  html.ui-v2 .topbar #cloud-save-status:not([hidden]) { max-width: 124px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block; line-height: 36px; }
  html.ui-v2 .topbar #cloud-save-status:not([hidden])::before { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; }
  html.ui-v2 .topbar .actions button, html.ui-v2 .topbar .actions .file-btn, html.ui-v2 .ui2-history button { padding: 0 10px; }
  html.ui-v2 .ui2-modes button { padding: 0 11px; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  html.ui-v2 .cloud-save-status { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}
/* UI skills pass, 20 Oct (the design guides the SVG Lab MCP serves,
   mcp/guides.js: dark-ui, craft-color, craft-engineering, system-first,
   craft-typography, craft-spacing, layout-structure, slop-catalog,
   materials-and-light). It keeps the owner's direction (dark, round,
   nothing sharp) and removes the tells the guides name:
   - a tonal near-black ramp instead of pure black (dark-ui: never pure
     black; depth from value steps and 8% hairlines, never glow);
   - glass only where the canvas passes under floating chrome (the context
     bar, zoom, hint, status line, a detached panel); menus, drawers and
     dialogs are solid surfaces (materials-and-light, slop-catalog);
   - one filled accent action per view: AI Generate. Export is white on
     dark, the mode switch and selected tiles use a value step, Upgrade is
     accent text (craft-color, layout-structure);
   - rows instead of peer cards inside a panel (slop-catalog "card
     apocalypse", craft-spacing);
   - one elevation recipe: a 1px ring at 8% plus a tight and a broad faint
     shadow, for floating surfaces only; docked panels get the hairline
     only, never a border and a broad shadow on one edge (craft-engineering);
   - type on the 12 / 14 / 16 scale, weights 400 / 500 / 600 (craft-typography);
   - concentric radii: a container is its item radius plus its inset
     (craft-engineering), controls stay round. */
@media (min-width: 721px) {
  html.ui-v2 {
    /* Owner, 7 Nov 2026: "get rid of the gray color completely. Instead we
       go complete dark or completely white like this export button." The
       tonal near-black ramp below (20 Oct) read as gray, so every chrome
       surface, the canvas, inputs and tiles are pure black with a 1px
       white 14% line; hover brightens the line, never fills gray; the
       selected item is white with dark text (see "Black and white" near
       the end of this file). */
    --ui2-ground: #000000;     /* page, top row, rail */
    --ui2-canvas: #000000;     /* the workspace the artboards sit on */
    --ui2-surface: #000000;    /* drawer, Details, menus, dialogs */
    --ui2-raised: #000000;     /* inputs, tiles (they carry --ui2-line) */
    --ui2-pressed: #000000;    /* pressed; selected items are white instead */
    --ui2-line: rgba(255, 255, 255, 0.14);
    --ui2-line-hi: rgba(255, 255, 255, 0.32);
    --ui2-on: #FFFFFF;         /* selected fill, like Export */
    --ui2-on-ink: #0B0B10;     /* text on the selected fill */
    --ui2-hair: rgba(255, 255, 255, 0.14);
    --ui2-text: #FFFFFF;
    --ui2-text-2: rgba(255, 255, 255, 0.64);
    --ui2-text-3: rgba(255, 255, 255, 0.5);
    --ui2-elev: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2px 3px rgba(0, 0, 0, 0.45), 0 12px 24px rgba(0, 0, 0, 0.35);
    --ui2-elev-dialog: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2px 3px rgba(0, 0, 0, 0.45), 0 24px 48px rgba(0, 0, 0, 0.5);
    --panel: var(--ui2-surface);
    --panel-2: var(--ui2-raised);
    --panel-3: var(--ui2-pressed);
    --panel-sunken: #000000;   /* 7 Nov: black, not a near-black step */
    --bg: #000000;
    --bg-deep: #000000;
    --surface-0: #000000;
    --surface-1: #000000;
    --surface-2: #000000;
    --surface-3: #000000;
    --surface-4: #000000;
    --line-soft: rgba(255, 255, 255, 0.14);
    --ui2-black: var(--ui2-ground);
    --ui2-glass: #000000;
    --ui2-glass-line: rgba(255, 255, 255, 0.14);
    --ink: var(--ui2-text);
  }
  html.ui-v2 body, html.ui-v2 .app, html.ui-v2 .topbar, html.ui-v2 .ui2-rail, html.ui-v2 .pages-strip { background: var(--ui2-ground); }
  html.ui-v2 #canvas { background-color: var(--ui2-canvas); }

  /* One elevation recipe, floating surfaces only. */
  html.ui-v2 .menu,
  html.ui-v2 .usage-panel,
  html.ui-v2 .cloud-size-panel,
  html.ui-v2 .ui2-file-menu,
  html.ui-v2 .ui2-help-menu,
  html.ui-v2 .ui2-selmenu,
  html.ui-v2 .ui2-pop {
    background: var(--ui2-surface); -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; box-shadow: var(--ui2-elev);
padding: 6px;        /* 20px items + 6px inset */
  }
  html.ui-v2 .ui2-pop { padding: 16px;}
  html.ui-v2 .ui2-selmenu { padding: 6px; }
  html.ui-v2 .ui2-ctx { box-shadow: var(--ui2-elev); border: 0; background: var(--ui2-glass); }
  html.ui-v2 .zoom-pill { box-shadow: var(--ui2-elev); border: 0; }
  html.ui-v2 .statusbar, html.ui-v2 .hint { box-shadow: var(--ui2-elev); border: 0; }

  /* Docked panels: a surface step and a hairline, no shadow. */
  html.ui-v2 .ui2-drawer.open, html.ui-v2 .properties {
    background: var(--ui2-surface); border: 1px solid var(--ui2-hair); box-shadow: none;
  }
  html.ui-v2 .ui2-dtabs { background: var(--ui2-surface); border-bottom: 1px solid var(--ui2-hair); }
  html.ui-v2 .ui2-drawer.ui2-floating, html.ui-v2 .properties.ui2-floating {
    background: var(--ui2-glass); border: 0; box-shadow: var(--ui2-elev);
  }

  /* One filled accent action: AI Generate, flat, no gradient or glow. */
  html.ui-v2 .ui2-cai,
  html.ui-v2 .ui2-cai:hover {
    background: var(--accent); color: var(--accent-ink); box-shadow: none; font-weight: 600;
  }
  html.ui-v2 .ui2-cai:hover { background: var(--accent-hi); }
  /* Export: the finishing action in white, not a second accent. */
  html.ui-v2 .actions button#btn-export,
  html.ui-v2 .actions #export-split .caret {
    background: var(--ui2-text); color: #111114; border-color: transparent; font-weight: 600; box-shadow: none;
  }
  html.ui-v2 .actions button#btn-export:hover,
  html.ui-v2 .actions #export-split .caret:hover { background: #FFFFFF; color: #111114; box-shadow: none; }
  html.ui-v2 .actions #export-split .caret { border-left: 1px solid rgba(0, 0, 0, 0.15); }
  /* The mode switch and selected items: a value step, white text. */
  html.ui-v2 .ui2-modes { background: var(--ui2-surface); border: 1px solid var(--ui2-hair); }
  html.ui-v2 .ui2-modes button { color: var(--ui2-text-2); opacity: 1; font-weight: 500; }
  html.ui-v2 .ui2-modes button:hover { color: var(--ui2-text); }
  html.ui-v2 .ui2-modes button[aria-pressed="true"] { background: var(--ui2-pressed); color: var(--ui2-text); font-weight: 600; }
  html.ui-v2 .ui2-modes button[aria-pressed="true"] .mode-count { background: var(--ui2-text); color: #111114; }
  html.ui-v2 .ui2-rail-btn { color: var(--ui2-text-2); }
  html.ui-v2 .ui2-rail-btn:hover { background: var(--ui2-raised); color: var(--ui2-text); }
  html.ui-v2 .ui2-rail-btn.on { background: var(--ui2-pressed); color: var(--ui2-text); }
  html.ui-v2 .ui2-rail-btn.on svg, html.ui-v2 .ui2-rail-btn.armed svg { color: var(--accent); }
  /* The armed tool shows a lime icon; the filled step marks the open drawer only. */
  html.ui-v2 .ui2-rail-btn[data-ui2-group="select"].on { background: transparent; }
  html.ui-v2 .ui2-rail-btn[data-ui2-group="select"].on:hover { background: var(--ui2-raised); }
  html.ui-v2 .ui2-rail-btn.armed { color: var(--ui2-text); }
  html.ui-v2 #user-menu-dropdown .btn-upgrade {
    background: transparent; color: var(--accent); box-shadow: none; font-weight: 600;
  }
  html.ui-v2 #user-menu-dropdown .btn-upgrade:hover { background: var(--ui2-raised); }
  html.ui-v2 #user-menu-dropdown .btn-upgrade .btn-upgrade-sheen { display: none; }
  html.ui-v2 #usage-toggle { background: transparent; color: var(--ui2-text-2); }
  html.ui-v2 #usage-toggle:hover { background: var(--ui2-raised); color: var(--ui2-text); }
  html.ui-v2 .ui2-history button, html.ui-v2 .ui2-file-btn { color: var(--ui2-text-2); }
  html.ui-v2 .ui2-history button:hover, html.ui-v2 .ui2-file-btn:hover { background: var(--ui2-raised); color: var(--ui2-text); }

  /* Rows, not cards, inside the drawer and menus. */
  html.ui-v2 .ui2-wide, html.ui-v2 .ui2-font, html.ui-v2 .ui2-addtext {
    background: transparent; margin-bottom: 2px;
  }
  html.ui-v2 .ui2-wide:hover, html.ui-v2 .ui2-font:hover, html.ui-v2 .ui2-addtext:hover { background: var(--ui2-raised); }
  html.ui-v2 .ui2-wide.on, html.ui-v2 .ui2-font.on { background: var(--ui2-pressed); box-shadow: none; }
  html.ui-v2 .ui2-wide .ui2-ic { background: var(--ui2-raised); }
  html.ui-v2 .ui2-wide:hover .ui2-ic { background: var(--ui2-pressed); }
  html.ui-v2 .ui2-tile, html.ui-v2 .ui2-icon { background: var(--ui2-raised);}
  html.ui-v2 .ui2-tile:hover, html.ui-v2 .ui2-icon:hover { background: var(--ui2-pressed); }
  html.ui-v2 .ui2-tile.on { background: var(--ui2-pressed); box-shadow: inset 0 0 0 1.5px var(--accent); }
  html.ui-v2 .ui2-drop {border-color: rgba(255, 255, 255, 0.12); }
  html.ui-v2 .ui2-search input { background: var(--ui2-raised); }

  /* Type on the scale: 12 / 14 / 16, weights 400 / 500 / 600. */
  html.ui-v2 .ui2-drawer-title { font-size: 16px; font-weight: 600; }
  html.ui-v2 .ui2-label { font-size: 12px; font-weight: 500; color: var(--ui2-text-3); margin: 20px 0 8px; }
  html.ui-v2 .ui2-note { font-size: 12px; line-height: 1.5; color: var(--ui2-text-3); }
  html.ui-v2 .ui2-wide b { font-size: 14px; font-weight: 600; }
  html.ui-v2 .ui2-wide .ui2-desc { font-size: 14px; line-height: 1.45; color: var(--ui2-text-2); }
  html.ui-v2 .ui2-tile, html.ui-v2 .ui2-icon { font-size: 12px; font-weight: 500; color: var(--ui2-text-2); }
  html.ui-v2 .ui2-font .ui2-fname { font-size: 12px; color: var(--ui2-text-3); }
  html.ui-v2 .ui2-rail-btn { font-size: 14px; }
  html.ui-v2 .ui2-cbtn, html.ui-v2 .ui2-cname, html.ui-v2 .ui2-cval { font-size: 14px; }
  html.ui-v2 .ui2-cname { color: var(--ui2-text-3); }
  html.ui-v2 .ui2-dtabs button, html.ui-v2 .ui2-dock, html.ui-v2 .ui2-drawer-close { font-size: 14px; }
  html.ui-v2 .ui2-help-menu .legal-links a.ui2-hsmall { font-size: 14px; color: var(--ui2-text-2); }
  html.ui-v2 .ui2-help-menu .version { font-size: 12px; color: var(--ui2-text-3); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) label, html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row span, html.ui-v2 .properties > .prop-group:not(#proto-group) .field span,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button, html.ui-v2 .properties > .prop-group:not(#proto-group) button:not(.swatch-chip):not(.seg button),
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatches-head span { font-size: 14px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg .seg-label { font-size: 12px; }
  html.ui-v2 .page-tab .tab-name, html.ui-v2 .page-add { font-size: 14px; }

  /* Dialogs: a solid surface with the dialog elevation; glass is for
     chrome over the canvas, not for a page nothing scrolls under. */
  html.ui-v2 .modal-card {
    background: var(--ui2-surface); -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; box-shadow: var(--ui2-elev-dialog);
  }
  html.ui-v2 .mcp-conn-list > li {background: var(--ui2-raised); border: 0; }
  html.ui-v2 .signup-bar { background: var(--ui2-surface); border: 0; box-shadow: var(--ui2-elev);}
}
/* UI skills pass, render review (visual-craft: name the worst visible fault,
   fix it, render again): no glow following the cursor; messages clear of a
   docked drawer; a context bar that folds instead of clipping; a neutral avatar. */
@media (min-width: 721px) {
  html.ui-v2 #cursor-glow { display: none !important; }
  html.ui-v2 .user-avatar { background: var(--ui2-pressed); color: var(--ui2-text); font-weight: 600; }
  html.ui-v2.ui2-drawer-open .hint,
  html.ui-v2.ui2-drawer-open .statusbar,
  html.ui-v2.ui2-drawer-open .signup-bar { left: 446px; }
  html.ui-v2 .ui2-clbl { white-space: nowrap; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  html.ui-v2.ui2-drawer-open .hint,
  html.ui-v2.ui2-drawer-open .statusbar,
  html.ui-v2.ui2-drawer-open .signup-bar { left: 406px; }
}
/* Render review 2: zoom to the bottom right (as in design 1), Feedback in
   Help, and one bottom-left lane for messages that never reaches zoom. */
@media (min-width: 721px) {
  html.ui-v2 .zoom-pill { left: auto; right: 16px; transform: none; }
  html.ui-v2:not([data-embed]) .feedback-toggle { display: none !important; }
  html.ui-v2 .ui2-help-fb {
    width: 100%; min-height: 40px; padding: 0 14px; margin-bottom: 2px; border: 0;
    display: flex; align-items: center; gap: 12px; background: none; cursor: pointer;
    color: var(--ui2-text); font: 500 14px var(--font-sans); text-align: left;
  }
  html.ui-v2 .ui2-help-fb svg { flex: none; color: var(--ui2-text-2); }
  html.ui-v2 .ui2-help-fb:hover { background: var(--ui2-raised); }
  html.ui-v2 .statusbar, html.ui-v2 .hint { max-width: min(420px, calc(100vw - 104px - 300px)); }
  html.ui-v2.ui2-drawer-open .statusbar, html.ui-v2.ui2-drawer-open .hint { max-width: min(420px, calc(100vw - 446px - 290px)); }
}
/* One message lane: the tool hint and the status line share the bottom-left
   spot; while the hint shows, the status line steps aside. */
@media (min-width: 721px) {
  html.ui-v2 .hint { bottom: 16px; }
  html.ui-v2.ui2-hint-on .statusbar { opacity: 0 !important; }
}
/* One shape system (owner, 20 Oct: "either capsule or rounded rectangle,
   not a mix"). Rounded rectangles only: no pills, no blobs. Four radii,
   nested so that a container is its item radius plus its inset:
   xs 6 (key chips, swatches, the avatar, the grip), sm 10 (buttons, inputs,
   menu items, rows, segment buttons), md 14 (bars, menus, pop-ups, tiles),
   lg 18 (panels, dialogs, floating cards). The Prototype panel keeps its own
   shapes: nothing in this layout restyles it. */
@media (min-width: 721px) {
  html.ui-v2 { --ui2-r-xs: 6px; --ui2-r-sm: 10px; --ui2-r-md: 14px; --ui2-r-lg: 18px; }

  html.ui-v2 .topbar button, html.ui-v2 .topbar .file-btn, html.ui-v2 .topbar .user-pill,
  html.ui-v2 .topbar .cloud-save-status, html.ui-v2 .topbar .cloud-save-size,
  html.ui-v2 .ui2-file-btn, html.ui-v2 .ui2-history button, html.ui-v2 .ui2-modes button,
  html.ui-v2 .ui2-cbtn, html.ui-v2 .ui2-btn, html.ui-v2 .ui2-dock, html.ui-v2 .ui2-drawer-close,
  html.ui-v2 .ui2-dtabs button, html.ui-v2 .ui2-segs button, html.ui-v2 .ui2-search input, html.ui-v2 .ui2-custom,
  html.ui-v2 .menu > button, html.ui-v2 .menu > a, html.ui-v2 #user-menu-dropdown > *,
  html.ui-v2 .ui2-file-menu > *, html.ui-v2 .ui2-help-menu .legal-links a, html.ui-v2 .ui2-help-fb,
  html.ui-v2 .ui2-wide, html.ui-v2 .ui2-font, html.ui-v2 .ui2-addtext, html.ui-v2 .ui2-wide .ui2-ic,
  html.ui-v2 .zoom-pill button, html.ui-v2 .page-add,
  html.ui-v2 .signup-bar button, html.ui-v2 .save-warning-cta, html.ui-v2 .save-warning-xbtn,
  html.ui-v2 .modal-card button, html.ui-v2 .modal-card input, html.ui-v2 .modal-card select, html.ui-v2 .modal-card textarea,
  html.ui-v2 .modal-card a.mcp-primary, html.ui-v2 .modal-card a.mcp-secondary, html.ui-v2 .mcp-conn-list > li,
  html.ui-v2 .ui2-drawer #layers li, html.ui-v2 .ui2-drawer #ab-nav .ab-nav-item, html.ui-v2 .ui2-drawer #ab-nav .ab-nav-add,
  html.ui-v2 .properties > .prop-group:not(#proto-group) :is(button, input, select, textarea):not(.swatch-chip) {
    border-radius: var(--ui2-r-sm);
  }
  html.ui-v2 .topbar .split-btn > #btn-export { border-radius: var(--ui2-r-sm) 0 0 var(--ui2-r-sm); }
  html.ui-v2 .topbar .split-btn > .caret { border-radius: 0 var(--ui2-r-sm) var(--ui2-r-sm) 0; }
  html.ui-v2 .ui2-modes,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg { border-radius: 12px; }          /* 10 + 2 inset */

  html.ui-v2 .ui2-ctx, html.ui-v2 .zoom-pill, html.ui-v2 .menu, html.ui-v2 #user-menu-dropdown,
  html.ui-v2 .usage-panel, html.ui-v2 .cloud-size-panel, html.ui-v2 .ui2-file-menu, html.ui-v2 .ui2-help-menu,
  html.ui-v2 .ui2-selmenu, html.ui-v2 .ui2-pop, html.ui-v2 .statusbar, html.ui-v2 .hint,
  html.ui-v2 .ui2-rail-btn, html.ui-v2 .ui2-tile, html.ui-v2 .ui2-icon, html.ui-v2 .ui2-drop {
    border-radius: var(--ui2-r-md);
  }
  /* 10px items + 4px inset = the 14px container. */
  html.ui-v2 .ui2-ctx, html.ui-v2 .menu, html.ui-v2 #user-menu-dropdown, html.ui-v2 .ui2-file-menu,
  html.ui-v2 .ui2-help-menu, html.ui-v2 .ui2-selmenu, html.ui-v2 .zoom-pill { padding: 4px; }

  html.ui-v2 .ui2-drawer.open, html.ui-v2 .properties, html.ui-v2 .modal-card, html.ui-v2 .signup-bar,
  html.ui-v2 .feedback-panel { border-radius: var(--ui2-r-lg); }

  html.ui-v2 .ui2-key, html.ui-v2 .ui2-sw, html.ui-v2 .ui2-swb, html.ui-v2 .ui2-grip, html.ui-v2 .user-avatar,
  html.ui-v2 .mode-count, html.ui-v2 .properties > .prop-group:not(#proto-group) .swatch-chip { border-radius: var(--ui2-r-xs); }

  /* Alignment. Menu items read from the left edge, all of them (an old rule
     centred every button inside the top row's actions, menus included). */
  html.ui-v2 .topbar .menu > button, html.ui-v2 .topbar .menu > a, html.ui-v2 #user-menu-dropdown > button,
  html.ui-v2 .ui2-file-menu > button, html.ui-v2 .ui2-file-menu > label {
    width: 100%; height: 40px; padding: 0 12px; box-sizing: border-box; border: 0; background: transparent;
    display: flex; align-items: center; justify-content: flex-start; gap: 10px; text-align: left;
    color: var(--ui2-text); font: 500 14px var(--font-sans);
  }
  html.ui-v2 .topbar .menu > button:hover, html.ui-v2 #user-menu-dropdown > button:hover,
  html.ui-v2 .ui2-file-menu > button:hover, html.ui-v2 .ui2-file-menu > label:hover { background: var(--ui2-raised); color: var(--ui2-text); }
  html.ui-v2 #user-menu-dropdown { min-width: 220px; gap: 0; }
  html.ui-v2 .ui2-file-menu { gap: 0; min-width: 220px; }
  /* Shape tiles: the shortcut key sits in the corner, so every icon and
     label lands on the same line whether or not the tool has a key. */
  html.ui-v2 .ui2-tile { position: relative; justify-content: center; gap: 8px; }
  html.ui-v2 .ui2-tile .ui2-key { position: absolute; top: 6px; right: 6px; min-width: 20px; line-height: 18px; font-size: 11px; }

  /* Prototype mode needs its panel; a Close there did nothing, so it is gone. */
  html.ui-v2 body.proto-mode .ui2-dtabs [data-ui2-dclose] { display: none; }
  html.ui-v2 body.proto-mode .ui2-dtabs { justify-content: space-between; }

  /* Layer rows: 28px targets for lock and delete, and a selected row as a
     value step, not a lime band with a stripe down its left edge. */
  html.ui-v2 .ui2-drawer #layers li { display: flex; align-items: center; gap: 8px; padding: 11px 8px 11px 6px; }
  html.ui-v2 .ui2-drawer #layers li button { min-width: 28px; min-height: 28px; margin: -5px 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ui2-r-xs); }
  html.ui-v2 .ui2-drawer #layers li .swatch { border-radius: 4px; }
  html.ui-v2 .ui2-drawer #layers li.selected { background: var(--ui2-pressed); box-shadow: none; font-weight: 500; }

  /* The corner arrow on Select is its own small button. */
  /* Top-right corner (owner, 22 Oct: at the bottom it ran into the word Select). */
  html.ui-v2 .ui2-more-mark { right: 4px; top: 4px; bottom: auto; width: 16px; height: 16px; border: 0; cursor: pointer; opacity: 0.7;
    background: linear-gradient(135deg, transparent 55%, currentColor 55%) no-repeat 6px 6px / 7px 7px; border-radius: var(--ui2-r-xs); }
  html.ui-v2 .ui2-more-mark:hover { opacity: 1; background-color: var(--ui2-pressed); }
}
/* Render review of the consistency pass. */
@media (min-width: 721px) {
  html.ui-v2 .usage-panel { left: auto; right: 0; min-width: 260px; padding: 14px; }
  html.ui-v2 .actions #export-split .caret,
  html.ui-v2 .actions #export-split .caret svg { color: #111114 !important; }
  html.ui-v2 .ui2-dtitle { display: none; flex: 1; padding-left: 4px; color: var(--ui2-text); font: 600 14px var(--font-sans); }
  html.ui-v2 body.proto-mode .ui2-dtitle { display: block; }
  /* Chalk Board's bar in the same shapes. */
  html.ui-v2 .wb-bar { border-radius: var(--ui2-r-md); padding: 4px; }
  html.ui-v2 .wb-bar button { border-radius: var(--ui2-r-sm); }
  html.ui-v2 .wb-bar .mode-switch { border-radius: 12px; padding: 2px; }
  html.ui-v2 .wb-bar .mode-switch button { border-radius: var(--ui2-r-sm); }
  html.ui-v2 .mode-switch, html.ui-v2 .mode-switch button { border-radius: var(--ui2-r-sm); }
  html.ui-v2 .ui2-modes { border-radius: 12px; }
}
@media (min-width: 721px) {
  html.ui-v2 .wb-bar button.wb-ink, html.ui-v2 .wb-bar button.wb-ink::before, html.ui-v2 .wb-bar button.wb-ink::after { border-radius: var(--ui2-r-xs); }
}
@media (min-width: 721px) {
  /* The Prototype panel's own capsule chips (order list, links) in the same
     rounded rectangle; only the radius changes, never its sizes. */
  html.ui-v2 #proto-group button, html.ui-v2 #proto-group a.proto-chip { border-radius: var(--ui2-r-sm); }
}
@media (min-width: 721px) {
  html.ui-v2.ui2-signup-on .statusbar,
  html.ui-v2.ui2-signup-on .hint { bottom: calc(var(--ui2-signup-h, 150px) + 28px); }
}
/* Review 3 (the owner's 18-minute recording, 20 Oct): the canvas fills the
   window and everything else floats over it as islands, with no strips and
   no dividing lines. The space the rail, the drawer and Details cover is
   published by app.js as --ui2-inset-l / --ui2-inset-r; the context bar,
   zoom, the page tabs and the messages stay inside it, so nothing overlaps a
   panel and nothing is squeezed. One size for every control in the top row
   and the rail (36px), islands 52px with an 8px inset (radius 18 = 10 + 8). */
@media (min-width: 721px) {
  html.ui-v2 {
    --ui2-top: 10px; --ui2-bar: 52px;
    --ui2-below: calc(var(--ui2-top) + var(--ui2-bar) + 8px);
    --ui2-inset-l: 98px; --ui2-inset-r: 10px; --strip-height: 0px;
  }
  html.ui-v2 .save-warning:not([hidden]) ~ .app { padding-top: 0; }
  /* The not-saved strip pushes every island down together. Set on the root
     (ui2-savewarn, toggled by the editor): --ui2-below is worked out where it
     is declared, so moving only the top bar left the context bar, rail and
     panels under it. */
  html.ui-v2.ui2-savewarn { --ui2-top: 54px; }
  html.ui-v2 .app { display: block; height: 100vh; }

  /* The canvas: the whole window, no frame. */
  html.ui-v2 #canvas-area, html.ui-v2 .canvas-area {
    position: fixed; inset: 0; z-index: 0; margin: 0; border-radius: 0; background: var(--ui2-canvas);
  }
  html.ui-v2 #canvas { border-radius: 0; }

  /* The top row: three islands, nothing behind them. */
  html.ui-v2 .topbar {
    position: fixed; top: var(--ui2-top); left: 10px; right: 10px; z-index: 60;
    background: transparent !important; border: 0; box-shadow: none; pointer-events: none;
  }
  html.ui-v2 .topbar > .topbar-row:not(.canvas-controls) {
    min-height: var(--ui2-bar); padding: 0; gap: 8px; background: transparent; justify-content: space-between; flex-wrap: nowrap;
  }
  html.ui-v2 .ui2-island {
    pointer-events: auto; flex: none; display: flex; align-items: center; gap: 2px;
    height: var(--ui2-bar); box-sizing: border-box; padding: 8px;
    background: var(--ui2-surface); border-radius: 18px; box-shadow: var(--ui2-elev);
  }
  html.ui-v2 .ui2-island-c { margin: 0 auto; }
  html.ui-v2 .ui2-island-r { gap: 4px; margin-left: 0; }
  html.ui-v2 .ui2-island .brand { padding: 0 8px 0 6px; }
  html.ui-v2 .ui2-island-c .ui2-modes { margin: 0; padding: 0; background: transparent; border: 0; }
  html.ui-v2 .ui2-island button, html.ui-v2 .ui2-island .file-btn, html.ui-v2 .ui2-island .user-pill,
  html.ui-v2 .ui2-island .cloud-save-status, html.ui-v2 .ui2-island .ui2-file-btn,
  html.ui-v2 .ui2-island .ui2-modes button, html.ui-v2 .ui2-island .ui2-history button {
    height: 36px; min-height: 36px; box-sizing: border-box;
  }
  html.ui-v2 .ui2-island .menu button, html.ui-v2 .ui2-island #user-menu-dropdown button { height: 40px; }
  /* Play belongs to Prototype only; Share shows in Design mode too (owner, 30 Oct). */
  html.ui-v2 body:not(.proto-mode) #proto-panel-actions > :not(#proto-share-top) { display: none !important; }

  /* The rail: an island down the left. */
  html.ui-v2 .ui2-rail {
    position: fixed; left: 10px; top: var(--ui2-below); bottom: 10px; width: 80px; z-index: 50;
    box-sizing: border-box; padding: 8px; gap: 4px; border: 0;
    background: var(--ui2-surface); border-radius: 18px; box-shadow: var(--ui2-elev);
  }
  html.ui-v2 .ui2-rail-btn { width: 64px; min-height: 60px; border-radius: var(--ui2-r-sm); }

  /* Drawer and Details: islands beside the rail and on the right. */
  html.ui-v2 .ui2-drawer.open {
    position: fixed; left: 98px; top: var(--ui2-below); bottom: 10px; width: 320px; z-index: 50;
    margin: 0; border: 0; border-radius: 18px; box-shadow: var(--ui2-elev); background: var(--ui2-surface);
  }
  html.ui-v2 .properties {
    position: fixed; right: 10px; top: var(--ui2-below); bottom: 10px; left: auto; width: 320px; z-index: 50;
    margin: 0; border: 0; border-radius: 18px; box-shadow: var(--ui2-elev); background: var(--ui2-surface);
  }
  html.ui-v2 .ui2-drawer.ui2-floating, html.ui-v2 .properties.ui2-floating { bottom: auto; right: auto; z-index: 70; }
  html.ui-v2 .ui2-drawer.ui2-min, html.ui-v2 .properties.ui2-min { bottom: auto !important; height: auto !important; }
  html.ui-v2 .ui2-drawer.ui2-min .ui2-drawer-body { display: none; }
  html.ui-v2 .properties.ui2-min > :not(.ui2-dtabs):not(.ui2-resize) { display: none !important; }
  html.ui-v2 .ui2-drawer-head { padding: 10px 10px 8px 12px; gap: 4px; }
  html.ui-v2 .ui2-drawer-title { flex: 1; }
  /* Icon buttons: Close, Put back, Minimise. */
  html.ui-v2 .ui2-ibtn {
    width: 32px; height: 32px; min-height: 32px; padding: 0; flex: none; border: 0; border-radius: var(--ui2-r-sm);
    display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--ui2-text-2); cursor: pointer;
  }
  html.ui-v2 .ui2-ibtn:hover { background: var(--ui2-raised); color: var(--ui2-text); }
  html.ui-v2 [data-ui2-dock] { display: none !important; }
  html.ui-v2 .ui2-floating [data-ui2-dock] { display: inline-flex !important; }
  /* Only Layers and Details detach; the other drawers hold one-off actions. */
  html.ui-v2 .ui2-drawer:not([data-open="layers"]) .ui2-grip,
  html.ui-v2 .ui2-drawer:not([data-open="layers"]) [data-ui2-min] { display: none; }
  html.ui-v2 .ui2-drawer:not([data-open="layers"]) .ui2-drawer-head { cursor: default; }
  html.ui-v2 .ui2-dtabs { padding: 8px 8px 8px 10px; gap: 2px; }
  html.ui-v2 .ui2-dtabs button[data-ui2-dtab] { flex: 1 1 auto; padding: 0 8px; min-width: 0; }
  /* Resize by the inner edge; the bottom edge once detached. */
  html.ui-v2 .ui2-resize { position: absolute; z-index: 6; }
  html.ui-v2 .ui2-resize-right { top: 18px; bottom: 18px; right: 0; width: 8px; cursor: ew-resize; }
  html.ui-v2 .ui2-resize-left { top: 18px; bottom: 18px; left: 0; width: 8px; cursor: ew-resize; }
  html.ui-v2 .ui2-resize-bottom { left: 18px; right: 18px; bottom: 0; height: 8px; cursor: ns-resize; display: none; }
  html.ui-v2 .ui2-floating .ui2-resize-bottom { display: block; }
  html.ui-v2 .ui2-resize:hover, html.ui-v2.ui2-resizing .ui2-resize { background: rgba(181, 255, 58, 0.25); border-radius: 4px; }
  html.ui-v2.ui2-resizing, html.ui-v2.ui2-resizing * { user-select: none !important; }
  html.ui-v2 .ui2-drawer:not([data-open="layers"]) .ui2-resize { display: none; }

  /* The context bar: centred in the free space, never under a panel. */
  html.ui-v2 .ui2-ctx {
    position: fixed; top: var(--ui2-below); left: var(--ui2-inset-l); right: var(--ui2-inset-r);
    margin: 0 auto; width: max-content; max-width: calc(100vw - var(--ui2-inset-l) - var(--ui2-inset-r) - 8px);
    transform: none; overflow: hidden; z-index: 45; box-sizing: border-box;
  }
  html.ui-v2 .ui2-ctx.ui2-floating { right: auto; margin: 0; width: max-content; }
  /* Never clip: what still does not fit scrolls sideways (wheel or trackpad). */
  html.ui-v2 .ui2-ctx { overflow-x: auto; overscroll-behavior-x: contain; }
  html.ui-v2 .ui2-ctx.ui2-fold1 .ui2-cbtn:is([data-ui2-ctx="dup"], [data-ui2-ctx="del"], [data-ui2-ctx="lock"], [data-ui2-ctx="outline"], [data-ui2-ctx="more"]) .ui2-clbl,
  html.ui-v2 .ui2-ctx.ui2-fold2 .ui2-cbtn .ui2-clbl, html.ui-v2 .ui2-ctx.ui2-fold2 .ui2-cname { display: none; }
  html.ui-v2 .ui2-ctx.ui2-fold1 .ui2-cbtn:is([data-ui2-ctx="dup"], [data-ui2-ctx="del"], [data-ui2-ctx="lock"], [data-ui2-ctx="outline"], [data-ui2-ctx="more"]),
  html.ui-v2 .ui2-ctx.ui2-fold2 .ui2-cbtn { padding: 0 10px; }

  /* Bottom row: page tabs on the left, zoom on the right, messages above. */
  html.ui-v2 .pages-strip {
    position: fixed; left: var(--ui2-inset-l); bottom: 10px; top: auto; z-index: 30;
    height: 44px; box-sizing: border-box; padding: 4px; gap: 2px; align-items: center; max-width: 42vw;
    background: var(--ui2-surface) !important; background-image: none !important; border-radius: 14px; box-shadow: var(--ui2-elev);
  }
  html.ui-v2 .page-tab {
    clip-path: none !important; height: 36px; padding: 0 10px; margin: 0; border-radius: var(--ui2-r-sm);
    background: transparent !important; box-shadow: none !important; filter: none !important;
  }
  html.ui-v2 .page-tab.active, html.ui-v2 .page-tab.active:hover { background: var(--ui2-pressed) !important; }
  html.ui-v2 .page-tab:hover { background: var(--ui2-raised) !important; }
  html.ui-v2 .page-add { height: 36px; border: 0; }
  html.ui-v2 .zoom-pill { position: fixed; right: var(--ui2-inset-r); bottom: 10px; left: auto; top: auto; transform: none; z-index: 30; }
  html.ui-v2 .fit-menu { position: fixed; transform: none; z-index: 90; background: var(--ui2-surface); border: 0; border-radius: var(--ui2-r-md); box-shadow: var(--ui2-elev); padding: 4px; }
  html.ui-v2 .fit-menu button { border-radius: var(--ui2-r-sm); }
  html.ui-v2 .statusbar, html.ui-v2 .hint { left: var(--ui2-inset-l); bottom: 64px; }
  html.ui-v2 .signup-bar { left: var(--ui2-inset-l); bottom: 64px; }
  html.ui-v2.ui2-signup-on .statusbar, html.ui-v2.ui2-signup-on .hint { bottom: calc(var(--ui2-signup-h, 150px) + 76px); }
  html.ui-v2.ui2-drawer-open .hint, html.ui-v2.ui2-drawer-open .statusbar, html.ui-v2.ui2-drawer-open .signup-bar { left: var(--ui2-inset-l); }
  html.ui-v2 .statusbar, html.ui-v2 .hint { max-width: min(460px, calc(100vw - var(--ui2-inset-l) - var(--ui2-inset-r) - 240px)); }
  html.ui-v2 .ai-watch-banner { top: calc(var(--ui2-below) + 60px); }

  /* One place per option. */
  html.ui-v2 .ui2-dup-hidden { display: none !important; }
  html.ui-v2 .ui2-help-menu a[href="/mcp-server"] { display: none !important; }
  /* The account menu hugs what it holds. */
  html.ui-v2 #user-menu-dropdown { min-width: 0; width: max-content; }
  html.ui-v2 #user-menu-dropdown > button { white-space: nowrap; padding: 0 14px; }
  /* The Select choice: rows that fit their text. */
  html.ui-v2 .ui2-selmenu { width: 300px; }
  html.ui-v2 .ui2-selmenu .ui2-wide { height: auto; min-height: 56px; }
  html.ui-v2 .ui2-selmenu .ui2-desc { white-space: normal; }

  /* AI Generate: the AI drawer's one big action. */
  html.ui-v2 .ui2-aigen {
    width: 100%; margin: 0 0 6px; padding: 14px; border: 0; border-radius: var(--ui2-r-md); cursor: pointer;
    display: flex; align-items: flex-start; gap: 12px; text-align: left;
    background: var(--accent); color: var(--accent-ink); font-family: var(--font-sans);
  }
  html.ui-v2 .ui2-aigen:hover { background: var(--accent-hi); }
  html.ui-v2 .ui2-aigen svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
  html.ui-v2 .ui2-aigen b { display: block; font-size: 16px; font-weight: 600; }
  html.ui-v2 .ui2-aigen .ui2-desc { display: block; margin-top: 4px; color: rgba(11, 11, 16, 0.75); font-size: 14px; line-height: 1.4; }

  /* New: a badge on what has just launched, so people try it. */
  html.ui-v2 .ui2-new {
    display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--ui2-r-xs);
    font: 600 11px/18px var(--font-sans); letter-spacing: 0.02em; color: var(--accent-ink); background: var(--accent);
    position: relative;
  }
  /* The beam is a ring that fades in and out: opacity only, so an idle
     editor never repaints (tests/idle-animations.test.mjs). */
  html.ui-v2 .ui2-new::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: 0 0 0 3px rgba(181, 255, 58, 0.3); opacity: 0;
    animation: ui2-beam 2.4s ease-in-out infinite;
  }
  /* Beside the icon, never on it. */
  html.ui-v2 .ui2-rail-btn { overflow: visible; }
  /* Beside the icon and inside the rail, glow included (it was clipped by the rail edge). */
  html.ui-v2 .ui2-rail-btn .ui2-new { position: absolute; top: 3px; left: calc(50% + 11px); right: auto; margin: 0; padding: 0 2px; font-size: 9px; line-height: 14px; letter-spacing: 0; }
  @keyframes ui2-beam { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) { html.ui-v2 .ui2-new::after { animation: none; } }

  /* Layers nested under their artboard. */
  html.ui-v2 .ui2-drawer .prop-group.ui2-nested { margin: 2px 0 8px 18px; padding-left: 8px; border-left: 1px solid var(--ui2-hair); }
  html.ui-v2 .ui2-drawer #layers li.ui2-other-ab { display: none; }
  /* One surface for everything that floats (owner, 20 Oct: "no size
     consistency at all"). The top bar, rail, context bar, page tabs, zoom
     and messages share one solid colour, one height, one corner, and their
     buttons share one height and corner. See-through bars turned grey over a
     white artboard. */
  html.ui-v2 #ui2-ctx, html.ui-v2 .zoom-pill, html.ui-v2 .pages-strip,
  html.ui-v2 .hint, html.ui-v2 .statusbar {
    background: var(--ui2-surface); -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 1px solid var(--ui2-hair); border-radius: 18px; box-shadow: var(--ui2-elev);
  }
  html.ui-v2 #ui2-ctx, html.ui-v2 .zoom-pill, html.ui-v2 .pages-strip {
    height: 52px; min-height: 52px; padding: 0 8px; box-sizing: border-box; align-items: center;
  }
  html.ui-v2 #ui2-ctx .ui2-cbtn, html.ui-v2 .zoom-pill button, html.ui-v2 .pages-strip .page-tab,
  html.ui-v2 .pages-strip button {
    height: 36px; min-height: 36px; border-radius: 10px;
  }
  /* The single-artboard heading and New artboard match the navigator's. */
  html.ui-v2 .ui2-drawer .ui2-one-screen .ab-nav-item { min-height: 42px; padding: 0 10px; font-size: 14px; border-radius: var(--ui2-r-sm); cursor: default; }
  html.ui-v2 .ui2-drawer .ui2-one-screen .ab-nav-add { width: 100%; height: 42px; margin-top: 8px; font-size: 14px; border-radius: var(--ui2-r-sm); }
  /* The Fit menu reads like the other menus: 14 px names, 13 px notes. */
  html.ui-v2 .fit-menu { padding: 6px; min-width: 300px; }
  html.ui-v2 .fit-menu button { padding: 10px 12px; border-radius: 10px; }
  html.ui-v2 .fit-menu button strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
  html.ui-v2 .fit-menu button em { display: block; margin-top: 2px; font-size: 13px; font-style: normal; line-height: 1.35; color: var(--ink-2); }
  /* Hunt 21 Oct: the bar never vanishes; with nothing selected it says so. A
     long artboard name is cut with an ellipsis instead of pushing Lock off. */
  html.ui-v2 .ui2-cname { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
  html.ui-v2 .ui2-cbtn[data-ui2-ctx="pickab"] .ui2-clbl { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
  html.ui-v2 .ui2-cidle { color: var(--ui2-text-3); }
  /* Upgrade is back in the top bar (owner, 21 Oct: "make people believe I
     really want them to upgrade"): signed-in free accounts see a filled
     lime button beside Usage. updateUpgradeButton decides who sees it. */
  html.ui-v2 .topbar #btn-upgrade:not([hidden]) {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--ui2-r-sm);
    background: var(--accent); color: var(--accent-ink, #0B0B10); border: 0; font: 600 14px var(--font-sans); text-decoration: none;
    box-shadow: 0 0 0 1px rgba(181, 255, 58, 0.35), 0 6px 18px rgba(181, 255, 58, 0.18);
  }
  html.ui-v2 .topbar #btn-upgrade:not([hidden]):hover { filter: brightness(1.06); }
  html.ui-v2 .topbar #btn-upgrade .icon { width: 16px; height: 16px; }
  /* Prototype adds Play and Share to the top row; to keep one line, Upgrade
     shows its bolt and the save status its dot (the words stay in their
     tooltips and for screen readers). */
  html.ui-v2 body.proto-mode .topbar #btn-upgrade:not([hidden]) { font-size: 0; gap: 0; width: 40px; padding: 0; justify-content: center; }
  html.ui-v2 body.proto-mode .topbar #btn-upgrade .icon { width: 18px; height: 18px; }
  html.ui-v2 body.proto-mode .topbar #cloud-save-status:not([hidden]) { font-size: 0; gap: 0; width: 32px; padding: 0; justify-content: center; text-align: center; }
  html.ui-v2 body.proto-mode .topbar #cloud-save-status:not([hidden])::before { margin: 0; }
  /* Share shows in Design mode too (owner, 30 Oct). In a laptop window the
     save status shows its dot there as well, so the row stays one line;
     Upgrade keeps its words. */
  @media (max-width: 1259px) {
    html.ui-v2 .topbar #cloud-save-status:not([hidden]) { font-size: 0; gap: 0; width: 32px; padding: 0; justify-content: center; text-align: center; }
    html.ui-v2 .topbar #cloud-save-status:not([hidden])::before { margin: 0; }
  }
  /* AI is the thing to try first (owner, 21 Oct: "highlight it so much that a
     visitor sees it directly"): the AI rail button wears the accent and a
     slow glow (opacity only, so an idle editor never repaints). */
  html.ui-v2 #ui2-rail [data-ui2-drawer="ai"] { position: relative; color: var(--accent); background: rgba(181, 255, 58, 0.10); box-shadow: inset 0 0 0 1px rgba(181, 255, 58, 0.35); }
  html.ui-v2 #ui2-rail [data-ui2-drawer="ai"] svg { color: var(--accent); }
  html.ui-v2 #ui2-rail [data-ui2-drawer="ai"]::after {
    content: ""; position: absolute; inset: -3px; border-radius: 13px; pointer-events: none;
    box-shadow: 0 0 0 3px rgba(181, 255, 58, 0.28), 0 0 18px rgba(181, 255, 58, 0.35); opacity: 0;
    animation: ui2-beam 2.6s ease-in-out infinite;
  }
  html.ui-v2 #ui2-rail [data-ui2-drawer="ai"].on { background: rgba(181, 255, 58, 0.18); }
  @media (prefers-reduced-motion: reduce) { html.ui-v2 #ui2-rail [data-ui2-drawer="ai"]::after { animation: none; opacity: 1; } }
  /* Panel buttons (Minimise, Close, Put back) a size people can hit: the tab
     row's flex: 1 had squeezed them to 16 and 8 px. */
  html.ui-v2 .ui2-ibtn { width: 36px; height: 36px; min-height: 36px; }
  html.ui-v2 .ui2-ibtn svg { width: 18px; height: 18px; stroke-width: 2; }
  html.ui-v2 .ui2-dtabs .ui2-ibtn { flex: 0 0 36px; padding: 0; }
  html.ui-v2 .ui2-dtabs button[data-ui2-dtab] { min-width: 0; padding: 0 8px; }
  /* Details never scrolls sideways: the swatch grid fits the panel width. */
  html.ui-v2 .properties { overflow-x: hidden; }
  html.ui-v2 .properties .swatches-grid { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatch-chip { min-width: 0; min-height: 0; width: 100%; aspect-ratio: 1 / 1; }
  /* Number fields without the old spinner arrows (the sliders beside them
     step the value). */
  html.ui-v2 input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
  html.ui-v2 input[type="number"]::-webkit-inner-spin-button, html.ui-v2 input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  /* Dropdowns in the editor's own style (owner, 21 Oct: "old fashioned"):
     Chrome's customizable select draws the open list too; other browsers get
     the styled closed control with their own list. */
  html.ui-v2 select {
    -webkit-appearance: none; appearance: none; height: 36px; padding: 0 32px 0 12px; border-radius: var(--ui2-r-sm);
    background-color: var(--ui2-raised); color: var(--ui2-text); border: 1px solid var(--ui2-hair); font: 500 14px var(--font-sans);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B9B9C0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; cursor: pointer;
  }
  html.ui-v2 select:hover { border-color: rgba(255, 255, 255, 0.16); }
  html.ui-v2 select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  @supports (appearance: base-select) {
    html.ui-v2 select { appearance: base-select; background-image: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; height: auto; padding: 0 12px; line-height: 20px; }
    html.ui-v2 select > button { display: contents; }
    html.ui-v2 select selectedcontent { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    html.ui-v2 select::picker-icon { content: ""; width: 12px; height: 12px; flex: none; margin-left: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B9B9C0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 12px 12px; transition: transform 0.15s; }
    html.ui-v2 select:open::picker-icon { transform: rotate(180deg); }
    html.ui-v2 select::picker(select) {
      appearance: base-select; border: 1px solid var(--ui2-hair); border-radius: 14px; padding: 6px;
      background: var(--ui2-surface); color: var(--ui2-text); box-shadow: var(--ui2-elev); max-height: 60vh;
    }
    html.ui-v2 select option { padding: 8px 10px; border-radius: 8px; font: 500 14px var(--font-sans); color: var(--ui2-text); }
    html.ui-v2 select option:hover, html.ui-v2 select option:focus { background: var(--ui2-raised); }
    html.ui-v2 select option:checked { background: rgba(181, 255, 58, 0.14); color: var(--ui2-text); }
    html.ui-v2 select option::checkmark { color: var(--accent); }
    html.ui-v2 select optgroup { font: 600 12px var(--font-sans); color: var(--ui2-text-3); padding: 6px 4px 2px; }
  }
  /* Rulers on the visible canvas: under the context bar's row, right of the
     rail and drawer, left of Details, above the page tabs. */
  html.ui-v2 .rulers { position: fixed; inset: auto; left: var(--ui2-inset-l); right: var(--ui2-inset-r); top: calc(var(--ui2-below) + var(--ui2-bar) + 8px); bottom: 70px; z-index: 25; }
  html.ui-v2 .rulers .ruler { background: var(--ui2-surface); border-color: var(--ui2-hair); }
  html.ui-v2 .rulers .ruler-x { border-radius: 0 8px 0 0; }
  html.ui-v2 .rulers .ruler-y { border-radius: 0 0 0 8px; }
  html.ui-v2 .rulers .ruler-corner { background: var(--ui2-surface); border-color: var(--ui2-hair); border-radius: 8px 0 0 0; }
  html.ui-v2 .rulers .tick { position: absolute; color: var(--ui2-text-3); font-size: 10px; white-space: nowrap; }
  html.ui-v2 .rulers .ruler-x .tick { transform: translateX(3px); border-left: 1px solid var(--ui2-hair); padding-left: 3px; height: 14px; line-height: 14px; }
  html.ui-v2 .rulers .ruler-y .tick { transform: translateY(3px); border-top: 1px solid var(--ui2-hair); padding-top: 2px; writing-mode: vertical-rl; transform: rotate(180deg); }
  /* Short windows (laptops at 150%, about 620px tall): the rail keeps every
     button, Help included, on screen. */
  @media (max-height: 700px) {
    html.ui-v2 .ui2-rail { padding: 6px; gap: 2px; }
    html.ui-v2 .ui2-rail-btn { min-height: 52px; padding: 5px 4px; gap: 4px; font-size: 12.5px; }
    html.ui-v2 .ui2-rail-btn svg { width: 18px; height: 18px; }
  }
  @media (max-height: 590px) {
    html.ui-v2 .ui2-rail-btn { min-height: 46px; padding: 3px 2px; gap: 2px; font-size: 12px; }
  }

  /* Layers: the open artboard folds its layers away on a second click (owner, 21 Oct). */
  html.ui-v2 #ab-nav .ab-nav-item.active { position: relative; padding-right: 26px; }
  html.ui-v2 #ab-nav .ab-nav-item.active::after { content: ""; position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); opacity: .7; transition: transform .16s ease; }
  html.ui-v2 #ab-nav.ui2-ab-folded .ab-nav-item.active::after { transform: rotate(-45deg); margin-top: -3px; }
  html.ui-v2 #ab-nav.ui2-ab-folded .prop-group.ui2-nested { display: none; }
  /* Right-click menu: the artboard switches carry a tick column. */
  html.ui-v2 #ctx-menu [data-ui2-cmd] { display: flex; align-items: center; gap: 8px; }
  html.ui-v2 #ctx-menu [data-ui2-cmd][hidden] { display: none; }
  html.ui-v2 #ctx-menu .ui2-mtick { display: inline-flex; flex: 0 0 14px; width: 14px; justify-content: center; color: var(--accent); font-weight: 700; }

  /* Uploads library (owner, 21 Oct): files wait here as tiles until placed. */
  html.ui-v2 .ui2-drop.ui2-drop-small { padding: 14px 14px; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
  html.ui-v2 .ui2-drop.ui2-drop-small svg { width: 22px; height: 22px; margin: 0; }
  html.ui-v2 .ui2-drop.ui2-drop-small span { flex-basis: 100%; font-size: 12px; }
  html.ui-v2 .ui2-drop.ui2-drop-small .ui2-btn { margin-top: 4px; height: 36px; }
  html.ui-v2 .ui2-ups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
  html.ui-v2 .ui2-up { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 14px; background: var(--ui2-raised); cursor: grab; outline: none; }
  html.ui-v2 .ui2-up:hover, html.ui-v2 .ui2-up:focus-visible { background: var(--ui2-pressed); }
  html.ui-v2 .ui2-up:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
  html.ui-v2 .ui2-up:active { cursor: grabbing; }
  html.ui-v2 .ui2-up-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
    background: #fff repeating-conic-gradient(#ececec 0% 25%, #fff 0% 50%) 0 0 / 14px 14px; }
  html.ui-v2 .ui2-up-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; pointer-events: none; }
  html.ui-v2 .ui2-up-name { font-size: 12px; color: var(--ui2-text-2, var(--ink-2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
  html.ui-v2 .ui2-up-del { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border: 0; border-radius: 9px; padding: 0;
    background: rgba(11, 11, 16, 0.78); color: #fff; font-size: 16px; line-height: 26px; cursor: pointer; opacity: 0; transition: opacity .12s ease; }
  html.ui-v2 .ui2-up:hover .ui2-up-del, html.ui-v2 .ui2-up:focus-within .ui2-up-del { opacity: 1; }
  @media (hover: none) { html.ui-v2 .ui2-up-del { opacity: 1; } }

  /* AI Generate in the new look (owner, 21 Oct: "modernise it as well, just
     like we did with our UI"), and a result you can actually see: the stage
     takes the art's own shape and most of the window's height, and the art
     fills it ("people don't have laser eyes"). */
  html.ui-v2 #ai-generate-modal .ai-generate-card { padding: 22px; gap: 16px; }
  html.ui-v2 #ai-generate-modal .modal-head h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
  html.ui-v2 #ai-generate-modal .modal-head h3::before {
    content: ""; width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--accent) center / 18px 18px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310130A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3c.6 3.4 2.6 5.4 6 6-3.4.6-5.4 2.6-6 6-.6-3.4-2.6-5.4-6-6 3.4-.6 5.4-2.6 6-6Z'/%3E%3Cpath d='M18 14c.3 1.7 1.3 2.7 3 3-1.7.3-2.7 1.3-3 3-.3-1.7-1.3-2.7-3-3 1.7-.3 2.7-1.3 3-3Z'/%3E%3C/svg%3E");
  }
  html.ui-v2 #ai-generate-modal .modal-head #ai-generate-close { width: 36px; height: 36px; }
  html.ui-v2 #ai-generate-modal .ai-generate-inputs { gap: 12px; }
  html.ui-v2 #ai-generate-modal .ai-generate-inputs .field { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 0; background: none; border: 0; }
  html.ui-v2 #ai-generate-modal .ai-generate-inputs .field > span { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ui2-text-2); }
  html.ui-v2 #ai-generate-modal textarea { min-height: 96px; padding: 12px 14px; font-size: 15px; line-height: 1.5; background: var(--ui2-raised); border: 1px solid var(--ui2-hair); border-radius: 14px; color: var(--ui2-text); }
  html.ui-v2 #ai-generate-modal textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181, 255, 58, 0.16); }
  html.ui-v2 #ai-generate-modal .ai-generate-dropzone { border-radius: 16px; border: 1.5px dashed rgba(255, 255, 255, 0.14); background: var(--ui2-raised); padding: 18px; }
  html.ui-v2 #ai-generate-modal .ai-generate-dropzone-empty { font-size: 14px; color: var(--ui2-text-2); }
  html.ui-v2 #ai-generate-modal .ai-generate-dropzone-hint { font-size: 12px; }
  html.ui-v2 #ai-generate-modal .ai-generate-action-row { flex-direction: column; align-items: stretch; gap: 8px; }
  html.ui-v2 #ai-generate-modal #ai-generate-run,
  html.ui-v2 #ai-generate-modal #ai-generate-add,
  html.ui-v2 #ai-generate-modal #ai-generate-unlock {
    flex: none; height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: #10130A; font-size: 16px; font-weight: 700;
  }
  html.ui-v2 #ai-generate-modal #ai-generate-run:hover:not(:disabled),
  html.ui-v2 #ai-generate-modal #ai-generate-add:hover,
  html.ui-v2 #ai-generate-modal #ai-generate-unlock:hover { filter: brightness(1.06); }
  html.ui-v2 #ai-generate-modal #ai-generate-run:disabled { background: var(--ui2-pressed); color: var(--ui2-text-2); cursor: not-allowed; }
  html.ui-v2 #ai-generate-modal .ai-generate-action-row .limit-note { font-size: 13px; color: var(--ui2-text-2); text-align: center; }
  html.ui-v2 #ai-generate-modal .ai-generate-preview { display: flex; flex-direction: column; min-width: 0; }
  html.ui-v2 #ai-generate-modal .ai-generate-preview-frame,
  html.ui-v2 #ai-generate-modal .ai-generate-card.is-wide .ai-generate-preview-frame {
    --ai-h: clamp(240px, calc(100vh - 290px), 640px);
    box-sizing: border-box; align-self: center; width: min(100%, calc(var(--ai-h) * var(--ai-ar, 1))); max-width: 100%;
    height: auto; min-height: 0; max-height: none;
    aspect-ratio: var(--ai-ar, 1); padding: 14px; display: flex; align-items: center; justify-content: center;
    border-radius: 18px; border: 0; box-shadow: var(--ui2-elev, 0 18px 40px rgba(0, 0, 0, 0.5));
  }
  html.ui-v2 #ai-generate-modal .ai-generate-preview-frame img,
  html.ui-v2 #ai-generate-modal .ai-generate-card.is-wide .ai-generate-preview-frame img {
    width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; border-radius: 6px;
  }
  html.ui-v2 #ai-generate-modal .ai-generate-preview-meta { text-align: center; font-size: 13px; color: var(--ui2-text-2); }
  html.ui-v2 #ai-generate-modal .ai-generate-preview-actions { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 8px; margin-top: 12px; }
  html.ui-v2 #ai-generate-modal .ai-generate-preview-actions > [hidden] { display: none; }
  html.ui-v2 #ai-generate-modal #ai-generate-discard,
  html.ui-v2 #ai-generate-modal #ai-generate-regenerate { height: 52px; border: 0; border-radius: 14px; background: var(--ui2-raised); color: var(--ui2-text); font-size: 15px; font-weight: 600; }
  html.ui-v2 #ai-generate-modal #ai-generate-discard:hover,
  html.ui-v2 #ai-generate-modal #ai-generate-regenerate:hover { background: var(--ui2-pressed); }
  html.ui-v2 #ai-generate-modal .ai-generate-error { border-radius: 12px; font-size: 13px; }
  html.ui-v2 #ai-generate-modal .ai-generate-status-text { font-size: 15px; color: var(--ui2-text-2); }

  /* Chalk Board (owner, 21 Oct: "you only need the essentials"): the
     board's own toolbar and nothing of the editor's (no rail, no File, no
     second Undo); the board gets the whole window. */
  html.ui-v2 body.wb-on .topbar, html.ui-v2 body.wb-on #ui2-rail, html.ui-v2 body.wb-on #ui2-drawer,
  html.ui-v2 body.wb-on .properties, html.ui-v2 body.wb-on .ui2-pop, html.ui-v2 body.wb-on .ui2-selmenu,
  html.ui-v2 body.wb-on #rulers { display: none !important; }
  html.ui-v2 .wb-bar { top: 12px; padding: 6px; gap: 2px; background: var(--ui2-surface); border: 0; box-shadow: var(--ui2-elev); }
  html.ui-v2 .wb-bar button { height: 40px; min-width: 40px; }
  html.ui-v2 .wb-bar .wb-word { padding: 0 11px; font-size: 13.5px; color: var(--ui2-text-2); }
  html.ui-v2 .wb-bar .wb-word:hover { color: var(--ui2-text); }
  html.ui-v2 .wb-bar .wb-boards-btn { color: var(--ui2-text); }
  html.ui-v2 .wb-bar .wb-mode-switch button { height: 32px; }
  html.ui-v2 .wb-board-menu, html.ui-v2 .wb-font-menu { background: var(--ui2-surface); border: 0; box-shadow: var(--ui2-elev-dialog); border-radius: var(--ui2-r-md); }
  html.ui-v2 .wb-bar.wb-side { top: auto; bottom: 12px; right: 12px; }

  /* Layers: shapes on no artboard get a row of their own (owner, 22 Oct). */
  html.ui-v2 .ui2-outside { display: flex; align-items: center; width: 100%; min-height: 36px; margin: 2px 0 6px; padding: 0 12px;
    border: 1px dashed var(--ui2-hair); border-radius: var(--ui2-r-sm); background: transparent; color: var(--ui2-text-2); font: 500 13px var(--font-sans); cursor: pointer; text-align: left; }
  html.ui-v2 .ui2-outside:hover { background: var(--ui2-raised); color: var(--ui2-text); }
  html.ui-v2 .ui2-outside[hidden] { display: none; }
}
/* Prototype mode, round 6 (owner's ReliefLink videos, 24 Oct). Menus live
   at the top of the page, above the floating panel and the toasts (F17); a
   toast steps aside while a menu covers its place. */
.proto-pop.proto-pop-top { position: fixed; z-index: 120; touch-action: pan-x pan-y; }
.statusbar.proto-toast-away { opacity: 0 !important; }
/* The "Play a tap" phone (F25): on top of the page in free canvas space,
   above the floating panel (50, or 70 moved), below menus and dialogs. */
.proto-lp.proto-lp-top { position: fixed; right: auto; bottom: auto; z-index: 80; }
.proto-pop-does { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 2px 2px; }
.proto-pop-does span { line-height: 1.35; }
.proto-pop-does button { flex: none; border: 0; border-radius: 6px; background: var(--panel-sunken); font: inherit; font-size: 11px; padding: 4px 8px; cursor: pointer; }
.proto-pop-note { opacity: 0.6; padding: 2px; }
/* The picked part's name and count stay at the top while the panel scrolls (A11). */
.proto-head.proto-head-pin { position: sticky; top: 0; z-index: 3; background: var(--panel); padding: 6px 0 8px; margin-top: -6px; }
html.ui-v2 .proto-head.proto-head-pin { top: 56px; }
.proto-editing { padding: 7px 9px; border-radius: 8px; background: var(--panel-sunken); line-height: 1.45; font-size: 12px; }
.proto-empty-line { line-height: 1.45; opacity: 0.85; }
.proto-cleanup { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.proto-multi-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proto-multi-acts .proto-multi-each { border-radius: 999px; padding: 5px 10px; background: var(--accent); color: var(--accent-ink, #0B0B10); font-size: 12px; font-weight: 700; }
.proto-multi-acts button, .proto-group .proto-ungroup { border: 1px solid var(--line-soft); border-radius: 999px; background: none; color: var(--ink); font: inherit; font-size: 12px; padding: 5px 10px; cursor: pointer; }
.proto-multi-acts button:hover, .proto-group .proto-ungroup:hover { border-color: var(--accent); }
.proto-group .proto-ungroup { margin: -2px 0 8px; }
/* A confirmation opens on its own dimmed layer above whatever opened it (the
   Share dialog's "Stop sharing?", Sign out, Remove all): its card is solid and
   the layer dims what is behind without counting on a blur, which some
   browsers do not draw, so no text behind shows through or overlaps (F24). */
#app-dialog { background: rgba(6, 6, 9, 0.8); }
#app-dialog .modal-card, html.ui-v2 #app-dialog .modal-card { background: var(--ui2-surface, #16161A); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* A pinch on the part's ▶ or the back pill zooms the canvas, not the page (G1). */
.proto-chip, .proto-back-pill { touch-action: none; }
.reset-view-btn { position: fixed; z-index: 2147483000; transform-origin: 0 0; border: 0; border-radius: 999px; background: var(--accent, #B5FF3A); color: #0B0B10; font: 700 14px/1 var(--font-sans, system-ui, sans-serif); padding: 10px 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); cursor: pointer; }
/* ────────────────────────────────────────────────────────────
   Teams (SVG-152, app.js section 42): the workspace switcher in My
   Projects, the Team panel, teammates' faces over the canvas and the tag
   on the artboard a teammate is on. Rows, not cards; rounded rectangles
   (6 / 10 / 12); one filled accent action in view.
   ──────────────────────────────────────────────────────────── */
.ws-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 10px;
}
.ws-tab {
  padding: 6px 10px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-tab:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.ws-tab.is-active { color: var(--ink); background: var(--panel-3); border-color: var(--line-soft); }
.ws-tab.ws-new { color: var(--ink-3); border-style: dashed; }
.ws-tab.ws-new:hover { color: var(--accent); }
.ws-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.ws-bar-btn,
.team-btn {
  padding: 6px 10px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ws-bar-btn:hover,
.team-btn:hover { background: var(--panel-3); }
.team-btn.primary { color: #0B0B10; background: var(--accent); border-color: transparent; }
.team-btn.primary:hover { filter: brightness(1.07); color: #0B0B10; }
.team-btn.danger { color: #ff8a8a; }
.team-btn.danger:hover { background: rgba(255,80,80,0.1); }
.ws-invites { margin: 0 0 10px; }
.ws-invite {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(181,255,58,0.35);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.ws-invite + .ws-invite { margin-top: 6px; }
.ws-invite-text { flex: 1; min-width: 0; }
.ws-invite-text strong { color: var(--ink); font-weight: 600; }
.ws-invite-join {
  padding: 6px 12px;
  color: #0B0B10;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ws-invite-join:hover { color: #0B0B10; filter: brightness(1.07); }
.ws-invite-decline {
  padding: 6px 10px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ws-invite-decline:hover { color: var(--ink); background: rgba(255,255,255,0.04); }

.team-card {
  max-width: 520px;
  max-height: min(760px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
}
.team-body { overflow-y: auto; padding-right: 2px; }
.team-h {
  margin: 16px 0 8px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.team-count { color: var(--ink-4); margin-left: 4px; }
.team-row { display: flex; gap: 8px; align-items: center; }
.team-row input,
.team-row select,
.team-role {
  min-width: 0;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
}
.team-row input { flex: 1; }
.team-row input:focus,
.team-row select:focus,
.team-role:focus { outline: none; border-color: var(--accent); }
.team-rename { margin-top: 4px; }
.team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.team-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.team-member:last-child { border-bottom: none; }
.team-avatar,
.team-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--tc, #56B4E9);
  color: #0B0B10;
  font-size: 11px;
  font-weight: 700;
}
.team-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.team-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-email { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-role-label { font-size: 12px; color: var(--ink-2); }
.team-icon-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
.team-icon-btn:hover { color: #ff8a8a; background: rgba(255,80,80,0.08); }
.team-muted { margin: 8px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.45; }
/* The Team plan block (SVG-214, 2026-10-27). */
.team-plan { margin: 4px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.team-plan .team-row { margin-top: 10px; flex-wrap: wrap; }
.team-plan input[type="number"] { flex: 0 0 72px; width: 72px; }
.team-plan-line { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.team-plan-line strong { color: var(--ink); }
.team-link {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(181,255,58,0.35);
  border-radius: 6px;
}
.team-link-text { margin: 0 0 8px; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.team-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Teammates over the canvas: initials top right, a name on hover. */
.team-presence {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 6;
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
.team-face {
  position: relative;
  box-shadow: 0 0 0 2px var(--bg);
  opacity: 0.75;
  cursor: default;
}
.team-face.is-editing { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--tc); }
.team-face-where {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}
.team-face:hover .team-face-where { opacity: 1; }
/* Layout v2: the zoom bar owns the bottom right; the faces go under the
   top bar's right end instead, and their names open downwards. */
html.ui-v2 .team-presence { top: 76px; bottom: auto; right: 16px; }
html.ui-v2 .team-face-where { top: calc(100% + 8px); bottom: auto; }
.team-presence-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 5;
  contain: strict;
}
.team-presence-svg .team-frame {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: 0.45;
  stroke-dasharray: 6 4;
}
.team-presence-svg .team-frame.is-editing { opacity: 0.9; stroke-dasharray: none; }
.team-presence-svg .team-tag text {
  fill: #0B0B10;
  font: 600 12px/1 var(--font-sans, system-ui, sans-serif);
}
/* Owner's video, 27 Oct: faces are buttons that open a small card. */
button.team-face { padding: 0; border: none; font: inherit; font-size: 11px; font-weight: 700; color: #0B0B10; cursor: pointer; }
button.team-face:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.team-face.is-open .team-face-where,
.team-presence:has(.team-card-pop) .team-face-where { opacity: 0; }
.team-card-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 248px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  color: var(--ink);
  z-index: 7;
}
html:not(.ui-v2) .team-card-pop { top: auto; bottom: calc(100% + 10px); }
.team-card-head { display: flex; gap: 10px; align-items: center; }
.team-card-line { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.team-card-note { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.team-card-pop .team-btn { margin-top: 10px; }
/* Transfer ownership: one tick, the rest greyed out. */
.team-pick-label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.team-pick-box { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.team-pick.is-picked { background: rgba(181,255,58,0.06); }
.team-pick.is-dim { opacity: 0.4; }
.team-pick.is-dim .team-pick-label { cursor: default; }
.team-btn:disabled { opacity: 0.45; cursor: default; filter: none; }
/* A viewer in a team project: a banner over the canvas, the tools that
   change things off (owner's video, 27 Oct). */
.team-viewonly {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  max-width: min(620px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid rgba(181,255,58,0.45);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

.team-viewonly.is-nudged { animation: team-viewonly-nudge .45s ease; }
@keyframes team-viewonly-nudge { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 6px)); } 75% { transform: translateX(calc(-50% + 6px)); } }
html.team-view-only .ui2-rail-btn:not(#ui2-help-btn),
html.team-view-only #ui2-ctx,
html.team-view-only #ui2-drawer,
html.team-view-only .page-add,
html.team-view-only .page-tab .x,
html.team-view-only .toolbar .tool:not([data-tool="hand"]):not([data-tool="zoom"]) {
  opacity: 0.35;
  pointer-events: none;
}
/* The Prototype panel at a glance (proto-engine slice 12, F1, F3, D11): with
   a part picked, its line, the cards that fit it, and More (closed). */
.proto-next.is-icons { grid-template-columns: repeat(4, 1fr); }
.proto-group .proto-next.is-icons button[data-act] { font-size: 14px; padding: 5px 2px; }
.proto-glance { font-size: 12px; line-height: 1.5; opacity: 0.92; }
.proto-glance strong { font-weight: 700; }
.proto-group .proto-glance button[data-act="show-order"] { color: var(--ink); text-decoration: underline dotted; text-underline-offset: 3px; }
.proto-group .proto-glance button.proto-glance-play { margin-left: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 9px; line-height: 20px; text-align: center; text-decoration: none; vertical-align: 1px; }
.proto-role .proto-cards { grid-template-columns: repeat(2, 1fr); }
.proto-role .proto-card-name { text-align: center; line-height: 1.25; }
.proto-role-glyph { font-size: 18px; line-height: 30px; color: var(--ink); opacity: 0.85; }
.proto-card[aria-pressed="true"] .proto-role-glyph { color: var(--accent); opacity: 1; }
.proto-help { flex: none; width: 15px; height: 15px; margin-left: 5px; padding: 0; border-radius: 50%; border: 1px solid var(--line-soft); background: transparent; color: var(--ink); font: inherit; font-size: 10px; font-weight: 700; line-height: 13px; text-align: center; vertical-align: 1px; opacity: 0.6; cursor: help; }
.proto-help::before { content: "?"; }
.proto-help:hover, .proto-help:focus-visible { opacity: 1; border-color: var(--accent); color: var(--accent); }
.proto-more { display: block; }
.proto-more > summary { cursor: pointer; font-size: 12px; font-weight: 700; opacity: 0.8; padding: 4px 0; list-style: none; }
.proto-more > summary::-webkit-details-marker { display: none; }
.proto-more > summary::before { content: "▸"; display: inline-block; width: 14px; transition: transform 0.15s; }
.proto-more[open] > summary::before { transform: rotate(90deg); }
.proto-more > summary:hover { opacity: 1; color: var(--accent); }
.proto-more > :not(summary) { margin-top: 10px; }
.proto-many { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: var(--panel-sunken); border: 1px solid var(--line-soft); }
.proto-many-says { font-size: 12px; font-weight: 600; line-height: 1.4; }
.proto-many-says span { font-weight: 400; opacity: 0.75; }
.proto-more .proto-then-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* ---- Point at it in ChatGPT: Add to chat and Comment (2026-10-29) ----
   Embed mode only (app.js "Point at it in ChatGPT"): a small bar over the
   selection and numbered comment pins over the canvas. */
.chat-pick-bar {
  position: fixed; z-index: 8990; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 4px; border-radius: 999px; background: var(--panel, #14141B);
  border: 1px solid var(--line-soft, rgba(255,255,255,.10)); box-shadow: 0 8px 24px rgba(0,0,0,.45);
  font: 12.5px/1.2 var(--font-sans, system-ui, sans-serif); color: var(--ink, #F5F5F7);
}
.chat-pick-bar.composing { border-radius: 12px; width: 280px; }
.chat-pick-bar > button {
  font: inherit; color: inherit; background: transparent; border: 0; border-radius: 999px;
  padding: 6px 11px; cursor: pointer; white-space: nowrap;
}
.chat-pick-bar > button:hover { background: var(--panel-3, #26262F); }
.chat-pick-bar > button[data-chat-pick="add"] { background: var(--accent, #B5FF3A); color: #0B0B10; font-weight: 600; }
.chat-pick-bar.in-chat > button[data-chat-pick="add"] { background: transparent; color: var(--accent, #B5FF3A); box-shadow: inset 0 0 0 1px var(--accent, #B5FF3A); }
.chat-pick-bar.in-chat .chat-pick-plus { display: none; }
/* M125: a small selection on screen (low zoom) gets a small pill: "+" and "Comment", never bigger than what it points at. */
.chat-pick-bar.chat-pick-compact { font-size: 11px; padding: 2px; gap: 2px; }
.chat-pick-bar.chat-pick-compact > button { padding: 3px 8px; }
.chat-pick-bar.chat-pick-compact:not(.in-chat) .chat-pick-add-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat-pick-form { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 4px; box-sizing: border-box; }
.chat-pick-form textarea {
  width: 100%; box-sizing: border-box; resize: none; border-radius: 8px; padding: 8px;
  background: var(--panel-sunken, #050507); color: inherit; border: 1px solid var(--line-soft, rgba(255,255,255,.10)); font: inherit;
}
.chat-pick-form-row { display: flex; justify-content: flex-end; gap: 6px; }
.chat-pick-form-row button { font: inherit; border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; background: var(--panel-3, #26262F); color: inherit; }
.chat-pick-form-row button.primary { background: var(--accent, #B5FF3A); color: #0B0B10; font-weight: 600; }
.chat-pick-note {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; background: var(--panel, #14141B); color: var(--ink, #F5F5F7);
  border: 1px solid var(--line-soft, rgba(255,255,255,.10)); box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
#chat-pick-pins { position: fixed; inset: 0; pointer-events: none; z-index: 8980; }
.chat-pin { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.chat-pin-n {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50% 50% 50% 2px;
  background: var(--accent, #B5FF3A); color: #0B0B10; font: 700 11px/1 var(--font-sans, system-ui, sans-serif);
  box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer;
}
.chat-pin-card {
  display: none; position: absolute; left: 26px; top: -4px; width: 220px; padding: 8px 10px; border-radius: 10px;
  background: var(--panel, #14141B); color: var(--ink, #F5F5F7); border: 1px solid var(--line-soft, rgba(255,255,255,.10));
  box-shadow: 0 8px 24px rgba(0,0,0,.45); font: 12.5px/1.45 var(--font-sans, system-ui, sans-serif);
}
.chat-pin.open .chat-pin-card { display: block; }
.chat-pin-card p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-pin-card button { font: inherit; border: 0; border-radius: 999px; padding: 4px 10px; cursor: pointer; background: var(--panel-3, #26262F); color: inherit; }
/* Many comments kept, then sent together (owner, 17 Nov 2026). */
.chat-pin.sent .chat-pin-n { background: #3A3A44; color: #F5F5F7; }
.chat-comments-tray {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 8991; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: 999px; background: #000; color: #F5F5F7; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 24px rgba(0,0,0,.45); font: 600 13px/1 var(--font-sans, system-ui, sans-serif);
}
.chat-comments-tray button { font: inherit; border: 0; border-radius: 999px; padding: 7px 12px; cursor: pointer; background: #26262F; color: inherit; }
.chat-comments-tray button.primary { background: var(--accent, #B5FF3A); color: #0B0B10; }
/* The chat view (owner video 30 Oct): only the canvas, a small tool rail, the
   zoom pill, the bar and the AI watch banner. Everything else is hidden. */
html.chat-view .app { grid-template-columns: 1fr; grid-template-rows: 1fr; grid-template-areas: "canvas"; }
/* The tool rail keeps its own strip, so it never covers the work. */
html.chat-view .canvas-area { margin-left: 78px; border-radius: 0; }
html.chat-view .topbar,
html.chat-view .toolbar,
html.chat-view .properties,
html.chat-view .statusbar,
html.chat-view .pages-strip,
html.chat-view .ui2-rail,
html.chat-view .ui2-drawer,
html.chat-view .ui2-ctx,
html.chat-view .rulers,
html.chat-view #ab-nav,
html.chat-view #feedback-widget,
html.chat-view #ctx-menu,
html.chat-view #embed-notice { display: none !important; }
/* The chat view never moves a board or a group (a drag there picks, app.js chatPick), so their
   names and the group's border do not offer a move (owner's staging video, 4 Nov 2026, 48:22:
   "Drag to move Pennywise Performance" in the side panel). */
html.chat-view #artboards .ab-label,
html.chat-view #artboards .ab-group-label,
html.chat-view #artboards .ab-group-grab { cursor: pointer; }
.chat-tools {
  position: fixed; left: 12px; top: 50%; transform: translateY(-50%); z-index: 8985;
  display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 16px;
  background: var(--panel, #14141B); border: 1px solid var(--line-soft, rgba(255,255,255,.10)); box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.chat-tools button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 54px; padding: 7px 0 5px; border: 0; border-radius: 11px;
  background: transparent; color: var(--ink, #F5F5F7); font: 600 10.5px/1.1 var(--font-sans, system-ui, sans-serif); cursor: pointer;
}
.chat-tools button:hover { background: var(--panel-3, #26262F); }
.chat-tools button.active { background: var(--accent, #B5FF3A); color: #0B0B10; }
/* Light mode (ChatGPT's own, passed in by the card): softer shadows, white on the olive accent. */
html.theme-light .chat-tools, html.theme-light .chat-pick-bar, html.theme-light .chat-pick-note, html.theme-light .chat-pin-card { box-shadow: 0 6px 20px rgba(20, 20, 27, .14); }
html.theme-light .chat-tools button.active,
html.theme-light .chat-pick-bar > button[data-chat-pick="add"],
html.theme-light .chat-pick-form-row button.primary,
html.theme-light .chat-pin-n { color: #FFFFFF; }
html.theme-light .chat-pick-bar.in-chat > button[data-chat-pick="add"] { color: var(--accent-lo, #5A8E0A); box-shadow: inset 0 0 0 1px var(--accent-lo, #5A8E0A); }
html.theme-light #chat-mark .chat-mark-loop { stroke: var(--accent-lo, #5A8E0A); fill: rgba(111, 174, 14, .12); filter: none; }
#chat-mark { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; }
#chat-mark.on { pointer-events: auto; cursor: crosshair; touch-action: none; }
#chat-mark .chat-mark-loop { fill: rgba(181, 255, 58, .10); stroke: var(--accent, #B5FF3A); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
/* An empty artboard shimmers until its first piece lands (owner, 30 Oct):
   drifting dots (the grey layout shapes went 8 Nov 2026), drawn by app.js in #blank-shimmer. */
#blank-shimmer .blank-shimmer-board { transition: opacity .35s ease; }
#blank-shimmer .blank-shimmer-board.is-leaving { opacity: 0; }
/* A board that is not a screen: a gradient loader instead of the "is planning this board" line (owner's
   ChatGPT test, 9 Nov 2026: "gradient based animation ... it should obviously also update"). A lime
   wash drifts across the board and a lime gradient runs through a slim track; transform only. */
#blank-shimmer .blank-shimmer-track { fill: rgba(0, 0, 0, .08); }
#blank-shimmer .is-dark .blank-shimmer-track { fill: rgba(255, 255, 255, .09); }
#blank-shimmer .is-clear .blank-shimmer-track { fill: rgba(128, 128, 128, .18); }
#blank-shimmer .is-light .blank-shimmer-lime { stop-color: #6FB800; }
#blank-shimmer .blank-shimmer-wash, #blank-shimmer .blank-shimmer-bar { transform-box: fill-box; will-change: transform; }
#blank-shimmer .blank-shimmer-wash { animation: blank-shimmer-wash 3.6s ease-in-out infinite; }
#blank-shimmer .blank-shimmer-bar { animation: blank-shimmer-load 1.6s cubic-bezier(.45, 0, .25, 1) infinite; }
@keyframes blank-shimmer-wash { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes blank-shimmer-load { 0% { transform: translateX(0); } 100% { transform: translateX(300%); } }
/* Dots like ChatGPT's "making an image" animation (owner, 5 Nov 2026): a faint grid, two soft
   patches of brighter dots drifting across it. */
#blank-shimmer .blank-shimmer-dot { fill: rgba(0, 0, 0, .13); }
#blank-shimmer .blank-shimmer-dot-hi { fill: rgba(0, 0, 0, .42); }
#blank-shimmer .is-dark .blank-shimmer-dot { fill: rgba(255, 255, 255, .14); }
#blank-shimmer .is-dark .blank-shimmer-dot-hi { fill: rgba(255, 255, 255, .55); }
#blank-shimmer .is-clear .blank-shimmer-dot { fill: rgba(128, 128, 128, .28); }
#blank-shimmer .is-clear .blank-shimmer-dot-hi { fill: rgba(128, 128, 128, .7); }
#blank-shimmer .blank-shimmer-patch { transform-box: view-box; }
#blank-shimmer .blank-shimmer-patch.is-a { animation: blank-shimmer-drift-a 7s ease-in-out infinite alternate; }
#blank-shimmer .blank-shimmer-patch.is-b { animation: blank-shimmer-drift-b 9s ease-in-out infinite alternate; }
@keyframes blank-shimmer-drift-a { 0% { transform: translate(22%, 25%); } 50% { transform: translate(68%, 45%); } 100% { transform: translate(35%, 78%); } }
@keyframes blank-shimmer-drift-b { 0% { transform: translate(80%, 70%); } 50% { transform: translate(30%, 55%); } 100% { transform: translate(72%, 22%); } }
@media (prefers-reduced-motion: reduce) { #blank-shimmer .blank-shimmer-wash, #blank-shimmer .blank-shimmer-bar { animation: none; } #blank-shimmer .blank-shimmer-wash { transform: none; } #blank-shimmer .blank-shimmer-bar { transform: translateX(150%); } }
@media (prefers-reduced-motion: reduce) { #blank-shimmer .blank-shimmer-patch { animation: none; } #blank-shimmer .blank-shimmer-patch.is-a { transform: translate(40%, 40%); } #blank-shimmer .blank-shimmer-patch.is-b { transform: translate(65%, 65%); } }
/* Open in (owner, 30 Oct 2026; review 31 Oct: inviting, reads as choices).
   app.js section 28a. The button sits first in the top bar's actions, lit in
   the accent so it reads as a way out; the menu is moved to <body> and
   placed under it. */
.open-in { position: relative; display: inline-flex; }
.open-in-btn .open-in-ic { width: 15px; height: 15px; flex: none; }
.open-in-btn .open-in-chev { width: 12px; height: 12px; flex: none; opacity: .7; }
.actions button#btn-open-in { color: var(--accent); background: var(--accent-soft); border-color: transparent; font-weight: 600; }
.actions button#btn-open-in:hover, .actions button#btn-open-in[aria-expanded="true"] { color: var(--accent); background: var(--panel-3); border-color: var(--accent); }
/* Design mode only (owner brief, 30 Oct): Prototype mode's top row holds Play
   and Share, and Chalk Board is a classroom board. */
body.proto-mode #open-in, body.wb-on #open-in, body.proto-mode #open-in-menu, body.wb-on #open-in-menu { display: none !important; }
.open-in-menu {
  position: fixed; z-index: 120; width: 320px; max-width: calc(100vw - 16px);
  max-height: calc(100vh - 80px); overflow-y: auto; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px;
  box-shadow: var(--shadow-2); padding: 6px; color: var(--ink);
  display: flex; flex-direction: column; gap: 1px; font-family: var(--font-sans);
}
.open-in-sec { margin: 8px 10px 4px; color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.open-in-sec:first-child { margin-top: 4px; }
.open-in-sec + .open-in-item { margin-top: 0; }
.open-in-done + .open-in-sec, .open-in-item + .open-in-sec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.open-in-item {
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer;
}
.open-in-item:hover, .open-in-item:focus-visible { background: var(--panel-2); outline: none; }
.open-in-item:hover .open-in-app-ic, .open-in-item:focus-visible .open-in-app-ic { color: var(--accent); }
.open-in-app-ic {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; background: var(--panel-2); border: 1px solid var(--line);
}
.open-in-app-ic svg { width: 18px; height: 18px; }
.open-in-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.open-in-txt b { font-size: 14px; font-weight: 600; }
.open-in-txt > span { color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }
.open-in-trail { flex: none; width: 16px; height: 16px; color: var(--ink-3); opacity: 0; transition: opacity var(--t-fast, .12s) ease; }
.open-in-trail svg { width: 16px; height: 16px; display: block; }
.open-in-item:hover .open-in-trail, .open-in-item:focus-visible .open-in-trail, .open-in-item[aria-expanded="true"] .open-in-trail { opacity: 1; }
.open-in-item[aria-expanded] .open-in-trail { opacity: .7; }
.open-in-item[aria-expanded="true"] .open-in-trail svg { transform: rotate(180deg); }
.open-in-more { padding: 2px 10px 8px 56px; }
.open-in-more-note { margin: 0 0 8px; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.open-in-steps { margin: 0 0 8px; padding: 0 0 0 16px; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.open-in-steps li + li { margin-top: 4px; }
.open-in-copy-row { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.open-in-copy-row code {
  flex: 1; min-width: 0; padding: 7px 9px; border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.open-in-copy {
  flex: none; height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; font: 600 12.5px var(--font-sans);
}
.open-in-copy.is-copied { background: var(--panel-2); color: var(--ink); }
.open-in-guide { display: inline-block; color: var(--ink-2); font-size: 12.5px; }
.open-in-guide:hover { color: var(--accent); }
.open-in-done { margin: 0 10px 6px 56px; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.open-in-done b { color: var(--accent); }
.open-in-done a { color: var(--accent); font-weight: 600; }
.open-in-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0; font-size: 13px; }
.open-in-quick > span { color: var(--ink-3); }
.open-in-quick-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.open-in-quick-link:hover { text-decoration: underline; }
html.ui-v2 .open-in-menu {
  background: var(--ui2-glass, var(--panel)); -webkit-backdrop-filter: var(--ui2-glass-blur, none); backdrop-filter: var(--ui2-glass-blur, none);
  border: 1px solid var(--ui2-glass-line, var(--line-soft)); border-radius: var(--ui2-r-md, 14px); padding: 4px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}
html.ui-v2 .open-in-item:hover, html.ui-v2 .open-in-item:focus-visible { background: var(--ui2-raised, var(--panel-2)); }
html.ui-v2 .open-in-app-ic { background: var(--ui2-raised, var(--panel-2)); border-color: transparent; }
html.ui-v2 .open-in-btn .open-in-ic { width: 17px; height: 17px; }
html.ui-v2 .topbar .actions button#btn-open-in { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
html.ui-v2 .topbar .actions button#btn-open-in:hover,
html.ui-v2 .topbar .actions button#btn-open-in[aria-expanded="true"] { background: var(--ui2-raised, var(--panel-2)); color: var(--accent); }
/* Laptop widths (the owner's window is about 1150px): the new layout's top
   row stays one line. Open in drops its arrow, and the save status folds to
   its coloured dot, as it already does in Prototype mode (it keeps its title
   and its text for screen readers). Narrower still, Open in shows as its icon
   (the button keeps its name and title). */
@media (min-width: 721px) and (max-width: 1279px) {
  html.ui-v2 .open-in-btn .open-in-chev { display: none; }
  html.ui-v2 body:not(.proto-mode) .topbar #cloud-save-status:not([hidden]) { font-size: 0; gap: 0; width: 32px; padding: 0; justify-content: center; text-align: center; }
  html.ui-v2 body:not(.proto-mode) .topbar #cloud-save-status:not([hidden])::before { margin: 0; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  html.ui-v2 .open-in-btn .open-in-label { display: none; }
  html.ui-v2 .topbar .actions button.open-in-btn { padding: 0 12px; }
}
/* Share in Design mode (31 Oct) next to Open in: signed in at 1440px the row
   was 44px too wide. The account pill shows its initial and arrow up to
   1599px, as it already does below 1280px; the name is in its menu. */
@media (min-width: 1280px) and (max-width: 1599px) {
  html.ui-v2 #user-email-short { display: none; }
}
/* Below 1280px (1024px signed out was 21px too wide, the owner's 1152px
   window signed in 77px): the mode switch drops its New badges (each about
   35px), and below 1200px Open in shows its icon only (it keeps its name). */
@media (min-width: 721px) and (max-width: 1279px) {
  html.ui-v2 #ui2-modes .ui2-new { display: none; }
}
@media (min-width: 721px) and (max-width: 1199px) {
  html.ui-v2 .open-in-btn .open-in-label { display: none; }
  html.ui-v2 .topbar .actions button.open-in-btn { padding: 0 12px; }
}
/* Import from Figma link (30 Oct 2026). */
#figma-import-modal .modal-card { width: 440px; max-width: calc(100vw - 32px); min-width: 0; box-sizing: border-box; }
#figma-import-modal .field input[type="text"] { width: 100%; min-width: 0; font-size: 13px; }
.figma-import-note { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.figma-import-status { margin: 0; min-height: 1.5em; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.figma-import-status.is-error { color: #FF8A80; }
/* Open in Figma inside ChatGPT (owner, 31 Oct): app.js section 28b. A top
   bar button in the embedded editor, the last tool on the chat view's rail,
   and a short note that says what happened. */
.actions button.figma-embed-btn { color: var(--accent); background: var(--accent-soft); border-color: transparent; font-weight: 600; }
.actions button.figma-embed-btn svg { flex: none; }
.chat-tools button.chat-figma { margin-top: 4px; border-top: 1px solid var(--line-soft, rgba(255,255,255,.10)); border-radius: 0 0 11px 11px; padding-top: 9px; }
.figma-embed-note {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 9000; margin: 0;
  max-width: min(520px, calc(100vw - 32px)); box-sizing: border-box; padding: 10px 14px; border-radius: 12px;
  background: var(--panel, #14141B); color: var(--ink, #F5F5F7); border: 1px solid var(--line-soft, rgba(255,255,255,.10));
  box-shadow: 0 8px 24px rgba(0,0,0,.45); font: 500 13px/1.45 var(--font-sans, system-ui, sans-serif);
}
.figma-embed-note b { color: var(--accent, #B5FF3A); }
.figma-embed-note a { color: var(--accent, #B5FF3A); font-weight: 600; }
html.chat-view .figma-embed-note { top: 12px; }
/* ===== Layered poster (SVG-237, owner preview, app.js "Layered poster") ===== */
#layered-modal .ai-generate-inputs { display: flex; flex-direction: column; gap: 12px; }
#layered-modal .ai-generate-inputs .field { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 0; background: none; border: 0; }
#layered-modal .ai-generate-inputs .field > span { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ui2-text-2, var(--ink-2)); }
#layered-modal textarea, #layered-modal input[type="text"], #layered-modal select { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px 12px; font-size: 14px; background: var(--ui2-raised, #16161c); border: 1px solid var(--ui2-hair, rgba(255,255,255,.12)); border-radius: 12px; color: var(--ui2-text, #eee); }
#layered-modal textarea { min-height: 88px; line-height: 1.5; }
#layered-modal .layered-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ui2-text-2, var(--ink-2)); }
#layered-modal .ai-generate-action-row { flex-direction: column; align-items: stretch; gap: 8px; }
#layered-modal #layered-run { height: 48px; border: 0; border-radius: 14px; background: var(--accent); color: #10130A; font-size: 15px; font-weight: 700; }
#layered-modal #layered-run:disabled { background: var(--ui2-pressed, #2a2a30); color: var(--ui2-text-2, #999); cursor: wait; }
#layered-modal .limit-note { text-align: center; }
#layered-modal .layered-status { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ui2-text-2, var(--ink-2)); }
#layered-modal .layered-status.is-error { color: #FF8A80; }
html.ui-v2 #ui2-drawer #ui2-layered-poster { background: var(--ui2-raised, #16161c); color: var(--ui2-text, #eee); border: 1px solid var(--accent); }
html.ui-v2 #ui2-drawer #ui2-layered-poster .ui2-desc { color: var(--ui2-text-2, #b4b4bc); }
#layered-bar { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 60; display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 999px; background: #16161c; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); font: 13px/1 Inter, system-ui, sans-serif; color: #eee; }
#layered-bar .layered-bar-name { padding: 0 8px; opacity: 0.75; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#layered-bar button { border-radius: 999px; padding: 8px 12px; cursor: pointer; font: inherit; }
#layered-bar #layered-regenerate { background: var(--accent, #B5FF3A); color: #0B0B10; border: 0; font-weight: 600; }
#layered-bar #layered-make-sizes { background: transparent; color: #eee; border: 1px solid rgba(255, 255, 255, 0.2); }
#layered-bar .layered-edit { display: flex; gap: 4px; align-items: center; margin: 0; }
#layered-bar .layered-edit input { width: 260px; max-width: 40vw; border-radius: 999px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: #0B0B10; color: #eee; font: inherit; }
#layered-bar .layered-edit input:focus { outline: none; border-color: var(--accent, #B5FF3A); }
#layered-bar #layered-edit-run { background: var(--accent, #B5FF3A); color: #0B0B10; border: 0; font-weight: 600; }
#layered-bar #layered-regenerate { background: transparent; color: #eee; border: 1px solid rgba(255, 255, 255, 0.2); font-weight: 400; }
@media (max-width: 720px) { #layered-bar { flex-wrap: wrap; justify-content: center; border-radius: 18px; max-width: calc(100vw - 32px); } #layered-bar .layered-edit input { width: 180px; } }
#layered-bar button:disabled { opacity: 0.6; cursor: wait; }
/* ────────────────────────────────────────────────────────────
   Phone layout (1 Nov 2026, the owner's mobile issue video M3)
   At 720px wide or less (html.ph, set in index.html before the first
   paint) the editor is the design, full screen: a slim top bar (project
   name, Undo, Redo, More), one bottom bar of big buttons (Select, Text,
   Colour, Artboards, Export), and a sheet that slides up over the canvas
   for colour, text, artboards, export, layers and every setting. The
   desktop panels are hidden here, never removed: the MCP and the browser
   suites still find every control by id, and the phone buttons press or
   write through those same controls (app.js "Phone layout").
   Nothing below applies above 720px: desktop stays exactly as it was.
   Guarded by tests/phone-layout.test.cjs.
   ──────────────────────────────────────────────────────────── */
.ph-top, .ph-bar, .ph-sheet, .ph-toast { display: none; }
@media (max-width: 720px) {
  html.ph {
    --ph-y0: 0px;            /* the not-saved strip's height, set by app.js */
    --ph-top: 52px;
    --ph-bar: 64px;
    --ph-safe: env(safe-area-inset-bottom, 0px);
    --ph-surface: var(--surface-2, #16161A);
  }
  /* ChatGPT's side panel (/embed) keeps the full-screen canvas but none of the phone bars: the panel is
     for watching and for picking what to ask ChatGPT about, never for editing (Sarah, 12 Nov 2026: the
     bottom bar Select, Text, Colour, Artboards, Export and the undo/redo top bar showed there). */
  html.ph[data-embed="chatgpt"] { --ph-top: 0px; --ph-bar: 0px; --ph-safe: 0px; }
  html.ph[data-embed="chatgpt"] .ph-top,
  html.ph[data-embed="chatgpt"] .ph-bar,
  html.ph[data-embed="chatgpt"] .ph-sheet,
  html.ph[data-embed="chatgpt"] .ph-toast { display: none !important; }
  html.ph, html.ph body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  html.ph .app {
    position: fixed; inset: 0;
    display: block;
    width: auto; height: auto;
    padding: 0 !important;
    /* No fade in here: while the editor is see-through, the page's own
       text (.seo-content, in the flow under the fixed editor) shows through. */
    animation: none;
  }
  /* The desktop chrome. Each piece is reachable from the bars or More. */
  html.ph .app > .topbar,
  html.ph .app > .toolbar,
  html.ph .app > .properties,
  html.ph .app > .statusbar,
  html.ph #ui2-rail, html.ph #ui2-drawer, html.ph #ui2-ctx, html.ph #ui2-pop, html.ph #ui2-help-menu,
  html.ph .canvas-area > .pages-strip,
  html.ph .canvas-area > .zoom-pill,
  html.ph #fit-menu,
  html.ph .canvas-area > #ab-nav,
  html.ph .rulers,
  html.ph .feedback-toggle,
  html.ph #cursor-glow { display: none !important; }
  html.ph .canvas-area {
    position: fixed;
    left: 0; right: 0;
    top: calc(var(--ph-y0) + var(--ph-top));
    bottom: calc(var(--ph-bar) + var(--ph-safe));
    margin: 0;
    border-radius: 0;
  }
  html.ph #canvas { border-radius: 0; touch-action: none; }

  /* Top bar: mark, project name, Undo, Redo, More. One row, never wraps. */
  html.ph .ph-top {
    display: flex;
    align-items: center;
    gap: 4px;
    position: fixed;
    top: var(--ph-y0); left: 0; right: 0;
    height: var(--ph-top);
    padding: 0 6px 0 14px;
    background: var(--ph-surface);
    border-bottom: 1px solid var(--line);
    z-index: 60;
  }
  html.ph .ph-mark { flex: 0 0 auto; width: 22px; height: 22px; color: var(--accent); }
  html.ph .ph-mark svg { width: 22px; height: 22px; display: block; }
  html.ph .ph-name {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    margin-left: 6px;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
  }
  html.ph .ph-name span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.ph .ph-ic {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    padding: 0;
  }
  html.ph .ph-ic:disabled { color: var(--ink-3); opacity: 0.45; }
  html.ph .ph-ic svg, html.ph .ph-bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  html.ph #ph-more svg { fill: currentColor; stroke: none; }
  html.ph .ph-ic:active, html.ph .ph-name:active { background: var(--surface-4, #26262F); }

  /* Bottom bar: five big targets. */
  html.ph .ph-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--ph-bar) + var(--ph-safe));
    padding: 6px 6px calc(6px + var(--ph-safe));
    background: var(--ph-surface);
    border-top: 1px solid var(--line);
    z-index: 60;
  }
  html.ph .ph-bar button {
    min-width: 0;
    min-height: 52px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 0 2px;
  }
  html.ph .ph-bar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.ph .ph-bar button[aria-pressed="true"] { color: var(--ink); background: var(--surface-4, #26262F); }
  html.ph .ph-bar button[aria-pressed="true"] svg { color: var(--accent); }

  /* The sheet: slides up over the lower part of the canvas, never the
     whole screen. Done, the grab bar dragged down, or the same button
     again closes it. */
  html.ph .ph-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--ph-bar) + var(--ph-safe));
    max-height: min(52vh, calc(100vh - var(--ph-y0) - var(--ph-top) - var(--ph-bar) - 120px));
    background: var(--ph-surface);
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.4);
    z-index: 59;
  }
  html.ph .ph-sheet-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 10px 8px 4px 18px;
    touch-action: none;
  }
  html.ph .ph-grab { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--ink-3); opacity: 0.5; }
  html.ph .ph-sheet-title { flex: 1 1 auto; margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
  html.ph .ph-sheet-done {
    min-height: 44px; padding: 0 16px;
    border: 0; border-radius: 10px;
    background: var(--surface-4, #26262F);
    color: var(--ink);
    font: inherit; font-size: 14px; font-weight: 600;
  }
  html.ph .ph-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 16px; }
  html.ph .ph-sheet-body > .properties { display: block !important; position: static; width: auto; height: auto; max-height: none; margin: 0; border: 0; box-shadow: none; background: transparent; padding: 0; overflow: visible; transform: none; }
  html.ph .ph-sheet-body > .properties > .panel-bar,
  html.ph .ph-sheet-body > .properties .ui2-dtabs { display: none; }
  html.ph .ph-note { margin: 4px 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
  html.ph .ph-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 12px; background: var(--surface-1, #0B0B10); }
  html.ph .ph-seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; }
  html.ph .ph-seg button[aria-pressed="true"] { background: var(--surface-4, #26262F); color: var(--ink); }
  html.ph .ph-swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
  html.ph .ph-swatches button { aspect-ratio: 1; min-height: 44px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.16); padding: 0; }
  html.ph .ph-swatches button.on { outline: 2px solid var(--accent); outline-offset: 2px; }
  html.ph .ph-row { display: flex; gap: 8px; margin: 0 0 8px; }
  html.ph .ph-btn, html.ph .ph-item {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-3, #1C1C25);
    color: var(--ink);
    font: inherit; font-size: 14px; font-weight: 600;
    padding: 0 14px;
  }
  html.ph .ph-btn { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; overflow: hidden; }
  html.ph .ph-btn.primary { background: var(--accent); color: var(--accent-ink, #0B0B10); border-color: transparent; }
  html.ph .ph-btn input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; }
  html.ph .ph-list { display: flex; flex-direction: column; gap: 6px; }
  html.ph .ph-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font-weight: 500; }
  html.ph .ph-item b { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.ph .ph-item small { flex: 0 0 auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
  html.ph .ph-item.on { border-color: var(--accent); }
  html.ph .ph-item:disabled { opacity: 0.5; }
  html.ph .ph-text { display: block; width: 100%; min-height: 96px; box-sizing: border-box; padding: 12px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-1, #0B0B10); color: var(--ink); font: inherit; font-size: 16px; resize: vertical; }
  html.ph .ph-label { display: block; margin: 8px 0; color: var(--ink-3); font-size: 12px; font-weight: 600; }

  html.ph .ph-toast {
    display: block;
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(var(--ph-bar) + var(--ph-safe) + 12px);
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-4, #26262F);
    color: var(--ink);
    font-size: 14px;
    text-align: center;
    z-index: 92;
    pointer-events: none;
  }

  /* The AI watch line (ChatGPT is designing here): a small bar at the top
     of the canvas, one row, never over the middle of the design. */
  html.ph .ai-watch-banner {
    top: 8px;
    left: 8px; right: 8px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 4px 4px 4px 12px;
    gap: 6px;
    border-radius: 12px;
    font-size: 13px;
  }
  html.ph .ai-watch-banner .ai-watch-text { flex: 1 1 auto; min-width: 0; }
  html.ph .ai-watch-banner .ai-watch-btn { min-height: 36px; padding: 0 10px; border-radius: 9px; }
  /* Its step feed folds to one line at the bottom of the canvas: what it
     is doing, the time, and Hide. Follow stays on. */
  html.ph .ai-live-feed {
    left: 8px !important; right: 8px !important; top: auto !important; bottom: 8px !important;
    width: auto; max-width: none;
    display: flex; align-items: center; gap: 8px;
    padding: 4px 4px 4px 12px;
    border-radius: 12px;
    cursor: default;
    transform: none !important;
  }
  html.ph .ai-live-feed .ai-live-head { flex: 1 1 auto; min-width: 0; font-size: 13px; }
  html.ph .ai-live-feed .ai-live-progress,
  html.ph .ai-live-feed .ai-live-steps,
  html.ph .ai-live-feed .ai-live-follow { display: none; }
  html.ph .ai-live-feed .ai-live-actions { margin: 0; padding: 0; }
  html.ph .ai-live-feed .ai-live-hide { min-height: 36px; padding: 0 12px; border-radius: 9px; }
  html.ph .ai-live-cursor .ai-live-what { max-width: 160px; }

  /* The Chalk Board brings its own bars (tools on top, Editor | Chalk Board
     at the bottom): the phone bars step aside while it is on. */
  html.ph body.wb-on .ph-top, html.ph body.wb-on .ph-bar, html.ph body.wb-on .ph-sheet { display: none !important; }
  html.ph body.wb-on .canvas-area { top: 0; bottom: 0; }

  /* Feedback opens from More; its panel is a sheet too. */
  html.ph .feedback-widget { left: 0; right: 0; bottom: 0; align-items: stretch; z-index: 91; }
  html.ph .feedback-panel { width: auto; max-width: none; border-radius: 18px 18px 0 0; }
  /* Hints and the sign-up nudge sit above the bottom bar. */
  html.ph .hint, html.ph .signup-bar { bottom: calc(var(--ph-bar) + var(--ph-safe) + 12px); left: 12px; right: 12px; max-width: none; }
}
/* Opened from ChatGPT (mobile issue M2, 2026-11-01): which account a ChatGPT link signed in to, or a choice when another account is signed in here. */
.chat-open-note { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 9000; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: min(560px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px 16px; border-radius: 14px; background: var(--panel, #16161D); color: var(--text, #E9E9EE); border: 1px solid var(--accent, #B5FF3A); font: 14px/1.45 var(--font-sans, system-ui, sans-serif); box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.chat-open-note span { flex: 1 1 220px; }
.chat-open-note button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(245, 245, 247, .2); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.chat-open-note button.is-primary { background: var(--accent, #B5FF3A); border-color: transparent; color: #0B0B10; }
/* The side panel in ChatGPT is a view: it never saves, so it offers no Take over (app.js,
   "The side panel never saves", 4 Nov 2026). Pause stays: it only pauses the AI. */
html[data-embed="chatgpt"] .ai-watch-banner [data-ai-watch="takeover"] { display: none !important; }

/* ---------- The owner's second agent test video: editor fixes (6 Nov 2026) ----------
   1. Hover fills the whole shape of what it marks, never a blob inside it.
   2. The top row never runs off the window (app.js fitTopRow folds words).
   4. Your saves: the save list on the editor's surface.
   6. Advanced (Details): the black round language, no grey slabs.
   The Chalk Board's boards menu is not scoped to the new layout: it has no
   classic look of its own. */
.wb-board-menu .wb-board-row:hover { background-image: linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)); }
.wb-board-menu .wb-board-row > button[data-wb-go]:hover { background: transparent; }
.wb-board-menu .wb-board-del:hover:not(:disabled) { background: transparent; color: #FF8A8A; }
@media (min-width: 721px) {
  /* 2. The save status keeps one width, so its words never push the row;
     a longer state ends in an ellipsis (its full words are in its tooltip
     and in Your saves). */
  html.ui-v2 .topbar #cloud-save-status:not([hidden]) {
    display: inline-block; width: 84px; max-width: 84px; box-sizing: border-box;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 34px; text-align: left;
  }
  html.ui-v2 .topbar #cloud-save-status:not([hidden])::before { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; }
  /* The folds, in order. */
  html.ui-v2 .topbar.ui2-tf1 .open-in-btn .open-in-chev,
  html.ui-v2 .topbar.ui2-tf1 #btn-user .user-chev { display: none; }
  html.ui-v2 .topbar.ui2-tf2 .brand-name { display: none; }
  html.ui-v2 .topbar.ui2-tf3 #ui2-modes .ui2-new { display: none; }
  html.ui-v2 .topbar.ui2-tf4 #cloud-save-status:not([hidden]) { font-size: 0; width: 32px; max-width: 32px; padding: 0; text-align: center; }
  html.ui-v2 .topbar.ui2-tf4 #cloud-save-status:not([hidden])::before { margin: 0; }
  html.ui-v2 .topbar.ui2-tf5 .open-in-btn .open-in-label { display: none; }
  html.ui-v2 .topbar.ui2-tf5 .actions button.open-in-btn { padding: 0 12px; }
  html.ui-v2 .topbar.ui2-tf6 #btn-upgrade:not([hidden]) { font-size: 0; gap: 0; width: 40px; padding: 0; justify-content: center; }
  html.ui-v2 .topbar.ui2-tf6 #btn-upgrade .icon { width: 18px; height: 18px; }

  /* 1. My Projects: the whole row fills on hover (and while its menu is
     open); the "..." cell fills its own whole cell, edge to edge. */
  html.ui-v2 #projects-list { border: 1px solid var(--ui2-hair); border-radius: var(--ui2-r-md); }
  html.ui-v2 #projects-list .project-row { background-color: transparent; border-bottom-color: var(--ui2-hair); }
  html.ui-v2 #projects-list .project-row.is-active { background-color: var(--ui2-raised); }
  html.ui-v2 #projects-list .project-row:hover,
  html.ui-v2 #projects-list .project-row:focus-within { background-image: linear-gradient(rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.045)); }
  html.ui-v2 #projects-list .project-load,
  html.ui-v2 #projects-list .project-load:hover,
  html.ui-v2 #projects-list .project-menu-toggle { border-radius: 0; background: transparent; }
  html.ui-v2 #projects-list .project-actions { border-left-color: var(--ui2-hair); }
  html.ui-v2 #projects-list .project-menu-toggle { color: var(--ui2-text-2); }
  html.ui-v2 #projects-list .project-menu-toggle:hover,
  html.ui-v2 #projects-list .project-menu-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, 0.07); color: var(--ui2-text); }
  /* Its menu: the editor's menu, each item filled whole on hover. */
  html.ui-v2 #projects-list .project-menu { padding: 4px; border: 0; border-radius: var(--ui2-r-md); background: var(--ui2-surface); box-shadow: var(--ui2-elev); }
  html.ui-v2 #projects-list .project-menu button { height: 36px; padding: 0 12px; border-radius: var(--ui2-r-sm); color: var(--ui2-text); font: 500 14px var(--font-sans); }
  html.ui-v2 #projects-list .project-menu button:hover { background: var(--ui2-raised); color: var(--ui2-text); }
  html.ui-v2 #projects-list .project-menu .project-action-delete:hover { background: rgba(255, 90, 90, 0.12); color: #FF8A8A; }
  /* Layers: the row fills; the lock, eye and delete inside it only change colour. */
  html.ui-v2 .ui2-drawer #layers li:hover { background: var(--ui2-raised); }
  html.ui-v2 .ui2-drawer #layers li.selected:hover { background: var(--ui2-pressed); }
  html.ui-v2 .ui2-drawer #layers li button:hover,
  html.ui-v2 .ui2-drawer #layers li button:not(:disabled):hover { background: transparent; }
  html.ui-v2 .ui2-drawer #layers li .lock-btn:hover { color: var(--ui2-text); }
  /* The top bar's buttons and menus: hover fills the button or the item, with
     no lime halo round it (the first top bar's rule drew one on every button
     of the right-hand island, menu items included). */
  html.ui-v2 .topbar .actions button:hover { box-shadow: none; }
  html.ui-v2 .topbar #usage-toggle:hover, html.ui-v2 .topbar .menu > button:hover, html.ui-v2 #user-menu-dropdown > button:hover { border-color: transparent; }
  html.ui-v2 .topbar #btn-user:hover { color: var(--ui2-text); border-color: var(--ui2-hair); }
  /* An artboard group's "x" and a page tab's "x": colour only. */
  html.ui-v2 .ab-nav-group-ungroup:hover,
  html.ui-v2 .tab-slot .x:hover { background: transparent; }

  /* 4. Your saves, on the editor's surface. */
  html.ui-v2 .cloud-size-panel.cloud-save-log-panel { padding: 14px 16px; border-radius: var(--ui2-r-md); }
  html.ui-v2 .cloud-size-title.save-log-title, html.ui-v2 .save-log-waiting, html.ui-v2 .save-log-what { color: var(--ui2-text); }
  html.ui-v2 .save-log-time, html.ui-v2 .save-log-empty { color: var(--ui2-text-3); }
  html.ui-v2 .save-log-list, html.ui-v2 .save-log-row { border-color: var(--ui2-hair); }

  /* 6. Advanced (the Details panel; owner, 6 Nov: "get rid of this gray
     crap"). No sunken black pits and no grey bevelled blocks: controls are a
     raised value step on the panel, the chosen option is the pressed step in
     white, hover fills the control's own shape, nothing glows, and a control
     that does not apply is hidden or drawn as an outline only. The
     Prototype panel keeps its own look. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) { border-bottom-color: var(--ui2-hair); color-scheme: dark; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg { background: transparent; border: 1px solid var(--ui2-hair); box-shadow: none; padding: 2px; gap: 2px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg .seg-label { color: var(--ui2-text-3); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button { background: transparent; border: 0; box-shadow: none; color: var(--ui2-text-2); font-weight: 500; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button:hover:not(:disabled) { background: var(--ui2-raised); color: var(--ui2-text); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button.active { background: var(--ui2-pressed); border: 0; box-shadow: none; color: var(--ui2-text); font-weight: 600; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .stroke-taper-seg button.active:not([data-value="off"]) { color: var(--accent); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="range"]::-webkit-slider-runnable-track {
    height: 4px; border: 0; border-radius: 2px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill-pct, 0%), var(--ui2-pressed) var(--fill-pct, 0%), var(--ui2-pressed) 100%);
  }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="range"]::-moz-range-track {
    height: 4px; border: 0; border-radius: 2px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill-pct, 0%), var(--ui2-pressed) var(--fill-pct, 0%), var(--ui2-pressed) 100%);
  }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="range"]::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; background: var(--accent); border: 0; box-shadow: 0 0 0 3px var(--ui2-surface); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--ui2-surface); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="range"]::-moz-range-thumb { background: var(--accent); border: 0; box-shadow: 0 0 0 3px var(--ui2-surface); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="number"],
  html.ui-v2 .properties > .prop-group:not(#proto-group) textarea { background: var(--ui2-raised); border: 1px solid transparent; box-shadow: none; color: var(--ui2-text); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="number"]:hover,
  html.ui-v2 .properties > .prop-group:not(#proto-group) textarea:hover { border-color: var(--ui2-hair); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="number"]:focus,
  html.ui-v2 .properties > .prop-group:not(#proto-group) textarea:focus { outline: none; border-color: var(--accent); box-shadow: none; }
  /* Labelled boxes (X, Y, W, H, the shadow, Blend): one box per control. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) .grid2 { gap: 8px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field { min-height: 36px; padding: 0 10px; box-sizing: border-box; background: var(--ui2-raised); border: 1px solid transparent; border-radius: var(--ui2-r-sm); box-shadow: none; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field:hover { border-color: var(--ui2-hair); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field:focus-within { background: var(--ui2-raised); border-color: var(--accent); box-shadow: none; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field span { color: var(--ui2-text-3); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field input[type="number"],
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field input[type="text"] { min-height: 34px; padding: 0; background: transparent; border: 0; box-shadow: none; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field > select { flex: 1; min-width: 0; height: 34px; min-height: 34px; padding-left: 4px; background-color: transparent; border-color: transparent; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field input[type="color"] { width: 30px; min-width: 30px; height: 30px; min-height: 30px; border: 1px solid var(--ui2-hair); border-radius: var(--ui2-r-xs); }
  /* Colour wells, no colour, invert. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row > input[type="color"] { width: 40px; height: 36px; padding: 0; border: 1px solid var(--ui2-hair); border-radius: var(--ui2-r-sm); background: transparent; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row > input[type="color"]:hover { border-color: rgba(255, 255, 255, 0.22); transform: none; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatch-none,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .fill-invert-btn { width: 36px; height: 36px; background: var(--ui2-raised); border: 1px solid transparent; color: var(--ui2-text-2); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatch-none:hover,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .fill-invert-btn:hover:not(:disabled) { border-color: var(--ui2-hair); color: var(--ui2-text); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatch-none.active { background: rgba(255, 90, 90, 0.10); border-color: rgba(255, 107, 107, 0.55); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .fill-invert-btn .fill-invert-hole { fill: var(--ui2-raised); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .fill-invert-btn.active { background: rgba(181, 255, 58, 0.12); border-color: rgba(181, 255, 58, 0.55); color: var(--accent); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .fill-invert-btn.active .fill-invert-hole { fill: #23291B; }
  /* Swatches: the add button is a small icon button inside the panel. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatches { border-top-color: var(--ui2-hair); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatches-head .mini { width: 32px; height: 32px; min-height: 32px; padding: 0; flex: none; border: 0; border-radius: var(--ui2-r-sm); background: transparent; color: var(--ui2-text-2); font-size: 18px; line-height: 1; box-shadow: none; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .swatches-head .mini:hover { background: var(--ui2-raised); color: var(--ui2-text); border: 0; }
  /* Buttons in a row (Arrange, Align, Path, Clip): a raised step, the
     pressed step on hover, no lime ring. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row.gap button,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .mini,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .full-width { background: var(--ui2-raised); border: 1px solid transparent; box-shadow: none; color: var(--ui2-text); font-weight: 500; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row.gap button:hover:not(:disabled),
  html.ui-v2 .properties > .prop-group:not(#proto-group) .mini:hover:not(:disabled),
  html.ui-v2 .properties > .prop-group:not(#proto-group) .full-width:hover:not(:disabled) { background: var(--ui2-pressed); border-color: transparent; box-shadow: none; color: var(--ui2-text); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row.gap button:active:not(:disabled) { transform: none; background: var(--ui2-pressed); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row.gap button.active { background: var(--ui2-pressed); color: var(--accent); }
  /* What does not apply now: an outline only, not a grey block. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) button:disabled { opacity: 1; background: transparent; border: 1px solid var(--ui2-hair); box-shadow: none; color: var(--ui2-text-3); cursor: not-allowed; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button:disabled { border: 0; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) input:disabled,
  html.ui-v2 .properties > .prop-group:not(#proto-group) select:disabled { opacity: 0.55; cursor: not-allowed; }
  /* Only for a stroke that tapers: Length shows once a taper is picked, and
     Taper only for a shape that can taper (an open line). */
  html.ui-v2 .properties > .prop-group:not(#proto-group) .stroke-taper-amount.is-disabled,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .stroke-taper-seg.is-disabled { display: none; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
}


/* ---------- SVG Lab Agent panel (app.js section 43, 2026-11-06) ----------
   The editor's own language (owner, 20 Oct): one solid black surface,
   rounded rectangles only (6 / 10 / 14 / 18), no capsules, no glow, one
   accent action. Second test video (6 Nov evening): one size that moves
   anywhere below the top bar, SVG Lab's own mark, a dark arrow on lime,
   no visible scrollbars, hover fills the whole shape. */
.agent-panel {
  /* No gray (owner's fourth video, 7 Nov 2026, E1: "complete dark or
     completely white like the Export button"). Every surface is black with a
     thin white line; hover makes the line brighter, never a gray fill. */
  --agp-surface: #000000;
  --agp-raised: #000000;
  --agp-pressed: #000000;
  --agp-hair: rgba(255, 255, 255, 0.14);
  --agp-line-hover: rgba(255, 255, 255, 0.32);
  --agp-text: #FFFFFF;
  --agp-text-2: rgba(255, 255, 255, 0.64);
  --agp-text-3: rgba(255, 255, 255, 0.64);
  --agp-accent: var(--accent, #B5FF3A);
  --agp-ink: #0B0B10;
  position: fixed;
  /* app.js place() sets left, top, width and height: one size, never glued to an edge. */
  top: 84px;
  right: 12px;
  width: min(384px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 100px));
  /* Under the top bar (60), its popovers and the floating selection bar (40
     is above the canvas only), so menus and popovers always open over it. */
  z-index: 39;
  display: flex;
  flex-direction: column;
  background: var(--agp-surface);
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 48px rgba(0, 0, 0, 0.5);
  color: var(--agp-text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
.agent-panel.is-dragging { user-select: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 28px 56px rgba(0, 0, 0, 0.55); }
.agent-panel button { font: inherit; color: inherit; }
.agent-panel svg { width: 16px; height: 16px; flex: none; }
/* Scrolling stays; the bar never shows (owner: "I do not want to see this"). */
.agent-panel *, .agent-panel { scrollbar-width: none; }
.agent-panel *::-webkit-scrollbar { display: none; width: 0; height: 0; }

.agp-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 8px; border-bottom: 1px solid var(--agp-hair); cursor: grab; touch-action: none; }
.agent-panel.is-dragging .agp-head { cursor: grabbing; }
.agp-grip { display: grid; place-items: center; width: 14px; color: var(--agp-text-3); }
.agp-grip svg { width: 10px; height: 16px; }
/* Plain colours: the mark also shows in the AI drawer, outside the panel's variables. */
.agp-mark { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--accent, #B5FF3A); color: #0B0B10; }
.agent-panel .agp-mark svg { width: 18px; height: 18px; display: block; }
.agp-title { flex: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
/* The status shrinks before the buttons do: the close button always shows
   (owner's third video, 7 Nov 2026: "Needs your answer" pushed it out). */
.agp-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; margin-left: 2px; font-size: 12px; color: var(--agp-text-2); padding: 2px 8px; border-radius: 6px; background: var(--agp-raised); white-space: nowrap; }
.agp-status.is-live { color: var(--agp-accent); }
.agp-status.is-ask { color: #FFD166; }
.agp-status.is-problem { color: #FF8A8A; }
.agp-head-btns { flex: none; margin-left: auto; display: flex; gap: 2px; }
.agp-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--agp-text-2); cursor: pointer; }
.agp-icon:hover { background: var(--agp-pressed); color: var(--agp-text); }

/* Earlier chats: this project first, then the others, each with delete. */
.agp-history { position: absolute; top: 54px; right: 10px; left: 10px; z-index: 3; max-height: min(420px, 70%); overflow: auto; padding: 6px; background: var(--agp-raised); border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 32px rgba(0, 0, 0, 0.45); }
.agp-hsec { margin: 6px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--agp-text-3); text-transform: uppercase; }
.agp-hempty { padding: 8px 10px; }
.agp-hrow { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
.agp-hrow:hover, .agp-hrow.is-on { background: var(--agp-pressed); }
.agp-hopen { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.agp-hopen span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-hopen small { color: var(--agp-text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-hdel { flex: none; width: 32px; height: 32px; display: grid; place-items: center; margin-right: 4px; border: 0; border-radius: 8px; background: none; color: var(--agp-text-3); cursor: pointer; opacity: 0; }
.agp-hrow:hover .agp-hdel, .agp-hdel:focus-visible { opacity: 1; }
.agp-hdel:hover { background: #3A1F22; color: #FF8A8A; }

.agp-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 12px; }
.agp-msg p { margin: 0; }
.agp-msg p + p, .agp-msg ul, .agp-msg ol { margin-top: 6px; }
.agp-msg ul, .agp-msg ol { margin-bottom: 0; padding-left: 20px; }
.agp-msg li + li { margin-top: 3px; }
.agp-msg code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; padding: 1px 5px; border-radius: 6px; background: var(--agp-raised); }
.agp-msg a { color: var(--agp-accent); }
.agp-gap { height: 4px; }
.agp-user { align-self: flex-end; max-width: 86%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.agp-bubble { padding: 9px 12px; border-radius: 14px 14px 6px 14px; background: var(--agp-pressed); overflow-wrap: anywhere; }
.agp-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.agp-tag { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--agp-text-2); padding: 1px 7px; border-radius: 6px; background: var(--agp-raised); }
.agp-agent { color: var(--agp-text); overflow-wrap: anywhere; }

.agp-steps { border-radius: 10px; background: var(--agp-raised); font-size: 13px; color: var(--agp-text-2); }
.agp-steps summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; border-radius: 10px; }
.agp-steps summary:hover { background: var(--agp-pressed); }
.agp-steps summary::-webkit-details-marker { display: none; }
.agp-steps summary span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--agp-text); }
.agp-steps summary svg { color: var(--agp-text-3); width: 14px; height: 14px; }
.agp-steps ol { margin: 0; padding: 0 10px 8px 32px; list-style: none; }
.agp-steps ol:empty { display: none; }
.agp-steps li { padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-steps .agp-more { color: var(--agp-text-3); }
.agp-x { color: var(--agp-text-3); }
.agp-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid rgba(181, 255, 58, 0.22); border-top-color: var(--agp-accent); animation: agp-spin 0.8s linear infinite; }
@keyframes agp-spin { to { transform: rotate(360deg); } }
.agp-working { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--agp-raised); font-size: 13px; color: var(--agp-text); }
.agp-stopped { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--agp-raised); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); font-size: 13px; color: var(--agp-text-2); }
.agp-stopped svg { width: 18px; height: 18px; color: var(--agp-text); margin-top: 1px; }
.agp-stopped b { color: var(--agp-text); }

.agp-ask { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--agp-raised); }
.agp-ask.is-open { box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.4); }
.agp-q p { margin: 0 0 8px; font-weight: 500; }
.agp-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.agp-opt { padding: 7px 12px; border: 0; border-radius: 10px; background: var(--agp-surface); box-shadow: inset 0 0 0 1px var(--agp-hair); cursor: pointer; }
.agp-opt:hover:not(:disabled) { background: var(--agp-pressed); }
.agent-panel .agp-opt.is-picked { background: var(--agp-accent); color: var(--agp-ink); box-shadow: none; }
.agp-opt:disabled { cursor: default; opacity: 0.55; }
.agp-note { font-size: 13px; color: var(--agp-text-2); padding: 8px 10px; border-radius: 10px; background: var(--agp-raised); }
.agp-fine { margin: 0; font-size: 12.5px; color: var(--agp-text-2); }
.agp-fine b { color: var(--agp-text); font-weight: 600; }
.agp-link { border: 0; padding: 0; background: none; color: var(--agp-accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* A real button in the chat (owner's third video, 7 Nov 2026: "Send answers"
   was underlined text). */
.agent-panel .agp-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--agp-accent); color: var(--agp-ink); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.agent-panel .agp-btn:hover { filter: brightness(1.06); }
.agp-ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* A chat that stopped on a fault: plain words and Try again. */
.agp-failed { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--agp-raised); box-shadow: inset 0 0 0 1px rgba(255, 138, 138, 0.35); font-size: 13px; color: var(--agp-text); }
.agp-failed span { flex: 1; min-width: 0; }

/* The empty chat: our mark, the question, where it works, four suggestions. */
.agp-empty { margin: auto 0; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 4px 2px; }
.agp-empty-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--agp-accent); color: var(--agp-ink); }
.agent-panel .agp-empty-mark svg { width: 26px; height: 26px; display: block; }
.agp-empty h3 { margin: 4px 0 0; font-size: 19px; font-weight: 600; }
.agp-empty .agp-fine { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.agp-suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.agp-sug { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--agp-raised); text-align: left; cursor: pointer; }
.agp-sug:hover { background: var(--agp-pressed); }
.agp-sug-ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--agp-surface); color: var(--agp-accent); }
.agp-sug b { display: block; font-size: 13.5px; font-weight: 600; }
.agp-sug small { display: block; font-size: 12.5px; color: var(--agp-text-2); }

.agp-foot { position: relative; padding: 8px 10px 10px; border-top: 1px solid var(--agp-hair); }
.agp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.agp-ctx, .agp-pick { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 26px; padding: 3px 8px; border-radius: 8px; background: var(--agp-raised); color: var(--agp-text-2); font-size: 12px; }
.agp-ctx span, .agp-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-ctx svg, .agp-pick svg { width: 13px; height: 13px; }
.agp-pick { color: var(--agp-text); box-shadow: inset 0 0 0 1px rgba(181, 255, 58, 0.35); max-width: 220px; }
.agp-pick img { width: 18px; height: 18px; flex: none; border-radius: 4px; object-fit: cover; background: #fff; }
.agp-pick button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; padding: 0; border-radius: 5px; background: none; color: var(--agp-text-3); cursor: pointer; }
.agp-pick button:hover { background: var(--agp-pressed); color: var(--agp-text); }
/* The composer: one rounded box, its ring wraps the whole box. */
.agp-box { border-radius: 14px; background: var(--agp-raised); box-shadow: inset 0 0 0 1px var(--agp-hair); }
.agp-box:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
.agp-box textarea { display: block; width: 100%; box-sizing: border-box; min-height: 44px; max-height: 140px; resize: none; padding: 11px 12px 4px; border: 0; background: none; color: var(--agp-text); font: inherit; outline: none; box-shadow: none; }
.agp-box textarea:focus, .agp-box textarea:focus-visible { outline: none; box-shadow: none; }
.agp-box textarea::placeholder { color: var(--agp-text-3); }
.agp-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px 6px 8px; }
.agp-usage { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--agp-text-2); font-size: 12px; cursor: pointer; }
.agp-usage svg { width: 13px; height: 13px; }
.agp-usage:hover { background: var(--agp-pressed); color: var(--agp-text); }
/* One button: an arrow to send; while the agent works and the box is empty,
   a spinning ring with a stop mark (owner: "a circle that is rotating"). */
.agent-panel .agp-go { position: relative; margin-left: auto; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--agp-accent); color: var(--agp-ink); cursor: pointer; }
.agent-panel .agp-go svg { width: 18px; height: 18px; }
.agent-panel .agp-go:hover { filter: brightness(1.06); }
.agent-panel .agp-go:disabled { opacity: 0.45; cursor: default; }
.agent-panel .agp-go[data-mode="stop"] { background: var(--agp-pressed); color: var(--agp-text); }
.agent-panel .agp-go[data-mode="stop"]:hover { background: #33333A; filter: none; }
.agp-ring { position: absolute; inset: 4px; border-radius: 50%; border: 2px solid rgba(181, 255, 58, 0.2); border-top-color: var(--agp-accent); animation: agp-spin 0.9s linear infinite; pointer-events: none; }
/* What this chat used, in credits. */
.agp-usagepop { position: absolute; left: 10px; right: 10px; bottom: 96px; z-index: 3; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--agp-raised); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 32px rgba(0, 0, 0, 0.45); font-size: 13px; }
.agp-uhead { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--agp-hair); }
.agp-uhead span { color: var(--agp-accent); font-weight: 600; }
.agp-urow { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--agp-text-2); }
.agp-urow > span { display: inline-flex; align-items: center; gap: 4px; }
.agp-urow b { color: var(--agp-text); font-weight: 600; }
.agp-owner { padding-top: 6px; border-top: 1px solid var(--agp-hair); }

/* E1 (owner's fourth video, 7 Nov 2026): black with a 1px white line for the
   panel, chips, rows, steps and the input; hover = a brighter line; the
   person's own message is lime-edged glass (below); picked chips and Send keep the lime. */
.agent-panel { box-shadow: 0 0 0 1px var(--agp-hair), 0 24px 48px rgba(0, 0, 0, 0.5); }
.agent-panel.is-dragging { box-shadow: 0 0 0 1px var(--agp-line-hover), 0 28px 56px rgba(0, 0, 0, 0.55); }
.agp-status, .agp-tag, .agp-msg code, .agp-steps, .agp-working, .agp-note, .agp-stopped, .agp-ask, .agp-sug, .agp-sug-ic, .agp-ctx, .agp-opt, .agp-box { background: #000000; box-shadow: inset 0 0 0 1px var(--agp-hair); }
.agp-ask.is-open { box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.5); }
.agp-history, .agp-usagepop { background: #000000; box-shadow: 0 0 0 1px var(--agp-hair), 0 16px 32px rgba(0, 0, 0, 0.6); }
.agp-icon:hover, .agp-hrow:hover, .agp-hrow.is-on, .agp-usage:hover, .agp-pick button:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--agp-line-hover); }
.agp-steps summary:hover { background: transparent; }
.agp-steps:hover, .agp-sug:hover, .agp-opt:hover:not(:disabled), .agp-box:focus-within { background: #000000; box-shadow: inset 0 0 0 1px var(--agp-line-hover); }
.agent-panel .agp-opt.is-picked, .agent-panel .agp-opt.is-picked:hover:not(:disabled) { background: var(--agp-accent); color: var(--agp-ink); box-shadow: none; }
.agp-hdel:hover { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 138, 138, 0.5); color: #FF8A8A; }
/* The person's own message: glass with a lime edge and white text (owner,
   7 Nov 2026: "White message on black is bad, you use glass UI effect or
   liquid UI effect with some color on the boundary of the message to make it
   look distinct"). A lime tint fading across the bubble, a lime edge and a
   thin light line on top; no glow (owner rule, 20 Oct). */
.agp-bubble {
  color: #FFFFFF;
  background: linear-gradient(145deg, rgba(181, 255, 58, 0.17) 0%, rgba(181, 255, 58, 0.05) 55%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow: inset 0 0 0 1px rgba(181, 255, 58, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.agent-panel .agp-go[data-mode="stop"] { background: #000000; color: var(--agp-text); box-shadow: inset 0 0 0 1px var(--agp-hair); }
.agent-panel .agp-go[data-mode="stop"]:hover { background: #000000; box-shadow: inset 0 0 0 1px var(--agp-line-hover); }
.agent-panel .agp-btn:disabled { opacity: 0.45; cursor: default; filter: none; }
/* Questions: "Pick any" on a multi question, and the box under its Other. */
.agp-multi { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--agp-text-2); }
.agp-otherin { display: block; width: 100%; box-sizing: border-box; height: 36px; margin-top: 8px; padding: 0 10px; border: 0; border-radius: 10px; background: #000000; box-shadow: inset 0 0 0 1px var(--agp-hair); color: var(--agp-text); font: inherit; font-size: 13.5px; outline: none; }
.agp-otherin:focus { box-shadow: inset 0 0 0 1px var(--agp-line-hover); }
.agp-otherin::placeholder { color: var(--agp-text-2); }

/* Reference pictures the agent drew from (owner's fifth video, 7 Nov 2026):
   small round thumbnails under their actions; a click opens them larger
   inside the panel. Black only, a thin white line; selected/hover = lime glass. */
.agp-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.agp-ref { position: relative; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #000000; box-shadow: inset 0 0 0 1px var(--agp-hair); cursor: zoom-in; }
.agp-ref img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.agp-ref::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--agp-hair); pointer-events: none; }
.agp-ref:hover::after, .agp-ref:focus-visible::after { box-shadow: var(--ui2-glass-on-edge, inset 0 0 0 1px rgba(181, 255, 58, 0.62), 0 0 14px rgba(181, 255, 58, 0.24)); }
.agp-ref:focus-visible { outline: none; }
.agp-viewer { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; background: #000000; border-radius: inherit; }
.agp-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--agp-hair); font-size: 14px; }
.agp-viewer-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px; }
.agp-viewer-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; box-shadow: 0 0 0 1px var(--agp-hair); background: #000000; cursor: default; }
.agp-viewer-cap { padding: 0 16px 16px; overflow-wrap: anywhere; }
/* Revert this reply (SVG Lab Agent, owner's fifth video S26): a quiet line
   under a finished reply, one question before it acts, and a plain note after. */
.agp-revert-row { display: flex; justify-content: flex-start; margin-top: -4px; }
.agent-panel .agp-revert { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; box-shadow: inset 0 0 0 1px var(--agp-hair); color: var(--agp-text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.agent-panel .agp-revert:hover, .agent-panel .agp-revert:focus-visible { color: var(--agp-text); box-shadow: inset 0 0 0 1px var(--agp-line-hover); outline: none; }
.agent-panel .agp-revert svg { width: 15px; height: 15px; }
.agent-panel .agp-revert.is-busy { cursor: default; }
.agp-revert-ask { padding: 10px 12px; border-radius: 10px; background: #000000; box-shadow: inset 0 0 0 1px var(--agp-line-hover); font-size: 13px; color: var(--agp-text); }
.agp-revert-ask p { margin: 0 0 10px; line-height: 1.4; }
.agp-revert-btns { display: flex; justify-content: flex-end; gap: 8px; }
.agent-panel .agp-btn.agp-btn-quiet { background: transparent; color: var(--agp-text); box-shadow: inset 0 0 0 1px var(--agp-hair); }
.agent-panel .agp-btn.agp-btn-quiet:hover { filter: none; box-shadow: inset 0 0 0 1px var(--agp-line-hover); }
.agp-reverted { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #000000; box-shadow: inset 0 0 0 1px var(--agp-hair); font-size: 13px; color: var(--agp-text-2); }
.agp-reverted svg { width: 16px; height: 16px; color: var(--agp-accent); flex: none; }

/* Round 4 (owner's sixth video, 8 Nov 2026, M55 to M69). Same language:
   black, a thin white line, lime only for picks and actions. */
/* M69: a short warning above the box; what each reply used beside Revert. */
.agp-warn { margin-bottom: 8px; padding: 7px 10px; border-radius: 10px; background: #000000; box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.45); font-size: 12.5px; line-height: 1.4; color: var(--agp-text); }
.agp-revert-row { align-items: center; gap: 8px; flex-wrap: wrap; }
.agp-replycost { font-size: 12px; color: var(--agp-text-2); }
/* M65: the closing reply's offers, one tap each. */
.agp-offers { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: -4px; }
.agent-panel .agp-offer { max-width: 100%; padding: 7px 12px; border: 0; border-radius: 10px; background: #000000; box-shadow: inset 0 0 0 1px rgba(181, 255, 58, 0.45); color: var(--agp-text); font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.agent-panel .agp-offer:hover, .agent-panel .agp-offer:focus-visible { box-shadow: inset 0 0 0 1px var(--agp-accent); outline: none; }
/* M61: his answers as a short list. */
.agp-answers .agp-bubble ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.agp-answers .agp-bubble li { display: flex; flex-direction: column; }
.agp-aq { font-size: 11.5px; color: rgba(255, 255, 255, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.agp-answers b { font-weight: 600; }
/* M62: a long card shows one question at a time. */
.agp-qn { margin-right: 4px; font-size: 11.5px; font-weight: 400; color: var(--agp-text-2); }
.agp-qnav { display: flex; align-items: center; gap: 6px; }
.agent-panel .agp-qdot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.22); cursor: pointer; }
.agent-panel .agp-qdot.is-done { background: rgba(181, 255, 58, 0.55); }
.agent-panel .agp-qdot.is-on { background: var(--agp-accent); }
.agp-qnav .agp-btn:first-of-type { margin-left: auto; }
.agp-qnav .agp-btn { height: 28px; padding: 0 10px; }
/* M42: a picture on an option. */
.agp-opts.has-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.agent-panel .agp-opt-pic { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; text-align: left; }
.agp-optimg { display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #000000; }
.agp-optimg img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A lettering style as a tile: light chalk words on the board's own dark colour. */
.agp-lettile { display: grid; place-items: center; height: 46px; padding: 0 6px; border-radius: 6px; background: #0B0B10; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); color: #F2F0E6; font-size: 14px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.agent-panel .agp-opt.is-picked .agp-lettile { box-shadow: inset 0 0 0 1px rgba(11, 11, 16, 0.4); }
/* M55, M67: the owner's working notes, and copied or built. */
.agp-steps .agp-midline { font-style: italic; color: var(--agp-text-3); white-space: normal; }
.agp-how { font-size: 11px; padding: 0 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--agp-hair); color: var(--agp-text-2); }
.agp-how-copied { box-shadow: inset 0 0 0 1px rgba(181, 255, 58, 0.45); }
.agp-steps .agp-stepcost { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--agp-hair); color: var(--agp-text-3); white-space: normal; }
.agp-elapsed { color: var(--agp-text-3); }
.agp-oldnote { text-align: center; }
/* M56, M57: reference pictures, owner only, as a chain found -> made -> drawn. */
.agp-refs-owner { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; padding: 8px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--agp-hair); }
.agp-owner-tag { font-size: 11.5px; }
.agp-refchain b { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.agp-refrow { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.agp-reffig { margin: 0; width: 88px; display: flex; flex-direction: column; gap: 3px; }
.agp-reffig .agp-ref { width: 88px; height: 66px; }
.agp-reffig figcaption { font-size: 11px; line-height: 1.3; color: var(--agp-text-2); overflow-wrap: anywhere; }
.agp-reffig figcaption a { color: var(--agp-accent); }
.agp-chain-arrow { align-self: center; margin-top: -18px; color: var(--agp-text-3); font-size: 13px; }
.agp-chain-end { align-self: center; margin-top: -18px; font-size: 11.5px; color: var(--agp-text-2); max-width: 70px; }
/* M58: the picture opens over the top of the chat, which stays in view below. */
.agp-viewer { inset: 58px 10px auto 10px; height: min(56%, 440px); border-radius: 14px; box-shadow: 0 0 0 1px var(--agp-hair), 0 16px 32px rgba(0, 0, 0, 0.6); }
.agp-viewer-head { gap: 8px; padding: 6px 6px 6px 12px; }
.agp-viewer-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-viewer-img { position: relative; padding: 8px 40px; }
.agent-panel .agp-vprev, .agent-panel .agp-vnext { position: absolute; top: 50%; transform: translateY(-50%); box-shadow: inset 0 0 0 1px var(--agp-hair); background: #000000; }
.agent-panel .agp-vprev { left: 4px; }
.agent-panel .agp-vnext { right: 4px; }
.agp-viewer-cap { padding: 0 12px 10px; }
.agp-viewer-cap a { color: var(--agp-accent); }
/* Owner view switches in the credits breakdown. */
.agp-ownerview { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px solid var(--agp-hair); }
.agp-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--agp-text); cursor: pointer; }
.agp-switch input { accent-color: var(--agp-accent); margin: 0; }
/* M66: the box grows upward to 200px; the chat above shrinks and keeps its end in view. */
.agp-box textarea { max-height: 200px; }

/* The standard information mark: an "i" inside a circle, its words in .svl-tip. */
.svl-info { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; vertical-align: -3px; border-radius: 50%; color: var(--ui2-text-2, rgba(240, 240, 240, 0.68)); cursor: help; outline: none; }
.svl-info svg { width: 16px; height: 16px; display: block; }
.svl-info:hover, .svl-info:focus-visible { color: var(--ui2-text, #F0F0F0); }
.svl-info:focus-visible { box-shadow: 0 0 0 2px rgba(181, 255, 58, 0.5); }
.svl-tip { position: fixed; z-index: 2000; max-width: 260px; padding: 8px 10px; border-radius: 10px; background: #000000; color: #FFFFFF; font-size: 12.5px; line-height: 1.45; font-weight: 400; text-align: left; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 24px rgba(0, 0, 0, 0.45); /* black, not gray (owner, 7 Nov 2026) */ pointer-events: none; white-space: normal; }

/* While the agent works from this panel, the panel is the one status: the
   watch banner and the live feed card would repeat it. The AI frame on the
   board, its corner squares and the AI cursor stay. */
html.agp-own .ai-watch-banner, html.agp-own-lock .ai-watch-banner, html.agp-own .ai-live-feed, html.agp-own-lock .ai-live-feed { display: none !important; }
#ai-presence .ai-presence-corner { fill: #0B0B10; stroke: var(--presence-1); }
#ai-presence .ai-presence-corner.slot-2 { stroke: var(--presence-2); }
#ai-presence .ai-presence-corner.slot-3 { stroke: var(--presence-3); }
html.agp-own #ai-presence .ai-presence-frame { opacity: 0.95; }
html.agp-own #ai-presence .ai-presence-corner { animation: ai-corner-pulse 1.6s ease-in-out infinite; }
@keyframes ai-corner-pulse { 50% { opacity: 0.35; } }
/* The AI rail button shows the agent is working while the panel is closed. */
#ui2-rail [data-ui2-drawer="ai"] { position: relative; }
.agp-busydot { position: absolute; top: 7px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent, #B5FF3A); pointer-events: none; }
/* The AI drawer's entry. */
html.ui-v2 .ui2-agent { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border: 0; border-radius: 14px; background: var(--ui2-raised, #1D1D22); color: var(--ui2-text, #F0F0F0); text-align: left; cursor: pointer; }
html.ui-v2 .ui2-agent:hover { background: var(--ui2-pressed, #26262C); }
html.ui-v2 .ui2-agent .agp-mark { width: 34px; height: 34px; border-radius: 10px; }
html.ui-v2 .ui2-agent .agp-mark svg { width: 20px; height: 20px; display: block; }
html.ui-v2 .ui2-agent b { display: block; font-size: 15px; font-weight: 600; }
html.ui-v2 .ui2-agent small { display: block; color: var(--ui2-text-2); font-size: 13px; }
html.ui-v2 .ui2-short { display: flex; align-items: center; gap: 6px; }
/* Hover fills the whole row; a part inside it never draws its own blob
   (owner's second test video: "add proper effect that fills the whole shape"). */
html.ui-v2 .ui2-wide:hover .svl-info { background: none; }

/* Black and white (owner, 7 Nov 2026, his test video at 21:16 to 21:51):
   "you have given it a black gray look again... Give it a proper dark look.
   Give the canvas a dark look... get rid of the gray color completely.
   Instead we go complete dark or completely white like this export button."
   The tokens near "UI skills pass, 20 Oct" are now pure black. This block
   sets the three states that used gray fills before:
   - resting controls (inputs, tiles, real buttons): black with a 1px white
     14% line;
   - hover: the line brightens to 32% and the text turns white, no fill;
   - selected (active mode, open drawer, armed tool, current page, chosen
     row or tab): lime-tinted liquid glass with a lime edge and a soft lime
     glow, white text (his second look the same day: white on black "hurts
     the eye").
   The lime accent stays on its own actions (Share, Open in, Upgrade, AI).
   Not here: the agent panel (.agp-*) and the Chalk Board (.wb-*). */
@media (min-width: 721px) {
  /* The selected look (see "Selected" below): lime-tinted liquid glass. */
  html.ui-v2:root {
    --ui2-glass-on: linear-gradient(145deg, rgba(181, 255, 58, 0.20) 0%, rgba(181, 255, 58, 0.07) 55%, rgba(255, 255, 255, 0.05) 100%);
    --ui2-glass-on-edge: inset 0 0 0 1px rgba(181, 255, 58, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 14px rgba(181, 255, 58, 0.24);
  }
  html.ui-v2 #canvas, html.ui-v2 .canvas-area, html.ui-v2 #canvas-area { background-color: #000000; }

  /* Resting: black with the line. */
  html.ui-v2 .topbar .actions > button:not(.btn-upgrade):not(.ui2-cai), html.ui-v2 .topbar #btn-user, html.ui-v2 .topbar #cloud-save-size,
  html.ui-v2 .topbar .actions > .file-btn,
  html.ui-v2 .ui2-tile, html.ui-v2 .ui2-icon, html.ui-v2 .ui2-wide .ui2-ic, html.ui-v2 .ui2-up, html.ui-v2 .ui2-agent,
  html.ui-v2 .ui2-search input, html.ui-v2 .mcp-conn-list > li, html.ui-v2 .open-in-app-ic, html.ui-v2 .user-avatar {
    background-color: #000000; box-shadow: inset 0 0 0 1px var(--ui2-line); border-color: transparent;
  }
  html.ui-v2 select, html.ui-v2 .modal-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), html.ui-v2 .modal-card textarea {
    background-color: #000000; border-color: var(--ui2-line);
  }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .field,
  html.ui-v2 .properties > .prop-group:not(#proto-group) textarea,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .fill-invert-btn,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .full-width {
    background-color: #000000; border-color: var(--ui2-line);
  }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .fill-invert-btn .fill-invert-hole { fill: #000000; }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg { background: #000000; box-shadow: inset 0 0 0 1px var(--ui2-line); }
  /* Slider tracks: the unfilled part is the line colour, not a gray fill. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill-pct, 0%), var(--ui2-line) var(--fill-pct, 0%), var(--ui2-line) 100%);
  }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .slider-row input[type="range"]::-moz-range-track {
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill-pct, 0%), var(--ui2-line) var(--fill-pct, 0%), var(--ui2-line) 100%);
  }

  /* Hover: a brighter line and white text, never a gray fill. */
  html.ui-v2:root body :is(.ui2-island button, .ui2-island .file-btn, .ui2-rail-btn, .ui2-ibtn, .ui2-wide, .ui2-font, .ui2-addtext,
    .ui2-tile, .ui2-icon, .ui2-up, .ui2-agent, .page-tab, .page-add, .fit-menu button, .zoom-pill button, .menu button, .menu a,
    .ui2-file-menu > button, .ui2-file-menu > label, .ui2-help-menu a, .ui2-help-fb, .ui2-ctx button, .ui2-dtabs button,
    .project-menu button, .project-menu-toggle, .ui2-outside, .open-in-item, .ab-nav-item, .usage-panel button, .ui2-pop button):hover:not(:disabled):not(:where(#btn-export, .caret, #btn-open-in, .btn-upgrade, .ui2-cai, #proto-share-top, .on, .armed, .active, .selected, [aria-pressed="true"], [aria-selected="true"])) {
    background-color: #000000 !important; box-shadow: inset 0 0 0 1px var(--ui2-line-hi) !important; color: var(--ui2-text);
  }
  html.ui-v2 .ui2-drawer #layers li:hover, html.ui-v2 #projects-list .project-row:hover, html.ui-v2 #projects-list .project-row:focus-within {
    background-color: #000000; background-image: none; box-shadow: inset 0 0 0 1px var(--ui2-line-hi);
  }
  html.ui-v2 .properties > .prop-group:not(#proto-group) button:not(.swatch-chip):hover:not(:disabled),
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button:hover:not(:disabled) {
    background-color: #000000; box-shadow: inset 0 0 0 1px var(--ui2-line-hi); color: var(--ui2-text);
  }
  /* The coloured actions keep their own hover. */
  html.ui-v2:root body .topbar .actions :is(#btn-export, .caret):hover { background: #FFFFFF !important; color: var(--ui2-on-ink) !important; box-shadow: none !important; }
  html.ui-v2:root body .topbar .actions .caret :is(svg, use, span) { color: var(--ui2-on-ink) !important; stroke: currentColor; }
  html.ui-v2:root body .topbar .actions #btn-open-in:hover,
  html.ui-v2:root body .topbar .actions #btn-open-in[aria-expanded="true"] { background: var(--accent-soft) !important; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent) !important; }
  html.ui-v2:root body :is(.btn-upgrade, .ui2-cai):hover { box-shadow: none !important; }
  html.ui-v2:root body #proto-share-top:hover { background: var(--accent-soft) !important; box-shadow: none !important; color: var(--accent); }

  /* Selected: liquid glass with a lime glow, white text (owner, 7 Nov 2026,
     second look: "Do not use this white color on black please it hurts the
     eye. You can apply liquid glass effect to selected options, with lime
     color luminescence."). The same recipe as the person's own message in
     the agent panel: a lime tint fading across, a lime edge, a thin light
     line on top, and a soft lime glow around. */
  html.ui-v2:root body .ui2-modes button[aria-pressed="true"],
  html.ui-v2:root body .ui2-modes button[aria-pressed="true"]:hover,
  html.ui-v2:root body .ui2-rail-btn.on, html.ui-v2:root body .ui2-rail-btn.on:hover,
  html.ui-v2:root body .ui2-rail-btn.armed, html.ui-v2:root body .ui2-rail-btn.armed:hover,
  html.ui-v2:root body .ui2-rail-btn[data-ui2-group="select"].on,
  html.ui-v2:root body .page-tab.active, html.ui-v2:root body .page-tab.active:hover,
  html.ui-v2:root body .ui2-wide.on, html.ui-v2:root body .ui2-font.on, html.ui-v2:root body .ui2-tile.on,
  html.ui-v2:root body .ui2-dtabs button[aria-selected="true"],
  html.ui-v2:root body .ui2-drawer #layers li.selected, html.ui-v2:root body .ui2-drawer #layers li.selected:hover,
  html.ui-v2:root body #ab-nav .ab-nav-item.active, html.ui-v2:root body .ab-nav-item.active {
    background: var(--ui2-glass-on) !important; color: #FFFFFF !important; box-shadow: var(--ui2-glass-on-edge) !important;
    -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  }
  html.ui-v2:root body :is(.ui2-rail-btn.on, .ui2-rail-btn.armed) svg { color: var(--accent); }
  html.ui-v2:root body :is(.ui2-wide.on, .ui2-font.on, .ui2-tile.on, .ui2-drawer #layers li.selected, .ab-nav-item.active) :is(span, b, small, .ui2-desc, .ui2-fname) { color: #FFFFFF; }
  html.ui-v2:root body :is(.ui2-wide.on, .ui2-font.on, .ui2-tile.on, .ui2-drawer #layers li.selected, .ab-nav-item.active) svg { color: var(--accent); }
  html.ui-v2:root body .ui2-modes button[aria-pressed="true"] .mode-count { background: var(--accent); color: var(--ui2-on-ink); }
  html.ui-v2 .properties > .prop-group:not(#proto-group) .seg button.active,
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row.gap button.active {
    background: var(--ui2-glass-on); color: #FFFFFF; box-shadow: var(--ui2-glass-on-edge);
  }

  /* Select (owner, 7 Nov 2026): "that small arrow should be at the bottom
     corner of that button, also the select icon is proportionally very small
     compared to button". The arrow sits in the bottom-right corner, clear of
     the word; the cursor is drawn bigger. */
  html.ui-v2:root body .ui2-rail-btn[data-ui2-tool="select"] > svg { width: 24px; height: 24px; }
  html.ui-v2:root body .ui2-more-mark { top: auto; right: 2px; bottom: 2px; width: 10px; height: 10px; background-position: 4px 4px; background-size: 6px 6px; }
  /* The current project row is marked by a brighter line (a white row would
     hide its thumbnail and words). */
  html.ui-v2 #projects-list .project-row.is-active { background-color: #000000; box-shadow: inset 0 0 0 1px var(--ui2-line-hi); }
  html.ui-v2 #projects-list .project-menu-toggle[aria-expanded="true"] { background: #000000; box-shadow: inset 0 0 0 1px var(--ui2-line-hi); }
  html.ui-v2 #btn-open-in[aria-expanded="true"] { background: var(--accent-soft); }
  /* The layered poster bar: black with the line, a rounded rectangle. */
  html.ui-v2 #layered-bar { background: #000000; border-color: var(--ui2-line); border-radius: 14px; }
  html.ui-v2 #layered-bar .layered-edit input { background: #000000; border-color: var(--ui2-line); border-radius: 10px; }
  html.ui-v2 #layered-bar button { border-radius: 10px; }
}

/* Agent arrivals (7 Nov 2026, app.js section 41, the build replay): throwaway copies of the
   agent's new and changed shapes animate in a layer of their own beside #content; the cursor's
   bubble turns to its left near the agent panel or the right edge; chalk dust on a Chalk Board. */
#ai-arrive-layer { pointer-events: none; }
#ai-arrive-layer .ai-arrive-dust { fill: rgba(245, 242, 232, 0.85); }
.ai-live-cursor.tag-left .ai-live-tag { left: auto; right: 4px; }
/* 8 Nov 2026 (round 3): the arrow presses in while it drags or draws; a caret where it types. */
.ai-live-cursor .ai-live-arrow { transition: transform 0.12s ease-out; transform-origin: 3px 2px; }
.ai-live-cursor.is-drawing .ai-live-arrow { transform: scale(0.86) translate(1px, 1px); }
#ai-arrive-layer .ai-arrive-caret { fill: var(--presence-1, #B5FF3A); }
/* Round 4 (owner's sixth test, 8 Nov 2026, app.js section 41): a new board waits hidden until the
   cursor drags its frame out (M5); the agent's cursor is a chalk stick on the Chalk Board (M12),
   fades away while nothing is drawn (M7), and points from the canvas edge at work out of view. */
#artboards-layer .ai-ab-pending, .ai-ab-pending { opacity: 0 !important; }
#ai-arrive-layer .ai-arrive-board { stroke: var(--presence-1, #B5FF3A); stroke-opacity: 0.9; }
#ai-arrive-layer .ai-arrive-board-name { fill: var(--presence-1, #B5FF3A); }
.ai-live-cursor .ai-live-chalk { display: none; }
.ai-live-cursor.is-chalk .ai-live-arrow { display: none; }
.ai-live-cursor.is-chalk .ai-live-chalk {
  display: block; width: 30px; height: 30px; margin: -26px 0 0 -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg transform='rotate(-45 16 16)'%3E%3Cpath d='M2.4 13.3L4 13.05L27.4 12.5Q29.3 12.6 29.4 14.3L29.5 17.8Q29.3 19.4 27.4 19.5L3.9 18.95L2.5 18.75Q1.2 18.2 0.9 16.9L1.1 16.1L0.8 15.3Q1.1 13.8 2.4 13.3Z' fill='%23F2F0EA' stroke='%230B0B10' stroke-opacity='.6' stroke-width='1'/%3E%3Cpath d='M27.3 12.9Q28.9 13 29 14.4L29.1 17.7Q28.9 19 27.3 19.1Z' fill='%23D3CFC5'/%3E%3Cpath d='M5 14.9h2.2M9.5 14.75h3.6M15.5 15h1.8M19 14.7h4.5M6.2 17.25h2.6M11.4 17.4h1.2M14.6 17.15h5.2M22.2 17.3h2.2' stroke='%23C9C5BB' stroke-width='.7' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='16.1' r='.45' fill='%23BDB9AF'/%3E%3Ccircle cx='13.6' cy='16.3' r='.35' fill='%23BDB9AF'/%3E%3Ccircle cx='20.4' cy='15.9' r='.4' fill='%23BDB9AF'/%3E%3Ccircle cx='24.8' cy='16.4' r='.35' fill='%23BDB9AF'/%3E%3Cpath d='M1.6 14.5Q2.5 13.9 3.3 14.1' stroke='%23FFFFFF' stroke-width='.7' stroke-linecap='round' fill='none'/%3E%3C/g%3E%3Ccircle cx='3' cy='29.5' r='.75' fill='%23F2F0EA' opacity='.7'/%3E%3Ccircle cx='7.4' cy='30.3' r='.5' fill='%23F2F0EA' opacity='.5'/%3E%3Ccircle cx='1.6' cy='26.4' r='.4' fill='%23F2F0EA' opacity='.5'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.ai-live-cursor.is-chalk.is-drawing .ai-live-chalk { transform: translate(1px, 1px) rotate(-4deg); }
.ai-live-cursor.is-chalk .ai-live-tag { top: 10px; padding: 2px 8px; font-size: 11px; }
.ai-live-cursor { transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease-out; }
.ai-live-cursor.is-idle { opacity: 0; }
.ai-live-cursor.is-edge .ai-live-arrow { transform: rotate(calc(var(--ai-edge-ang, 0deg) - 30deg)); transform-origin: 10px 10px; }
.ai-live-cursor.is-edge .ai-live-tag { opacity: 0.85; }
.ai-live-cursor .ai-live-what { max-width: 360px; }
html.agp-own #ai-presence .ai-pill:not(.is-ended) { display: none; }
@media (prefers-reduced-motion: reduce) {
  #ai-arrive-layer { display: none; }
}

/* Hide it for now (Sarah, 10 Nov 2026): the editor's ways into SVG Lab Agent show
   only once the server has said yes to the signed-in account (app.js section 43
   sets html.agent-on). Production keeps AGENT_MODE "owner", so nobody else sees a
   button that would only answer "could not start". */
html:not(.agent-on) .ui2-agent,
html:not(.agent-on) .wb-help-use [data-wb-use] { display: none !important; }

/* Floating Black (SVG-304, picked 10 Nov 2026 from four mockups in
   docs/design/ui-options-2026-11-10, option 2; "2 is right with docking &
   detaching capabilities for big menus or side bars"). Like Figma's newest
   layout and pen.dev: the canvas fills the window and every bar is an island
   of ONE height (44), ONE corner (14) and ONE inner padding (4), so the
   buttons inside are all 36 high with corner 10 and line up across bars
   (the mockup drew 32 / 8; 36 / 10 keeps the owner's 36px targets and his
   6 / 10 / 12 / 14 / 18 corners).
   Linear's CEO named the faults this fixes: bad alignment, buttons in mixed
   shapes and sizes, uneven spacing. 12px from every window edge and between
   rows. The rail is icons only (its names show on hover), as short as its
   buttons. The context bar moves to the bottom row, between the page tabs
   and zoom, so the top of the canvas is clear. Less lime: Open in and Share
   are plain, Upgrade is small lime text; lime stays on the selected glass,
   the credits mark and AI. Every big panel (each drawer, Advanced, the
   agent) docks to the side or floats: app.js "Dock or detach any big
   panel". Phones (720px and under) keep their own layout. */
@media (min-width: 721px) {
  html.ui-v2 {
    --ui2-top: 12px; --ui2-bar: 44px; --ui2-gut: 12px;
    --ui2-below: calc(var(--ui2-top) + var(--ui2-bar) + var(--ui2-gut));
    --ui2-inset-l: 72px; --ui2-inset-r: 12px; --ui2-inset-lb: 12px;
    /* An outer ring, not an inset one: a panel's sticky black header would
       paint over an inset line and the edge would seem to start below it. */
    --ui2-fb-elev: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 32px rgba(0, 0, 0, 0.6);
  }
  html.ui-v2.ui2-savewarn { --ui2-top: 54px; }

  /* One island recipe for every bar. */
  html.ui-v2 .topbar { top: var(--ui2-top); left: var(--ui2-gut); right: var(--ui2-gut); }
  html.ui-v2 .topbar > .topbar-row:not(.canvas-controls) { min-height: var(--ui2-bar); gap: var(--ui2-gut); }
  html.ui-v2 .ui2-island, html.ui-v2 #ui2-ctx, html.ui-v2 .zoom-pill, html.ui-v2 .pages-strip {
    height: var(--ui2-bar); min-height: var(--ui2-bar); padding: 4px; gap: 2px; box-sizing: border-box;
    border: 0; border-radius: 14px; background: #000000; box-shadow: var(--ui2-fb-elev);
  }
  html.ui-v2 .ui2-island button, html.ui-v2 .ui2-island .file-btn, html.ui-v2 .ui2-island .user-pill,
  html.ui-v2 .ui2-island .cloud-save-status, html.ui-v2 .ui2-island .ui2-file-btn, html.ui-v2 .ui2-island a.btn-upgrade,
  html.ui-v2 .ui2-island .ui2-modes button, html.ui-v2 .ui2-island .ui2-history button,
  html.ui-v2 #ui2-ctx button, html.ui-v2 .zoom-pill button, html.ui-v2 .page-tab, html.ui-v2 .page-add {
    height: 36px; min-height: 36px; border-radius: 10px; box-sizing: border-box;
  }
  html.ui-v2 .zoom-pill button { min-width: 36px; }
  html.ui-v2 .zoom-pill #zoom-level { min-width: 52px; font-size: 14px; }
  /* Menus that open from a bar keep their own 40px rows. */
  html.ui-v2 .ui2-island .menu button, html.ui-v2 .ui2-island #user-menu-dropdown button,
  html.ui-v2 .ui2-island .ui2-file-menu > :is(button, label) { height: 40px; min-height: 40px; }
  html.ui-v2 .ui2-island .ui2-modes button { padding: 0 14px; }
  html.ui-v2 .ui2-island .divider { height: 20px; margin: 0 4px; background: rgba(255, 255, 255, 0.085); }

  /* Less lime in the top row. */
  html.ui-v2:root body .topbar .actions button#btn-open-in,
  html.ui-v2:root body .topbar .actions button#btn-open-in:hover,
  html.ui-v2:root body .topbar .actions button#btn-open-in[aria-expanded="true"] {
    background: #000000 !important; color: var(--ui2-text) !important; box-shadow: none !important;
  }
  html.ui-v2:root body .topbar .actions button#btn-open-in:hover,
  html.ui-v2:root body .topbar .actions button#btn-open-in[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--ui2-line-hi) !important; }
  html.ui-v2:root body #proto-share-top { background: #000000 !important; color: var(--ui2-text) !important; border: 0 !important; box-shadow: none !important; }
  html.ui-v2:root body #proto-share-top:hover { box-shadow: inset 0 0 0 1px var(--ui2-line-hi) !important; }
  html.ui-v2:root body .topbar a.btn-upgrade {
    display: inline-flex; align-items: center; padding: 0 8px; background: transparent !important; border: 0 !important;
    box-shadow: none !important; color: var(--accent) !important; font-weight: 600; font-size: 14px;
  }
  html.ui-v2:root body .topbar a.btn-upgrade[hidden] { display: none !important; }
  html.ui-v2:root body .topbar a.btn-upgrade:hover { text-decoration: underline; text-underline-offset: 3px; }
  html.ui-v2:root body .topbar a.btn-upgrade .icon, html.ui-v2:root body .topbar a.btn-upgrade .btn-upgrade-sheen { display: none; }
  /* "New" in the mode switch is a small lime mark, not a pill. */
  html.ui-v2 .ui2-modes .ui2-new { width: 5px; height: 5px; margin-left: 6px; padding: 0; border-radius: 2px; font-size: 0; line-height: 0; vertical-align: middle; }
  html.ui-v2 .ui2-modes .ui2-new::after { display: none; }

  /* The rail: icons only, as short as its buttons. */
  html.ui-v2 .ui2-rail {
    left: var(--ui2-gut); top: var(--ui2-below); bottom: auto; width: 52px; max-height: calc(100vh - var(--ui2-below) - var(--ui2-gut));
    padding: 4px; gap: 2px; align-items: center; overflow-y: auto; scrollbar-width: none;
    border-radius: 14px; box-shadow: var(--ui2-fb-elev);
  }
  html.ui-v2 .ui2-rail::-webkit-scrollbar { display: none; }
  html.ui-v2 .ui2-rail-btn {
    width: 44px; height: 44px; min-height: 44px; padding: 0; flex: none; gap: 0; border-radius: 10px;
    font-size: 0; line-height: 0; color: var(--ui2-text-2); justify-content: center;
  }
  html.ui-v2 .ui2-rail-btn > svg, html.ui-v2:root body .ui2-rail-btn[data-ui2-tool="select"] > svg { width: 20px; height: 20px; }
  html.ui-v2 .ui2-rail-btn:hover { color: var(--ui2-text); }
  /* Thin lines group the rail: make, then adjust and manage, then help. */
  html.ui-v2 .ui2-rail-sp { flex: none; width: 22px; height: 1px; margin: 5px 0; background: rgba(255, 255, 255, 0.085); }
  html.ui-v2 #ui2-details-btn { margin-top: 11px; overflow: visible; }
  html.ui-v2 #ui2-details-btn::before { content: ""; position: absolute; top: -7px; left: 11px; width: 22px; height: 1px; background: rgba(255, 255, 255, 0.085); pointer-events: none; }
  /* New is a small lime mark in the corner, clear of the icon; it still beams. */
  html.ui-v2 .ui2-rail-btn .ui2-new { top: 3px; right: 3px; left: auto; width: 6px; height: 6px; padding: 0; border-radius: 2px; font-size: 0; line-height: 0; }
  html.ui-v2 #ui2-rail .agp-busydot { top: 5px; right: 5px; width: 6px; height: 6px; }
  html.ui-v2:root body .ui2-more-mark { right: 1px; bottom: 1px; }

  /* Docked panels: beside the rail on the left, on the right edge. */
  html.ui-v2 .ui2-drawer.open { left: calc(var(--ui2-gut) + 52px + 8px); top: var(--ui2-below); bottom: var(--ui2-gut); border-radius: 14px; box-shadow: var(--ui2-fb-elev); }
  html.ui-v2 .properties { right: var(--ui2-gut); top: var(--ui2-below); bottom: var(--ui2-gut); border-radius: 14px; box-shadow: var(--ui2-fb-elev); }
  html.ui-v2 .agent-panel { border-radius: 14px; box-shadow: var(--ui2-fb-elev); }

  /* The bottom row: page tabs, the context bar, zoom. */
  html.ui-v2 .pages-strip { left: var(--ui2-inset-lb); bottom: var(--ui2-gut); padding: 4px; }
  html.ui-v2 .page-tab { padding: 0 10px; }
  html.ui-v2 .zoom-pill { right: var(--ui2-inset-r); bottom: var(--ui2-gut); padding: 4px; }
  html.ui-v2.agp-docked-r .zoom-pill { right: max(var(--ui2-inset-r, 12px), var(--agp-clear-r, 12px)); }
  html.ui-v2 .ui2-ctx {
    top: auto; bottom: var(--ui2-gut); left: var(--ui2-ctx-l, var(--ui2-inset-l)); right: var(--ui2-ctx-r, var(--ui2-inset-r));
    max-width: calc(100vw - var(--ui2-ctx-l, var(--ui2-inset-l)) - var(--ui2-ctx-r, var(--ui2-inset-r)) - 8px);
    padding: 0 4px;
  }
  html.ui-v2 .ui2-ctx.ui2-floating { bottom: auto; right: auto; }
  html.ui-v2 .statusbar, html.ui-v2 .hint, html.ui-v2 .signup-bar,
  html.ui-v2.ui2-drawer-open .hint, html.ui-v2.ui2-drawer-open .statusbar, html.ui-v2.ui2-drawer-open .signup-bar {
    /* Right of the rail (and a docked drawer): on a short window a tall
       message would otherwise cover the rail's last buttons. */
    left: var(--ui2-inset-l); bottom: calc(var(--ui2-gut) + var(--ui2-bar) + 8px);
  }
  html.ui-v2.ui2-signup-on .statusbar, html.ui-v2.ui2-signup-on .hint { bottom: calc(var(--ui2-signup-h, 150px) + 72px); }
  html.ui-v2 .hint, html.ui-v2 .statusbar { border: 0; border-radius: 14px; box-shadow: var(--ui2-fb-elev); }
  html.ui-v2 .ai-watch-banner { top: var(--ui2-below); }

  /* Dock or detach any big panel: every drawer, not only Layers. */
  html.ui-v2 .ui2-drawer .ui2-grip, html.ui-v2 .ui2-drawer [data-ui2-min] { display: inline-flex; }
  html.ui-v2 .ui2-drawer:not([data-open="layers"]) .ui2-drawer-head { cursor: grab; }
  html.ui-v2 .ui2-drawer:not([data-open="layers"]) .ui2-resize { display: block; }
  html.ui-v2 .ui2-drawer:not(.ui2-floating) .ui2-resize-bottom, html.ui-v2 .properties:not(.ui2-floating) .ui2-resize-bottom { display: none; }
  /* The one button that docks a floating panel or floats a docked one. */
  html.ui-v2 [data-ui2-dock], html.ui-v2 .ui2-floating [data-ui2-dock] { display: inline-flex !important; }
  html.ui-v2 .ui2-floating { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 24px 56px rgba(0, 0, 0, 0.7); }
  /* Panel headers: the same 36px buttons as every bar; the tabs keep their
     words whole now that the dock button always shows. */
  html.ui-v2 .ui2-dtabs { padding: 6px 6px 6px 8px; gap: 2px; }
  html.ui-v2 .ui2-dtabs button[data-ui2-dtab] { height: 36px; min-height: 36px; padding: 0 6px; border-radius: 10px; flex: 0 1 auto; font-size: 14px; white-space: nowrap; }
  html.ui-v2 .ui2-dtabs .ui2-ibtn, html.ui-v2 .ui2-drawer-head .ui2-ibtn { flex: 0 0 30px; width: 30px; height: 30px; min-height: 30px; border-radius: 10px; }
  html.ui-v2 .ui2-dtabs [data-ui2-dock] { margin-left: auto; }
  html.ui-v2 .ui2-dtabs .ui2-grip { width: 12px; }
  html.ui-v2 .agent-panel .agp-icon[data-agp-act="dock"] svg { width: 16px; height: 16px; }

  /* Sarah's test video, 10 Nov 2026. (1) "These are also buttons but there is
     no boundary, it seems like floating text" and, on the gradient editor,
     "make the boundary a bit more prominent": every plain button in Details
     and in dialogs shows a clear edge at rest and a brighter one on hover. */
  html.ui-v2 .properties > .prop-group:not(#proto-group) .row > button:not(.swatch-chip),
  html.ui-v2 .properties > .prop-group:not(#proto-group) .grid2 > button,
  html.ui-v2 .modal-card .row > button,
  html.ui-v2 .modal-card .grid2 > button {
    min-height: 32px; background-color: #000000; border-color: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  }
  html.ui-v2 .modal-card .row > button:hover:not(:disabled),
  html.ui-v2 .modal-card .grid2 > button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ui2-line-hi); }
  /* The dialog's own edge is just as clear over the dimmed, blurred canvas. */
  html.ui-v2 .modal-card { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24), 0 2px 3px rgba(0, 0, 0, 0.45), 0 24px 48px rgba(0, 0, 0, 0.5); }
  /* (2) "Never add the scroll slider on the right side": lists still scroll,
     with no bar. The pickers of the editor's selects (Blend) are drawn by
     the browser, so the global rule never reached them. */
  html.ui-v2 select::picker(select) { scrollbar-width: none; }
  /* (3) "Are you sure the white color on bright green is the right choice":
     on the lime AI Generate card, every mark is dark, at rest and on hover
     (the info icon was light and went white on hover). */
  html.ui-v2 #ui2-drawer .ui2-aigen:not(#ui2-layered-poster),
  html.ui-v2 #ui2-drawer .ui2-aigen:not(#ui2-layered-poster):hover,
  html.ui-v2 #ui2-drawer .ui2-aigen:not(#ui2-layered-poster) :is(b, svg, .svl-info, .svl-info:hover, .svl-info:focus-visible) { color: #0B0B10; }
}

/* ────────────────────────────────────────────────────────────
   Where the SVG Lab Agent works, at a glance (owner's agent test video,
   17 Nov 2026; app.js section 43d). Pure black chrome, round glass.
   ──────────────────────────────────────────────────────────── */
/* F3: the dot beside the name. Orange needs you, green breathing works, blue done. */
.agp-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.agp-dot.is-ask { background: #FFB020; box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.18); }
.agp-dot.is-live { background: #3DDC84; animation: agp-dot-breathe 2.4s ease-in-out infinite; }
.agp-dot.is-done { background: #4DA3FF; box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.18); }
/* Room for the dot and the Make it small button: the header's icon buttons are a little narrower. */
.agp-head .agp-icon { width: 28px; }
.agp-head { gap: 6px; }
@keyframes agp-dot-breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .agp-dot.is-live { animation: none; } }
/* F3: the panel folded to a small box (its header only), where it was. */
.agent-panel.agp-min { height: auto !important; width: auto !important; right: auto !important; min-width: 0; max-width: calc(100vw - 24px); }
.agent-panel.agp-min > :not(.agp-head) { display: none !important; }
.agent-panel.agp-min .agp-head { border-bottom: 0; padding: 8px 8px 8px 8px; }
.agent-panel.agp-min .agp-head-btns [data-agp-act]:not([data-agp-act="min"]):not([data-agp-act="close"]) { display: none; }
/* F10: a message on its way. */
.agp-user.is-pending .agp-bubble { opacity: 0.72; }
/* F2: the small box at the bottom left of the canvas. */
.agp-where {
  position: absolute; left: 16px; bottom: 16px; z-index: 30;
  display: flex; align-items: center; gap: 8px; max-width: min(460px, calc(100% - 32px));
  padding: 6px 6px 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 28px rgba(0, 0, 0, 0.45);
  color: #FFFFFF; font-size: 12.5px; line-height: 1.3;
}
.agp-where-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, 0.72); }
.agp-where-text b { color: #FFFFFF; font-weight: 600; }
.agp-where-show {
  flex: none; height: 26px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: #000000; color: #FFFFFF; font: inherit; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}
.agp-where-show:hover, .agp-where-show:focus-visible { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); outline: none; }
/* SVG Lab Agent opens in Prototype mode and on the Chalk Board too (owner, 17 Nov 2026). */
.agp-launch { position: fixed; right: 16px; bottom: 76px; z-index: 8992; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 12px; border: 0; border-radius: 999px; background: #000; color: #F5F5F7; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 10px 26px rgba(0,0,0,.45); font: 600 13px/1 var(--font-sans, system-ui, sans-serif); }
.agp-launch:hover, .agp-launch:focus-visible { box-shadow: 0 0 0 1px var(--accent, #B5FF3A), 0 10px 26px rgba(0,0,0,.45); outline: none; }
.agp-launch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #B5FF3A); }
/* The canvas map moves by its title (owner, 17 Nov 2026). */
.cnav .cnav-head { cursor: grab; }
.cnav.moving, .cnav.moving .cnav-head { cursor: grabbing; user-select: none; }
/* The box opens the chat and moves anywhere (owner's second staging video, 17 Nov 2026). */
.agp-where { cursor: grab; touch-action: none; }
.agp-where.dragging { cursor: grabbing; }
.agp-where-chat { margin-left: 2px; }
/* F4: the board the agent works on now. */
#agp-work-mark .agp-mark-frame { stroke: var(--accent, #B5FF3A); stroke-width: 1.5; stroke-opacity: 0.85; }
#agp-work-mark .agp-mark-tag-bg { fill: #000000; stroke: var(--accent, #B5FF3A); stroke-opacity: 0.6; }
#agp-work-mark .agp-mark-tag-text { fill: #FFFFFF; font-family: var(--font-sans); font-weight: 600; text-anchor: middle; dominant-baseline: central; }
/* F5: while the agent only reads, nothing on the canvas moves as if it were changing things. */
html.agp-reading #ai-presence .ai-presence-corner,
html.agp-reading #ai-presence .ai-presence-frame.is-breathing { animation: none; }
html.agp-reading .ai-live-cursor { display: none !important; }

/* ────────────────────────────────────────────────────────────
   Canvas navigation: a map and a list (owner, 17 Nov 2026; app.js 36e).
   Shown while the page has 4 or more artboards. Pure black chrome, round
   glass, the lime accent, no visible scrollbar.
   ──────────────────────────────────────────────────────────── */
.cnav {
  position: absolute; top: 12px; right: 12px; z-index: 38;
  display: flex; flex-direction: column; width: 232px; max-height: calc(100% - 96px);
  background: rgba(0, 0, 0, 0.84); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 16px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 28px rgba(0, 0, 0, 0.45);
  color: #FFFFFF; font-family: var(--font-sans); font-size: 12px; line-height: 1.3; user-select: none; overflow: hidden;
}
.cnav svg { display: block; width: 16px; height: 16px; flex: none; }
.cnav-head { display: flex; align-items: center; gap: 7px; padding: 9px 8px 6px 12px; }
.cnav-icon { color: var(--accent, #B5FF3A); display: flex; }
.cnav-title { font-weight: 600; }
.cnav-count { margin-left: auto; color: rgba(255, 255, 255, 0.56); font-variant-numeric: tabular-nums; }
.cnav-fold {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: rgba(255, 255, 255, 0.64); cursor: pointer;
}
.cnav-fold:hover, .cnav-fold:focus-visible { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; outline: none; }
.cnav-body { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; min-height: 0; flex: 1 1 auto; }
.cnav-map {
  display: block; width: 100%; height: 96px; flex: none; border-radius: 10px; cursor: pointer; touch-action: none;
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.cnav.dragging .cnav-map { cursor: grabbing; }
.cnav-cap { min-height: 15px; padding: 0 4px; color: rgba(255, 255, 255, 0.56); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnav-cap.is-note { color: #FFB020; }
.cnav-find {
  height: 28px; padding: 0 10px; border: 0; border-radius: 999px; outline: none; flex: none;
  background: #000000; color: #FFFFFF; font: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.cnav-find:focus { box-shadow: inset 0 0 0 1px var(--accent, #B5FF3A); }
.cnav-find::placeholder { color: rgba(255, 255, 255, 0.4); }
.cnav-list {
  display: flex; flex-direction: column; gap: 1px; min-height: 0; max-height: 280px; flex: 0 1 auto;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.cnav-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.cnav-row, .cnav-group-head {
  display: flex; align-items: center; gap: 7px; width: 100%; min-height: 28px; padding: 0 8px; flex: none;
  border: 0; border-radius: 9px; background: transparent; color: rgba(255, 255, 255, 0.78);
  font: inherit; text-align: left; cursor: pointer;
}
.cnav-row.hover, .cnav-row:focus-visible { background: rgba(181, 255, 58, 0.1); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(181, 255, 58, 0.55); outline: none; }
.cnav-row.on { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; font-weight: 600; }
.cnav-row.on.hover { background: rgba(181, 255, 58, 0.14); }
.cnav-row.locked .cnav-name { opacity: 0.6; }
.cnav-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.2px rgba(255, 255, 255, 0.4); }
.cnav-row.on .cnav-dot { background: var(--accent, #B5FF3A); box-shadow: none; }
.cnav-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnav-tag { flex: none; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; color: rgba(255, 255, 255, 0.64); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.cnav-tag.is-agent, .cnav-tag.is-ai { color: var(--accent, #B5FF3A); box-shadow: inset 0 0 0 1px rgba(181, 255, 58, 0.55); }
.cnav-group { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 2px 6px; margin: 2px 0; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.cnav-group-head { color: rgba(255, 255, 255, 0.56); font-weight: 600; min-height: 24px; }
.cnav-group-head:hover, .cnav-group-head:focus-visible { color: var(--accent, #B5FF3A); background: rgba(255, 255, 255, 0.06); outline: none; }
.cnav-group-n { flex: none; color: rgba(255, 255, 255, 0.4); font-variant-numeric: tabular-nums; }
.cnav-empty { padding: 6px 8px; color: rgba(255, 255, 255, 0.5); }
.cnav-list.reordering .cnav-row { cursor: grabbing; }
.cnav-row.lifted { opacity: 0.45; }
.cnav-row.drop-before { box-shadow: inset 0 2px 0 var(--accent, #B5FF3A); }
.cnav-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent, #B5FF3A); }
/* Folded: a small round handle with the count. */
.cnav-handle {
  display: none; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: #FFFFFF; font: inherit; font-weight: 600; cursor: pointer;
}
.cnav-handle svg { color: var(--accent, #B5FF3A); }
.cnav.collapsed { width: auto; border-radius: 999px; }
.cnav.collapsed .cnav-handle { display: flex; }
.cnav.collapsed .cnav-head, .cnav.collapsed .cnav-body { display: none; }
.cnav-handle:hover, .cnav-handle:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
/* The artboard the pointer is on in the map or the list, on the canvas. */
#cnav-hover-mark .cnav-mark-frame { fill: rgba(181, 255, 58, 0.06); stroke: var(--accent, #B5FF3A); stroke-width: 2; }
/* Never on the Chalk Board, in the chat view, on a phone or in an embedded editor. */
body.wb-on .cnav, body.wb-on #cnav-hover-mark,
html.chat-view .cnav, html.chat-view #cnav-hover-mark,
html.ph .cnav, html.ph #cnav-hover-mark { display: none !important; }
/* Magnified edit (owner's request, 17 Nov 2026; app.js "Magnified edit").
   A temporary board lifted over the canvas. The element sits exactly over
   the board's surface (drawn in the SVG) and paints only around it: a soft
   shadow under it, the dim over the rest of the canvas (the 200vmax spread,
   clipped by .canvas-area), a blue glitter edge and its small bar. It takes
   no clicks except on the bar. */
.mag-frame {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  z-index: 3; pointer-events: none; border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(120, 185, 255, 0.55),
    0 0 22px 2px rgba(60, 150, 255, 0.5),
    0 38px 90px -12px rgba(0, 0, 0, 0.8),
    0 14px 32px rgba(0, 0, 0, 0.5),
    0 0 0 200vmax rgba(3, 4, 8, 0.64);
  animation: mag-lift 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes mag-lift { from { opacity: 0; } to { opacity: 1; } }
/* The edge: a bright blue sweep running round the board... */
.mag-frame::before {
  content: ""; position: absolute; inset: -2px; padding: 2px;
  border-radius: calc(var(--mag-r, 14px) + 2px);
  background: conic-gradient(from 20deg,
    #1f6bff 0deg, #7cc0ff 36deg, #ffffff 50deg, #7cc0ff 64deg, #1f6bff 104deg,
    #2f7dff 180deg, #7cc0ff 216deg, #e8f4ff 230deg, #7cc0ff 244deg, #1f6bff 284deg, #1f6bff 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  /* tests/idle-animations: an endless animation may change only transform or opacity. */
  animation: mag-pulse 2.4s ease-in-out infinite alternate;
}
/* ...and glitter: three fields of tiny sparks drifting along it. */
.mag-frame::after {
  content: ""; position: absolute; inset: -6px; padding: 6px;
  border-radius: calc(var(--mag-r, 14px) + 6px);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 0.8px, transparent 1.4px) 0 0 / 17px 13px,
    radial-gradient(circle, rgba(150, 205, 255, 0.9) 0 1px, transparent 1.7px) 6px 4px / 23px 19px,
    radial-gradient(circle, rgba(80, 155, 255, 0.85) 0 0.7px, transparent 1.3px) 11px 9px / 13px 29px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: mag-twinkle 1.3s ease-in-out infinite alternate;
}
@keyframes mag-pulse { from { opacity: 0.7; } to { opacity: 1; } }
@keyframes mag-twinkle { from { opacity: 0.45; } to { opacity: 1; } }
.mag-bar {
  position: absolute; right: 0; bottom: calc(100% + 12px);
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.8);
  pointer-events: auto; white-space: nowrap; color: #fff;
  font: 500 12px/1 var(--font-sans, system-ui, sans-serif);
}
.mag-frame.mag-bar-below .mag-bar { bottom: auto; top: calc(100% + 12px); }
.mag-bar-label { padding: 0 10px 0 9px; color: rgba(255, 255, 255, 0.6); }
.mag-btn {
  appearance: none; -webkit-appearance: none; border: 0; margin: 0; background: transparent; color: #fff;
  font: inherit; height: 28px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.mag-btn:hover { background: rgba(255, 255, 255, 0.1); }
.mag-btn:focus-visible { outline: 2px solid #B5FF3A; outline-offset: 1px; }
.mag-btn:disabled { opacity: 0.4; cursor: default; background: transparent; }
.mag-btn-primary { background: #B5FF3A; color: #000; font-weight: 600; }
.mag-btn-primary:hover { background: #c8ff6b; }
.mag-switch { position: relative; width: 22px; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); transition: background 0.15s; }
.mag-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.mag-btn[aria-pressed="true"] .mag-switch { background: #B5FF3A; }
.mag-btn[aria-pressed="true"] .mag-switch::after { transform: translateX(10px); background: #000; }
/* A click on the sleeping canvas shakes the bar: the way out is there. */
.mag-frame.mag-nudge .mag-bar { animation: mag-nudge 420ms ease-out; }
@keyframes mag-nudge { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
/* While a zoom shows as a picture, the board's chrome waits for the real view. */
html[data-view-zooming] .mag-frame { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .mag-frame, .mag-frame::before, .mag-frame::after, .mag-frame.mag-nudge .mag-bar { animation: none; }
}

/* Layers: search and rename in place (owner, 17 Nov 2026, SVG-337). */
.layers-search { display: block; margin: 0 0 8px; }
/* In the Layers drawer it heads the panel, above the artboards, with the drawer's 12px rhythm below. */
html.ui-v2 [data-ui2-slot="layer-search"] .layers-search { margin: 0 0 12px; }
.layers-search input { width: 100%; box-sizing: border-box; }
#layers.layers-searching li.ls-miss { display: none !important; }
html.ui-v2 .ui2-drawer #layers.layers-searching li.ls-hit.ui2-other-ab { display: flex; }
#layers .ls-ab {
  flex: 0 0 auto; margin-left: 6px; padding: 1px 6px; border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px; color: var(--ink-3, #9a9aa3); font-size: 11px; line-height: 16px; white-space: nowrap;
  max-width: 90px; overflow: hidden; text-overflow: ellipsis;
}
#layers input.layer-rename {
  flex: 1 1 auto; min-width: 0; height: 24px; padding: 0 6px; box-sizing: border-box;
  border: 1px solid rgba(181, 255, 58, 0.62); border-radius: 6px; background: #000; color: var(--ink, #fff);
  font: inherit; outline: none;
}
.layers-search-empty { margin: 6px 2px; color: var(--ink-3, #9a9aa3); font-size: 12px; }

/* Uploads library (owner, 17 Nov 2026, SVG-337): sections, rename, move, design system files. */
/* The heading row keeps the drawer's label rhythm (20px above, 8px below): the label inside it is
   its first child, so .ui2-label:first-child would otherwise drop its top margin (owner's test, 17 Nov). */
html.ui-v2 .ui2-up-head { display: flex; align-items: center; gap: 6px; min-height: 26px; margin: 20px 0 8px; }
html.ui-v2 .ui2-up-head .ui2-label { margin: 0; }
html.ui-v2 .ui2-up-head .ui2-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v2 .ui2-up-rename { width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--ink-3, #9a9aa3); font-size: 13px; cursor: pointer; }
html.ui-v2 .ui2-up-rename:hover { border-color: rgba(255, 255, 255, 0.36); color: var(--ink, #fff); }
/* Design system is a section like Uploads, on the same grid: no box of its own (its tiles line up
   with the Uploads tiles); a file dragged over it outlines the whole section. */
html.ui-v2 .ui2-ds { margin: 0; padding: 0; border: 0; border-radius: 14px; }
html.ui-v2 .ui2-ds.over { outline: 1px dashed var(--accent); outline-offset: 6px; background: rgba(181, 255, 58, 0.04); }
html.ui-v2 .ui2-ds .ui2-note { margin: 0 0 10px; }
html.ui-v2 .ui2-ds .ui2-ups { margin: 0 0 10px; }
html.ui-v2 .ui2-ds .ui2-ds-add { width: 100%; margin-top: 0; height: 36px; border: 1px solid rgba(255, 255, 255, 0.36); background: transparent; }
html.ui-v2 .ui2-ds .ui2-ds-add:hover { border-color: rgba(255, 255, 255, 0.7); background: transparent; }
html.ui-v2 .ui2-up-img.ui2-up-doc { background: #0b0b10; border: 1px solid rgba(255, 255, 255, 0.14); }
html.ui-v2 .ui2-up-doc b { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink, #fff); padding: 4px 8px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 8px; }
html.ui-v2 .ui2-up-move { position: absolute; top: 10px; right: 40px; width: 26px; height: 26px; border: 0; border-radius: 9px; padding: 0;
  background: rgba(11, 11, 16, 0.78); color: #fff; font-size: 14px; line-height: 26px; cursor: pointer; opacity: 0; transition: opacity .12s ease; }
html.ui-v2 .ui2-up:hover .ui2-up-move, html.ui-v2 .ui2-up:focus-within .ui2-up-move { opacity: 1; }
@media (hover: none) { html.ui-v2 .ui2-up-move { opacity: 1; } }
html.ui-v2 .ui2-up.saving { opacity: 0.6; }
html.ui-v2 .ui2-up-rename-input { width: 100%; box-sizing: border-box; height: 22px; padding: 0 4px; border: 1px solid rgba(181, 255, 58, 0.62);
  border-radius: 6px; background: #000; color: var(--ink, #fff); font: inherit; font-size: 12px; outline: none; }
html.ui-v2 .ui2-up-usage { margin: 20px 0 0; }
html.ui-v2 .ui2-up-empty { margin: 0; }

/* Uploads: "Choose files" reads as a button (owner, 17 Nov 2026: "add a little light box
   around it so the user knows it's a button"). Black chrome rule: a light line, no grey fill. */
html.ui-v2 .ui2-drop .ui2-btn[data-ui2-act="choose"] {
  border: 1px solid rgba(255, 255, 255, 0.36); background: transparent; padding: 0 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
html.ui-v2 .ui2-drop .ui2-btn[data-ui2-act="choose"]:hover { border-color: rgba(255, 255, 255, 0.7); background: transparent; }

[hidden] { display: none !important; }
