/* public/css/builder-shell-pane.css — Phase 2 of the refactor (REFACTOR_PLAN.md §7).
   Copied verbatim from public/dashboard-v2.css ranges:
     3766..3911 (my-site page + AI builder page shell)
     7000..9146 (preview/sections/publish panes + state visibility)
*/

/* === My site page ===================================================== */
.site-card-large {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 28px;
}
.site-live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--green); font-weight: 600; margin-bottom: 10px;
}
.site-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2.4s ease-in-out infinite; }
.site-url-large {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem; font-weight: 500;
  color: var(--ink); letter-spacing: -0.005em;
  word-break: break-all; margin: 0 0 8px;
}
.site-card-sub {
  font-size: 0.95rem; color: var(--ink-mute); line-height: 1.55;
  margin-bottom: 20px;
}
.site-preview {
  height: 360px; width: 100%;
  background: linear-gradient(135deg, oklch(15% 0.018 60) 0%, oklch(22% 0.02 38) 100%);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px;
  color: oklch(96% 0.02 80);
  position: relative; overflow: hidden;
}
.site-preview-brand {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: oklch(80% 0.10 38);
  margin-bottom: 12px;
}
.site-preview-headline {
  font-family: 'Geist', sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.024em;
  line-height: 1.15;
  margin: 0 0 18px;
  max-width: 600px;
}
.site-preview-cta {
  display: inline-flex; padding: 8px 16px;
  background: oklch(64% 0.16 38);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem; font-weight: 500;
  font-family: 'Geist', sans-serif;
}

.quick-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
  margin-top: 28px;
}
.quick-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.84rem; color: var(--ink-mute);
  text-decoration: none; cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.quick-action:hover { color: var(--ink); border-color: var(--hairline-2); }
.quick-action svg { width: 13px; height: 13px; flex-shrink: 0; }

/* === AI builder page ================================================== */
.builder-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  height: calc(100vh - 180px);
  min-height: 480px;
}

/* === Claude-style chat surface ========================================
   Empty state: vertically-centered logo + serif greeting + rounded
   input + suggestion chips. No page header. When state="ready",
   layout becomes 2-column (chat left, preview right that slid in). */

/* Plan footer ("Builder · A$39.99/mo · Renews 28 May | Billing · Support")
   doesn't belong on the chat surface. Hide whenever the AI builder is
   mounted, regardless of state. */
main.dash:has(.builder-shell--centered) .foot { display: none !important; }

/* Sidebar collapse for first-run AI Builder users.
   Body class `is-builder-firstrun` is added by JS on AI builder mount
   when there's no site yet, removed when state transitions to ready.
   The sidebar slides out + the content area fills the freed width.
   The existing .side-opener button stays visible as a tiny hamburger
   so the user can still navigate if they want.
   ====================================================================== */
body.is-builder-firstrun .side {
  transform: translateX(-100%);
  pointer-events: none;
}
/* Builder chat surface (Lovable-style): sidebar hidden so the chat
   gets full-bleed width. Body class added by the AI builder shell on
   mount, removed when navigating away. */
body.is-builder-chat .side {
  transform: translateX(-100%);
  pointer-events: none;
}
/* Mobile exception: the drawer pattern relies on the sidebar sitting
   in place at left:0 with the card sliding over/away from it. The
   desktop builder rule above pushes the sidebar fully off-screen
   for the full-bleed preview, which breaks the drawer on mobile
   (tap hamburger → card slides right → reveals empty space because
   the sidebar isn't there). Restore the mobile drawer behaviour
   by reverting the transform + pointer-events at narrow widths. */
@media (max-width: 720px) {
  body.is-builder-chat .side {
    transform: none;
    pointer-events: auto;
  }
  /* The .shell carries padding-top: 52px on mobile to clear the
     topbar. But on this page the topbar is position:sticky (see
     inline rule at dashboard-v2-page.html:5634), so it already takes
     52px of flow — adding shell padding too would leave a 52px gap
     above the chat surface and the sidebar would show through it.
     Zero both the shell padding AND the prior main.dash padding-top
     reset (which was a leftover from when the topbar was assumed to
     be position:fixed). The topbar's own z-index:70 keeps it above
     everything, so no extra offset is needed. */
  body.is-builder-chat .shell { padding-top: 0 !important; }
  body.is-builder-chat .shell > main.dash { padding-top: 0 !important; }
}
body.is-builder-chat .shell {
  grid-template-columns: 1fr !important;
}
body.is-builder-chat .shell > main.dash {
  grid-column: 1 / -1 !important;
}
/* Builder mode replaces the side-opener corner icon with a Back button. */
/* ──── builder-shell-pane.css range 2: source lines 7000..9146 ──── */
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 1px 2px rgba(31, 22, 17, 0.03),
    0 12px 32px -12px rgba(31, 22, 17, 0.10);
}
.builder-choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.builder-choice-title {
  font-family: 'Geist', 'Inter Tight', 'Inter', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink, #1F1611);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.builder-choice-select-one {
  font-size: 0.75rem;
  font-weight: 500;
  color: #8A7868;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 22, 17, 0.04);
  flex: 0 0 auto;
}
.builder-choice-card--v2 .builder-choice-grid {
  gap: 10px;
  margin: 0;
}
.builder-choice-card--v2 .builder-choice-grid--text {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 560px) {
  .builder-choice-card--v2 .builder-choice-grid--text {
    grid-template-columns: 1fr;
  }
}
.builder-choice-card--v2 .builder-choice-tile {
  background: #FBFBFB;
  padding: 14px 14px 12px;
  border: 1px solid rgba(31, 22, 17, 0.07);
  border-radius: 14px;
  min-height: 140px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 1px 2px rgba(31, 22, 17, 0.04);
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.18s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) {
  background: #FFFFFF;
  border-color: rgba(31, 22, 17, 0.14);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 2px 4px rgba(31, 22, 17, 0.05),
    0 8px 18px -10px rgba(31, 22, 17, 0.12);
}
.builder-choice-card--v2 .builder-choice-tile:focus-visible {
  outline: none;
  border-color: rgba(31, 22, 17, 0.18);
  box-shadow:
    0 0 0 2px #FBFBFB,
    0 0 0 4px rgba(31, 22, 17, 0.28);
}
.builder-choice-card--v2 .builder-choice-tile.is-selected {
  background: #FFFFFF;
  border-color: var(--ink, #1F1611);
  color: var(--ink, #1F1611);
  box-shadow:
    0 0 0 1px var(--ink, #1F1611),
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 2px 6px rgba(31, 22, 17, 0.06);
}
.builder-choice-card--v2 .builder-choice-tile.is-selected .builder-choice-tile-sub {
  color: var(--ink-mute, #6B5A4C);
}
.builder-choice-card--v2 .builder-choice-grid--palette .builder-choice-tile {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.builder-choice-card--v2 .builder-choice-grid--palette .builder-choice-swatches {
  height: 64px;
}

/* Skeleton page-shape mockup inside each template tile. Same primitive
   shapes used in the picker dock v3 (lay-*) but with a `cm-` prefix to
   live alongside the choice-tile structure. Shapes use warm-grey fill
   with a subtle gradient for depth; on hover they darken; when the tile
   is selected they go full ink (monochrome — no indigo, OpenAI/Claude
   aesthetic). */
.builder-choice-mockup {
  display: flex !important;
  width: 100%;
  height: 64px;
  padding: 7px;
  margin: 0 0 4px;
  background: #F1F1F1;
  border: 1px solid rgba(31, 22, 17, 0.05);
  border-radius: 8px;
  box-sizing: border-box;
}
/* hero-columns: dominant hero (50%) + a short title strip + a row of 3
   service-card cells below. The title strip + slightly taller cm-row
   together break the "three thin bars" silhouette so this pattern reads
   clearly as "homepage hero + service cards" — visually distinct from
   the stacked editorial pattern next door. */
.builder-choice-mockup[data-mockup="hero-columns"] {
  flex-direction: column !important;
  gap: 4px;
  justify-content: flex-start;
  align-items: stretch;
}
.builder-choice-mockup[data-mockup="hero-columns"] > * {
  flex-shrink: 0;
}
.builder-choice-mockup[data-mockup="hero-columns"] .cm-hero {
  display: block;
  height: 28px;
  width: 100%;
  flex: 0 0 28px;
  border-radius: 3px;
}
.builder-choice-mockup[data-mockup="hero-columns"] .cm-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 18px;
  width: 100%;
  align-items: stretch;
}
.builder-choice-mockup .cm-cell {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  min-height: 14px;
  align-self: stretch;
  border-radius: 3px;
}
.builder-choice-mockup[data-mockup="stack"] {
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px;
}
.builder-choice-mockup .cm-bar {
  display: block;
  flex: 1;
  min-height: 5px;
  border-radius: 2px;
}
.builder-choice-mockup[data-mockup="split"] {
  flex-direction: row;
  padding: 6px;
}
.builder-choice-mockup .cm-split {
  display: flex;
  gap: 5px;
  flex: 1;
  width: 100%;
}
.builder-choice-mockup .cm-big {
  display: block;
  flex: 1.4;
  border-radius: 2px;
}
.builder-choice-mockup .cm-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.builder-choice-mockup .cm-small {
  display: block;
  flex: 1;
  border-radius: 2px;
}
.builder-choice-mockup[data-mockup="grid"] {
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px;
}
.builder-choice-mockup .cm-head {
  display: block;
  height: 8px;
  border-radius: 2px;
}
.builder-choice-mockup .cm-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  flex: 1;
}
.builder-choice-mockup .cm-gcell {
  border-radius: 2px;
}
/* Default + hover + selected fills — single declaration so the gradient
   stays consistent across all shape primitives. */
.builder-choice-mockup .cm-hero,
.builder-choice-mockup .cm-cell,
.builder-choice-mockup .cm-bar,
.builder-choice-mockup .cm-big,
.builder-choice-mockup .cm-small,
.builder-choice-mockup .cm-head,
.builder-choice-mockup .cm-gcell {
  background: linear-gradient(180deg, #DCD8CE 0%, #CFCBC1 100%);
}
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) .cm-hero,
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) .cm-cell,
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) .cm-bar,
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) .cm-big,
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) .cm-small,
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) .cm-head,
.builder-choice-card--v2 .builder-choice-tile:hover:not(:disabled):not(.is-selected) .cm-gcell {
  background: linear-gradient(180deg, #CFCBC1 0%, #C3BEB3 100%);
}
.builder-choice-card--v2 .builder-choice-tile.is-selected .cm-hero,
.builder-choice-card--v2 .builder-choice-tile.is-selected .cm-cell,
.builder-choice-card--v2 .builder-choice-tile.is-selected .cm-bar,
.builder-choice-card--v2 .builder-choice-tile.is-selected .cm-big,
.builder-choice-card--v2 .builder-choice-tile.is-selected .cm-small,
.builder-choice-card--v2 .builder-choice-tile.is-selected .cm-head,
.builder-choice-card--v2 .builder-choice-tile.is-selected .cm-gcell {
  background: linear-gradient(180deg, #1F1611 0%, #2A1E17 100%);
}

/* "Describe your own" radio row — appears below the grid. */
.builder-choice-custom {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--ink-mute);
  font: inherit;
  font-size: 0.92rem;
  border-radius: 8px;
  transition: color 0.14s, background 0.14s;
}
.builder-choice-custom:hover { color: var(--ink); background: rgba(255,255,255,0.5); }
.builder-choice-custom__radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-mute);
  flex: 0 0 auto;
  position: relative;
  transition: border-color 0.14s, background 0.14s;
}
.builder-choice-custom.is-selected .builder-choice-custom__radio {
  border-color: var(--ink);
}
.builder-choice-custom.is-selected .builder-choice-custom__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--ink);
}
.builder-choice-custom.is-selected { color: var(--ink); }

