/* builder.css — App Builder SPA (Design 042 §5.3 builder UI).
 *
 * Theme tokens ONLY (AI_CONTEXT rule 2 / Prime Directive #7): every colour comes
 * from a --color-* token so the surface works in light AND dark. The two themes are
 * declared as token sets on body.theme-light / body.theme-dark; builder.js toggles
 * the class and respects prefers-color-scheme on first load. Token NAMES mirror the
 * site's --color-* scheme so the builder reads as part of the same product. */

:root {
  --radius: 10px;
  --radius-sm: 7px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
}

body.theme-light {
  --color-bg:            #f4f5f7;
  --color-surface:       #ffffff;
  --color-surface-alt:   #f9fafb;
  --color-surface-hover: #f1f2f4;
  --color-border:        #e5e7eb;
  --color-border-subtle: #eef0f2;
  --color-text:          #111827;
  --color-text-muted:    #6b7280;
  --color-text-on-accent:#ffffff;
  --color-accent:        #6366f1;
  --color-accent-hover:  #4f46e5;
  --color-accent-subtle: #eef2ff;
  --color-red:           #dc2626;
  --color-green:         #16a34a;
}

body.theme-dark {
  --color-bg:            #0f1115;
  --color-surface:       #181b21;
  --color-surface-alt:   #1f232b;
  --color-surface-hover: #262b34;
  --color-border:        #2b3038;
  --color-border-subtle: #23272e;
  --color-text:          #e6e8eb;
  --color-text-muted:    #9aa1ac;
  --color-text-on-accent:#ffffff;
  --color-accent:        #818cf8;
  --color-accent-hover:  #6366f1;
  --color-accent-subtle: #232744;
  --color-red:           #f87171;
  --color-green:         #4ade80;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── top bar ─────────────────────────────────────────────────────────────── */
.ab-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 30;
}
.ab-brand { display: flex; align-items: center; gap: 10px; }
/* persistent "back to your apps" link — token-styled, before the logo */
.ab-back {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--color-text-muted);
  padding: 4px 8px; border-radius: var(--radius-sm); margin-right: 2px;
}
.ab-back:hover { color: var(--color-text); background: var(--color-surface-hover); }
.ab-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--color-accent); color: var(--color-text-on-accent);
  font-weight: 700; font-size: 13px;
}
.ab-title { font-weight: 600; }
.ab-top-right { display: flex; align-items: center; gap: 12px; }
.ab-tenant { color: var(--color-text-muted); font-size: 13px; }

/* ── layout ──────────────────────────────────────────────────────────────── */
.ab-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; }
.ab-loading { display: flex; justify-content: center; padding: 80px 0; }
.ab-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--color-border); border-top-color: var(--color-accent);
  animation: ab-spin .7s linear infinite;
}
@keyframes ab-spin { to { transform: rotate(360deg); } }

.ab-h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.ab-sub { color: var(--color-text-muted); margin-bottom: 24px; }
.ab-section-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); margin: 28px 0 12px; font-weight: 600; }

/* ── cards / grid ────────────────────────────────────────────────────────── */
.ab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ab-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, transform .12s;
  display: flex; flex-direction: column; gap: 6px;
  color: inherit;
}
.ab-card:hover { border-color: var(--color-accent); transform: translateY(-1px); }
.ab-card h3 { font-size: 16px; font-weight: 600; }
.ab-card p { color: var(--color-text-muted); font-size: 13px; }
.ab-card-meta { color: var(--color-text-muted); font-size: 12px; margin-top: auto; }
.ab-card-dashed { border-style: dashed; align-items: center; justify-content: center; text-align: center; min-height: 120px; color: var(--color-text-muted); }

/* ── Advanced affordance (Design 092 Phase 2.1) — "build from scratch" demoted ─
   from a peer card to a small secondary link, still fully reachable. */
.ab-advanced { margin-top: 28px; display: flex; flex-direction: column; gap: 6px; }
.ab-advanced-h { margin: 0; }
.ab-link {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--color-accent); text-align: left; text-decoration: underline;
  text-underline-offset: 2px; align-self: flex-start;
}
.ab-link:hover { color: var(--color-text); }
.ab-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.ab-btn {
  font: inherit; font-weight: 500; cursor: pointer;
  border-radius: var(--radius-sm); padding: 8px 14px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); transition: background .12s, border-color .12s;
}
.ab-btn:hover { background: var(--color-surface-hover); }
.ab-btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-text-on-accent); }
.ab-btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.ab-btn-ghost { background: transparent; border-color: transparent; }
.ab-btn-ghost:hover { background: var(--color-surface-hover); }
.ab-btn-danger { color: var(--color-red); border-color: transparent; background: transparent; }
.ab-btn-danger:hover { background: var(--color-surface-hover); }
.ab-btn-sm { padding: 5px 10px; font-size: 13px; }
.ab-btn:disabled { opacity: .5; cursor: not-allowed; }
.ab-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ab-spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ── breadcrumb ──────────────────────────────────────────────────────────── */
.ab-crumb { display: flex; gap: 6px; align-items: center; color: var(--color-text-muted); font-size: 13px; margin-bottom: 14px; }
.ab-crumb a { color: var(--color-accent); cursor: pointer; text-decoration: none; }
.ab-crumb a:hover { text-decoration: underline; }

