
  .inline-toolbar {
    transform: translateZ(0);
  }
  .inline-toolbar-stack {
    transition: transform 560ms cubic-bezier(0.22, 1, 0.36, 1), filter 560ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .inline-toolbar-actions-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
    max-width: min(28rem, 100%);
    margin-left: auto;
  }
  .inline-toolbar-stack-open {
    transform: translateY(-10px);
    filter: drop-shadow(0 20px 48px rgba(15, 23, 42, 0.16));
  }
  .inline-toolbar-panel,
  .inline-toolbar-action,
  .inline-toolbar-toggle {
    will-change: transform, opacity;
  }
  .inline-toolbar-panel {
    background: #ffffff;
    width: min(22rem, 92vw);
    max-width: 92vw;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
  }
  .inline-toolbar-action {
    background: #ffffff;
    min-height: 2.7rem;
    padding-inline: 1rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  }
  .inline-toolbar-action-active {
    background: #eef2ff;
    border-color: rgba(99, 102, 241, 0.35);
    color: #4338ca;
  }
  .inline-toolbar-toggle {
    transform-origin: bottom right;
    background: #ffffff;
    color: #374151;
    border: 1px solid #e5e7eb;
  }
  /* Edit-mode state driven by parent class (added by Alpine) */
  .inline-toolbar-open .inline-toolbar-toggle {
    background: #16a34a;
    color: #ffffff;
    border-color: transparent;
  }
  /* Dark mode */
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .inline-toolbar-toggle {
    background: #1e293b;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.2);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .inline-toolbar-open .inline-toolbar-toggle {
    background: #16a34a;
    color: #ffffff;
    border-color: transparent;
  }
  .inline-toolbar-open .inline-toolbar-toggle {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
  }
  .inline-toolbar-toggle-icon {
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .inline-toolbar-open .inline-toolbar-toggle-icon {
    transform: rotate(-10deg) scale(1.08);
  }
  @media (max-width: 767px) {
    /* Override Tailwind utilities on the wrapper (right-6, items-end, gap-3) */
    .inline-toolbar.inline-toolbar {
      left: 0.5rem;
      right: 0.5rem;
      bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
      align-items: stretch;
      gap: 0.5rem;
    }
    .inline-toolbar .inline-toolbar-stack {
      align-items: stretch;
      gap: 0.5rem;
      align-self: stretch;
      width: 100%;
    }
    .inline-toolbar .inline-toolbar-actions-row,
    .inline-toolbar .inline-toolbar-panel {
      align-self: stretch;
    }
    .inline-toolbar .inline-toolbar-toggle {
      align-self: flex-end;
    }
    /* Compact horizontally-scrollable dock — single row, no wrap, no group dividers */
    .inline-toolbar-actions-row {
      max-width: 100%;
      justify-content: flex-start;
      gap: 0.35rem;
      flex-wrap: nowrap;
      overflow-x: auto;
      overflow-y: visible;
      padding: 0.4rem 0.55rem;
      margin: 0;
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid rgba(148, 163, 184, 0.28);
      border-radius: 999px;
      box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      scrollbar-width: none;
      -ms-overflow-style: none;
      -webkit-overflow-scrolling: touch;
    }
    .inline-toolbar-actions-row::-webkit-scrollbar { display: none; }
    .inline-toolbar-group {
      gap: 0.3rem;
      flex-shrink: 0;
    }
    /* Hide vertical-pipe dividers between groups on mobile — they look broken in a scrolling strip */
    .inline-toolbar-group + .inline-toolbar-group::before {
      display: none;
    }
    .inline-toolbar-stack-open {
      transform: translateY(-2px);
      filter: drop-shadow(0 12px 26px rgba(15, 23, 42, 0.12));
    }
    .inline-toolbar-panel {
      width: 100%;
      max-width: 100%;
      margin-bottom: 0;
      margin-left: 0;
      max-height: min(50vh, 22rem);
      overflow-y: auto;
      border-radius: 1rem;
      padding: 0.85rem;
    }
    .inline-toolbar-action {
      min-height: 2.25rem;
      width: auto;
      max-width: none;
      margin-left: 0;
      padding: 0.45rem 0.75rem;
      border-radius: 999px;
      font-size: 0.74rem;
      box-shadow: none;
      flex-shrink: 0;
    }
    /* Show text labels on mobile — hide icons (text-only buttons for clarity) */
    .inline-toolbar-action i {
      display: none;
    }
    .inline-toolbar-action-label {
      display: inline;
    }
    .inline-toolbar-toggle {
      align-self: flex-end;
      min-height: 2.75rem;
      padding: 0.65rem 1rem;
      gap: 0.45rem;
      border-radius: 999px;
      font-size: 0.85rem;
      width: auto;
      margin-right: 0;
    }
    .inline-toolbar-toggle-label {
      white-space: nowrap;
    }
    .inline-edit-active .inline-editable {
      outline-width: 1px;
      outline-offset: 2px;
    }
    .inline-edit-active .inline-editable .edit-hint {
      top: -8px;
      right: 0;
      font-size: 9px;
      padding: 1px 5px;
    }
    .inline-section-manage {
      top: 0.6rem;
      right: auto;
      left: 0.6rem;      /* move to left — right side conflicts with dot nav */
      transform: none;
      z-index: 500;      /* above dot nav (200), section nav (79) */
    }
    .inline-card-manage {
      top: 0.55rem;
      right: 0.55rem;
      z-index: 500;
    }
    .inline-manage-pill {
      gap: 0.25rem;
      padding: 0.3rem 0.45rem;
      box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }
    .inline-manage-btn {
      width: 1.7rem;
      height: 1.7rem;
      font-size: 0.72rem;
    }
    .inline-manage-btn.inline-manage-add {
      padding: 0 0.65rem;
      font-size: 0.72rem;
    }
    .inline-save-indicator {
      margin-right: 0;
      align-self: flex-end;
    }
    /* When a full-screen mobile drawer (hero / sections) OR any Inspector
       pane is open, hide the toolbar's action row + toggle so they don't
       float over the bottom sheet. Pane's own close button is the way out. */
    body.inline-mobile-drawer-open .inline-toolbar-actions-row,
    body.inline-mobile-drawer-open .inline-toolbar-toggle,
    body.inline-mobile-drawer-open .inline-toolbar-panel,
    body.editor-panel-open .inline-toolbar-actions-row,
    body.editor-panel-open .inline-toolbar-toggle,
    body.editor-panel-open .inline-toolbar-panel {
      display: none !important;
    }

    /* ── Hide MEB when any editor panel or inspector pane is open ─────────── */
    /* The inspector/style panel is z-index 9800; MEB is 10100 — MEB covers   */
    /* the panel's bottom (Apply button, last scroll content). Hide MEB so the */
    /* full panel is reachable.                                                 */
    body.editor-panel-open .meb,
    body.editor-inspector-pane-open .meb,
    body.inline-mobile-drawer-open .meb {
      display: none !important;
    }

    /* ── Touch: hover never fires — always show card pills in edit mode ── */
    .inline-edit-active .inline-home-manage.inline-card-manage {
      opacity: 1 !important;
      pointer-events: auto !important;
    }

    /* ── MEB replaces SECTION-LEVEL pills on mobile; card pills stay visible ── */
    /* Only hide section manage wrappers — card manage wrappers (camera, CTA,   */
    /* duplicate, delete) remain accessible since MEB doesn't cover those.       */
    .inline-edit-active .inline-home-manage.inline-section-manage { display: none !important; }

    /* ── Push the existing inline toolbar above the MEB when edit mode active ── */
    body.inline-edit-active .inline-toolbar.inline-toolbar {
      bottom: calc(env(safe-area-inset-bottom, 0px) + 68px);
    }
    /* ── Hide floating toolbar while keyboard is open (MEB text mode) ─────── */
    body.meb-text-active .inline-toolbar {
      opacity: 0 !important;
      pointer-events: none !important;
      transform: translateY(20px) !important;
      transition: opacity 200ms ease, transform 200ms ease !important;
    }

    /* ── Mobile Edit Bar (MEB) ──────────────────────────────────────────── */
    .meb {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 10100;
      flex-direction: row;
      align-items: center;
      gap: 0;
      padding: 0.5rem 0.75rem;
      /* No safe-area padding-bottom when keyboard is open — JS handles translation */
      padding-bottom: 0.5rem;
      background: rgba(255, 255, 255, 0.88);
      overflow: hidden; /* prevent both mode panels from showing side-by-side */
      will-change: transform;
      transition: transform 120ms ease-out;
      border-top: 1px solid rgba(148, 163, 184, 0.22);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.10);
    }
    body.inline-edit-active .meb {
      display: flex;
    }

    /* State panels — only one shown at a time */
    .meb-section-mode,
    .meb-text-mode {
      display: none;
      width: 100%;
      align-items: center;
      gap: 0.4rem;
    }
    .meb-section-mode.meb-active,
    .meb-text-mode.meb-active {
      display: flex;
    }

    /* Shared button base */
    .meb-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 44px;
      min-height: 44px;
      padding: 0 0.65rem;
      border-radius: 0.6rem;
      border: 1px solid rgba(148, 163, 184, 0.28);
      background: rgba(255, 255, 255, 0.9);
      color: #374151;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      gap: 0.3rem;
      white-space: nowrap;
      flex-shrink: 0;
      transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
    }
    .meb-btn:active {
      background: rgba(99, 102, 241, 0.08);
      border-color: rgba(99, 102, 241, 0.3);
      color: #4338ca;
    }
    .meb-btn-primary {
      background: #6366f1;
      color: #fff;
      border-color: transparent;
    }
    .meb-btn-primary:active {
      background: #4f46e5;
      color: #fff;
    }
    .meb-btn-ai {
      color: #7c3aed;
      border-color: rgba(124, 58, 237, 0.3);
    }
    .meb-btn-done {
      background: #16a34a;
      color: #fff;
      border-color: transparent;
    }
    .meb-btn-done:active {
      background: #15803d;
    }
    .meb-btn-exit {
      color: #dc2626;
      border-color: rgba(220, 38, 38, 0.28);
    }

    /* Font family select in text mode */
    .meb-select {
      height: 44px;
      padding: 0 0.5rem;
      border-radius: 0.6rem;
      border: 1px solid rgba(148, 163, 184, 0.28);
      background: rgba(255, 255, 255, 0.9);
      color: #374151;
      font-size: 0.72rem;
      font-weight: 600;
      cursor: pointer;
      flex-shrink: 0;
      max-width: 5.5rem;
      appearance: none;
      -webkit-appearance: none;
      text-align: center;
    }

    /* Center label — expands to fill space */
    .meb-label {
      flex: 1;
      text-align: center;
      font-size: 0.72rem;
      font-weight: 600;
      color: #64748b;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 0 0.25rem;
      min-width: 0;
    }

    /* Save button feedback */
    .meb-save-ok .meb-btn-save {
      background: #16a34a;
      color: #fff;
      border-color: transparent;
    }

    /* Dark mode */
    :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .meb {
      background: rgba(15, 22, 38, 0.92);
      border-top-color: rgba(148, 163, 184, 0.16);
      box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.36);
    }
    :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .meb-btn {
      background: rgba(30, 41, 59, 0.85);
      color: #e2e8f0;
      border-color: rgba(148, 163, 184, 0.22);
    }
    :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .meb-btn-primary {
      background: #6366f1;
      color: #fff;
      border-color: transparent;
    }
    :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .meb-btn-done {
      background: #16a34a;
      color: #fff;
      border-color: transparent;
    }
    :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .meb-btn-exit {
      color: #f87171;
      border-color: rgba(248, 113, 113, 0.3);
    }
    :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .meb-btn-ai {
      color: #a78bfa;
      border-color: rgba(167, 139, 250, 0.3);
    }
    :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .meb-label {
      color: #94a3b8;
    }

    /* Slightly larger touch targets for manage buttons on mobile */
    .inline-section-manage .inline-manage-btn,
    .inline-card-manage .inline-manage-btn {
      width: 2rem;
      height: 2rem;
      font-size: 0.78rem;
    }
    /* Give the section pill a stronger shadow so it's legible over content */
    .inline-section-manage .inline-manage-pill {
      box-shadow: 0 4px 16px rgba(15, 23, 42, 0.28), 0 1px 4px rgba(15, 23, 42, 0.14);
    }
  }

  /* Dark-mode polish for the mobile dock */
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .inline-toolbar-actions-row {
    background: rgba(22, 30, 46, 0.92);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .inline-toolbar-action {
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.22);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .inline-toolbar-action.inline-toolbar-action-active {
    background: rgba(67, 56, 202, 0.55);
    color: #e0e7ff;
    border-color: rgba(129, 140, 248, 0.55);
  }
  .inline-editable {
    position: relative;
    transition: all 0.2s ease;
  }
  .inline-edit-active .inline-editable {
    cursor: text;
    outline: 2px dashed rgba(99, 102, 241, 0.4);
    outline-offset: 4px;
    border-radius: 4px;
  }
  .inline-edit-active .inline-editable:hover {
    outline-color: rgba(99, 102, 241, 0.8);
    background: rgba(99, 102, 241, 0.05);
  }
  .inline-edit-active .inline-editable:focus {
    outline: 2px solid #6366f1;
    outline-offset: 4px;
    background: rgba(99, 102, 241, 0.08);
  }
  .inline-editable .edit-hint {
    display: inline-flex;
    opacity: 0;
    transform: translateY(6px) scale(0.9);
    transition: opacity 260ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .inline-edit-active .inline-editable .edit-hint {
    position: absolute;
    top: -10px;
    right: -4px;
    background: #6366f1;
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .inline-saving {
    opacity: 0.6;
    pointer-events: none;
  }
  .inline-save-ok {
    animation: inlineSaveFlash 0.6s ease;
  }
  /* ── Phase 3: Selection ring + boundary action bar ───────────────────── */

  /* Section shells are the positioning root */
  .inline-manage-section,
  .inline-card-shell {
    position: relative;
  }

  /* ── Section hover ring ──────────────────────────────────────────────── */
  .inline-edit-active .inline-manage-section {
    outline: 1px solid transparent;
    outline-offset: 2px;
    border-radius: 2px;
    transition: outline-color 150ms ease;
  }
  .inline-edit-active .inline-manage-section:hover,
  .inline-edit-active .inline-manage-section.inline-section-selected {
    outline-color: rgba(99, 102, 241, 0.45);
  }
  .inline-edit-active .inline-manage-section.inline-section-selected {
    outline-color: rgba(99, 102, 241, 0.75);
    outline-width: 2px;
  }

  /* ── Section action bar — sits AT the top boundary, not inside content ── */
  /* The bar is positioned so it sits just above the section's top edge.
     It's hidden by default and fades in on section hover or selection.   */
  .inline-home-manage {
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  .inline-edit-active .inline-manage-section:hover .inline-home-manage,
  .inline-edit-active .inline-manage-section.inline-section-selected .inline-home-manage {
    opacity: 1;
    pointer-events: auto;
  }

  /* Section action bar: floats at the top-right corner of the section */
  .inline-section-manage {
    position: absolute;
    top: 0;
    right: 0.75rem;
    transform: translateY(-50%);   /* half above the section boundary */
    z-index: 30;
  }

  /* Card action badge: compact, top-right of card, revealed on card hover */
  .inline-card-manage {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
  }
  .inline-edit-active .inline-card-shell:hover .inline-card-manage,
  .inline-edit-active .inline-card-shell.inline-card-selected .inline-card-manage {
    opacity: 1;
    pointer-events: auto;
  }

  /* ── Action pill (shared by section bar + card badge) ────────────────── */
  .inline-manage-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 1px 4px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.3rem 0.45rem;
    position: relative; /* needed for overflow dropdown */
  }

  /* ── Action buttons ──────────────────────────────────────────────────── */
  .inline-manage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.4rem;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: 0.72rem;
    transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
    cursor: pointer;
  }
  .inline-manage-btn:hover {
    background: #f1f5f9;
    border-color: rgba(99, 102, 241, 0.22);
    color: #4338ca;
  }
  .inline-manage-btn.inline-manage-danger:hover {
    background: #fef2f2;
    border-color: rgba(248, 113, 113, 0.3);
    color: #b91c1c;
  }
  .inline-manage-btn.inline-manage-add {
    width: auto;
    padding: 0 0.65rem;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #6366f1;
  }
  .inline-manage-btn.inline-manage-add:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4338ca;
  }
  .inline-manage-btn.inline-manage-btn-primary {
    width: auto;
    padding: 0 0.65rem;
    background: #6366f1;
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    gap: 0.3rem;
  }
  .inline-manage-btn.inline-manage-btn-primary:hover {
    background: #4f46e5;
    border-color: rgba(79, 70, 229, 0.6);
    color: #fff;
  }

  /* Pill divider — thin vertical line between button groups */
  .inline-pill-divider {
    width: 1px;
    height: 1.1rem;
    background: rgba(148, 163, 184, 0.35);
    flex-shrink: 0;
    margin: 0 0.1rem;
  }
  /* ── Q3: Toolbar button groups ───────────────────────────────────────── */
  .inline-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
  }
  .inline-toolbar-group + .inline-toolbar-group::before {
    content: '';
    display: block;
    width: 1px;
    height: 1.5rem;
    background: rgba(148, 163, 184, 0.35);
    margin-right: 0.15rem;
    flex-shrink: 0;
    align-self: center;
  }

  /* ── Inline image wrappers ──────────────────────────────────────────── */
  /* Empty image slot: always hidden via inline style; shown as add-zone in edit mode */
  .inline-edit-active .inline-img-wrap.inline-img-empty {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    border: 1.5px dashed rgba(99, 102, 241, 0.4);
    border-radius: 0.4rem;
    color: rgba(99, 102, 241, 0.6);
    font-size: 0.7rem;
    cursor: pointer;
    margin-bottom: 0.75rem;
  }
  .inline-edit-active .inline-img-wrap.inline-img-empty::after {
    content: '+ Add image';
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }

  /* ── Q4: Persistent save indicator ──────────────────────────────────── */
  .inline-save-indicator {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: opacity 300ms ease, color 200ms ease, background 200ms ease, border-color 200ms ease;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    margin-right: 0.25rem;
    align-self: center;
  }
  .inline-save-indicator--idle {
    opacity: 0;
  }
  .inline-save-indicator--saving {
    opacity: 1;
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
    color: #92400e;
  }
  .inline-save-indicator--saved {
    opacity: 1;
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.28);
    color: #15803d;
  }
  .inline-save-indicator--error {
    opacity: 1;
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.32);
    color: #b91c1c;
    pointer-events: auto;
  }

  /* ── Q1: Section overflow dropdown ───────────────────────────────────── */
  .inline-section-overflow-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 100;
    min-width: 9rem;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.65rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    animation: inlineMenuIn 160ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  @keyframes inlineMenuIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
  }
  .inline-overflow-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #334155;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 120ms ease, color 120ms ease;
  }
  .inline-overflow-item:hover {
    background: #f1f5f9;
    color: #1e293b;
  }
  .inline-overflow-item i {
    width: 0.9rem;
    text-align: center;
    color: #6366f1;
    font-size: 0.72rem;
  }
  .inline-overflow-item.inline-overflow-danger:hover {
    background: #fef2f2;
    color: #b91c1c;
  }
  .inline-overflow-item.inline-overflow-danger i {
    color: #ef4444;
  }

  .inline-structure-busy {
    pointer-events: none;
  }
  .inline-card-removing {
    transform-origin: center top;
    animation: inlineCardRemove 260ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  .inline-section-refresh {
    animation: inlineSectionRefresh 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .inline-card-enter {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    animation: inlineCardEnter 460ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--inline-enter-delay, 0ms);
  }
  .inline-card-added {
    animation: inlineCardAdded 760ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .inline-card-moved {
    animation: inlineCardMoved 620ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .inline-card-spotlight {
    animation: inlineCardSpotlight 900ms ease;
  }
  .inline-about-card-shell {
    position: relative;
  }
  .inline-about-drag-handle {
    cursor: grab;
  }
  .inline-about-drag-handle:active {
    cursor: grabbing;
  }
  .inline-about-items-container {
    position: relative;
  }
  .inline-about-sort-placeholder {
    position: relative;
    border: 1px dashed rgba(99, 102, 241, 0.24);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.04), rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.04));
    border-radius: 18px;
    min-height: 88px;
    transition: height 180ms ease, transform 180ms ease, opacity 180ms ease;
    animation: inlineAboutPlaceholderIn 180ms ease;
  }
  .inline-about-sort-placeholder::after {
    content: '';
    position: absolute;
    inset: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
  }
  .inline-about-dragging {
    opacity: 0.22;
    transform: scale(0.985);
  }
  .inline-about-drop-active {
    outline: 1px solid rgba(99, 102, 241, 0.18);
    outline-offset: 10px;
    border-radius: 24px;
  }
  .inline-about-section-refresh {
    animation: inlineAboutSectionRefresh 280ms ease;
  }
  .inline-about-card-added {
    animation: inlineAboutCardSettle 360ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .inline-about-card-added::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(110deg, rgba(99, 102, 241, 0) 10%, rgba(99, 102, 241, 0.12) 40%, rgba(14, 165, 233, 0.18) 52%, rgba(99, 102, 241, 0) 76%);
    animation: inlineAboutGlowTrail 820ms ease forwards;
  }
  .inline-about-card-spotlight {
    animation: inlineAboutSpotlight 900ms ease;
  }
  .inline-about-card-reordered {
    animation: inlineAboutReordered 300ms ease;
  }
  .inline-home-drag-handle {
    cursor: grab;
  }
  .inline-home-drag-handle:active {
    cursor: grabbing;
  }
  .inline-home-items-container {
    position: relative;
  }
  .inline-home-sort-placeholder {
    position: relative;
    min-height: 88px;
    border-radius: 20px;
    border: 1px dashed rgba(59, 130, 246, 0.28);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(15, 23, 42, 0.04));
    transition: height 180ms ease, transform 180ms ease;
    animation: inlineAboutPlaceholderIn 180ms ease;
  }
  .inline-home-dragging {
    opacity: 0.24;
    transform: scale(0.985);
  }
  .inline-home-drop-active {
    outline: 1px solid rgba(59, 130, 246, 0.18);
    outline-offset: 10px;
    border-radius: 24px;
  }
  @keyframes inlineSaveFlash {
    0% { outline-color: #22c55e; }
    100% { outline-color: transparent; }
  }
  @keyframes inlineCardRemove {
    0% {
      opacity: 1;
      transform: scale(1) translateY(0);
      filter: saturate(1);
    }
    100% {
      opacity: 0;
      transform: scale(0.9) translateY(-12px);
      filter: saturate(0.8);
    }
  }
  @keyframes inlineSectionRefresh {
    0% {
      opacity: 0.3;
      transform: translateY(10px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes inlineCardEnter {
    0% {
      opacity: 0;
      transform: translateY(18px) scale(0.97);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  @keyframes inlineCardAdded {
    0% {
      transform: translateY(18px) scale(0.94);
      box-shadow: 0 0 0 rgba(59, 130, 246, 0);
    }
    45% {
      transform: translateY(-4px) scale(1.02);
      box-shadow: 0 20px 40px rgba(59, 130, 246, 0.16);
    }
    100% {
      transform: translateY(0) scale(1);
      box-shadow: 0 0 0 rgba(59, 130, 246, 0);
    }
  }
  @keyframes inlineCardMoved {
    0% {
      transform: scale(1);
    }
    35% {
      transform: translateY(-6px) scale(1.02);
    }
    100% {
      transform: translateY(0) scale(1);
    }
  }
  @keyframes inlineCardSpotlight {
    0% {
      box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
    25% {
      box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.14);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
  }
  @keyframes inlineAboutPlaceholderIn {
    0% {
      opacity: 0;
      transform: scaleY(0.7);
    }
    100% {
      opacity: 1;
      transform: scaleY(1);
    }
  }
  @keyframes inlineAboutSectionRefresh {
    0% {
      opacity: 0.7;
      transform: translateY(6px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes inlineAboutCardSettle {
    0% {
      transform: translateY(12px);
      box-shadow: 0 10px 18px rgba(99, 102, 241, 0);
    }
    100% {
      transform: translateY(0);
      box-shadow: 0 10px 18px rgba(99, 102, 241, 0);
    }
  }
  @keyframes inlineAboutGlowTrail {
    0% {
      opacity: 0;
      transform: translateX(-16%) skewX(-14deg);
    }
    20% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: translateX(18%) skewX(-14deg);
    }
  }
  @keyframes inlineAboutSpotlight {
    0% {
      box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
    30% {
      box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.12);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
  }
  @keyframes inlineAboutReordered {
    0% {
      transform: translateY(-4px);
    }
    100% {
      transform: translateY(0);
    }
  }

  /* ── Design Picker drawer ─────────────────────────────────────────────── */
  .designs-picker-overlay {
    opacity: 0;
    transition: opacity 240ms ease;
    pointer-events: none;
    touch-action: none;
  }
  .designs-picker-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .designs-picker-backdrop {
    opacity: 0;
    transition: opacity 240ms ease;
  }
  .designs-picker-overlay.is-visible .designs-picker-backdrop { opacity: 1; }

  /* Right-side drawer panel */
  .designs-picker-dialog {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: min(560px, 95vw);
    display: flex;
    flex-direction: column;
    background: #0a0f1e;
    transform: translateX(100%);
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
  }
  .designs-picker-overlay.is-visible .designs-picker-dialog {
    transform: translateX(0);
  }
  @media (max-width: 767px) {
    .designs-picker-dialog { width: 100%; }
  }
  #designsApplyBtn:disabled { opacity: 0.4; cursor: not-allowed; }

  /* ── Left nav tabs ────────────────────────────────────────────────────── */
  .dp-nav-tab {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 9px 12px;
    border-radius: 10px; border: none; background: transparent;
    font-size: 12px; font-weight: 600; color: #64748b;
    cursor: pointer; text-align: left; white-space: nowrap;
    transition: background 0.14s, color 0.14s;
  }
  .dp-nav-tab:hover {
    background: color-mix(in srgb, var(--primary-color, #2563eb) 10%, transparent);
    color: color-mix(in srgb, var(--primary-color, #2563eb) 76%, #0f172a);
  }
  .dp-nav-tab.active {
    background: color-mix(in srgb, var(--primary-color, #2563eb) 16%, transparent);
    color: color-mix(in srgb, var(--primary-color, #2563eb) 84%, #0f172a);
  }
  .dp-nav-tab .dp-nav-icon { width: 20px; text-align: center; opacity: 0.72; }
  .dp-nav-tab.active .dp-nav-icon { opacity: 1; }

  /* ── Section panels ───────────────────────────────────────────────────── */
  .dp-section { display: none; padding-bottom: 14px; }
  .dp-section.active { display: block; }

  /* ── Theme horizontal scroll strip ───────────────────────────────────── */
  .dp-theme-strip {
    display: flex; gap: 12px;
    overflow-x: auto; overflow-y: visible;
    padding: 4px 2px 12px;
    scrollbar-width: none; -ms-overflow-style: none;
    /* negative margin hack so card box-shadows aren't clipped */
    margin: 0 -2px;
  }
  .dp-theme-strip::-webkit-scrollbar { display: none; }
  .dp-theme-card {
    flex: 0 0 148px;
    border-radius: 14px; border: 2px solid #e2e8f0;
    overflow: hidden; cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
  }
  .dp-theme-card:hover { border-color: #a5b4fc; box-shadow: 0 4px 16px rgba(99,102,241,0.12); }
  .dp-theme-card.active { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }
  .dp-theme-card-preview {
    height: 88px; position: relative; overflow: hidden;
  }
  .dp-theme-card-label {
    padding: 8px 10px 9px;
    font-size: 11px; font-weight: 700; color: #374151;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dp-theme-card.active .dp-theme-card-label { color: #4f46e5; }
  .dp-theme-card-badge {
    position: absolute; top: 6px; right: 6px;
    font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 99px;
    background: rgba(99,102,241,0.9); color: #fff;
  }

  /* ── Option pill rows ─────────────────────────────────────────────────── */
  /* Pill strip: single-row scrollable, used for bg-mode, layout-scale, etc. */
  .dp-pill-strip {
    display: flex; gap: 6px; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: visible;
    padding: 3px 2px 10px;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .dp-pill-strip::-webkit-scrollbar { display: none; }
  .dp-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
    padding: 3px 0 10px;
  }
  .dp-pill {
    flex: 0 0 auto;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 12px; min-width: 64px;
    border-radius: 10px; border: 2px solid #e2e8f0;
    font-size: 11px; font-weight: 600; color: #64748b;
    cursor: pointer; white-space: nowrap; background: #fff;
    transition: border-color 0.13s, background 0.13s, color 0.13s;
  }
  .dp-pill:hover {
    border-color: color-mix(in srgb, var(--primary-color, #2563eb) 42%, #cbd5e1);
    background: color-mix(in srgb, var(--primary-color, #2563eb) 8%, #ffffff);
    color: color-mix(in srgb, var(--primary-color, #2563eb) 78%, #0f172a);
  }
  .dp-pill.active {
    border-color: color-mix(in srgb, var(--primary-color, #2563eb) 54%, #94a3b8);
    background: color-mix(in srgb, var(--primary-color, #2563eb) 12%, #ffffff);
    color: color-mix(in srgb, var(--primary-color, #2563eb) 86%, #0f172a);
  }
  .dp-pill .dp-pill-icon { font-size: 14px; opacity: 0.85; }
  .dp-pill.active .dp-pill-icon { opacity: 1; }
  .dp-pill .dp-pill-sub { font-size: 9.5px; font-weight: 400; color: #94a3b8; margin-top: 1px; }
  .dp-pill.active .dp-pill-sub { color: color-mix(in srgb, var(--primary-color, #2563eb) 58%, #64748b); }

  /* 2-item toggle fits side by side naturally — no hscroll needed */
  .dp-toggle-row { display: flex; gap: 8px; }
  .dp-toggle-row .dp-pill { flex: 1; }

  /* Surface selector chips */
  .dp-surface-chip {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px; border-radius: 12px; border: 2px solid #e2e8f0;
    cursor: pointer; background: #fff; text-align: left;
    transition: border-color 0.13s, background 0.13s;
    flex: 1;
  }
  .dp-surface-chip:hover { border-color: #a5b4fc; background: #f5f3ff; }
  .dp-surface-chip.active { border-color: #6366f1; background: #eef2ff; }
  .dp-surface-chip-label { font-size: 12px; font-weight: 700; color: #374151; }
  .dp-surface-chip.active .dp-surface-chip-label { color: #4338ca; }
  .dp-surface-chip-sub { font-size: 10px; color: #94a3b8; }
  .dp-surface-chip.active .dp-surface-chip-sub { color: #818cf8; }
  .dp-surface-chip-preset { font-size: 9.5px; margin-top: 4px; color: #6366f1; font-weight: 600; }

  /* Section label style inside panels */
  .dp-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: #94a3b8; margin-bottom: 8px; margin-top: 16px;
  }
  .dp-label:first-child { margin-top: 0; }
  .dp-hint { font-size: 11px; color: #94a3b8; margin-bottom: 6px; margin-top: -4px; }

  /* Always-dark drawer: dp-* element overrides (drawer is always dark, no body-class needed) */
  .designs-picker-dark .dp-nav-tab {
    color: rgba(226, 232, 240, 0.78);
  }
  .designs-picker-dark .dp-nav-tab:hover {
    background: rgba(99, 102, 241, 0.20);
    color: #c7d2fe;
  }
  .designs-picker-dark .dp-nav-tab.active {
    background: rgba(99, 102, 241, 0.32);
    color: #e0e7ff;
  }
  .designs-picker-dark .dp-theme-card,
  .designs-picker-dark .dp-pill,
  .designs-picker-dark .dp-surface-chip {
    background: rgba(16, 22, 34, 0.95);
    border-color: rgba(148, 163, 184, 0.22);
    color: rgba(226, 232, 240, 0.86);
  }
  .designs-picker-dark .dp-theme-card-label,
  .designs-picker-dark .dp-surface-chip-label {
    color: #f8fafc;
  }
  .designs-picker-dark .dp-pill .dp-pill-sub,
  .designs-picker-dark .dp-surface-chip-sub,
  .designs-picker-dark .dp-hint,
  .designs-picker-dark .dp-label {
    color: rgba(203, 213, 225, 0.78);
  }
  .designs-picker-dark .dp-pill:hover,
  .designs-picker-dark .dp-surface-chip:hover,
  .designs-picker-dark .dp-theme-card:hover {
    border-color: rgba(129, 140, 248, 0.78);
    background: rgba(26, 30, 52, 0.95);
  }
  .designs-picker-dark .dp-pill.active,
  .designs-picker-dark .dp-surface-chip.active,
  .designs-picker-dark .dp-theme-card.active {
    border-color: #818cf8;
    background: rgba(67, 56, 202, 0.32);
    color: #e0e7ff;
  }
  .designs-picker-dark .dp-surface-chip-preset { color: #a5b4fc; }
  .designs-picker-dark .dp-theme-card { background: rgba(16, 22, 34, 0.95); }

  .design-preset-card {
    opacity: 0;
    transform: translateY(8px);
    animation: designPresetCardIn 300ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  @keyframes designPresetCardIn { to { opacity: 1; transform: translateY(0); } }

  /* ── Phase 4: Contextual Field Toolbar ─────────────────────────────────── */

  .ctf-toolbar {
    position: fixed;
    z-index: 10050;
    background: rgba(255, 255, 255, 0.99);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 0.6rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.22rem 0.28rem;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(5px) scale(0.98);
    transition: opacity 140ms ease, transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .ctf-toolbar.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-toolbar {
    background: rgba(22, 30, 46, 0.98);
    border-color: rgba(148, 163, 184, 0.20);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  }

  @media (max-width: 767px) {
    .ctf-toolbar {
      padding: 0.35rem 0.5rem;
      gap: 0.3rem;
      border-radius: 0.8rem;
      box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.10);
    }
    .ctf-btn {
      min-width: 2.2rem;
      height: 2.2rem;
      font-size: 0.8rem;
      padding: 0 0.45rem;
    }
    .ctf-select {
      height: 2.2rem;
      font-size: 0.78rem;
    }
  }

  /* Buttons */
  .ctf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.3rem;
    border-radius: 0.35rem;
    border: 1px solid transparent;
    background: transparent;
    color: #475569;
    font-size: 0.72rem;
    cursor: pointer;
    line-height: 1;
    transition: background 110ms ease, color 110ms ease, border-color 110ms ease;
  }
  .ctf-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
  }
  .ctf-btn.is-active {
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.25);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-btn {
    color: rgba(226, 232, 240, 0.7);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
  }

  /* Divider */
  .ctf-divider {
    width: 1px;
    height: 1.15rem;
    background: rgba(148, 163, 184, 0.3);
    margin: 0 0.15rem;
    flex-shrink: 0;
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-divider {
    background: rgba(148, 163, 184, 0.22);
  }

  /* Font / Size selects */
  .ctf-select {
    height: 1.65rem;
    padding: 0 1.3rem 0 0.45rem;
    border-radius: 0.35rem;
    border: 1px solid transparent;
    background: transparent;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M4 5L0 0h8z' fill='%2394a3b8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.35rem center;
    transition: background-color 110ms ease;
    outline: none;
  }
  .ctf-select:hover { background-color: #f1f5f9; }
  .ctf-select:focus { background-color: #f8fafc; border-color: rgba(99, 102, 241, 0.28); }

  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-select {
    color: rgba(226, 232, 240, 0.8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M4 5L0 0h8z' fill='%2364748b'/%3E%3C/svg%3E");
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-select:hover {
    background-color: rgba(255, 255, 255, 0.06);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-select option {
    background: #1e293b;
    color: #f1f5f9;
  }

  /* AI dropdown */
  .ctf-ai-dropdown {
    position: fixed;
    z-index: 10055;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 0.65rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(15, 23, 42, 0.06);
    min-width: 10.5rem;
    padding: 0.28rem;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    animation: inlineMenuIn 160ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-ai-dropdown {
    background: rgba(22, 30, 46, 0.98);
    border-color: rgba(148, 163, 184, 0.20);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
  .ctf-ai-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.65rem;
    border-radius: 0.4rem;
    font-size: 0.77rem;
    font-weight: 500;
    color: #334155;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 100ms ease, color 100ms ease;
  }
  .ctf-ai-item:hover { background: #f1f5f9; color: #1e293b; }
  .ctf-ai-item i { width: 0.9rem; text-align: center; color: #8b5cf6; font-size: 0.72rem; }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-ai-item {
    color: rgba(226, 232, 240, 0.8);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-ai-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #f1f5f9;
  }

  /* AI preview bubble */
  .ctf-ai-preview {
    position: fixed;
    z-index: 10055;
    max-width: min(28rem, 90vw);
    background: #ffffff;
    border: 1.5px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    padding: 0.7rem 0.9rem;
    animation: inlineMenuIn 180ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-ai-preview {
    background: rgba(22, 30, 46, 0.98);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
  .ctf-ai-preview-text {
    font-size: 0.82rem;
    line-height: 1.55;
    color: #334155;
    margin-bottom: 0.65rem;
    white-space: pre-wrap;
    word-break: break-word;
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-ai-preview-text {
    color: rgba(226, 232, 240, 0.9);
  }
  .ctf-ai-preview-actions {
    display: flex;
    gap: 0.45rem;
    justify-content: flex-end;
  }
  .ctf-ai-cancel {
    padding: 0.3rem 0.75rem;
    border-radius: 0.4rem;
    background: transparent;
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.32);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease;
  }
  .ctf-ai-cancel:hover { background: #f1f5f9; color: #475569; }
  .ctf-ai-retry {
    padding: 0.3rem 0.75rem;
    border-radius: 0.4rem;
    background: transparent;
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.32);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 100ms ease;
  }
  .ctf-ai-retry:hover { background: rgba(99, 102, 241, 0.06); }
  .ctf-ai-accept {
    padding: 0.3rem 0.9rem;
    border-radius: 0.4rem;
    background: #6366f1;
    color: #ffffff;
    border: none;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 100ms ease;
  }
  .ctf-ai-accept:hover { background: #4f46e5; }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-ai-cancel {
    color: rgba(148, 163, 184, 0.9);
    border-color: rgba(148, 163, 184, 0.22);
  }
  :is(body.theme-dark, body.ui-mode-dark, body.public-site-body.preset-mode-dark) .ctf-ai-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
  }