/* Footer with Skip all (text-link) + primary CTA (filled). */
.builder-choice-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(31, 22, 17, 0.06);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.builder-choice-skip {
  background: transparent;
  border: 0;
  color: #8A7868;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.14s, background 0.14s;
}
.builder-choice-skip:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(31, 22, 17, 0.04);
}
.builder-choice-skip:disabled { opacity: 0.45; cursor: default; }
.builder-choice-cta {
  background: var(--ink, #1F1611);
  color: var(--paper, #fff);
  border: 1px solid var(--ink, #1F1611);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  height: 36px;
  padding: 0 18px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 1px 2px rgba(31, 22, 17, 0.18),
    0 6px 14px -6px rgba(31, 22, 17, 0.30);
  transition: background 0.14s, transform 0.14s, box-shadow 0.18s;
}
.builder-choice-cta:hover:not(:disabled) {
  background: #2A1E17;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 2px 4px rgba(31, 22, 17, 0.20),
    0 10px 22px -8px rgba(31, 22, 17, 0.36);
}
.builder-choice-cta:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(31, 22, 17, 0.32) inset;
}
.builder-choice-cta:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

/* User-side "you picked X" pill — right-aligned, ink-inverse, small. */
.builder-msg.is-user.builder-pick-pill {
  font-size: 0.85rem;
  padding: 8px 14px !important;
  border-radius: 14px !important;
  max-width: 75%;
}
.builder-form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.builder-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.builder-form-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.005em;
}
.builder-form-input,
.builder-form-chip-input {
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--ink);
  padding: 6px 2px 7px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.builder-form-input::placeholder,
.builder-form-chip-input::placeholder {
  color: var(--ink-faint);
}
.builder-form-input:focus,
.builder-form-chip-input:focus {
  border-bottom-color: var(--ink);
}
.builder-form-help {
  margin: 0;
  font-size: 0.76rem;
  color: var(--ink-faint);
  line-height: 1.45;
}
.builder-form-field.has-error .builder-form-label { color: #b3401b; }
.builder-form-field.has-error .builder-form-input,
.builder-form-field.has-error .builder-form-chip-input,
.builder-form-field.has-error .builder-form-chips {
  border-bottom-color: #b3401b;
}
.builder-form-field.has-error .builder-form-chips {
  border-bottom: 1px solid #b3401b;
  padding-bottom: 4px;
}
/* 2026-05-19 — explicit required-state markup on labels (the leading
   "*"), and an error-tinted border on the segmented control when the
   founder-locked flowType pick is missing. */
.builder-form-req {
  color: #b3401b;
  margin-left: 2px;
  font-weight: 600;
}
.builder-form-field.has-error .builder-form-segmented {
  border-color: #b3401b;
  box-shadow: 0 0 0 1px #b3401b inset;
}

/* Suburb chips */
.builder-form-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
  align-items: center;
}
.builder-form-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--cream-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.2;
}
.builder-form-chip.is-placeholder {
  background: transparent;
  border-style: dashed;
  color: var(--ink-faint);
  padding: 4px 11px;
}
.builder-form-chip-remove {
  background: transparent;
  border: 0;
  color: var(--ink-mute);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.builder-form-chip-remove:hover { color: var(--ink); background: rgba(31, 22, 17, 0.06); }

/* Photo picker */
.builder-form-photo {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.builder-form-photo-pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px dashed var(--hairline);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.85rem;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.builder-form-photo-pick:hover {
  background: var(--cream-2);
  color: var(--ink);
  border-color: var(--ink-mute);
}
.builder-form-photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.builder-form-photo-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream-2);
  border: 1px solid var(--hairline);
}
.builder-form-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.builder-form-photo-thumb.is-uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
}
.builder-form-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: rgba(31, 22, 17, 0.72);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.builder-form-photo-remove:hover { background: rgba(31, 22, 17, 0.92); }