/* ── models + fields ─────────────────────────────────────────────────────── */
.ab-model {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}
.ab-model-head { padding: 14px 16px; border-bottom: 1px solid var(--color-border-subtle); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ab-model-head h3 { font-size: 16px; font-weight: 600; }
.ab-model-head small { color: var(--color-text-muted); font-weight: 400; margin-left: 8px; }
.ab-fields { width: 100%; border-collapse: collapse; }
.ab-fields th, .ab-fields td { text-align: left; padding: 9px 16px; border-bottom: 1px solid var(--color-border-subtle); font-size: 14px; }
.ab-fields th { color: var(--color-text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.ab-fields tr:last-child td { border-bottom: none; }
.ab-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--color-accent-subtle); color: var(--color-accent); font-size: 12px; font-weight: 500; }
.ab-pill-muted { background: var(--color-surface-alt); color: var(--color-text-muted); }
.ab-model-foot { padding: 10px 16px; background: var(--color-surface-alt); }

/* ── forms / modal ───────────────────────────────────────────────────────── */
.ab-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.ab-modal { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); width: 100%; max-width: 460px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.ab-modal-head { padding: 16px 20px; border-bottom: 1px solid var(--color-border-subtle); font-weight: 600; }
.ab-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ab-modal-foot { padding: 14px 20px; border-top: 1px solid var(--color-border-subtle); display: flex; justify-content: flex-end; gap: 8px; }
.ab-field { display: flex; flex-direction: column; gap: 5px; }
.ab-field label { font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.ab-input, .ab-select, .ab-textarea {
  font: inherit; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-surface-alt);
  color: var(--color-text); width: 100%;
}
.ab-input:focus, .ab-select:focus, .ab-textarea:focus { outline: 2px solid var(--color-accent); outline-offset: -1px; border-color: var(--color-accent); }
.ab-checkbox-row { display: flex; align-items: center; gap: 8px; }
.ab-options-list { display: flex; flex-direction: column; gap: 6px; }

/* ── toasts ──────────────────────────────────────────────────────────────── */
.ab-toasts { position: fixed; bottom: 22px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.ab-toast { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-left: 3px solid var(--color-accent); border-radius: var(--radius-sm); padding: 10px 16px; box-shadow: var(--shadow); font-size: 14px; }
.ab-toast-error { border-left-color: var(--color-red); }
.ab-toast-success { border-left-color: var(--color-green); }
/* An actionable toast (e.g. "Open page →") needs to be clickable through the no-pointer container. */
.ab-toast-link { color: var(--color-accent); font-weight: 600; text-decoration: none; pointer-events: auto; }
.ab-toast-link:hover { text-decoration: underline; }

/* ── empty / error states ────────────────────────────────────────────────── */
.ab-empty { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.ab-empty h2 { color: var(--color-text); font-size: 18px; margin-bottom: 8px; }
.ab-locked { max-width: 460px; margin: 60px auto; text-align: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 32px; }
.ab-locked h2 { margin-bottom: 10px; }

/* ── AI: "Describe your app" panel + review (Design 042 §10 #2) ──────────────
 * Theme tokens only — works light + dark, same --color-* scheme as the rest. */
.ab-describe {
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 28px;
}
.ab-describe-h { display: flex; align-items: center; gap: 8px; }
.ab-describe-h h2 { font-size: 16px; font-weight: 600; color: var(--color-text); }
.ab-spark { color: var(--color-accent); font-size: 18px; line-height: 1; }
.ab-describe .ab-sub { margin: 6px 0 12px; }
.ab-describe-input { width: 100%; min-height: 72px; resize: vertical; }
.ab-describe-foot { margin-top: 12px; justify-content: flex-end; }

.ab-modal-wide { max-width: 680px; }
.ab-review { gap: 16px; }
.ab-review-model {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-alt);
  padding: 12px 14px;
}
.ab-review-model-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ab-review-model-h h4 { font-size: 14px; font-weight: 600; color: var(--color-text); }
.ab-note {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--color-text-muted);
  font-size: 13px;
}
.ab-note strong { color: var(--color-text); display: block; margin-bottom: 4px; }
/* a compact inline hint under a field-modal control (Design 090 app-picker) */
.ab-note-sm { margin-top: 6px; padding: 6px 10px; font-size: 12px; }
.ab-review-notes { margin: 0; padding-left: 18px; }
.ab-review-notes li { margin: 2px 0; }

/* ── icon picker + app icon tiles (Design 044 §2.4) — tokens only, light + dark ── */
.ab-iconpicker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
}
.ab-icontile {
  appearance: none; cursor: pointer; aspect-ratio: 1 / 1;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface-alt); color: var(--color-text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .12s, background .12s, transform .12s;
}
.ab-icontile:hover { border-color: var(--color-accent); transform: translateY(-1px); }
.ab-icontile:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.ab-icontile svg { width: 22px; height: 22px; }
.ab-icontile.is-selected {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* the app icon tile shown on builder cards + the app header */
.ab-app-icon {
  flex: none; width: 40px; height: 40px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-accent-subtle); color: var(--color-accent);
}
.ab-app-icon svg { width: 22px; height: 22px; }
.ab-app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ab-app-card-archived { opacity: .7; }
.ab-app-card-archived .ab-app-icon { filter: grayscale(.5); }

/* ── master-detail config IA (Design 049 §4) — tokens only, light + dark ─────── */
/* A two-pane frame: a model sidebar (master) + a focused, tabbed detail panel.
 * The app header above spans both columns; the frame collapses to one column ≤760px
 * (the sidebar becomes a <select> picker above the panel). No new colours. */
.ab-ms { display: grid; grid-template-columns: 248px 1fr; gap: 16px; align-items: start; }
.ab-ms-side {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; position: sticky; top: 72px;
}
.ab-ms-side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--color-border-subtle);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted);
}
.ab-ms-picker { display: none; }   /* shown only on narrow screens (below) */
.ab-ms-list { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
.ab-ms-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text);
}
.ab-ms-item:hover { background: var(--color-surface-hover); }
.ab-ms-item.is-active { background: var(--color-accent-subtle); color: var(--color-accent); }
.ab-ms-item.is-active .ab-ms-item-name { font-weight: 600; }
.ab-ms-item:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.ab-ms-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-ms-count { flex: none; }

.ab-ms-detail {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); min-width: 0;
}
.ab-ms-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--color-border-subtle);
}
.ab-ms-detail-name { font-size: 16px; font-weight: 600; color: var(--color-text); }
.ab-ms-detail-meta { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.ab-ms-detail-body { padding: 4px 0 6px; }
.ab-ms-detail-body .ab-views,
.ab-ms-detail-body .ab-pages { padding: 14px 18px; border-top: none; margin-top: 0; }

/* tab strip — reuses the runtime .ar-viewbar / .ar-viewchip idiom (§4.4). */
.ab-tabstrip {
  display: flex; gap: 4px; padding: 8px 12px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.ab-tab {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; cursor: pointer;
  padding: 8px 12px; border: 0; background: transparent; color: var(--color-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ab-tab:hover { color: var(--color-text); background: var(--color-surface-hover); }
.ab-tab.is-active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.ab-tab:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.ab-tab .ab-pill:empty { display: none; }   /* hide the count pill until it's loaded */

/* Design 084 — the Presentations group's secondary sub-strip (Views | Screens). Lighter
   than the primary tab strip so the hierarchy reads: Fields (primary) › Presentations ›
   {Views, Screens}. A one-line caption under each sub-section defines the surface. */
.ab-subtabstrip {
  display: flex; gap: 4px; padding: 10px 12px 0; margin: 0;
}
.ab-subtab {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; cursor: pointer;
  padding: 5px 10px; border: 1px solid var(--color-border-subtle); background: transparent;
  color: var(--color-text-muted); border-radius: 999px;
}
.ab-subtab:hover { color: var(--color-text); background: var(--color-surface-hover); }
.ab-subtab.is-active { color: var(--color-accent); border-color: var(--color-accent); background: var(--color-accent-subtle); }
.ab-subtab:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.ab-subtab .ab-pill:empty { display: none; }
.ab-pres-body { padding-top: 2px; }
.ab-section-caption { margin: 0 0 12px; font-size: 13px; }

/* the fields table inside the detail panel + the compact ⋯ row menu. */
.ab-fields-wrap { padding: 4px 18px 14px; }
.ab-fields-wrap .ab-model-foot { background: transparent; padding: 12px 0 0; }
.ab-rowmenu { display: inline-block; position: relative; }
.ab-rowmenu > summary { list-style: none; cursor: pointer; display: inline-block; }
.ab-rowmenu > summary::-webkit-details-marker { display: none; }
.ab-rowmenu-list {
  position: absolute; right: 0; top: 100%; z-index: 5; min-width: 120px;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.ab-rowmenu-list .ab-btn { text-align: left; }

/* optimistic "pending" state (§4.4): dimmed, no geometry change (no layout shift). */
.is-pending { opacity: .55; }

@media (max-width: 760px) {
  .ab-ms { grid-template-columns: 1fr; }
  .ab-ms-side { position: static; }
  .ab-ms-side-head { display: none; }
  .ab-ms-list { display: none; }
  .ab-ms-picker { display: block; margin: 0; }
}

/* ── Views section (Design 046 §7) — tokens only, light + dark ──────────────── */
.ab-views { border-top: 1px solid var(--color-border-subtle); margin-top: 14px; padding-top: 12px; }
.ab-views-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ab-views-head h4 { margin: 0; font-size: 14px; color: var(--color-text); }
.ab-views-list { display: flex; flex-direction: column; gap: 6px; }
.ab-viewrow { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--color-border);
  border-radius: 8px; background: var(--color-surface); font-size: 13px; color: var(--color-text); }
.ab-viewrow-builtin { background: var(--color-surface-alt); }
.ab-viewname { font-weight: 600; }
.ab-viewbind { color: var(--color-text-muted); font-size: 12px; flex: 1; }
.ab-viewicon { display: inline-flex; width: 16px; height: 16px; color: var(--color-text-muted); }
.ab-viewicon svg { width: 16px; height: 16px; }

.ab-viewtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
/* Design 087 B4 — the "More view types" disclosure (power views collapse here). */
.ab-viewmore { margin-top: 10px; }
.ab-viewmore__summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--color-text-muted); margin-bottom: 8px; }
.ab-viewmore__summary:hover { color: var(--color-text); }
.ab-viewmore[open] .ab-viewmore__summary { margin-bottom: 10px; }
/* Design 088 §5.1 — the quiet "add the first screen" affordance shown in place of an empty
   Screens tab (presence-keyed). */
.ab-pres-addscreen { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--color-border-subtle); }
.ab-viewtile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px;
  border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface);
  color: var(--color-text); cursor: pointer; font: inherit; font-size: 13px; text-align: center; }