/* Submit button — rectangular sibling of .builder-input-send */
.builder-form-submit {
  margin-top: 6px;
  width: 100%;
  background: var(--ink);
  color: var(--cream, #FAFAFA);
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 0 rgba(31, 22, 17, 0.06), 0 4px 12px -4px rgba(31, 22, 17, 0.30);
  transition: background 0.18s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, opacity 0.15s;
}
.builder-form-submit:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 1px 0 rgba(31, 22, 17, 0.06), 0 8px 18px -6px rgba(31, 22, 17, 0.38);
}
.builder-form-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(31, 22, 17, 0.06), 0 2px 6px -3px rgba(31, 22, 17, 0.30);
}
.builder-form-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.builder-form-submit svg { transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.builder-form-submit:hover:not(:disabled) svg { transform: translateX(2px); }

.builder-form-card.is-submitting {
  opacity: 0.6;
  pointer-events: none;
}

/* Mobile tab strip — hidden on desktop (both panes show side-by-side). */
.builder-mtabs { display: none; }
@media (max-width: 1000px) {
  .builder-shell { grid-template-columns: 1fr; height: auto; }

  /* Show the mobile tab strip and hide the inactive pane */
  .builder-mtabs {
    display: flex;
    background: var(--cream-2);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 14px;
  }
  .builder-mtab {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-mute);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s;
  }
  .builder-mtab:hover { color: var(--ink); }
  .builder-mtab.is-on {
    background: var(--paper, #FFFFFF);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(31, 22, 17, 0.06);
  }
  /* Mobile-only: only the active pane is visible */
  .builder-shell[data-mobile-tab="refine"]  .builder-pane:nth-child(2) { display: none; }
  .builder-shell[data-mobile-tab="preview"] .builder-pane:nth-child(1) { display: none; }
  /* Make whichever pane IS visible take a sensible mobile height */
  /* Each builder pane fills the available height below the sticky
     topbar. Was `calc(100dvh - 240px)` — that 240px gap left ~180px
     of cream void between the form's last field and the fixed
     composer (chat-pane stopped 240px short of the viewport bottom,
     and the composer floats over its own padding-bottom band, not
     against the pane). Shrink the subtractor to just the topbar's
     52px so chat-pane reaches the composer; the pane's own
     padding-bottom (110px) still reserves space for the composer to
     sit above the chat content. */
  .builder-shell .builder-pane { min-height: calc(100dvh - 52px); }
}

/* ──────────────────────────────────────────────────────────────────────
   MOBILE BUILDER — Phase 1: preview-first ready state + draggable
   bottom sheet. Replaces the old tab-style mobile layout (.builder-mtabs
   above) at <=720px when data-builder-state="ready". Empty state stays
   on the existing centered chat (Phase 2 redesigns that).

   CONTAINING-BLOCK GOTCHA: the card-slide drawer (see "Card-slide drawer"
   block earlier in this file) applies `transform: translateX(...)` to
   .shell > main.dash, which makes main.dash the containing block for
   position:fixed descendants — so `bottom:0` ends up relative to
   main.dash's padding box, not the viewport. main.dash extends ~68px
   past the viewport on this page, which pushed the sheet off-screen.
   The card-slide doesn't apply on the builder page (sidebar is hidden
   via body.is-builder-chat), so killing the transform here lets the
   sheet anchor to the viewport again. */
@media (max-width: 720px) {
  /* :not(.mob-drawer-open) — drawer-closed defaults. Animation/opacity
     resets so other effects (page-enter fades, etc.) don't double-play
     during the builder mount. The card-slide drawer animation itself
     is now handled in dashboard-v2-page.css v9b — main.dash uses
     `left: var(--drawer-offset)` instead of `transform: translateX(...)`
     to avoid creating a containing block for position:fixed descendants
     (composer / cards-view shell). The transform override was removed
     from here because v9b's rule supersedes it. */
  body.is-builder-chat:not(.mob-drawer-open) .mob-topbar,
  body.is-builder-chat:not(.mob-drawer-open) .dash-hero-bg {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* Phase 1 mobile sheet layout — diagram, snap points, behaviour notes.
   Visual sketch (peek state):
     ┌──────────────────────┐
     │ [≡] BookingSprint    │ existing mob-topbar
     ├──────────────────────┤
     │   live preview       │ preview-pane, position:fixed inset
     │   (iframe full bleed)│
     ├──────────────────────┤
     │ ━━━━ (drag handle)   │ .builder-sheet-handle
     │ Refine chips         │ visible at peek
     │ [Type to change…]    │ composer (input box)
     ├──────────────────────┤  sheet expands upward when dragged
     │ chat thread          │ chat-body (visible only when sheet > peek)
     └──────────────────────┘

   Snap points (managed by inline JS in dashboard-v2-page.html):
     peek = 200px  (chips + composer; chat-body hidden)
     half = 55dvh  (adds chat-body)
     full = 100dvh - 64px  (covers the page but not the topbar) */

/* Handle is hidden on desktop + empty-state mobile — only renders
   visibly when the sheet is active (mobile + ready state). The
   !important here guards against the JS setting an inline height
   on the chat-pane during empty state (the sheet setup runs on
   mount regardless of state, and any height side-effect must not
   reveal the handle). */
.builder-sheet-handle { display: none !important; }

@media (max-width: 720px) {
  /* Disable the legacy tab-style mobile layout entirely. */
  .builder-mtabs { display: none !important; }
  .builder-shell[data-mobile-tab="refine"] .builder-pane,
  .builder-shell[data-mobile-tab="preview"] .builder-pane { display: flex !important; }

  /* === READY STATE: preview-first with draggable bottom sheet === */
  .builder-shell--centered[data-builder-state="ready"] {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    height: calc(100dvh - 52px);
    max-width: none !important;
    width: 100% !important;
    overflow: hidden;
    position: relative;
  }

  /* Preview pane becomes the full-screen canvas below the topbar.
     NB: main.dash (this pane's ancestor) carries `transform:
     translateX(0)` for the card-slide drawer, which creates a new
     containing block. So position:fixed values here are relative to
     main.dash, not the viewport. main.dash already starts below the
     52px topbar — so top:0 here equals y=52 of the viewport. */
  .builder-shell--centered[data-builder-state="ready"] .builder-preview-pane {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    z-index: 1;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--cream);
    display: flex !important;
    flex-direction: column;
    animation: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide the desktop preview head (Preview/Settings tabs + Domain bar).
     Domain bar surfaces somewhere else in Phase 4 (publish flow). For
     Phase 1 the user can still use the chat to "make it live" via the
     existing refine chips that talk to the same backend. */
  .builder-shell--centered[data-builder-state="ready"] .builder-preview-head {
    display: none;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-preview-body {
    flex: 1 1 auto;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-preview-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
  }

  /* Chat pane becomes the draggable bottom sheet. JS controls
     --sheet-height + the [data-sheet-state] attribute.
     min-height:0 override — the legacy `@media (max-width: 1000px)`
     rule above sets `.builder-pane { min-height: calc(100dvh - 240px) }`,
     which was clamping the sheet to ~604px on a 844-tall viewport.
     justify-content:flex-start override — the default chat-pane rule
     (line 3642) sets justify-content:center for the empty/centered
     hero state, but in bottom-sheet mode the children (drag handle,
     hero/instruction, composer) MUST stack from the top edge of the
     sheet. Without this override, when chat-body is empty
     (post-generation but no chat history yet) the children get
     vertically centred AND overflow the 200px sheet — the drag
     handle ends up ~330px ABOVE the sheet's top edge, hidden behind
     the preview iframe. Touch events go to the iframe, the user
     can't drag the sheet. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--sheet-height, 200px);
    max-height: calc(100dvh - 64px);
    min-height: 0 !important;
    z-index: 5;
    background: var(--paper, #ffffff);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    box-shadow:
      0 -1px 0 0 rgba(31, 22, 17, 0.05),
      0 -10px 32px -12px rgba(31, 22, 17, 0.18);
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    /* flex-start — was flex-end. With flex-end the children pile to the
       BOTTOM of the sheet, and when total content > sheet height (which
       happens in peek mode because empty-hero + instruction + composer
       all stack here), the OVERFLOW pushes UP past the sheet's top edge.
       The drag handle (first source-order child) ends up at y=401 on
       a 932-tall viewport — hidden behind the preview iframe, untouchable.
       flex-start anchors children to the top; the composer is pinned to
       the bottom via margin-top:auto on .builder-input-wrap below. */
    justify-content: flex-start !important;
    transition: height 0.32s cubic-bezier(0.2, 0, 0, 1);
  }
  /* Pin composer to the sheet's bottom regardless of how much other
     content is above it. Combined with flex-start on the parent, this
     gives us "handle at top, composer at bottom, any in-between content
     flows from the top". */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane > .builder-input-wrap {
    margin-top: auto !important;
  }
  /* In peek state the empty-hero greeting + instruction line are
     irrelevant — they're for the centered empty/hero layout. Hidden
     in all sheet states by the broader rule further down. */
  /* During an active drag, kill the transition so the sheet tracks
     the finger 1:1 instead of easing toward target heights. JS adds
     .is-sheet-dragging when a pointer is down on the handle. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane.is-sheet-dragging {
    transition: none;
  }

  /* Sheet handle — the grab bar at the top of the sheet. */
  .builder-shell--centered[data-builder-state="ready"] .builder-sheet-handle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 28px;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    background: transparent;
    border: 0;
    /* Big enough hit target without being visually heavy. */
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-sheet-handle:active {
    cursor: grabbing;
  }
  .builder-sheet-handle__grip {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--ink-mute);
    opacity: 0.32;
    transition: opacity 0.18s;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-sheet-handle:hover .builder-sheet-handle__grip,
  .builder-shell--centered[data-builder-state="ready"] .builder-sheet-handle:active .builder-sheet-handle__grip {
    opacity: 0.55;
  }

  /* Chat / Sections tabs — surfaced on mobile in half/full sheet states
     so the user can flip the sheet's body between the AI chat thread
     and the per-section editing UI. Hidden in peek (peek is reserved
     for quick chips + composer; the tabs would just steal vertical
     space). The bare .builder-chat-tabs[hidden] rule (line 7297)
     keeps it invisible until shellTransitionToReady flips
     hidden=false. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="peek"] .builder-chat-tabs {
    display: none !important;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="half"] .builder-chat-tabs,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="full"] .builder-chat-tabs {
    display: flex !important;
    flex-shrink: 0;
    padding: 6px 18px 0;
    border-bottom: 1px solid rgba(31, 22, 17, 0.06);
    background: var(--paper, #ffffff);
    gap: 4px;
  }
  /* Re-style the tab buttons for the mobile sheet — tighter, taller
     hit-area, ink-only active state (no heavy underline) so the chrome
     reads as Claude-clean. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane .builder-chat-tab {
    padding: 10px 14px 12px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-mute);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    letter-spacing: -0.005em;
    transition: color 0.18s ease, border-color 0.18s ease;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane .builder-chat-tab.is-on {
    color: var(--ink);
    border-bottom-color: var(--ink);
    font-weight: 600;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane .builder-chat-tab:hover {
    color: var(--ink);
  }

  /* Chat thread inside the sheet — hidden in peek, visible in
     half/full. Scrolls within its own bounds when content overflows.
     Flex-anchor (margin-top:auto on first child) inherited from the
     base .builder-chat-body rule keeps the latest message pinned to
     the bottom edge so the most relevant content sits right above
     the chips, not the top. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* 2026-05-24 founder report: text + composer were "shrinking and
       getting wider through the chat". Root cause was state=ready
       stacking another 16px horizontal padding on top of the constant
       16px chat-pane padding (sheet-era leftover) — total inset
       jumped from 16px to 32px the moment the site went live. Keep
       vertical breathing room here; horizontal gutter is owned by
       chat-pane (constant across states).
       --bs-anchor-reserve is set by shellReserveScrollRoomForTopAnchor
       (JS) when a fresh user message lands in ready state so the row
       can be scrolled all the way to the top of the viewport. Default
       8px = pre-fix behaviour. */
    padding: 4px 0 max(8px, var(--bs-anchor-reserve, 8px));
    -webkit-overflow-scrolling: touch;
    /* 2026-05-24 — scroll-padding-top tells scrollIntoView to leave
       this much headroom above the anchored target. Clears the 52px
       fixed topbar + breathing room so follow-up user messages don't
       end up tucked underneath it. Pairs with scroll-margin-top on
       .builder-msg-row.is-user (belt + suspenders for browsers that
       honour one but not the other). */
    scroll-padding-top: 88px;
  }
  /* At peek, hide the chat thread so the sheet shows just chips + composer. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="peek"] .builder-chat-body {
    display: none;
  }
  /* At MINIMIZED — only the drag handle is visible. The tradie pulls the
     sheet down to this state to see the full site preview unobstructed.
     A tap on the handle brings it back to peek. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-chat-tabs,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-chat-body,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-sections-body,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-input-wrap,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-suggestion-row,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-refine-row {
    display: none !important;
  }
  /* Give the handle a slightly more visible grip in minimized state — it's
     the only affordance the user has to bring the sheet back up. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-sheet-handle__grip {
    opacity: 0.5;
    width: 44px;
  }
  /* Sections body — visible only in half/full AND when the Sections tab
     is active (toggled via data-active-tab on the chat-pane by the JS at
     dashboard-v2-page-builder.js:~530). */
  .builder-shell--centered[data-builder-state="ready"] .builder-sections-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px;
    -webkit-overflow-scrolling: touch;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="peek"] .builder-sections-body,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane:not([data-active-tab="sections"]) .builder-sections-body {
    display: none !important;
  }
  /* When Sections or Publish tab is active, hide the chat thread + chips
     + composer so the active body panel has the sheet to itself. The
     composer + refine row are explicitly hidden so the user doesn't try
     to send messages from the Publish settings panel. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-active-tab="sections"] .builder-chat-body,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-active-tab="sections"] .builder-suggestion-row,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-active-tab="publish"] .builder-chat-body,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-active-tab="publish"] .builder-suggestion-row,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-active-tab="publish"] .builder-input-wrap {
    display: none !important;
  }
  /* Publish body — sibling of chat-body / sections-body. Shows in
     half/full when [data-active-tab="publish"]. */
  .builder-shell--centered[data-builder-state="ready"] .builder-publish-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 28px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    -webkit-overflow-scrolling: touch;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="peek"] .builder-publish-body,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane[data-sheet-state="minimized"] .builder-publish-body,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane:not([data-active-tab="publish"]) .builder-publish-body {
    display: none !important;
  }
  /* Publish body — inner sections. Premium minimal styling matching the
     Claude/Anthropic clean-on-cream aesthetic (Phase 14h restyle 2026-05-19).
     Layout: hero URL → collapsed subdomain editor → status+publish action →
     Pro upgrade card. Generous vertical rhythm, URL is the hero, status is
     inline with the primary action. */

  /* === 1. Hero URL card ===
     The published URL is the panel's hero: full-width, large monospace.
     The entire row is tappable — copy-to-clipboard happens on tap. No
     separate "Live at" label. */
  .builder-publish-hero {
    margin: 0;
  }
  .builder-publish-hero__copy {
    appearance: none;
    width: 100%;
    border: 1px solid var(--hairline);
    background: var(--paper);
    border-radius: 16px;
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(31, 22, 17, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.06s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .builder-publish-hero__copy:active {
    transform: scale(0.99);
  }
  .builder-publish-hero__copy:hover {
    border-color: var(--hairline-2);
    box-shadow: 0 3px 10px rgba(31, 22, 17, 0.05);
  }
  .builder-publish-hero__url {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.35;
    /* break-all so a long subdomain wraps cleanly inside the hero card
       rather than overflowing horizontally. */
    word-break: break-all;
  }
  .builder-publish-hero__copy-icon {
    flex-shrink: 0;
    color: var(--ink-mute);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--cream-2, transparent);
    transition: color 0.15s ease, background 0.15s ease;
  }
  .builder-publish-hero__copy:hover .builder-publish-hero__copy-icon {
    color: var(--ink);
  }
  .builder-publish-hero__copy-hint {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
  }
  /* Copied state — flashes briefly via the same .is-copied class JS uses. */
  .builder-publish-hero__copy.is-copied .builder-publish-hero__copy-icon {
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.08);
  }

  /* === 2. Subdomain editor ===
     Collapsed-by-default ghost row. Tap toggles is-editing to reveal the
     input + status. Keeps the panel quiet pre-edit. */
  .builder-publish-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .builder-publish-editor__toggle {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-mute);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .builder-publish-editor__toggle-label {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ink-mute);
  }
  .builder-publish-editor__toggle-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-mute);
    transition: color 0.15s ease;
  }
  .builder-publish-editor__toggle:hover .builder-publish-editor__toggle-action {
    color: var(--ink);
  }
  .builder-publish-editor__toggle-chev {
    transition: transform 0.2s ease;
  }
  .builder-publish-editor.is-editing .builder-publish-editor__toggle-chev {
    transform: rotate(90deg);
  }
  .builder-publish-editor.is-editing .builder-publish-editor__toggle-action-text::after {
    content: ' done';
  }
  .builder-publish-editor.is-editing .builder-publish-editor__toggle-action-text {
    color: var(--ink);
  }
  .builder-publish-editor__panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .builder-publish-editor .builder-domain-input-wrap[data-mobile-publish] {
    display: flex;
    align-items: center;
    border: 1px solid var(--hairline-2);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--paper);
    gap: 0;
    font-size: 0.98rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .builder-publish-editor .builder-domain-input-wrap[data-mobile-publish]:focus-within {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(31, 22, 17, 0.06);
  }
  .builder-publish-editor .builder-domain-input {
    border: 0;
    outline: 0;
    background: transparent;
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ink);
    font: inherit;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
    font-size: 0.96rem;
    padding: 0;
  }
  .builder-publish-editor .builder-domain-suffix {
    color: var(--ink-mute);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
    font-size: 0.94rem;
    flex-shrink: 0;
    padding-left: 4px;
  }
  .builder-publish-editor .builder-domain-status {
    font-size: 0.82rem;
    color: var(--ink-mute);
    padding: 2px 2px;
  }
  .builder-publish-editor .builder-domain-status.is-available { color: #2e7d32; }
  .builder-publish-editor .builder-domain-status.is-taken,
  .builder-publish-editor .builder-domain-status.is-invalid,
  .builder-publish-editor .builder-domain-status.is-reserved { color: #b34740; }

  /* === 3. Status row + Publish action ===
     Live indicator + last-published time sit ABOVE the publish button as
     inline meta — replaces the separate meta-card. */
  .builder-publish-action {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .builder-publish-action__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    color: var(--ink-mute);
  }
  .builder-publish-action__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e7d32;
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12);
    flex-shrink: 0;
  }
  .builder-publish-action__status-label {
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.005em;
  }
  .builder-publish-action__status-sep {
    color: var(--ink-faint);
  }
  .builder-publish-action__when {
    color: var(--ink-mute);
  }
  /* When the site has never published, hide the status row entirely (JS
     toggles via [data-builder-publish-meta] hidden on the hero card; the
     status row uses the same is-unpublished modifier set by JS).  */
  .builder-publish-action.is-unpublished .builder-publish-action__status {
    display: none;
  }

  .builder-publish-btn--mob {
    appearance: none;
    border: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 16px 18px;
    border-radius: 14px;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(31, 22, 17, 0.08), 0 4px 16px rgba(31, 22, 17, 0.04);
    transition: opacity 0.15s ease, background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
  }
  .builder-publish-btn--mob:hover:not(:disabled) {
    box-shadow: 0 2px 4px rgba(31, 22, 17, 0.12), 0 6px 22px rgba(31, 22, 17, 0.08);
  }
  .builder-publish-btn--mob:active:not(:disabled) {
    transform: scale(0.985);
  }
  .builder-publish-btn--mob:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
  }
  .builder-publish-btn--mob.is-published {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--hairline-2);
    box-shadow: none;
  }
  .builder-publish-btn--mob .builder-publish-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
  }

  /* === Generic copy button (used by the hero — but also kept here for
     any future inline copy affordance). === */
  .builder-publish-copy {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ink-mute);
    padding: 4px;
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .builder-publish-copy:hover { color: var(--ink); background: var(--hairline); }
  .builder-publish-copy.is-copied { color: #2e7d32; }

  /* === 4. Pro upgrade card ===
     Distinct from the rest — accent edge + warm gradient surface so it
     reads as an opportunity, not a row. */
  .builder-publish-custom-row {
    appearance: none;
    position: relative;
    border: 1px solid var(--hairline-2);
    background:
      linear-gradient(135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(245, 158, 11, 0.04) 100%),
      var(--paper);
    padding: 18px 20px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.06s ease;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }
  .builder-publish-custom-row::before {
    /* subtle accent edge on the left */
    content: '';
    position: absolute;
    left: 0; top: 18%; bottom: 18%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--orange, #d97706), color-mix(in srgb, var(--orange, #d97706) 60%, transparent));
    opacity: 0.85;
  }
  .builder-publish-custom-row:hover {
    border-color: var(--hairline-3);
    box-shadow: 0 4px 18px rgba(217, 119, 6, 0.08);
  }
  .builder-publish-custom-row:active {
    transform: scale(0.99);
  }
  .builder-publish-custom-row__icon {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--orange, #d97706);
    background: color-mix(in srgb, var(--orange, #d97706) 12%, transparent);
  }
  .builder-publish-custom-row__main { flex: 1 1 auto; min-width: 0; }
  .builder-publish-custom-row__title {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
  }
  .builder-publish-custom-row__sub {
    font-size: 0.8rem;
    color: var(--ink-mute);
    margin-top: 3px;
  }
  .builder-publish-custom-row__chev {
    flex-shrink: 0;
    color: var(--ink-mute);
    transition: transform 0.15s ease, color 0.15s ease;
  }
  .builder-publish-custom-row:hover .builder-publish-custom-row__chev {
    color: var(--ink);
    transform: translateX(2px);
  }

  /* === 5. Variant A — "Settings-page rows" (founder-selected 2026-05-19) ===
     The hero URL card + collapsed subdomain editor + status row stack into a
     unified bordered card with hairline dividers between rows (iOS Settings /
     Stripe Dashboard feel). The Publish button + Pro-upgrade row live
     OUTSIDE the card so they read as separate primary actions, not part of
     the info group.

     These rules override the Phase 14h baseline (sections 1-4 above) by
     source-order specificity. They live in the same @media (max-width:720px)
     block so they only apply to the mobile bottom-sheet Publish tab. */

  /* Tighten the panel padding and zero out the inter-section gap so the
     three info rows visually merge into one unified card. Selector
     specificity-matched to the .builder-shell--centered[data-builder-
     state="ready"] base rule at line ~7110 so source order wins. */
  .builder-shell--centered[data-builder-state="ready"] .builder-publish-body {
    padding: 24px 20px 32px;
    gap: 0;
  }
  /* Strip stray margins on the three wrapper rows. */
  .builder-publish-hero,
  .builder-publish-editor,
  .builder-publish-action {
    margin: 0;
  }
  /* Hero row — flatten the standalone card into the top row of the
     unified card. No shadow, no radius (handled by the unified wrapper),
     calmer hover. */
  .builder-publish-hero__copy {
    border: 0;
    border-radius: 0;
    padding: 14px 16px;
    box-shadow: none;
    background: var(--paper);
    gap: 12px;
  }
  .builder-publish-hero__copy:hover {
    background: var(--cream-2);
    box-shadow: none;
  }
  .builder-publish-hero__copy:active {
    transform: none;
    box-shadow: none;
  }
  .builder-publish-hero__url {
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: -0.005em;
  }
  .builder-publish-hero__copy-icon {
    width: 28px;
    height: 28px;
    background: transparent;
  }
  /* Editor row. */
  .builder-publish-editor { gap: 0; }
  .builder-publish-editor__toggle {
    padding: 14px 16px;
    background: var(--paper);
    color: var(--ink);
  }
  .builder-publish-editor__toggle-label {
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
  }
  .builder-publish-editor__toggle-action { color: var(--ink-mute); }
  .builder-publish-editor__panel {
    padding: 0 16px 14px;
    background: var(--paper);
  }
  /* Status row — last row of the unified card. Hairline borders on all
     sides + bottom radius so the card visually "closes" before the
     publish button. */
  .builder-publish-action {
    gap: 0;
    border: 0;
  }
  .builder-publish-action__status {
    padding: 14px 16px;
    background: var(--paper);
    margin: 0;
    font-size: 0.86rem;
    gap: 8px;
    justify-content: flex-start;
    border: 1px solid var(--hairline);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
  }
  /* Unified card chrome on hero + editor — outer border, top-rounded. */
  .builder-publish-hero,
  .builder-publish-editor {
    border-left: 1px solid var(--hairline);
    border-right: 1px solid var(--hairline);
  }
  .builder-publish-hero {
    border-top: 1px solid var(--hairline);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    overflow: hidden;
  }
  .builder-publish-editor {
    border-top: 1px solid var(--hairline);
  }
  /* Publish button — separate, full-width primary BELOW the unified
     card. Margined off so it doesn't crush the card edge. */
  .builder-publish-btn--mob {
    margin-top: 18px;
    margin-bottom: 18px;
    width: 100%;
    border-radius: 12px;
    padding: 16px 18px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: -0.005em;
    box-shadow:
      0 1px 2px rgba(31, 22, 17, 0.08),
      0 6px 18px rgba(31, 22, 17, 0.06);
  }
  /* Custom-domain row — calm settings-row look. Drops the orange edge
     and warm gradient so it sits as a quiet sibling action, not a
     marketing CTA. */
  .builder-publish-custom-row {
    border-radius: 14px;
    padding: 16px 18px;
    background: var(--paper);
    border: 1px solid var(--hairline);
    box-shadow: none;
  }
  .builder-publish-custom-row::before { display: none; }
  .builder-publish-custom-row__icon {
    background: var(--cream-2);
    color: var(--ink-mute);
    width: 32px;
    height: 32px;
  }
  .builder-publish-custom-row__title { font-size: 0.94rem; }
  .builder-publish-custom-row__sub { font-size: 0.78rem; }

  /* Tab dot — small indicator next to "Publish" tab label when changes
     are pending. JS toggles via [data-builder-publish-tab-dot] visibility. */
  .builder-chat-tab-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ink);
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  .builder-chat-tab-dot.is-on { opacity: 1; }
  /* Hide the legacy empty-hero + instruction in EVERY ready state —
     they're chrome for the centred/empty pre-build layout and are
     irrelevant once the sheet exists. Without this they cause
     content overflow that pushes the drag handle past the sheet's
     top edge. */
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane .builder-empty-hero,
  .builder-shell--centered[data-builder-state="ready"] .builder-chat-pane .builder-instruction {
    display: none !important;
  }

  /* Input wrap (refine chips + composer) sits at the bottom of the sheet
     and stays visible at every sheet height. */
  .builder-shell--centered[data-builder-state="ready"] .builder-input-wrap {
    /* 2026-05-24: dropped horizontal 16px padding (sheet-era leftover).
       chat-pane already owns the 16px outer gutter — stacking another
       16px here was shrinking the composer by 32px the moment state
       flipped to ready. */
    padding: 8px 0 max(16px, env(safe-area-inset-bottom)) !important;
    flex-shrink: 0;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-input-box {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box;
  }

  /* Refine chips: keep horizontally scrollable on narrow widths. */
  .builder-shell--centered[data-builder-state="ready"] .builder-refine-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 4px 10px;
    margin: 0 -4px 6px;
    /* Subtle fade at the right edge so the user knows there's more to scroll. */
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent 100%);
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-refine-row::-webkit-scrollbar {
    display: none;
  }
  .builder-shell--centered[data-builder-state="ready"] .builder-refine-chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Hide the empty-state suggestion row in ready state on mobile. */
  .builder-shell--centered[data-builder-state="ready"] .builder-suggestion-row {
    display: none !important;
  }
}

.builder-pane {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--cream);
  display: flex; flex-direction: column;
  overflow: hidden;
}
/* Phase 13: "+ New chat" pane head. Hidden by default; revealed only
   once the chat has started so the empty-hero stays clean on first paint. */