.ab-viewtile:hover:not(.is-disabled) { border-color: var(--color-accent); background: var(--color-surface-hover); }
.ab-viewtile.is-selected { border-color: var(--color-accent); background: var(--color-accent-subtle); }
.ab-viewtile.is-disabled { opacity: .5; cursor: not-allowed; }
.ab-viewtile .ab-viewicon { width: 22px; height: 22px; }
.ab-viewtile .ab-viewicon svg { width: 22px; height: 22px; }
.ab-viewtile-reason { font-size: 11px; color: var(--color-text-muted); }
.ab-binder { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.ab-checklist { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto;
  border: 1px solid var(--color-border); border-radius: 8px; padding: 8px; background: var(--color-surface); }

/* ── The page builder (Design 047) — token-only, light + dark ───────────────── */
.ab-pages { margin-top: 10px; }
/* Nested dialogs (miniModal) sit above the overlay that opened them: the base z-index
   here is a safe floor above .ab-overlay (100); the exact value is set per-instance in
   JS so the newest dialog always lands above the current topmost overlay. */
.ab-overlay-nested { z-index: 101; }
.ab-page-editor { max-width: 860px; }
.ab-page-state-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ab-page-state-row { align-items: center; gap: 8px; }
.ab-page-canvas { border: 1px solid var(--color-border); border-radius: 8px; padding: 10px;
  background: var(--color-surface-alt); max-height: 360px; overflow-y: auto; }
.ab-node { border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface);
  padding: 8px 10px; margin-bottom: 8px; }
.ab-node-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ab-node-summary { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.ab-node-children { margin: 8px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--color-border-subtle);
  display: flex; flex-direction: column; }
.ab-wire-event { border-top: 1px solid var(--color-border-subtle); padding: 8px 0; }
.ab-wire-action { align-items: center; gap: 8px; margin: 4px 0; }
.ab-value-row { align-items: center; gap: 6px; }
.ab-select-sm, .ab-input-sm { padding: 4px 6px; font-size: 12px; }
.ab-page-values { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.ab-page-preview { border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden;
  background: var(--color-surface); }
.ab-page-preview-head { font-size: 12px; color: var(--color-text-muted); padding: 6px 10px;
  border-bottom: 1px solid var(--color-border-subtle); background: var(--color-surface-alt); }
.ab-page-preview-frame { width: 100%; height: 360px; border: 0; display: block; background: var(--color-surface); }
/* Describe-a-page example chips (Design 050 §2.1) — field-type-derived prompt scaffolds. */
.ab-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ab-chip { display: inline-block; max-width: 100%; text-align: left; padding: 6px 10px; font-size: 13px;
  line-height: 1.3; border: 1px solid var(--color-border); border-radius: 999px;
  background: var(--color-surface-alt); color: var(--color-text); cursor: pointer; }
.ab-chip:hover { background: var(--color-surface-hover); border-color: var(--color-accent); }