.builder-pane-head {
  display: none;
  padding: 10px 14px 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
/* Publish button — sits to the right of "New chat" in the pane head.
   Filled with the warm-stone-dark ink so it reads as the primary
   action of the page (the user's end goal: get my site live). */
.builder-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--paper, #fff);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.builder-publish-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.builder-publish-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ── Editable domain bar (preview-head, next to Publish button) ────
   Wired in dashboard-v2-page.html via shellInitDomainBar(). Input
   debounces against GET /api/builder/check-slug; Publish button
   POSTs to /api/builder/publish with the current slug. */
.builder-domain-bar { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.builder-domain-input-wrap {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px 9px; background: var(--paper, #fff);
  border: 1px solid var(--hairline, #E7E2DA);
  border-radius: 999px;
  font-size: 0.74rem; min-width: 0; max-width: 320px;
  transition: border-color 0.15s, background 0.15s;
}
.builder-domain-input-wrap:focus-within { border-color: var(--ink); background: var(--cream, #FBFBFB); }
.builder-domain-prefix, .builder-domain-suffix {
  color: var(--ink-soft, rgba(31,22,17,0.55));
  white-space: nowrap; user-select: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem;
}
.builder-domain-input {
  width: 140px; min-width: 60px; border: 0; background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem; font-weight: 600; color: var(--ink);
  padding: 2px 0; outline: none;
}
.builder-domain-input::placeholder { color: rgba(31, 22, 17, 0.32); font-weight: 400; }
.builder-domain-input[readonly] { color: var(--ink-mute, #6B5A4C); cursor: default; }
.builder-domain-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; line-height: 1.4;
}
.builder-domain-status[hidden] { display: none; }
.builder-domain-status.is-checking { background: var(--cream-2, #F4F4F4); color: var(--ink-mute, #6B5A4C); }
.builder-domain-status.is-checking::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; border: 1.5px solid rgba(31, 22, 17, 0.2);
  border-top-color: var(--ink);
  animation: bdr-spin 0.7s linear infinite;
}
.builder-domain-status.is-available { background: rgba(44, 107, 44, 0.12); color: #2c6b2c; }
.builder-domain-status.is-taken,
.builder-domain-status.is-invalid,
.builder-domain-status.is-reserved,
.builder-domain-status.is-error { background: #f5dcd9; color: #7c2218; }
.builder-domain-suggestion {
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; font-weight: 600; margin-left: 4px;
}
@keyframes bdr-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* Extended publish-btn states for the domain-bar flow */
.builder-publish-btn .builder-publish-dot {
  width: 6px; height: 6px; border-radius: 50%; background: transparent; display: inline-block;
}
.builder-publish-btn.is-publishing { cursor: wait; opacity: 0.85; }
.builder-publish-btn.is-published { background: #2c6b2c; border-color: #2c6b2c; cursor: default; }
.builder-publish-btn.is-published .builder-publish-dot {
  background: #6ce58a;
  box-shadow: 0 0 0 2px rgba(108, 229, 138, 0.25);
}
.builder-chat-pane:has(.builder-chat-body:not(:empty)) .builder-pane-head {
  display: flex;
}
.builder-newchat-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--hairline-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.builder-newchat-btn:hover {
  background: var(--cream-2);
  color: var(--ink);
  border-color: var(--hairline-3);
}
.builder-chat-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: baseline; justify-content: space-between;
}
.builder-chat-eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}
.builder-chat-counter {
  font-size: 0.78rem; color: var(--ink-mute);
}
.builder-chat-body {
  flex: 1; overflow-y: auto;
  /* 2026-05-16 v4: bumped bottom padding so the last message has
     breathing room above the composer. */
  padding: 16px 18px 32px;
  display: flex; flex-direction: column; gap: 14px;
}
.builder-msg {
  /* Widened from 85% -> 96% — AI messages (which contain the brief-form
     fields) need to reach close to the screen edges. User pills keep
     the lower 92% override below since they auto-size to content. */
  max-width: 96%; padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem; line-height: 1.45;
}
.builder-msg.is-user {
  align-self: flex-end;
  /* Warm-stone grey, Claude-style — softer than the near-black --ink the
     bubble used to ship with. Founder 2026-05-16. */
  background: var(--cream-3); color: var(--ink);
}
.builder-msg.is-ai {
  align-self: flex-start;
  background: var(--cream-2); color: var(--ink);
}

/* 2026-05-24 handoff card — polished pass after founder feedback
   ("final your sites ready thing needs fixing as well styling
   wise"). Italic-serif title matches the empty-state Instrument-
   Serif family; tighter overall surface (cream gradient, deeper
   shadow), beefier 44px button row with the primary Preview pill
   filling 60% of the width so it leads the eye. Card width opened
   up to ~400px so the title + 2-button row reads as one unit. */
/* 2026-05-24 (rev 4) — Lovable-parity styling. Subtle brand-orange
   halo (1px outline + 4px soft glow) gives the card a "freshly-
   landed important thing" feel without being loud. Pure white
   surface, 16px border-radius (slightly less than 18 for a more
   utility-card feel), three-layer ink shadow lifts it off the
   chat thread. Specificity anchored via parent row + !important
   on every surface prop to beat the .builder-msg-row.is-ai
   .builder-msg override at L4091 which strips bg + padding. */
.builder-msg-row.is-ai .builder-msg.builder-handoff {
  background: #FFFFFF !important;
  border: 1px solid transparent !important;
  border-radius: 16px !important;
  padding: 20px 20px 18px !important;
  max-width: 400px !important;
  box-shadow:
    0 0 0 1px rgba(255, 91, 0, 0.18),
    0 0 0 4px rgba(255, 91, 0, 0.05),
    0 2px 6px rgba(31, 22, 17, 0.04),
    0 12px 32px -10px rgba(31, 22, 17, 0.14) !important;
  align-self: flex-start !important;
}
/* 2026-05-24 reveal animation — handoff card + site-info land softly
   after the 30s build animation completes instead of snapping in.
   Slower curve than the default builderRowEnter (700ms vs 400ms) so
   the post-build moment feels deliberate; site-info delays 220ms so
   it cascades under the card rather than landing at the same beat.
   builderRowEnter on .builder-msg-row is overridden here. */
.builder-msg-row[data-builder-handoff] {
  animation: bsBuildRevealCard 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.builder-msg-row[data-builder-siteinfo] {
  animation: bsBuildRevealProse 700ms cubic-bezier(0.16, 1, 0.3, 1) 220ms both;
}
@keyframes bsBuildRevealCard {
  0%   { opacity: 0; transform: translateY(14px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes bsBuildRevealProse {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0);    }
}
@media (prefers-reduced-motion: reduce) {
  .builder-msg-row[data-builder-handoff],
  .builder-msg-row[data-builder-siteinfo] { animation: none !important; }
}
.builder-handoff__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.builder-handoff__title {
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--ink, #1F1611);
}
.builder-handoff__lede {
  font-size: 0.9rem;
  color: var(--ink-mute, #6B5A4C);
  line-height: 1.5;
}
.builder-handoff__actions {
  display: flex;
  gap: 10px;
}
.builder-handoff__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(31, 22, 17, 0.12);
  background: #FFFFFF;
  color: var(--ink, #1F1611);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.14s cubic-bezier(0.2, 0, 0, 1);
  -webkit-tap-highlight-color: transparent;
}
/* 2026-05-24: equal-width buttons (founder ask). Was asymmetric
   1.6/1 so Preview leads, but the imbalance read as unfinished.
   Equal flex keeps the same visual weight; the dark vs light fill
   still carries the primary/secondary hierarchy. */
.builder-handoff__btn { flex: 1 1 0; }
.builder-handoff__btn:hover { background: #FAFAFA; }
.builder-handoff__btn:active { transform: translateY(0.5px); }
.builder-handoff__btn.is-primary {
  background: linear-gradient(180deg, #2A211B 0%, #1F1611 100%);
  color: var(--cream, #FAFAF8);
  border-color: rgba(0, 0, 0, 0.55);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    0 4px 10px -2px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.builder-handoff__btn.is-primary:hover {
  background: linear-gradient(180deg, #332923 0%, #241B16 100%);
}

/* 2026-05-24 site-info follow-up AI msg — appended right after the
   handoff card. Renders as plain prose (no card surface) per
   founder ask: "the second text should not be in a card it should
   just be normal text". The chat's default AI-msg styling at
   L4091 (.builder-msg-row.is-ai .builder-msg → bg:transparent,
   padding: 2px 0) is the desired baseline; we only style the
   prose elements + the inline pill link inside. */
.builder-msg.builder-siteinfo p {
  margin: 0 0 12px;
  /* 2026-05-24 founder: nudged to 1.04rem to match the bumped
     AI/user chat font sizes. */
  font-size: 1.04rem;
  line-height: 1.55;
  color: var(--ink, #1F1611);
}
.builder-msg.builder-siteinfo p strong {
  color: var(--ink, #1F1611);
  font-weight: 600;
}
.builder-msg.builder-siteinfo p:first-child {
  margin-top: 0;
}
.builder-msg.builder-siteinfo p:nth-last-child(2) {
  margin-bottom: 8px;
}
.builder-siteinfo__pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 10px;
  background: #FBFBFB;
  border: 1px solid rgba(31, 22, 17, 0.1);
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink, #1F1611);
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, transform 0.14s cubic-bezier(0.2, 0, 0, 1);
  -webkit-tap-highlight-color: transparent;
}
.builder-siteinfo__pill:hover {
  background: #F4F4F4;
  border-color: rgba(31, 22, 17, 0.15);
}
.builder-siteinfo__pill:active { transform: translateY(0.5px); }
.builder-siteinfo__pill svg { flex-shrink: 0; }

.builder-quick-refines {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 18px; border-top: 1px solid var(--hairline);
}
.builder-refine-chip {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  /* 2026-05-29 founder: was 0.78rem / 4px 11px — chips read as
     footnotes vs the AI reply text. Bumped to 0.88rem and a touch more
     padding so they sit as real affordances. */
  padding: 6px 12px;
  font-family: inherit; font-size: 0.88rem;
  color: var(--ink-mute); cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.builder-refine-chip:hover { color: var(--ink); border-color: var(--hairline-2); }
.builder-compose {
  padding: 12px 18px;
  border-top: 1px solid var(--hairline);
  display: flex; gap: 8px; align-items: flex-end;
}
.builder-compose textarea {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit; font-size: 0.92rem;
  resize: none;
  min-height: 24px; max-height: 120px;
  outline: none;
  padding: 6px 0;
}
.builder-send {
  background: var(--ink); color: var(--cream);
  border: 0; border-radius: 8px;
  padding: 8px 14px; font-family: inherit;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer;
}
.builder-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}
.builder-preview-head-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.builder-tabs { display: inline-flex; background: var(--cream-2); border-radius: 8px; padding: 3px; gap: 2px; }
.builder-tab {
  background: transparent; border: 0; padding: 5px 12px;
  font-family: inherit; font-size: 0.82rem; color: var(--ink-mute);
  border-radius: 6px; cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.builder-tab.is-on { background: var(--cream); color: var(--ink); font-weight: 500; }

/* Chat-side tab strip (Chat / Sections) revealed after generation. */
.builder-chat-tabs {
  display: flex; gap: 4px;
  padding: 10px 18px 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--cream);
}
.builder-chat-tabs[hidden] { display: none; }
.builder-chat-tab {
  appearance: none; border: 0; background: transparent;
  padding: 7px 12px; font: inherit; font-size: 0.82rem; font-weight: 500;
  color: var(--ink-mute); cursor: pointer;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  display: inline-flex; align-items: center;
}
.builder-chat-tab:hover { color: var(--ink); background: var(--cream-2); }
.builder-chat-tab.is-on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.builder-chat-tab-count {
  margin-left: 5px; padding: 1px 6px;
  background: var(--cream-3); color: var(--ink-mute);
  border-radius: 999px; font-size: 0.66rem; font-weight: 600;
}
.builder-chat-tab-count:empty { display: none; }

.builder-sections-body { flex: 1; overflow-y: auto; padding: 14px 18px; min-height: 0; }
.builder-sections-body[hidden] { display: none; }
.builder-sections-hint { margin: 0 0 14px; font-size: 0.8rem; color: var(--ink-mute); line-height: 1.45; }
.builder-sections-empty { font-size: 0.85rem; color: var(--ink-mute); font-style: italic; }
.builder-sections-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
/* Phase A 2026-05-16: row gained a tradie-language description row between
   the section name (row 1) and the headline (now row 3). 2026-05-17: row 6
   added for the inline rewrite composer (textarea + Send/Cancel) that drops
   under the actions when the tradie clicks Redo with AI. Grid rows are
   now 6: name, desc, headline, variants, actions, composer. */
.builder-sections-row {
  display: grid; grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto auto auto;
  gap: 2px 10px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid transparent; background: transparent;
  transition: background 0.14s, border-color 0.14s;
}
.builder-sections-row[data-hidden="true"] .builder-sections-row__name { text-decoration: line-through; text-decoration-color: var(--ink-faint); text-decoration-thickness: 1px; }
.builder-sections-row[data-hidden="true"] .builder-sections-row__desc,
.builder-sections-row[data-hidden="true"] .builder-sections-row__headline { opacity: 0.55; }
.builder-sections-row:hover { background: var(--cream-2); border-color: var(--hairline); }
.builder-sections-row__name {
  grid-column: 1; grid-row: 1;
  font-size: 0.88rem; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.builder-sections-row__hidden-pill {
  display: inline-flex; align-items: center;
  background: var(--cream-3);
  color: var(--ink-mute);
  font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  text-decoration: none;
}
.builder-sections-row__desc {
  grid-column: 1 / -1; grid-row: 2;
  font-size: 0.74rem; color: var(--ink-mute); line-height: 1.4;
  margin-top: 1px;
}
.builder-sections-row__headline {
  grid-column: 1 / -1; grid-row: 3;
  font-size: 0.76rem; color: var(--ink-faint); line-height: 1.35;
  font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 4px;
}
.builder-sections-row__actions {
  grid-column: 1 / -1; grid-row: 5;
  display: inline-flex; gap: 4px; margin-top: 10px;
  flex-wrap: wrap;
}
.builder-sections-action {
  appearance: none; background: var(--paper); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 5px 12px;
  font: inherit; font-size: 0.74rem; color: var(--ink-mute);
  cursor: pointer; transition: all 0.14s;
}
.builder-sections-action:hover { color: var(--ink); border-color: var(--ink); background: var(--cream); }
.builder-sections-action.is-danger:hover { color: #7c2218; border-color: #c4534a; background: #fdf3f1; }
.builder-sections-action[disabled] { opacity: 0.4; cursor: not-allowed; }
.builder-sections-action.is-secondary {
  color: var(--ink-faint); border-color: transparent; background: transparent;
}
.builder-sections-action.is-secondary:hover {
  color: var(--ink); border-color: var(--hairline); background: var(--cream);
}

/* Inline rewrite composer (2026-05-17). Drops under the actions row when
   the tradie clicks Redo with AI. One optional textarea + Cancel/Rewrite
   buttons. Empty submission is allowed — server treats "no direction"
   as "rewrite with section guidance + brief only". */
.builder-sections-row__composer {
  grid-column: 1 / -1; grid-row: 6;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; margin-top: 8px;
  background: var(--cream-1);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.builder-sections-composer__label {
  font-size: 0.72rem; color: var(--ink-mute); font-weight: 500;
  line-height: 1.35;
}
.builder-sections-composer__input {
  appearance: none;
  width: 100%; box-sizing: border-box;
  min-height: 56px; resize: vertical;
  padding: 8px 10px;
  font: inherit; font-size: 0.82rem; line-height: 1.4; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline); border-radius: 8px;
  transition: border-color 0.14s;
}
.builder-sections-composer__input:focus {
  outline: none;
  border-color: var(--ink);
}
.builder-sections-composer__input[disabled] {
  opacity: 0.55; cursor: not-allowed;
}
.builder-sections-composer__actions {
  display: flex; gap: 6px; justify-content: flex-end;
}

/* T1 variant picker chips (2026-05-16). Sits between the headline row
   and the Jump/Rewrite/Hide row. Pill shape matches .builder-sections-
   action but the active chip inverts to the ink/paper duo so the
   tradie can see at a glance which layout is live. Warm-stone only;
   no dark+orange (that lives in the prototype, not the real app).
   Phase A 2026-05-16: chips now carry a one-word variant name alongside
   the letter so the tradie can read "B Photo" instead of just "B". */
.builder-sections-row__variants {
  grid-column: 1 / -1; grid-row: 4;
  display: inline-flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.builder-section-variant-chip {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--hairline);
  color: var(--ink-mute);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}
.builder-section-variant-chip__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--cream-3);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.builder-section-variant-chip__name { padding-right: 2px; }
.builder-section-variant-chip:hover { color: var(--ink); border-color: var(--ink); background: var(--cream); }
.builder-section-variant-chip:hover .builder-section-variant-chip__letter { background: var(--paper); }
.builder-section-variant-chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.builder-section-variant-chip.is-on .builder-section-variant-chip__letter {
  background: rgba(255,255,255,0.18);
  color: var(--paper);
}
.builder-section-variant-chip[disabled] { opacity: 0.45; cursor: wait; }

/* Phase A 2026-05-16: footer counter at the bottom of the Sections list,
   "10 sections · 2 hidden · 1 layout changed". Reads as a quiet status
   line, separated from the list by a hairline so it doesn't compete
   with row hover states. */
.builder-sections-footer {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}
.builder-sections-footer[hidden] { display: none; }

.builder-device-toggle { display: inline-flex; gap: 4px; }
.builder-device-btn {
  background: transparent; border: 0;
  width: 28px; height: 28px;
  border-radius: 6px;
  color: var(--ink-faint); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.builder-device-btn:hover { background: var(--cream-2); color: var(--ink); }
.builder-device-btn.is-on { background: var(--cream-2); color: var(--ink); }
.builder-preview-body {
  flex: 1; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream-2);
  overflow: auto;
}
