/* Becomy Studio — shared Marketing + Apparence + Theme editor */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

    *, *::before, *::after { box-sizing: border-box; }
    .ae-body { font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; background: #f9f9ff; color: #111827; line-height: 1.5; }
    .ae-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; position: sticky; top: 0; z-index: 30; }
    .ae-topbar:not(.ae-shell-topbar) { background: #fff; border-bottom: 1px solid #e5e7eb; }
    .ae-shell-topbar { padding-left: 0; padding-right: 0; }
    .ae-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 1080px; margin: 0 auto; padding: 12px 20px; }
    body:has(.ae-product-editor-full) .ae-topbar-inner { max-width: 1280px; }
    body:has(.ae-anno) .ae-topbar-inner { max-width: 1440px; }
    .ae-topbar-hero { align-items: flex-start; padding: 20px 24px 16px; }
    .ae-topbar h1 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
    .ae-topbar-sub { font-size: 14px; color: #6b7280; margin: 4px 0 0; max-width: 480px; }
    .ae-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .ae-topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .ae-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; color: #374151; transition: background .15s, border-color .15s; }
    .ae-btn:hover { background: #f9fafb; border-color: #9ca3af; }
    .ae-btn-sm { padding: 5px 10px; font-size: 12px; }
    .ae-btn-icon { padding: 8px 12px; }
    .ae-btn-ghost { border-color: transparent; background: transparent; color: #6b7280; }
    .ae-btn-ghost:hover { background: #f3f4f6; color: #111827; }
    .ae-btn-primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
    .ae-btn-primary:hover { background: #4338ca; border-color: #4338ca; }
    .ae-btn-secondary { background: #f3f4f6; border-color: #e5e7eb; color: #374151; }
    .ae-btn-success { background: #059669; border-color: #059669; color: #fff; }
    .ae-btn-success:hover { background: #047857; }
    .ae-btn-warning { background: #d97706; border-color: #d97706; color: #fff; }
    .ae-btn-danger-text { color: #dc2626; border: none; background: transparent; }
    .ae-btn-danger-text:hover { background: #fef2f2; }
    .ae-save-status { font-size: 12px; color: #9ca3af; display: block; margin-top: 2px; }
    .ae-save-status-dirty { color: #d97706; font-weight: 600; }
    .ae-save-status-saving { color: #6b7280; }
    .ae-badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: capitalize; flex-shrink: 0; }
    .ae-badge-draft { background: #f3f4f6; color: #4b5563; }
    .ae-badge-active { background: #d1fae5; color: #065f46; }
    .ae-badge-paused { background: #fef3c7; color: #92400e; }
    .ae-badge-error { background: #fee2e2; color: #991b1b; }
    .ae-tg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
    .ae-tg-field { display: flex; flex-direction: column; gap: 5px; }
    .ae-tg-label { font-size: 12px; font-weight: 600; color: #374151; }
    .ae-tg-required { color: #dc2626; }
    .ae-tg-subhead { margin: 0; font-size: 14px; font-weight: 600; color: #111827; }
    .ae-tg-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
    .ae-tg-run {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 10px 12px;
      border: 1px solid #f3f4f6;
      border-radius: 8px;
      font-size: 13px;
      transition: border-color .3s, background .3s;
    }
    .ae-tg-run-main { display: flex; align-items: center; gap: 10px 12px; min-width: 0; }
    .ae-tg-run.is-cooking { position: relative; overflow: hidden; border-color: #c7d2fe; background: linear-gradient(135deg, #faf5ff, #f5f3ff, #eef2ff); background-size: 200% 200%; animation: ae-tg-cooking-bg 4s ease infinite; }
    .ae-tg-run.is-cooking::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #6366f1, #a78bfa, transparent); animation: ae-tg-shimmer 2s linear infinite; }
    .ae-tg-status { display: inline-flex; align-items: center; gap: 6px; text-transform: none; }
    .ae-tg-status.is-pulsing { animation: ae-tg-badge-pulse 2s ease-in-out infinite; }
    .ae-tg-pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; animation: ae-tg-pulse 1.2s ease-in-out infinite; }
    .ae-tg-status-pending { background: #f3f4f6; color: #6b7280; }
    .ae-tg-status-fetching { background: #dbeafe; color: #1d4ed8; }
    .ae-tg-status-capturing { background: #cffafe; color: #0e7490; }
    .ae-tg-status-analyzing { background: #ede9fe; color: #6d28d9; }
    .ae-tg-status-generating { background: #e0e7ff; color: #4338ca; }
    .ae-tg-status-refining { background: #ffedd5; color: #c2410c; }
    .ae-tg-status-validating { background: #fef3c7; color: #b45309; }
    .ae-tg-status-completed { background: #d1fae5; color: #065f46; }
    .ae-tg-status-failed { background: #fee2e2; color: #991b1b; }
    .ae-tg-cooking-banner { display: flex; align-items: center; gap: 8px; margin-top: 0; padding: 10px 12px; border-radius: 8px; background: #eef2ff; border: 1px solid #c7d2fe; color: #4338ca; font-size: 13px; animation: ae-tg-badge-pulse 2.5s ease-in-out infinite; }
    @keyframes ae-tg-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
    @keyframes ae-tg-badge-pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); } }
    @keyframes ae-tg-cooking-bg { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
    @keyframes ae-tg-shimmer { 0% { left: -100%; } 100% { left: 100%; } }
    .ae-tg-run-name { flex: 1; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .ae-tg-run-meta { margin-left: auto; display: flex; align-items: center; gap: 10px 12px; flex-shrink: 0; }
    .ae-tg-run-date { color: #9ca3af; font-size: 12px; white-space: nowrap; }
    .ae-tg-run-error { color: #991b1b; font-size: 12px; margin: 0; }
    .ae-tg-run-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
    .ae-tg-run-report { font-size: 12px; color: #6b7280; margin: 0; }
    .ae-tg-run-report summary { cursor: pointer; color: #4f46e5; }
    .ae-tg-run-report ul { margin: 6px 0 0; padding-left: 18px; }
    .ae-tg-generated-hint { margin: 0; font-size: 13px; line-height: 1.45; }
    .ae-tg-score { background: #eef2ff; color: #4338ca; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
    .ae-tg-score-high { background: #d1fae5; color: #065f46; }
    .ae-tg-score-mid { background: #fef3c7; color: #92400e; }
    .ae-tg-score-low { background: #fee2e2; color: #991b1b; }
    .ae-tg-score-unknown { background: #f3f4f6; color: #6b7280; font-weight: 600; }
    .ae-tg-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
    .ae-tg-shot { margin: 0; }
    .ae-tg-shot figcaption { font-size: 11px; font-weight: 600; color: #6b7280; margin-bottom: 4px; text-transform: capitalize; }
    .ae-tg-shot-pair { display: flex; gap: 4px; }
    .ae-tg-shot-pair img { width: 50%; border: 1px solid #e5e7eb; border-radius: 6px; object-fit: cover; object-position: top; max-height: 200px; }
    .ae-onboarding { background: linear-gradient(90deg, #eef2ff, #faf5ff); border-bottom: 1px solid #e0e7ff; padding: 12px 20px; }
    .ae-onboarding-inner { max-width: 900px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
    .ae-onboarding ol { display: flex; gap: 16px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; flex: 1; }
    .ae-onboarding li { font-size: 13px; color: #4338ca; display: flex; align-items: center; gap: 8px; }
    .ae-onboarding li span { background: #4f46e5; color: #fff; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
    .ae-help-popover { position: fixed; top: 56px; right: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.12); z-index: 50; max-width: 260px; font-size: 13px; }
    .ae-help-popover ul { margin: 8px 0 0; padding-left: 18px; color: #6b7280; }
    .ae-help-popover kbd { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
    .ae-layout { display: flex; height: calc(100vh - 53px - 200px); overflow: hidden; }
    .ae-layout.ae-agent-collapsed-layout { height: calc(100vh - 53px - 44px); }
    .ae-palette { width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid #e5e7eb; padding: 14px; overflow-y: auto; }
    .ae-palette-intro { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #f3f4f6; }
    .ae-palette-intro strong { font-size: 13px; }
    .ae-palette-intro p { font-size: 12px; color: #9ca3af; margin: 2px 0 0; }
    .ae-palette h2 { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; margin: 14px 0 8px; font-weight: 700; }
    .ae-palette-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; margin-bottom: 5px; border: 1px solid #f3f4f6; border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; color: #374151; transition: all .15s; }
    .ae-palette-item:hover { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }
    .ae-palette-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
    .ae-palette-more { margin-top: 12px; font-size: 12px; color: #6b7280; }
    .ae-palette-more summary { cursor: pointer; padding: 6px 0; }
    .ae-canvas-wrap { flex: 1; overflow: auto; position: relative; background-color: #f8fafc; background-image: radial-gradient(#e2e8f0 1px, transparent 1px); background-size: 24px 24px; }
    .ae-canvas-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 2; text-align: center; color: #64748b; padding: 24px; }
    .ae-canvas-empty p { margin: 4px 0; font-size: 14px; }
    .ae-canvas { position: relative; width: 3000px; height: 2000px; }
    .ae-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
    .ae-edge { stroke: #94a3b8; stroke-width: 2; fill: none; pointer-events: stroke; cursor: pointer; }
    .ae-edge:hover { stroke: #ef4444; stroke-width: 3; }
    .ae-edge-temp { stroke: #4f46e5; stroke-width: 2; stroke-dasharray: 6 4; fill: none; }
    .ae-edge-label { font-size: 11px; fill: #475569; pointer-events: none; font-weight: 600; }
    .ae-node { position: absolute; width: 200px; background: #fff; border: 2px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: grab; user-select: none; transition: box-shadow .15s, border-color .15s; }
    .ae-node:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
    .ae-node.selected { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.18); }
    .ae-node-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; font-weight: 600; border-radius: 10px 10px 0 0; }
    .ae-node-body { padding: 9px 12px 11px; font-size: 12px; color: #64748b; min-height: 20px; word-break: break-word; line-height: 1.45; }
    .ae-node-delete { margin-left: auto; border: none; background: none; color: #cbd5e1; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
    .ae-node-delete:hover { color: #ef4444; }
    .ae-port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #94a3b8; cursor: crosshair; z-index: 5; transition: transform .1s; }
    .ae-port:hover { border-color: #4f46e5; background: #eef2ff; transform: scale(1.15); }
    .ae-port-in { top: -8px; left: 50%; transform: translateX(-50%); }
    .ae-port-out { bottom: -8px; left: 50%; transform: translateX(-50%); }
    .ae-port-out.yes { left: 25%; border-color: #059669; }
    .ae-port-out.no { left: 75%; border-color: #ef4444; }
    .ae-port-out.a { left: 25%; border-color: #7c3aed; }
    .ae-port-out.b { left: 75%; border-color: #db2777; }
    .ae-node-trigger .ae-node-head { background: #eef2ff; color: #3730a3; }
    .ae-node-action_email .ae-node-head { background: #ecfdf5; color: #065f46; }
    .ae-node-delay .ae-node-head { background: #fffbeb; color: #92400e; }
    .ae-node-condition .ae-node-head { background: #f5f3ff; color: #5b21b6; }
    .ae-node-tag_add .ae-node-head, .ae-node-tag_remove .ae-node-head { background: #f0f9ff; color: #075985; }
    .ae-node-action_sms .ae-node-head { background: #fdf4ff; color: #86198f; }
    .ae-node-action_webhook .ae-node-head { background: #f8fafc; color: #334155; }
    .ae-node-action_coupon .ae-node-head { background: #fff7ed; color: #c2410c; }
    .ae-node-split_ab .ae-node-head { background: #faf5ff; color: #7e22ce; }
    .ae-node-exit .ae-node-head { background: #fef2f2; color: #991b1b; }
    .ae-panel { width: 300px; flex-shrink: 0; background: #fff; border-left: 1px solid #e5e7eb; padding: 16px 18px; overflow-y: auto; }
    .ae-panel h2 { font-size: 14px; font-weight: 700; margin: 0 0 14px; color: #111827; }
    .ae-field { margin-bottom: 14px; }
    .ae-field label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 5px; }
    .ae-field input:not([type="checkbox"]):not([type="radio"]), .ae-field select, .ae-field textarea { width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; background: #fff; transition: border-color .15s; }
    .ae-field input:not([type="checkbox"]):not([type="radio"]):focus, .ae-field select:focus, .ae-field textarea:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
    .ae-field textarea { min-height: 100px; resize: vertical; }
    .ae-hint { font-size: 12px; color: #9ca3af; margin-top: 6px; line-height: 1.45; }
    .ae-list { max-width: none; width: 100%; margin: 0; padding: 24px 20px 48px; box-sizing: border-box; }
    .ae-list--narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
    .ae-list--medium,
    .ae-list--wide,
    .ae-list--brief { max-width: none; }
    .ae-list--calendar { width: 100%; max-width: none; box-sizing: border-box; overflow-x: hidden; }
    .ae-catalog .ae-list { max-width: none; margin: 0; padding: 0; }
    .ae-section { margin-bottom: 28px; }
    .ae-section-compact { margin-bottom: 16px; }
    .ae-section-compact .ae-section-head { margin-bottom: 8px; }
    .ae-section-head h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
    .ae-section-head p { font-size: 14px; color: #6b7280; margin: 0; }
    .ae-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
    .ae-template-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; background: #fff; border: 2px solid #e5e7eb; border-radius: 12px; cursor: pointer; text-align: left; transition: all .2s; width: 100%; font: inherit; color: inherit; }
    .ae-template-card:hover { border-color: #4f46e5; background: #fafafe; box-shadow: 0 4px 16px rgba(79,70,229,.1); }
    .ae-template-icon { font-size: 24px; margin-bottom: 4px; }
    .ae-template-card strong { font-size: 15px; color: #111827; }
    .ae-template-card span:last-child { font-size: 13px; color: #6b7280; }

    /* Theme Hub — status + library */
    .ae-theme-status-grid {
      display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px;
    }
    @media (max-width: 720px) {
      .ae-theme-status-grid { grid-template-columns: 1fr; }
    }
    .ae-theme-status-card {
      background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 18px;
      display: flex; flex-direction: column; gap: 8px; min-height: 140px;
    }
    .ae-theme-status-card--draft { border-color: #c7d2fe; background: #fafafe; }
    .ae-theme-status-card__head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
    .ae-theme-status-card__head h3 { margin: 0; font-size: 18px; font-weight: 650; }
    .ae-theme-status-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
    .ae-hub-section-head { margin-bottom: 12px; }
    .ae-hub-section-head h2 { margin: 0 0 4px; font-size: 18px; }
    .ae-theme-library { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
    .ae-theme-card {
      display: flex; flex-direction: column; gap: 10px;
      background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 18px;
    }
    .ae-theme-card.is-recommended { border-color: #c7d2fe; box-shadow: 0 0 0 1px rgba(99,102,241,.08); }
    .ae-theme-card.is-live { border-color: #a7f3d0; }
    .ae-theme-card__icon { font-size: 28px; line-height: 1; }
    .ae-theme-card__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .ae-theme-card__title strong { font-size: 16px; }
    .ae-theme-card__desc { margin: 0; font-size: 13px; color: #6b7280; line-height: 1.45; }
    .ae-theme-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
    .ae-theme-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
    .ae-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .ae-card-stack { display: block; }
    .ae-card-stack > * + * { margin-top: 12px; }
    .ae-card-create { border-style: dashed; background: #fafafa; }
    .ae-create-form { display: flex; gap: 8px; align-items: center; flex: 1; width: 100%; flex-wrap: wrap; }
    .ae-input-flex { flex: 1; min-width: 160px; padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; }
    .ae-select-inline { padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; min-width: 180px; }
    .ae-scenario-card { align-items: center; }
    .ae-scenario-main { flex: 1; min-width: 0; }
    .ae-scenario-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
    .ae-scenario-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #6b7280; flex-wrap: wrap; }
    .ae-meta-pill { background: #eef2ff; color: #4338ca; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 11px; }
    .ae-stats-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
    .ae-stats-compact { margin-top: 8px; gap: 16px; }
    .ae-stat { display: flex; flex-direction: column; }
    .ae-stat-value { font-size: 17px; font-weight: 700; color: #111827; line-height: 1.2; }
    .ae-stat-label { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }
    .ae-stat-active .ae-stat-value { color: #059669; }
    .ae-stat-completed .ae-stat-value { color: #4f46e5; }
    .ae-stat-rate .ae-stat-value { color: #0891b2; }
    .ae-home-metrics-row {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 10px;
    }
    .ae-home-metrics-row .ae-stat-card {
      min-width: 0;
      padding: 14px 16px;
      border-radius: 12px;
      border: 1px solid #e5e7eb;
      background: #fff;
      text-decoration: none;
      color: inherit;
      transition: border-color .15s, box-shadow .15s;
    }
    .ae-home-metrics-row .ae-stat-card:hover {
      border-color: #c7d2fe;
      box-shadow: 0 2px 8px rgba(79, 70, 229, .08);
    }
    .ae-home-metrics-row .ae-stat-card--products .ae-stat-value { color: #059669; }
    .ae-stat-delta {
      display: inline-block;
      font-size: 11px;
      font-weight: 600;
      margin-top: 6px;
      line-height: 1.2;
    }
    .ae-stat-delta--up { color: #059669; }
    .ae-stat-delta--down { color: #dc2626; }
    .ae-stat-delta--neutral { color: #9ca3af; }
    .ae-stat-badge {
      display: inline-block;
      margin-top: 6px;
      font-size: 10px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 999px;
      background: #f3f4f6;
      color: #4b5563;
      line-height: 1.4;
    }
    @media (max-width: 768px) {
      .ae-home-metrics-row {
        display: flex;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 10px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
      }
      .ae-home-metrics-row .ae-stat-card {
        flex: 0 0 148px;
      }
    }
    .ae-home-today-list {
      list-style: none;
      margin: 12px 0 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .ae-home-today-item {
      flex-direction: row !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 12px;
      text-decoration: none;
      color: inherit;
    }
    .ae-home-quick-links-grid {
      margin-top: 12px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }
    .ae-home-quick-link { position: relative; text-decoration: none; color: inherit; }
    .ae-home-quick-link .ae-stat-badge {
      position: absolute;
      top: 12px;
      right: 12px;
      margin-top: 0;
    }
    @media (max-width: 768px) {
      .ae-home-quick-links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    .ae-scenario-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .ae-flash { max-width: none; width: 100%; margin: 12px 0 0; padding: 12px 18px; border-radius: 10px; background: #fee2e2; color: #991b1b; font-size: 13px; box-sizing: border-box; }
    .ae-toast { position: fixed; bottom: 20px; right: 20px; background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; opacity: 0; transition: opacity .25s; z-index: 60; max-width: 320px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
    .ae-toast.visible { opacity: 1; }
    .ae-agent { background: #fff; border-top: 1px solid #e5e7eb; height: 200px; display: flex; flex-direction: column; flex-shrink: 0; }
    .ae-agent.ae-agent-collapsed { height: 44px; overflow: hidden; }
    .ae-agent-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid #f3f4f6; }
    .ae-agent-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .ae-agent-badge { background: #4f46e5; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
    .ae-agent-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 10px 8px; }
    .ae-agent-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
    .ae-agent-chip { font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid #e0e7ff; background: #f5f3ff; color: #4338ca; cursor: pointer; transition: background .15s; }
    .ae-agent-chip:hover { background: #eef2ff; border-color: #c7d2fe; }
    .ae-agent-messages { flex: 1; overflow-y: auto; font-size: 13px; line-height: 1.5; padding: 4px 0; min-height: 0; }
    .ae-agent-msg { margin-bottom: 8px; padding: 8px 12px; border-radius: 10px; }
    .ae-agent-msg-user { background: #eef2ff; margin-left: 24px; }
    .ae-agent-msg-assistant { background: #f8fafc; border: 1px solid #e5e7eb; margin-right: 24px; }
    .ae-agent-msg-system { display: none; }
    .ae-agent-msg-body { display: block; line-height: 1.55; font-size: 13px; color: #334155; word-break: break-word; }
    .ae-agent-msg-body p { margin: 0 0 8px; }
    .ae-agent-msg-body p:last-child { margin-bottom: 0; }
    .ae-agent-msg-body ul,
    .ae-agent-msg-body ol { margin: 6px 0 10px; padding-left: 1.25rem; }
    .ae-agent-msg-body li { margin-bottom: 4px; }
    .ae-agent-msg-body li:last-child { margin-bottom: 0; }
    .ae-agent-msg-body strong { font-weight: 600; color: #1e293b; }
    .ae-agent-msg-body em { font-style: italic; }
    .ae-agent-msg-body code { font-family: ui-monospace, monospace; font-size: 12px; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
    .ae-agent-msg-body .ae-agent-md-pre { margin: 8px 0; padding: 10px 12px; background: #1e293b; color: #f8fafc; border-radius: 8px; overflow-x: auto; font-size: 12px; line-height: 1.45; }
    .ae-agent-msg-body .ae-agent-md-pre code { background: transparent; padding: 0; color: inherit; }
    .ae-agent-msg-body .ae-agent-md-h { margin: 10px 0 6px; font-weight: 600; color: #1e293b; }
    .ae-agent-msg-body h3.ae-agent-md-h { font-size: 14px; }
    .ae-agent-msg-body h4.ae-agent-md-h { font-size: 13px; }
    .ae-agent-charts { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
    .ae-agent-chart { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
    .ae-agent-chart-title { font-size: 12px; font-weight: 600; color: #1e293b; margin-bottom: 8px; }
    .ae-agent-chart-canvas { position: relative; height: 180px; }
    .ae-agent-chart-summary { margin-top: 8px; font-size: 11px; color: #64748b; }
    .ae-agent-input-row { display: flex; gap: 10px; align-items: flex-end; }
    .ae-agent-input-row textarea { flex: 1; resize: none; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 13px; font-family: inherit; }
    .ae-agent-input-row textarea:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
    @media (max-width: 768px) {
      .ae-layout { flex-direction: column; height: auto; min-height: 400px; }
      .ae-palette { width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb; max-height: 180px; }
      .ae-panel { width: 100%; border-left: none; border-top: 1px solid #e5e7eb; max-height: 200px; }
    }


    .docs-body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #111827; background: #f8fafc; margin: 0; }
    .docs-header { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 40; }
    .docs-header-inner { max-width: 920px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .docs-logo { font-weight: 700; font-size: 18px; color: #4f46e5; text-decoration: none; }
    .docs-nav a { font-size: 14px; color: #4b5563; text-decoration: none; margin-left: 16px; }
    .docs-nav a:hover { color: #4f46e5; }
    .docs-main { max-width: 920px; margin: 0 auto; padding: 32px 20px 64px; }
    .docs-hero { background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%); border: 1px solid #e0e7ff; border-radius: 16px; padding: 32px; margin-bottom: 32px; }
    .docs-hero h1 { font-size: 28px; font-weight: 700; margin: 0 0 8px; color: #312e81; }
    .docs-hero p { font-size: 16px; color: #4338ca; margin: 0; line-height: 1.6; }
    .docs-toc { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px 24px; margin-bottom: 32px; }
    .docs-toc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; margin: 0 0 12px; }
    .docs-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
    .docs-toc li { margin-bottom: 6px; font-size: 14px; }
    .docs-toc a { color: #4f46e5; text-decoration: none; }
    .docs-toc a:hover { text-decoration: underline; }
    .docs-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 28px 32px; margin-bottom: 20px; scroll-margin-top: 80px; }
    .docs-section h2 { font-size: 22px; font-weight: 700; margin: 0 0 16px; color: #111827; }
    .docs-section h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: #374151; }
    .docs-section p, .docs-section li { font-size: 15px; line-height: 1.7; color: #374151; }
    .docs-section ul, .docs-section ol { margin: 8px 0 16px; padding-left: 22px; }
    .docs-section li { margin-bottom: 6px; }
    .docs-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0 16px; }
    .docs-table th, .docs-table td { border: 1px solid #e5e7eb; padding: 10px 12px; text-align: left; vertical-align: top; }
    .docs-table th { background: #f9fafb; font-weight: 600; color: #374151; }
    .docs-table code { font-size: 13px; }
    .docs-callout { background: #eff6ff; border-left: 4px solid #3b82f6; padding: 14px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 14px; color: #1e40af; }
    .docs-callout-tip { background: #ecfdf5; border-left-color: #059669; color: #065f46; }
    .docs-callout-warn { background: #fffbeb; border-left-color: #d97706; color: #92400e; }
    .docs-flow { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.8; color: #1f2937; overflow-x: auto; white-space: pre; margin: 12px 0; }
    .docs-btn { display: inline-block; padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
    .docs-btn-primary { background: #4f46e5; color: #fff; }
    .docs-btn-primary:hover { background: #4338ca; color: #fff; }
    .docs-btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; margin-left: 8px; }
    .docs-footer { max-width: 920px; margin: 0 auto; padding: 24px 20px 40px; font-size: 13px; color: #9ca3af; text-align: center; border-top: 1px solid #e5e7eb; }
    code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
    @media (max-width: 640px) { .docs-toc ol { columns: 1; } .docs-section { padding: 20px; } }

/* Theme editor (ae-te-* aliases) */

    :root {
      --ae-accent: #5850ec;
      --ae-accent-hover: #4f46e5;
      --ae-accent-soft: #eef2ff;
      --ae-accent-border: #c7d2fe;
      --ae-surface: #ffffff;
      --ae-canvas: #f9f9ff;
      --ae-border: #e8e8f5;
      --ae-text: #111827;
      --ae-muted: #6b7280;
      --ae-radius: 8px;
      --ae-copilot-width: 320px;
      --ae-te-border: var(--ae-border);
      --ae-te-bg: #f9fafb;
      --ae-te-accent: var(--ae-accent);
      --ae-te-text: var(--ae-text);
      --ae-te-muted: var(--ae-muted);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      color: var(--ae-te-text);
      background: var(--ae-te-bg);
    }
    .ae-te-app { display: flex; flex-direction: column; height: 100vh; position: relative; }
    .ae-te-topbar {
      display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
      height: 52px; padding: 0 16px; background: var(--ae-surface);
      border-bottom: 1px solid var(--ae-te-border); flex-shrink: 0; gap: 12px;
    }
    .ae-te-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .ae-te-topbar-center { display: flex; justify-content: center; min-width: 0; }
    .ae-te-topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
    .ae-te-history-controls { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
    .ae-te-history-btn {
      min-width: 36px; min-height: 36px; padding: 6px 8px; display: inline-flex; align-items: center; gap: 4px;
    }
    .ae-te-history-btn:disabled { opacity: 0.4; cursor: not-allowed; }
    .ae-te-history-icon { font-size: 16px; line-height: 1; }
    .ae-te-history-label { font-size: 12px; }
    .ae-te-history-drawer {
      position: fixed; top: 52px; right: 0; width: min(360px, 100vw); bottom: 0; z-index: 80;
      background: #fff; border-left: 1px solid var(--ae-te-border);
      display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
    }
    .ae-te-history-btn.is-active { background: var(--ae-accent-soft); border-color: var(--ae-accent-border); color: var(--ae-accent); }
    .ae-te-history-drawer.hidden { display: none !important; }
    .ae-te-history-drawer-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 14px; border-bottom: 1px solid var(--ae-te-border); flex-shrink: 0;
    }
    .ae-te-history-drawer-title { margin: 0; font-size: 15px; font-weight: 600; }
    .ae-te-history-drawer-body { flex: 1; overflow: auto; padding: 8px 10px 16px; }
    .ae-te-history-drawer-footer {
      padding: 10px 14px; border-top: 1px solid var(--ae-te-border); flex-shrink: 0;
    }
    .ae-te-history-empty { color: var(--ae-te-muted); font-size: 13px; padding: 12px 6px; }
    .ae-te-history-day {
      font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
      color: var(--ae-te-muted); padding: 10px 6px 4px;
    }
    .ae-te-history-row {
      display: block; width: 100%; text-align: left; border: 1px solid transparent;
      background: transparent; border-radius: 8px; padding: 8px 10px; margin-bottom: 4px;
    }
    .ae-te-history-row:hover, .ae-te-history-row:focus { background: var(--ae-accent-soft); border-color: var(--ae-te-border); }
    .ae-te-history-row.is-head { border-color: var(--ae-te-accent); background: var(--ae-accent-soft); }
    .ae-te-history-row-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; color: var(--ae-te-muted); }
    .ae-te-history-row-label { font-size: 13px; font-weight: 500; margin-top: 2px; color: var(--ae-te-text); }
    .ae-te-history-row-diff { font-size: 11px; color: var(--ae-te-muted); margin-top: 4px; }
    .ae-te-history-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
    .ae-te-history-row-actions .ae-btn { min-height: 36px; min-width: 44px; }
    .ae-te-history-row.is-previewing { border-color: var(--ae-te-accent); box-shadow: inset 0 0 0 1px var(--ae-te-accent); }
    .ae-te-history-preview-banner {
      display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
      padding: 8px 12px; margin: 0 0 8px; border-radius: 10px;
      background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; font-size: 13px;
    }
    .ae-te-history-preview-banner.hidden { display: none !important; }
    .ae-te-history-preview-note { font-style: normal; color: #64748b; margin-left: 6px; font-size: 12px; }
    .ae-theme-milestone-hint { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
    .ae-te-history-badge {
      font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px;
      background: #e0e7ff; color: #3730a3;
    }
    .ae-te-history-badge--ai { background: #fce7f3; color: #9d174d; }
    .ae-te-history-here { font-size: 10px; font-weight: 600; color: var(--ae-te-accent); }
    .ae-te-history-overlay {
      position: absolute; inset: 52px 0 0 0; z-index: 45;
      background: rgba(15, 23, 42, 0.28); display: flex; align-items: center; justify-content: center;
    }
    .ae-te-history-overlay.hidden { display: none !important; }
    .ae-te-history-overlay-card {
      display: inline-flex; align-items: center; gap: 10px; background: #fff;
      border-radius: 10px; padding: 12px 16px; font-size: 13px;
      box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    }
    .ae-te-history-spinner {
      width: 16px; height: 16px; border-radius: 50%;
      border: 2px solid var(--ae-te-border); border-top-color: var(--ae-te-accent);
      animation: ae-te-spin 0.7s linear infinite;
    }
    @keyframes ae-te-spin { to { transform: rotate(360deg); } }
    .ae-te-app.is-history-applying .ae-te-sidebar { pointer-events: none; opacity: 0.55; }
    @media (max-width: 720px) {
      .ae-te-history-label { display: none; }
      .ae-te-history-label--desktop { display: none; }
      .ae-te-history-controls { gap: 0; order: -1; }
      .ae-te-history-btn {
        min-width: 44px; min-height: 44px; padding: 8px;
        display: inline-flex; align-items: center; justify-content: center;
      }
      .ae-te-history-drawer {
        top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: min(72vh, 560px);
        border-left: 0; border-top: 1px solid var(--ae-te-border); border-radius: 16px 16px 0 0;
        max-width: 100vw; z-index: 90;
      }
      .ae-te-history-row-actions .ae-btn { flex: 1 1 auto; }
      .ae-te-topbar {
        overflow-x: hidden;
        grid-template-columns: minmax(0, 1fr) auto;
        height: auto; min-height: 52px; padding: 6px 8px; gap: 6px;
      }
      .ae-te-topbar-center { display: none; }
      .ae-te-topbar-right { gap: 4px; flex-wrap: nowrap; }
      .ae-te-design-toggle-label, .ae-te-topbar .ae-te-design-mode-btn span:not(.ae-te-design-toggle-icon) { display: none; }
      .ae-body.ae-te-body { overflow-x: hidden; }
    }
    .ae-te-topbar-title { font-weight: 600; font-size: 14px; white-space: nowrap; }
    .ae-te-topbar-meta { color: var(--ae-te-muted); font-size: 13px; }
    .ae-te-topbar a { color: var(--ae-te-accent); text-decoration: none; font-size: 13px; }
    .ae-te-badge-draft {
      font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
      background: #fef3c7; color: #92400e; white-space: nowrap;
    }
    .ae-te-template-select {
      font-size: 13px; padding: 4px 8px; border: 1px solid var(--ae-te-border);
      border-radius: 6px; background: #fff; color: var(--ae-te-text);
    }
    .ae-te-topbar-actions { position: relative; }
    .ae-te-menu-trigger { min-width: 32px; font-size: 16px; line-height: 1; }
    .ae-te-menu-list {
      position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
      list-style: none; margin: 0; padding: 6px; min-width: 180px;
      background: #fff; border: 1px solid var(--ae-te-border); border-radius: 8px;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    }
    .ae-te-menu-list.hidden { display: none !important; }
    .ae-te-menu-list a {
      display: block; padding: 8px 10px; border-radius: 6px; font-size: 13px;
      color: var(--ae-te-text); text-decoration: none;
    }
    .ae-te-menu-list a:hover { background: var(--ae-accent-soft); color: var(--ae-accent-hover); }
    .ae-te-workspace { display: flex; flex: 1; min-height: 0; height: calc(100vh - 52px); overflow: hidden; }
    .ae-te-stage {
      display: flex; flex: 1; min-width: 0; min-height: 0; background: var(--ae-canvas);
    }
    .ae-te-sidebar {
      width: 320px; flex-shrink: 0; background: #fff;
      border-right: 1px solid var(--ae-te-border);
      display: flex; flex-direction: column; min-height: 0;
    }
    .ae-te-sidebar-tabs {
      display: flex; gap: 4px; padding: 10px 10px 0; flex-shrink: 0;
      border-bottom: 1px solid var(--ae-te-border);
    }
    .ae-te-sidebar-tab {
      flex: 1; padding: 8px 10px; border: none; border-radius: 8px 8px 0 0;
      background: transparent; font-size: 12px; font-weight: 600; color: var(--ae-te-muted);
      cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
    }
    .ae-te-sidebar-tab.is-active {
      color: var(--ae-accent); background: var(--ae-accent-soft); border-bottom-color: var(--ae-accent);
    }
    .ae-te-sidebar-panel { display: none; flex: 1; min-height: 0; flex-direction: column; }
    .ae-te-sidebar-panel.is-active { display: flex; }
    .ae-te-sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
    .ae-te-sidebar-sticky-add {
      display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--ae-te-border);
      background: #fff; flex-shrink: 0;
    }
    .ae-te-add-section-select { flex: 1; font-size: 13px; padding: 7px 9px; border: 1px solid var(--ae-te-border); border-radius: 6px; }
    .ae-te-layout-group { margin-bottom: 8px; border: 1px solid var(--ae-te-border); border-radius: 8px; overflow: hidden; }
    .ae-te-layout-group-header {
      display: flex; align-items: center; justify-content: space-between; width: 100%;
      padding: 8px 12px; border: none; background: var(--ae-te-bg); font-size: 12px;
      font-weight: 600; color: var(--ae-te-text); cursor: pointer; text-align: left;
    }
    .ae-te-layout-group.is-open .ae-te-layout-group-header .ae-te-section-caret { transform: rotate(90deg); }
    .ae-te-layout-group-body { display: none; padding: 4px 8px 8px; }
    .ae-te-layout-group.is-open .ae-te-layout-group-body { display: block; }
    .ae-te-settings-group-title { margin-top: 8px; }
    .ae-te-empty-install-secondary { margin-top: 8px; }
    .ae-te-empty-template {
      margin: 8px; padding: 14px; border: 1px dashed var(--ae-te-border, #e5e7eb); border-radius: 10px;
      background: #f8fafc; display: flex; flex-direction: column; gap: 8px;
    }
    .ae-te-empty-template p { margin: 0; font-size: 12px; color: var(--ae-te-muted, #64748b); line-height: 1.4; }
    .ae-te-sidebar-subheading {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--ae-te-muted);
      padding: 8px 12px 4px;
    }
    .ae-te-sidebar-heading {
      font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
      color: var(--ae-te-muted); margin: 16px 8px 8px; font-weight: 600;
    }
    .ae-te-preview {
      flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0;
      padding: 12px; gap: 8px;
    }
    .ae-te-preview-toolbar {
      display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; flex-wrap: wrap;
    }
    .ae-te-preview-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .ae-te-design-tools { display: inline-flex; align-items: center; gap: 4px; }
    .ae-te-design-tool {
      display: inline-flex; align-items: center; justify-content: center;
      width: 30px; height: 30px; padding: 0; border-radius: 6px;
      border: 1px solid var(--ae-te-border); background: #fff; color: var(--ae-te-muted); cursor: pointer;
    }
    .ae-te-design-tool.is-active {
      color: var(--ae-accent); border-color: var(--ae-accent-border); background: var(--ae-accent-soft);
    }
    .ae-te-viewport-switch {
      display: inline-flex; border: 1px solid var(--ae-te-border); border-radius: 8px; overflow: hidden; background: #fff;
    }
    .ae-te-viewport-btn {
      border: none; background: transparent; padding: 5px 10px; font-size: 11px; font-weight: 600;
      color: var(--ae-te-muted); cursor: pointer;
    }
    .ae-te-viewport-btn.is-active { background: var(--ae-accent-soft); color: var(--ae-accent); }
    .ae-te-preview-viewport { flex: 1; min-height: 0; display: flex; justify-content: center; min-width: 0; }
    .ae-te-preview-viewport.is-mobile .ae-te-preview-frame {
      width: 100%; max-width: 390px; box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15); border-radius: 12px; overflow: hidden;
    }
    .ae-te-preview-viewport.is-mobile .ae-te-preview-frame iframe { border-radius: 12px; }
    .ae-te-design-tool--ghost { background: transparent; }
    .ae-te-preview-frame {
      position: relative; flex: 1; min-height: 0; display: flex; min-width: 0;
    }
    .ae-te-preview-frame iframe { flex: 1; min-height: 0; }
    .ae-te-annotate-layer {
      position: absolute; inset: 0; z-index: 3; cursor: crosshair; touch-action: none;
    }
    .ae-te-annotate-layer[hidden] { display: none !important; }
    .ae-te-annotate-svg { width: 100%; height: 100%; display: block; pointer-events: none; }
    .ae-te-annotate-rect {
      fill: rgba(79, 70, 229, 0.08); stroke: var(--ae-accent); stroke-width: 2; stroke-dasharray: 6 4;
    }
    .ae-te-annotate-rect.is-pending { stroke: var(--ae-accent-hover); animation: ae-te-annotate-pulse 1s ease-in-out infinite; }
    @keyframes ae-te-annotate-pulse {
      0%, 100% { stroke-opacity: 1; }
      50% { stroke-opacity: 0.45; }
    }
    .ae-te-preview-hint {
      font-size: 12px; color: var(--ae-te-muted);
    }
    .ae-te-app:not(.is-design-mode) .ae-te-preview-hint { display: none; }
    .ae-te-selection-pill {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 12px; color: var(--ae-accent-hover); background: var(--ae-accent-soft); border: 1px solid var(--ae-accent-border);
      border-radius: 999px; padding: 4px 10px; max-width: 60%;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
    }
    .ae-te-selection-pill[hidden] { display: none !important; }
    .ae-te-preview iframe {
      flex: 1; border: 1px solid var(--ae-te-border); border-radius: 6px; background: #fff; width: 100%;
      min-height: 0;
    }
    .ae-te-design-toggle {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 6px;
      border: 1px solid var(--ae-te-border); background: #fff; color: var(--ae-te-muted); cursor: pointer;
    }
    .ae-te-design-toggle.is-active {
      color: var(--ae-accent); border-color: var(--ae-accent-border); background: var(--ae-accent-soft);
    }
    .ae-te-design-toggle-icon { font-size: 10px; line-height: 1; }
    .ae-te-design-shell .ae-copilot-drawer {
      position: relative; left: auto; right: auto; bottom: auto; top: auto;
      flex: 0 0 var(--ae-copilot-width, 400px); width: var(--ae-copilot-width, 400px);
      min-width: var(--ae-copilot-width, 400px); max-height: none; height: 100%;
      border-top: none; border-left: 1px solid var(--ae-te-border); box-shadow: none;
      z-index: 2;
    }
    .ae-te-design-shell .ae-copilot-drawer.is-collapsed {
      flex: 0 0 44px; width: 44px; min-width: 44px; height: 100% !important;
    }
    .ae-te-design-shell .ae-copilot-drawer { position: relative; padding-left: 8px; }
    .ae-te-design-shell .ae-copilot-resize-handle {
      display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
      height: auto; cursor: ew-resize; border-bottom: none; border-right: 1px solid var(--ae-te-border);
      background: linear-gradient(to right, transparent, #f3f4f6); z-index: 3;
    }
    .ae-te-design-shell .ae-copilot-resize-handle::after {
      width: 4px; height: 40px; left: 50%; top: 50%;
    }
    body.ae-copilot-resizing-width { cursor: ew-resize; user-select: none; }
    body.ae-copilot-resizing-width .ae-te-design-shell .ae-copilot-drawer { transition: none; }
    .ae-te-design-shell.ae-copilot-side-layout .ae-copilot-drawer.is-side,
    .ae-te-design-shell .ae-copilot-drawer.is-side {
      flex: 0 0 var(--ae-copilot-width, 400px);
      width: var(--ae-copilot-width, 400px);
      min-width: var(--ae-copilot-width, 400px);
    }
    .ae-te-body { overflow: hidden; }
    .ae-te-section {
      border: 1px solid var(--ae-te-border); border-radius: 6px; margin-bottom: 8px; background: #fff;
    }
    .ae-te-section.is-selected {
      border-color: var(--ae-accent); box-shadow: 0 0 0 1px var(--ae-accent);
      background: var(--ae-accent-soft); border-left: 3px solid var(--ae-accent);
    }
    .ae-te-section.is-dragging { opacity: 0.4; }
    .ae-te-section-header {
      display: flex; align-items: center; gap: 8px; padding: 10px 12px;
      cursor: pointer; user-select: none; font-size: 14px;
    }
    .ae-te-section-header:hover { background: var(--ae-te-bg); }
    .ae-te-drag-handle { cursor: grab; color: var(--ae-te-muted); font-size: 14px; user-select: none; }
    .ae-te-section-header[draggable="true"] { cursor: grab; }
    .ae-te-section.is-dragging { opacity: 0.55; }
    .ae-te-section-name { flex: 1; font-weight: 500; }
    .ae-te-section-caret { color: var(--ae-te-muted); transition: transform 0.15s; }
    .ae-te-section.is-open .ae-te-section-caret { transform: rotate(90deg); }
    .ae-te-section-body { display: none; padding: 4px 12px 12px; border-top: 1px solid var(--ae-te-border); }
    .ae-te-section.is-open .ae-te-section-body { display: block; }
    .ae-te-field { margin: 10px 0; }
    .ae-te-field-hint { margin: 4px 0 0; font-size: 11px; color: var(--ae-muted); }
    .ae-te-field label { display: block; font-size: 12px; color: var(--ae-te-muted); margin-bottom: 4px; }
    .ae-te-field input[type="text"], .ae-te-field input[type="url"], .ae-te-field textarea, .ae-te-field select {
      width: 100%; padding: 7px 9px; border: 1px solid var(--ae-te-border); border-radius: 4px;
      font-size: 13px; font-family: inherit;
    }
    .ae-te-field input[type="color"] { width: 48px; height: 32px; padding: 2px; border: 1px solid var(--ae-te-border); border-radius: 4px; }
    .ae-te-field input[type="range"] { width: 100%; }
    .ae-te-field-inline { display: flex; align-items: center; gap: 8px; }
    .ae-te-field-inline label { margin: 0; }
    .ae-te-range-value { font-size: 12px; color: var(--ae-te-muted); min-width: 48px; text-align: right; }
    .ae-te-block {
      border: 1px solid var(--ae-te-border); border-radius: 4px; margin: 8px 0; padding: 8px 10px; background: var(--ae-te-bg);
    }
    .ae-te-block-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
    .ae-te-empty {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      height: 100vh; gap: 16px;
    }
    .ae-te-button {
      display: inline-block; background: var(--ae-te-accent); color: #fff; border: none;
      padding: 10px 20px; border-radius: 6px; font-size: 14px; cursor: pointer; text-decoration: none;
    }
    .ae-te-button--ghost { background: transparent; color: var(--ae-te-accent); border: 1px dashed var(--ae-te-accent); width: 100%; }
    .ae-te-status { font-size: 12px; color: var(--ae-te-muted); }
    .ae-te-status.is-saving { color: #d97706; }
    .ae-te-status.is-saved { color: #059669; }
    .ae-te-status.is-error { color: #dc2626; }
    .ae-te-image-field { align-items: flex-start; flex-wrap: wrap; }
    .ae-te-image-url-input { flex: 1; min-width: 120px; }
    .ae-te-image-thumb {
      width: 48px; height: 48px; object-fit: cover; border-radius: 6px;
      border: 1px solid var(--ae-te-border); flex-shrink: 0;
    }
    .ae-te-asset-dialog {
      border: 1px solid var(--ae-te-border); border-radius: 12px; padding: 16px;
      max-width: 520px; width: calc(100vw - 32px);
    }
    .ae-te-asset-dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
    .ae-te-asset-dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
    .ae-te-asset-dialog-title { margin: 0; font-size: 15px; font-weight: 600; }
    .ae-te-asset-preview { margin-bottom: 12px; border-radius: 8px; overflow: hidden; border: 1px solid var(--ae-te-border); }
    .ae-te-asset-preview img { display: block; width: 100%; max-height: 160px; object-fit: contain; background: var(--ae-te-bg); }
    .ae-te-asset-dropzone {
      border: 1px dashed var(--ae-accent-border); border-radius: 8px; padding: 12px;
      text-align: center; margin-bottom: 12px; background: var(--ae-accent-soft);
    }
    .ae-te-asset-dropzone p { margin: 0 0 8px; font-size: 12px; color: var(--ae-te-muted); }
    .ae-te-asset-dropzone.is-dragover { border-color: var(--ae-accent); background: #e0e7ff; }
    .ae-te-asset-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
      max-height: 280px; overflow-y: auto;
    }
    .ae-te-asset-grid-item {
      border: 1px solid var(--ae-te-border); border-radius: 8px; padding: 4px;
      cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s;
    }
    .ae-te-asset-grid-item:hover, .ae-te-asset-grid-item.is-selected {
      border-color: var(--ae-accent); box-shadow: 0 0 0 1px var(--ae-accent);
    }
    .ae-te-asset-grid-item img {
      width: 100%; height: 72px; object-fit: cover; border-radius: 4px; display: block;
    }
    .ae-agent-conversation {
      flex: 1; min-height: 0; display: flex; flex-direction: column;
      position: relative; overflow: hidden;
    }
    .ae-copilot-empty-state {
      position: absolute; inset: 0; z-index: 1;
      display: flex; flex-direction: column; align-items: flex-start;
      justify-content: center; gap: 8px; padding: 16px 4px;
      pointer-events: none;
    }
    .ae-copilot-empty-state:not([hidden]) { pointer-events: auto; }
    .ae-agent-conversation:has(.ae-agent-messages:not(:empty)) .ae-copilot-empty-state {
      display: none !important;
    }
    .ae-copilot-empty-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ae-text); }
    .ae-copilot-empty-hint { margin: 0; font-size: 13px; color: var(--ae-muted); line-height: 1.5; }
    .ae-copilot-empty-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
    .ae-copilot-section-chip { margin-top: 4px; }
    .ae-copilot-shortcut-hint {
      display: block; font-size: 11px; color: #94a3b8; margin-top: 2px;
    }

/* Studio admin shell */

html:has(.ae-shell-body) { height: 100%; }
.ae-shell-body {
  height: 100%;
  overflow: hidden;
  --ae-sidebar-width: 252px;
  --ae-shell-header-height: 84px;
  --ae-shell-header-offset: 0px;
  --ae-unsaved-bar-height: 52px;
}
.ae-shell-body:has(.ae-unsaved-bar.is-visible) {
  --ae-shell-header-offset: var(--ae-unsaved-bar-height);
}
.ae-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Native checkboxes in Studio — never style them like text inputs */
.ae-shell input[type="checkbox"]:not(.ae-segment-input),
.ae-product-editor-full input[type="checkbox"]:not(.ae-segment-input) {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  padding: 0 !important;
  margin: 0;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px;
  background: #fff !important;
  accent-color: #38128A;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none !important;
  color: inherit;
}
.ae-shell input[type="radio"]:not(.ae-segment-input),
.ae-product-editor-full input[type="radio"]:not(.ae-segment-input) {
  appearance: auto;
  -webkit-appearance: radio;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  padding: 0 !important;
  margin: 0;
  accent-color: #38128A;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none !important;
  background: transparent !important;
}
.ae-sidebar {
  width: var(--ae-sidebar-width);
  flex-shrink: 0;
  background: #f6f6fb;
  border-right: 1px solid #e8e8f5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 24;
}
.ae-sidebar-brand {
  padding: 0;
  border-bottom: 1px solid #e8e8f5;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  padding-top: calc(var(--ae-shell-header-offset) + var(--ae-shell-header-height));
}
.ae-sidebar-brand-header {
  position: fixed;
  top: var(--ae-shell-header-offset);
  left: 0;
  width: var(--ae-sidebar-width);
  height: var(--ae-shell-header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 30;
  background: linear-gradient(135deg, #c7d2fe 0%, #ddd6fe 42%, #ede9fe 100%);
  border-bottom: 1px solid #e5e7eb;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.55),
    0 2px 12px rgba(88, 80, 236, 0.06);
  transition: top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.ae-sidebar-logo {
  display: block;
  font-weight: 700;
  font-size: 17px;
  color: #111827;
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.ae-sidebar-logo:hover { color: #111827; }
.ae-sidebar-logo-accent { color: #4f46e5; }
.ae-store-switcher {
  position: relative; width: 100%; padding: 12px 16px 14px;
}
.ae-store-switcher-kicker {
  margin: 0 0 6px; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #9ca3af;
}
.ae-store-switcher-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border-radius: 8px; background: transparent;
  cursor: pointer; text-align: left;
  transition: background .15s ease;
}
.ae-store-switcher-trigger:hover { background: #f9fafb; }
.ae-store-switcher.is-static .ae-store-switcher-trigger { cursor: default; }
.ae-store-switcher.is-static .ae-store-switcher-trigger:hover { background: transparent; }
.ae-store-switcher-icon {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px;
  background: #f3f4f6; color: #6b7280;
}
.ae-store-switcher-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: #374151;
  line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ae-store-switcher-chevron {
  display: flex; color: #9ca3af; flex-shrink: 0;
}
.ae-store-switcher-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1); padding: 6px; max-height: 240px; overflow-y: auto;
}
.ae-store-switcher-menu.hidden { display: none; }
.ae-store-switcher-menu-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: #9ca3af; padding: 6px 8px 4px; margin: 0;
}
.ae-store-switcher-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 8px; text-decoration: none; color: #374151; font-size: 13px;
}
.ae-store-switcher-item:hover { background: #f3f4f6; color: #111827; }
.ae-store-switcher-item-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; background: #f3f4f6;
}
.ae-store-switcher-item-icon img { display: block; width: 14px; height: 14px; }
.ae-store-switcher-item-name {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ae-store-switcher-credits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 8px 0;
  padding: 2px 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: #94a3b8;
  cursor: pointer;
  appearance: none;
}
.ae-store-switcher-credits:hover { color: #64748b; }
.ae-store-switcher-credits.is-low { color: #d97706; }
.ae-store-switcher-credits.is-empty { color: #dc2626; font-weight: 600; }
.ae-store-switcher-credits-icon { font-size: 11px; line-height: 1; }
.ae-store-switcher-credits-unit { font-weight: 400; color: inherit; opacity: 0.85; }
.ae-store-switcher-credits-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.ae-store-switcher-credits:hover .ae-store-switcher-credits-cta {
  background: #e2e8f0;
  color: #334155;
}
.ae-store-switcher-credits.is-empty .ae-store-switcher-credits-cta {
  background: #fee2e2;
  color: #b91c1c;
}
.ae-sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.ae-sidebar-section {
  margin-bottom: 4px; padding-top: 12px;
}
.ae-sidebar-section:first-child { padding-top: 4px; }
.ae-sidebar-section + .ae-sidebar-section {
  border-top: 1px solid #e5e7eb; margin-top: 4px;
}
.ae-sidebar-section-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 6px;
  margin-bottom: 2px;
}
.ae-sidebar-section-toggle:hover { background: #f3f4f6; }
.ae-sidebar-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #6b7280; font-weight: 600; padding: 0; margin: 0;
}
.ae-sidebar-section-chevron {
  display: flex; color: #9ca3af; transition: transform .15s ease; flex-shrink: 0;
}
.ae-sidebar-section.is-collapsed .ae-sidebar-section-chevron { transform: rotate(-90deg); }
.ae-sidebar-section.is-collapsed .ae-sidebar-section-items { display: none; }
.ae-sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.ae-sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 8px; border-radius: 8px; font-size: 13.5px; line-height: 1.3;
  color: #374151; text-decoration: none; margin-bottom: 1px;
  border-left: 3px solid transparent;
}
.ae-sidebar-icon {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex-shrink: 0; color: #9ca3af;
}
.ae-sidebar-link-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-sidebar-link:hover { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ae-sidebar-link:hover .ae-sidebar-icon { color: #6b7280; }
.ae-sidebar-link.is-active {
  background: #fff; color: #4338ca; font-weight: 600;
  border-left-color: #4f46e5; box-shadow: 0 1px 3px rgba(79,70,229,.08);
}
.ae-sidebar-link.is-active .ae-sidebar-icon { color: #4f46e5; }
.ae-sidebar-link.is-legacy { color: #9ca3af; }
.ae-sidebar-link.is-legacy .ae-sidebar-icon { opacity: 0.6; }
.ae-sidebar-legacy-badge {
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: #9ca3af; background: #f3f4f6; padding: 2px 5px; border-radius: 4px; flex-shrink: 0;
}
.ae-sidebar-advanced { margin-top: 4px; }
.ae-sidebar-advanced-details { margin: 0; }
.ae-sidebar-advanced-summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 6px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: #9ca3af;
}
.ae-sidebar-advanced-summary::-webkit-details-marker { display: none; }
.ae-sidebar-advanced-summary::after {
  content: "▾"; float: right; font-size: 10px; opacity: 0.7;
}
.ae-sidebar-advanced-details:not([open]) .ae-sidebar-advanced-summary::after { content: "▸"; }
.ae-sidebar-advanced-items { margin-top: 2px; padding-left: 4px; }
.ae-topbar-nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid #e5e7eb; border-radius: 8px;
  background: #fff; color: #374151; cursor: pointer; flex-shrink: 0;
}
.ae-home-newsfeed-list {
  padding: 0; margin: 0; list-style: none;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  background: #fff;
}
.ae-home-newsfeed-item + .ae-home-newsfeed-item { border-top: 1px solid #f3f4f6; }
.ae-home-newsfeed-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 10px; text-decoration: none; color: inherit;
  min-height: 28px;
}
.ae-home-newsfeed-link:hover { background: #f9fafb; }
.ae-home-newsfeed-emoji {
  flex: 0 0 auto;
  width: 1.35em;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}
.ae-home-newsfeed-main { display: flex; flex-direction: column; gap: 0; min-width: 0; flex: 1 1 auto; }
.ae-home-newsfeed-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ae-home-newsfeed-meta {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 11px; line-height: 1.2; color: #6b7280;
}
.ae-home-newsfeed-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ae-home-newsfeed-badge.ae-badge {
  padding: 0 5px; font-size: 10px; line-height: 1.4; border-radius: 999px;
  text-transform: none;
}
.ae-home-tonight-banner { align-items: center; }
.ae-product-power-details { margin-top: 4px; }
.ae-product-power-summary {
  cursor: pointer; font-weight: 600; font-size: 13px; color: #374151; padding: 8px 0;
}
.ae-sidebar-footer {
  padding: 14px 16px; border-top: 1px solid #e5e7eb; background: #fff;
}
.ae-sidebar-user { display: block; font-size: 11px; color: #6b7280; margin-bottom: 8px; word-break: break-all; }
.ae-shell-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100vh;
  position: relative;
  overflow: hidden;
}
.ae-shell-topbar {
  position: fixed;
  top: var(--ae-shell-header-offset);
  left: var(--ae-sidebar-width);
  right: 0;
  z-index: 30;
  flex-shrink: 0;
  height: var(--ae-shell-header-height);
  transition: top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.ae-shell-topbar.ae-topbar-v2 {
  background: linear-gradient(
    90deg,
    rgba(237, 233, 254, 0.94) 0%,
    rgba(240, 237, 255, 0.9) 18%,
    rgba(245, 243, 255, 0.86) 40%,
    rgba(249, 248, 255, 0.82) 65%,
    rgba(252, 251, 255, 0.78) 85%,
    rgba(255, 255, 255, 0.75) 100%
  );
  backdrop-filter: blur(20px) saturate(1.55);
  -webkit-backdrop-filter: blur(20px) saturate(1.55);
  border-bottom: 1px solid #e5e7eb;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 16px rgba(88, 80, 236, 0.07);
}
body.ae-copilot-side-layout .ae-shell-topbar,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-shell-topbar {
  right: var(--ae-copilot-width, 320px);
}
/* Creative Studio focus mode: full-width workspace, no copilot drawer */
body.ae-copilot-suppressed .ae-shell-topbar {
  right: 0;
}
body.ae-copilot-suppressed .ae-shell-content {
  padding-bottom: 24px;
}
body.ae-copilot-suppressed .ae-shell-content:has(.ae-product-editor-full) {
  padding-bottom: 96px;
}
.ae-shell-content {
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: calc(-1 * (var(--ae-shell-header-offset) + var(--ae-shell-header-height)));
  padding-top: calc(var(--ae-shell-header-offset) + var(--ae-shell-header-height) + 12px);
  padding-bottom: calc(var(--ae-copilot-height, 360px) + 12px);
  position: relative;
  z-index: 2;
  background: #f9f9ff;
}

.ae-shell-content:has(.ae-product-editor-full) {
  padding-bottom: calc(var(--ae-copilot-height, 360px) + 96px);
}
.ae-copilot-drawer {
  position: fixed; bottom: 0; right: 0; left: var(--ae-sidebar-width); z-index: 25;
  background: #fff; border-top: 1px solid #e5e7eb; display: flex; flex-direction: column;
  height: var(--ae-copilot-height, 360px);
  min-height: 44px;
  max-height: 85vh;
  transition: height .15s ease;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}
.ae-copilot-drawer.is-collapsed {
  height: 44px !important;
  overflow: hidden;
  transition: height .2s ease;
}
.ae-copilot-drawer.is-expanded .ae-agent-messages { flex: 1; }
.ae-copilot-resize-handle {
  flex-shrink: 0;
  height: 10px;
  cursor: ns-resize;
  background: linear-gradient(to bottom, transparent, #f3f4f6);
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}
.ae-copilot-resize-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
}
.ae-copilot-drawer.is-collapsed .ae-copilot-resize-handle {
  cursor: default;
  pointer-events: none;
}
body.ae-copilot-resizing {
  cursor: ns-resize;
  user-select: none;
}
body.ae-copilot-resizing .ae-copilot-drawer { transition: none; }
.ae-copilot-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ae-copilot-composer {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 10px; margin-top: auto; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(248,250,252,0) 0%, #f8fafc 28%);
  border-top: 1px solid #eef2f7;
}
.ae-copilot-drawer.is-side .ae-copilot-composer,
body.ae-copilot-side-layout .ae-copilot-composer {
  padding-left: 6px; padding-right: 6px;
}
.ae-copilot-composer-field {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px 8px;
  border: 1px solid #3f3f46; border-radius: 14px;
  background: #27272a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color .15s, box-shadow .15s;
}
/* Legacy dark composer — theme editor shell only (drawer has its own light card) */
.ae-te-design-shell .ae-copilot-composer-field {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px 8px;
  border: 1px solid #3f3f46; border-radius: 14px;
  background: #27272a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255,255,255,0.04);
}
.ae-copilot-drawer .ae-copilot-composer-field {
  padding: 12px 12px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  gap: 0 !important;
}
.ae-copilot-drawer.is-side .ae-copilot-composer-field,
body.ae-copilot-side-layout .ae-copilot-drawer .ae-copilot-composer-field {
  padding: 14px 14px 10px;
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  background: var(--ae-surface);
  box-shadow: 0 1px 4px rgba(88, 80, 236, 0.05);
}
.ae-copilot-composer-field:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.45), 0 10px 28px rgba(15, 23, 42, 0.22);
}
.ae-copilot-drawer.is-side .ae-copilot-composer-field:focus-within,
body.ae-copilot-side-layout .ae-copilot-drawer .ae-copilot-composer-field:focus-within {
  border-color: var(--ae-accent-border);
  box-shadow: 0 0 0 3px rgba(88, 80, 236, 0.1);
}
.ae-copilot-composer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ae-copilot-composer-main textarea,
.ae-te-design-shell .ae-copilot-composer-field textarea {
  width: 100%;
  min-height: 72px; max-height: 260px;
  border: none; padding: 0; margin: 0; resize: none;
  font-size: 13px; line-height: 1.55; font-family: inherit; color: #f4f4f5;
  background: transparent;
  overflow-y: auto;
}
.ae-copilot-drawer .ae-copilot-composer-field textarea {
  min-height: 56px;
  max-height: 160px;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #111827;
}
.ae-copilot-drawer.is-side .ae-copilot-composer-field textarea,
body.ae-copilot-side-layout .ae-copilot-drawer .ae-copilot-composer-field textarea {
  color: var(--ae-text);
}
.ae-copilot-composer-field textarea:focus { outline: none; box-shadow: none; }
.ae-copilot-composer-field textarea::placeholder { color: #71717a; }
.ae-copilot-drawer.is-side .ae-copilot-composer-field textarea::placeholder,
body.ae-copilot-side-layout .ae-copilot-drawer .ae-copilot-composer-field textarea::placeholder {
  color: #94a3b8;
}
.ae-copilot-composer-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ae-copilot-composer-toolbar-left,
.ae-copilot-composer-toolbar-right {
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.ae-copilot-composer-toolbar-right { margin-left: auto; flex-shrink: 0; }
.ae-copilot-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer; border: none;
  transition: background .15s, color .15s, opacity .15s; white-space: nowrap;
}
.ae-copilot-stop-btn {
  background: transparent; color: #64748b; padding: 0 10px;
}
.ae-copilot-stop-btn:hover { background: #f1f5f9; color: #334155; }
.ae-copilot-stop-btn[hidden] { display: none !important; }
.ae-copilot-send-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; min-width: 30px; padding: 0;
  border: none; border-radius: 8px;
  background: #6366f1; color: #fff; cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s;
}
.ae-copilot-send-btn:hover { background: #4f46e5; }
.ae-copilot-send-btn:active { transform: scale(0.96); }
.ae-copilot-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ae-copilot-send-btn[hidden] { display: none !important; }
.ae-copilot-input-hint { font-size: 11px; color: #94a3b8; padding: 0 4px; line-height: 1.3; text-align: center; }
.ae-copilot-drawer .ae-agent-body { flex: 1; min-height: 0; }
.ae-copilot-drawer .ae-agent-conversation { flex: 1; min-height: 0; }
.ae-copilot-drawer .ae-agent-messages { flex: 1; min-height: 0; }
.ae-copilot-header {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-bottom: none;
  min-height: auto;
  background: transparent;
}
.ae-copilot-tabbar {
  flex: 1; display: flex; align-items: stretch; min-width: 0; overflow: hidden;
}
.ae-copilot-tabs {
  display: flex; align-items: stretch; overflow-x: auto; flex: 1; min-width: 0;
  scrollbar-width: none;
}
.ae-copilot-tabs::-webkit-scrollbar { display: none; }
.ae-copilot-tab {
  flex-shrink: 0; max-width: 150px; padding: 0 12px; border: none; background: transparent;
  border-bottom: 2px solid transparent; font-size: 12px; color: #64748b; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 36px;
}
.ae-copilot-tab:hover { color: #334155; background: #f8fafc; }
.ae-copilot-tab.is-active { color: #38128A; border-bottom-color: #38128A; background: #faf5ff; font-weight: 500; }
.ae-copilot-tab-new {
  flex-shrink: 0; width: 32px; height: 36px; border: none; background: transparent;
  color: #64748b; font-size: 18px; line-height: 1; cursor: pointer; border-left: 1px solid #f1f5f9;
}
.ae-copilot-tab-new:hover { background: #f8fafc; color: #38128A; }
.ae-copilot-history-panel {
  display: flex; flex-direction: column; max-height: 220px;
  border-bottom: 1px solid #f1f5f9; background: #fff;
}
.ae-copilot-history-panel[hidden] { display: none !important; }
.ae-copilot-history-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 4px; flex-shrink: 0;
}
.ae-copilot-history-title { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.ae-copilot-history-list {
  overflow-y: auto; padding: 4px 6px 8px; display: flex; flex-direction: column; gap: 2px;
}
.ae-copilot-history-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 8px 10px; border: none; border-radius: 6px;
  background: transparent; cursor: pointer; text-align: left;
}
.ae-copilot-history-item:hover { background: #f8fafc; }
.ae-copilot-history-item.is-active { background: #faf5ff; }
.ae-copilot-history-item-title {
  font-size: 12px; color: #1e293b; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.ae-copilot-history-item-meta { font-size: 10px; color: #94a3b8; }
.ae-copilot-history-empty { font-size: 12px; color: #94a3b8; padding: 12px; margin: 0; text-align: center; }
.ae-copilot-toolbar { display: flex; align-items: center; gap: 1px; flex-shrink: 0; padding-right: 4px; }
.ae-copilot-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; background: transparent; color: #64748b;
  border-radius: 4px; cursor: pointer; padding: 0; position: relative;
}
.ae-copilot-icon-btn:hover { background: #f1f5f9; color: #1e293b; }
.ae-copilot-icon-btn.is-active { color: #38128A; background: #eef2ff; }
.ae-copilot-icon { display: block; }
.ae-copilot-icon-btn .ae-copilot-icon-compact,
.ae-copilot-icon-btn .ae-copilot-icon-dock-bottom,
.ae-copilot-icon-btn .ae-copilot-icon-restore { display: none; }
.ae-copilot-icon-btn.is-active .ae-copilot-icon-expand,
.ae-copilot-drawer.is-side .ae-copilot-icon-btn[data-studio-copilot-target="dockButton"] .ae-copilot-icon-dock-side,
.ae-copilot-drawer.is-collapsed .ae-copilot-icon-btn[data-studio-copilot-target="collapseButton"] .ae-copilot-icon-collapse { display: none; }
.ae-copilot-icon-btn.is-active .ae-copilot-icon-compact { display: block; }
.ae-copilot-drawer.is-side .ae-copilot-icon-btn[data-studio-copilot-target="dockButton"] .ae-copilot-icon-dock-bottom { display: block; }
.ae-copilot-drawer.is-collapsed .ae-copilot-icon-btn[data-studio-copilot-target="collapseButton"] .ae-copilot-icon-restore { display: block; }
.ae-copilot-drawer.is-collapsed .ae-copilot-tabbar { display: none; }
.ae-copilot-drawer.is-collapsed .ae-copilot-header { justify-content: flex-end; }
.ae-notifications-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-height: 400px;
  overflow-y: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.12); z-index: 50;
}
.ae-notifications-dropdown.is-open { display: block; }
.ae-notification-item { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.ae-notification-item.is-unread { background: #faf5ff; }
.ae-notification-badge {
  position: absolute; top: -4px; right: -4px; background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.ae-command-palette-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  align-items: flex-start; justify-content: center; padding: 12vh 12px 24px;
}
.ae-command-palette-overlay.is-open { display: flex; }
.ae-command-palette {
  width: min(560px, 100%);
  background: var(--ae-surface, #fff);
  border: 1px solid var(--ae-border, #e8e8f5);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
  overflow: hidden;
}
.ae-command-palette input {
  width: 100%; padding: 14px 16px; border: none;
  border-bottom: 1px solid var(--ae-border, #e8e8f5);
  font-size: 15px; color: var(--ae-text, #111827); background: var(--ae-surface, #fff);
}
.ae-command-palette input:focus { outline: none; }
.ae-command-palette input::placeholder { color: #94a3b8; }
.ae-command-palette-results { max-height: min(420px, 58vh); overflow-y: auto; }
.ae-command-palette-section {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 16px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #94a3b8; background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}
.ae-command-palette-section:first-child { border-top: none; }
.ae-command-palette-empty,
.ae-command-palette-loading {
  padding: 18px 16px; color: var(--ae-muted, #6b7280); font-size: 13px;
}
.ae-command-palette-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 10px 16px; min-height: 44px;
  border: none; background: var(--ae-surface, #fff);
  cursor: pointer; font-size: 14px; color: var(--ae-text, #111827);
}
.ae-command-palette-item:hover,
.ae-command-palette-item.is-selected { background: var(--ae-accent-soft, #eef2ff); }
.ae-command-palette-item-main { min-width: 0; flex: 1; }
.ae-command-palette-item-label {
  display: block; line-height: 1.35; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ae-command-palette-item small {
  display: block; color: #9ca3af; font-size: 11px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ae-command-palette-item-badge {
  flex-shrink: 0; margin-top: 2px; font-size: 10px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ae-muted, #6b7280);
  background: #f1f5f9; border-radius: 999px; padding: 2px 8px;
}
@media (max-width: 768px) {
  .ae-command-palette-overlay { padding: 8vh 10px 16px; }
  .ae-command-palette-results { max-height: min(62vh, 480px); }
  .ae-topbar-search-kbd { display: none; }
  .ae-topbar-search { padding: 10px 12px; }
}

/* Copilot UX upgrade */
.ae-agent-msg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 11px; color: #64748b; }
.ae-agent-msg-head span { font-weight: 600; color: #38128A; }
.ae-agent-msg-head small { display: none; }
.ae-agent-msg-insight { background: transparent; border-radius: 0; padding: 0; }
.ae-agent-msg-intro { font-size: 13px; color: #475569; margin-bottom: 8px; }
.ae-agent-msg-intro p:last-child { margin-bottom: 0; }
.ae-agent-artifact {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 14px; margin: 8px 0; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ae-agent-artifact-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ae-agent-artifact-label { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; }
.ae-agent-artifact-body { font-size: 13px; color: #1e293b; line-height: 1.55; }
.ae-agent-artifact-body p { margin: 0 0 8px; }
.ae-agent-artifact-body p:last-child { margin-bottom: 0; }
.ae-agent-artifact-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; color: #64748b; cursor: pointer; padding: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.ae-agent-artifact-copy:hover { background: #f8fafc; color: #38128A; border-color: #c7d2fe; }
.ae-agent-artifact-copy.is-copied { color: #059669; border-color: #bbf7d0; background: #ecfdf5; }
.ae-agent-msg-outro { margin-top: 8px; font-size: 12px; color: #64748b; }
.ae-agent-msg-outro p:last-child { margin-bottom: 0; }
.ae-agent-msg-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ae-agent-artifact-body strong { font-weight: 600; color: #1e293b; }
.ae-agent-artifact-body .ae-agent-md-h { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #1e293b; }
.ae-agent-msg-user .ae-agent-msg-head { justify-content: flex-end; }
.ae-agent-msg-assistant .ae-agent-msg-insight .ae-agent-msg-body { padding: 0; }
.ae-agent-msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ae-agent-msg-meta { margin-top: 8px; font-size: 11px; color: #94a3b8; }
.ae-agent-msg-meta summary { cursor: pointer; }
.ae-agent-confirm-banner { display: flex; gap: 8px; margin-top: 10px; }
.ae-agent-loading-steps { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b; margin-bottom: 8px; }
.ae-agent-loading-step { opacity: 0.45; transition: opacity .25s, color .25s; padding-left: 2px; }
.ae-agent-loading-step.is-active { opacity: 1; color: #38128A; font-weight: 500; }
.ae-agent-msg-brand { font-weight: 600; color: #38128A; }
.ae-agent-msg-context-badge {
  margin-left: 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #6366f1; background: #eef2ff; padding: 2px 8px; border-radius: 999px;
}
.ae-agent-md-link { color: #4338ca; font-weight: 500; text-decoration: none; border-bottom: 1px solid #c7d2fe; }
.ae-agent-md-link:hover { color: #3730a3; border-bottom-color: #4338ca; }
.ae-campaign-summary-intro { margin-bottom: 10px; font-size: 13px; color: #475569; }
.ae-campaign-summary {
  margin-top: 4px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #faf5ff 0%, #fff 48px);
  border: 1px solid #e9d5ff; box-shadow: 0 8px 24px rgba(56, 18, 138, 0.06);
}
.ae-campaign-summary-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px 14px 8px;
}
.ae-campaign-summary-header-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.ae-campaign-summary-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; }
.ae-campaign-summary-title { margin: 0; font-size: 15px; font-weight: 700; color: #1e1b4b; line-height: 1.3; }
.ae-campaign-summary-occasion { margin: 2px 0 0; font-size: 12px; color: #64748b; }
.ae-campaign-summary-badge {
  flex-shrink: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #5b21b6; background: #ede9fe; padding: 4px 10px; border-radius: 999px;
}
.ae-campaign-summary-header-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.ae-campaign-summary-polling {
  font-size: 10px; font-weight: 600; color: #6366f1; letter-spacing: .02em;
  animation: ae-campaign-pulse 1.6s ease-in-out infinite;
}
.ae-campaign-summary.is-polling .ae-campaign-summary-progress-fill {
  background: linear-gradient(90deg, #6366f1, #a78bfa, #6366f1);
  background-size: 200% 100%;
  animation: ae-campaign-shimmer 1.8s linear infinite;
}
@keyframes ae-campaign-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes ae-campaign-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.ae-campaign-summary-period { margin: 0; padding: 0 14px 10px; font-size: 12px; color: #6366f1; font-weight: 500; }
.ae-campaign-summary-alert {
  margin: 0 14px 10px; padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.45;
  display: flex; flex-direction: column; gap: 2px;
}
.ae-campaign-summary-alert.is-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.ae-campaign-summary-alert.is-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.ae-campaign-summary-alert strong { font-weight: 600; }
.ae-campaign-summary-progress { padding: 0 14px 12px; }
.ae-campaign-summary-progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: #64748b; margin-bottom: 6px; }
.ae-campaign-summary-progress-track { height: 6px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.ae-campaign-summary-progress-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .4s ease;
}
.ae-campaign-summary-cards { display: flex; flex-direction: column; gap: 1px; background: #f3f4f6; border-top: 1px solid #f3f4f6; }
.ae-campaign-summary-row {
  display: flex; gap: 10px; padding: 10px 14px; background: #fff; align-items: flex-start;
}
.ae-campaign-summary-row-icon { font-size: 16px; line-height: 1.2; flex-shrink: 0; width: 22px; text-align: center; }
.ae-campaign-summary-row-body { flex: 1; min-width: 0; }
.ae-campaign-summary-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.ae-campaign-summary-row-label { font-size: 13px; font-weight: 600; color: #1e293b; }
.ae-campaign-summary-row-status {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; white-space: nowrap;
}
.ae-campaign-summary-row.is-ready .ae-campaign-summary-row-status { color: #059669; }
.ae-campaign-summary-row.is-generating .ae-campaign-summary-row-status { color: #d97706; }
.ae-campaign-summary-row.is-failed .ae-campaign-summary-row-status { color: #dc2626; }
.ae-campaign-summary-row.is-pending .ae-campaign-summary-row-status { color: #94a3b8; }
.ae-campaign-summary-row-summary { margin: 0; font-size: 12px; color: #64748b; line-height: 1.4; }
.ae-campaign-summary-row-error { margin: 4px 0 0; font-size: 11px; color: #b91c1c; line-height: 1.35; }
.ae-campaign-summary-status-icon { flex-shrink: 0; }
.ae-campaign-summary-dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.ae-campaign-summary-spinner {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fde68a; border-top-color: #d97706;
  animation: ae-campaign-spin .8s linear infinite; display: inline-block;
}
@keyframes ae-campaign-spin { to { transform: rotate(360deg); } }
.ae-campaign-summary-actions {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; background: #fafafa; border-top: 1px solid #f3f4f6;
}
.ae-campaign-summary-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 11px 16px; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #38128A 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(56, 18, 138, 0.25); transition: transform .15s, box-shadow .15s;
}
.ae-campaign-summary-cta:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(56, 18, 138, 0.32); }
.ae-campaign-summary-chip { width: 100%; text-align: left; justify-content: flex-start; }
.ae-copilot-drawer .ae-campaign-summary-chip {
  background: #fff; border: 1px solid #e5e7eb; color: #374151; font-size: 12px;
}
.ae-copilot-drawer .ae-campaign-summary-chip:hover { background: #f9fafb; border-color: #d1d5db; }
.ae-campaign-summary-chip.is-destructive { color: #b91c1c; border-color: #fecaca; }
.ae-campaign-summary-preview { margin-top: 8px; }
.ae-campaign-summary-preview.is-text {
  padding: 8px 10px; border-radius: 8px; background: #f8fafc; border: 1px solid #e2e8f0;
}
.ae-campaign-summary-preview-line { margin: 0; font-size: 12px; color: #475569; line-height: 1.45; }
.ae-campaign-summary-preview-line + .ae-campaign-summary-preview-line { margin-top: 4px; }
.ae-campaign-summary-preview.is-image,
.ae-campaign-summary-preview.is-video {
  border-radius: 10px; overflow: hidden; border: 1px solid #e5e7eb; background: #fff;
}
.ae-campaign-summary-preview-media { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.ae-campaign-summary-preview.is-video .ae-campaign-summary-preview-media { max-height: 220px; background: #000; }
.ae-campaign-summary-preview.is-loading,
.ae-campaign-summary-preview.is-empty {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  font-size: 12px; color: #64748b; background: #f8fafc; border: 1px dashed #cbd5e1;
}
.ae-campaign-auto-open {
  margin-bottom: 12px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  border: 1px solid #c7d2fe; box-shadow: 0 6px 18px rgba(99, 102, 241, 0.08);
}
.ae-campaign-auto-open.is-sticky {
  margin-bottom: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 16px rgba(99, 102, 241, 0.1);
}
.ae-copilot-auto-open-dock:not([hidden]) {
  display: block;
  flex-shrink: 0;
  padding: 0 12px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}
.ae-campaign-auto-open.is-sticky .ae-campaign-auto-open-copy { margin-bottom: 8px; }
.ae-campaign-auto-open.is-sticky .ae-campaign-auto-open-actions { gap: 6px; }
.ae-campaign-auto-open.is-sticky .ae-campaign-auto-open-primary,
.ae-campaign-auto-open.is-sticky .ae-campaign-auto-open-secondary {
  padding: 7px 10px; font-size: 11px;
}
.ae-campaign-auto-open.is-sticky .ae-campaign-auto-open-dismiss {
  width: 100%; text-align: center; margin-left: 0; margin-top: 4px;
}
.ae-campaign-auto-open.is-dismissed { display: none; }
.ae-campaign-auto-open-copy { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ae-campaign-auto-open-title { font-size: 13px; font-weight: 700; color: #312e81; }
.ae-campaign-auto-open-countdown { font-size: 12px; color: #4338ca; }
.ae-campaign-auto-open-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ae-campaign-auto-open-primary {
  padding: 8px 12px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #38128A 0%, #6366f1 100%);
}
.ae-campaign-auto-open-secondary {
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #374151; background: #fff; border: 1px solid #d1d5db;
}
.ae-campaign-auto-open-dismiss {
  padding: 0; border: none; background: none; cursor: pointer;
  font-size: 11px; color: #64748b; text-decoration: underline; margin-left: auto;
}
.ae-copilot-drawer .ae-agent-msg-assistant .ae-agent-msg-head {
  display: flex; align-items: center; gap: 0; margin-bottom: 8px;
}
.ae-agent-typing { display: inline-flex; align-items: center; gap: 5px; padding: 6px 2px; }
.ae-agent-typing-dot { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; opacity: 0.4; animation: ae-typing-bounce 1.2s infinite ease-in-out both; }
.ae-agent-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.ae-agent-typing-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes ae-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.ae-agent-chart-skeleton { height: 180px; border-radius: 10px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: ae-shimmer 1.2s infinite; }
.ae-agent-chart-kpi { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ae-agent-chart-kpi-main { display: flex; flex-direction: column; gap: 2px; }
.ae-agent-chart-kpi-main strong { font-size: 20px; color: #1e293b; }
.ae-agent-chart-kpi-main span { font-size: 11px; color: #64748b; }
.ae-agent-chart-delta { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #64748b; }
.ae-agent-chart-delta.is-up { background: #ecfdf5; color: #059669; }
.ae-agent-chart-delta.is-down { background: #fef2f2; color: #dc2626; }
.ae-agent-chart-footnote { margin-top: 8px; font-size: 10px; color: #94a3b8; }
.ae-agent-chart-empty { padding: 24px; text-align: center; color: #64748b; font-size: 13px; background: #f8fafc; border-radius: 8px; }
.ae-agent-chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ae-agent-chart-range { font-size: 11px; padding: 4px 8px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; cursor: pointer; }
.ae-agent-chart-range.is-active { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.ae-agent-chart-actions { display: flex; flex-wrap: wrap; gap: 4px; }
/* Side-docked copilot: flex column beside main content (no fixed overlay) */
.ae-copilot-drawer.is-side,
body.ae-copilot-side-layout .ae-copilot-drawer {
  position: relative;
  flex: 0 0 var(--ae-copilot-width, 320px);
  width: var(--ae-copilot-width, 320px);
  min-width: var(--ae-copilot-width, 320px);
  height: auto !important;
  max-height: none;
  align-self: stretch;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  border-top: none;
  border-left: 1px solid #e5e7eb;
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.04);
  z-index: 20;
  overflow: hidden;
}
body.ae-copilot-side-layout .ae-shell {
  flex-direction: row;
  align-items: stretch;
}
body.ae-copilot-side-layout .ae-shell-main {
  flex: 1 1 auto;
  min-width: 0;
}
body.ae-copilot-side-layout .ae-shell-content,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-shell-content {
  padding-right: 16px;
  padding-bottom: 24px;
  padding-top: 160px;
}
body.ae-copilot-side-layout .ae-shell-content:has(.ae-product-editor-full),
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-shell-content:has(.ae-product-editor-full) {
  padding-right: 16px;
  padding-bottom: 96px;
}
body.ae-copilot-side-layout .ae-copilot-drawer,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-copilot-drawer.is-side {
  position: relative;
  padding-left: 8px;
}
body.ae-copilot-side-layout .ae-copilot-resize-handle,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-copilot-resize-handle {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  height: auto;
  cursor: ew-resize;
  border-bottom: none;
  border-right: 1px solid #e5e7eb;
  background: linear-gradient(to right, transparent, #f3f4f6);
  z-index: 3;
}
body.ae-copilot-side-layout .ae-copilot-resize-handle::after,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-copilot-resize-handle::after {
  width: 4px;
  height: 40px;
  left: 50%;
  top: 50%;
}
body.ae-copilot-resizing-width { cursor: ew-resize; user-select: none; }
body.ae-copilot-resizing-width .ae-copilot-drawer { transition: none; }

/* Product editor: full scroll + side-copilot layout */
body.ae-copilot-side-layout .ae-product-editor-layout,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-product-editor-layout { grid-template-columns: minmax(0, 1fr); }
body.ae-copilot-side-layout .ae-product-editor-aside,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-product-editor-aside { display: none; }
body.ae-copilot-side-layout .ae-product-editor.ae-product-editor-full,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-product-editor.ae-product-editor-full { max-width: none; }
body.ae-copilot-side-layout .ae-unsaved-bar,
.ae-shell:has(.ae-copilot-drawer.is-side) .ae-unsaved-bar { right: var(--ae-copilot-width, 320px); }
.ae-product-editor.ae-product-editor-full { max-width: 1280px; padding-bottom: 96px; }
.ae-product-editor-full .tox-tinymce-aux { z-index: 45; }
.ae-product-editor-full #attachments .aspect-video { width: 100%; max-width: 100%; }
.ae-analytics-filters { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.ae-analytics-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b; }
.ae-analytics-filters select { padding: 8px 10px; border-radius: 8px; border: 1px solid #e5e7eb; font-size: 13px; }
.ae-agent-chart-sticky {
  position: sticky; top: 0; z-index: 2; background: #fff;
  padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; margin-bottom: 8px;
}
.ae-agent-chart-sticky:not([hidden]) + .ae-agent-suggestions { margin-top: 0; }
@keyframes ae-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Catalog / products (agentic studio) — default fills the studio content column */
.ae-catalog { max-width: none; width: 100%; margin: 0; padding: 20px 20px 48px; box-sizing: border-box; }
.ae-catalog--narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.ae-catalog--medium,
.ae-catalog--wide,
.ae-catalog--creative { max-width: none; }

/* Creative session context band */
.ae-catalog--creative { scroll-margin-top: 12px; }
body.ae-copilot-suppressed .ae-catalog--creative { padding-top: 4px; }

.ae-creative-context {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 4px;
}
.ae-creative-context-static {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ae-creative-context-sticky {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.ae-creative-context-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.ae-creative-context-product {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  text-decoration: none;
  width: fit-content;
  max-width: 100%;
}
.ae-creative-context-product:hover { background: #1f2937; color: #fff; }
.ae-creative-context-thumb { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
.ae-creative-context-thumb--empty { display: inline-flex; align-items: center; justify-content: center; background: #374151; font-size: 14px; }
.ae-creative-context-product-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-creative-context-title-wrap { max-width: 520px; }
.ae-creative-context-title {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  padding: 2px 0;
}
.ae-creative-context-title:focus { outline: none; box-shadow: inset 0 -2px 0 #6366f1; }
.ae-creative-context-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-badge--indigo { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.ae-badge--muted { background: #f3f4f6; color: #6b7280; text-transform: none; }
.ae-creative-context-copilot { margin: 0; font-size: 13px; }
.ae-creative-context-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ae-creative-storage-link {
  font-size: 12px;
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.ae-creative-storage-link:hover { color: var(--ae-text); }

.ae-creative-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 10px;
}
.ae-creative-mode {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}
.ae-creative-mode.is-active { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.ae-creative-post-batch {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.ae-creative-post-batch-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.ae-creative-related-sessions {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}
.ae-creative-related-sessions-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ae-creative-related-sessions-summary::-webkit-details-marker { display: none; }
.ae-catalog--wide { max-width: none; }
.ae-catalog.docs-main { max-width: 920px; margin-left: auto; margin-right: auto; }
.ae-pref-details { display: grid; gap: 10px; margin: 0; font-size: 14px; }
.ae-pref-details dt { color: #64748b; font-weight: 600; margin: 0; }
.ae-pref-details dd { margin: 0 0 4px; color: #111827; }
.ae-pref-channel strong { display: block; font-size: 14px; color: #111827; margin-bottom: 4px; }
.ae-seo-logo-preview { margin: 0 0 10px; }
.ae-seo-logo-preview__img { max-height: 120px; border-radius: 8px; display: block; }
.ae-input-affix {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.ae-input-affix .ae-input-flex {
  border: 0;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}
.ae-input-affix__suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
  border-left: 1px solid #e5e7eb;
}
.ae-card-form,
.ae-catalog .ae-section .ae-card {
  display: block;
  align-items: stretch;
  justify-content: flex-start;
}
.ae-card-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 0;
}
.ae-card-form .ae-field:last-child { margin-bottom: 0; }
.ae-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.ae-catalog-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.ae-catalog-hero-copy h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; color: #111827; }
.ae-catalog-hero-copy p { margin: 0; font-size: 14px; color: #64748b; max-width: 520px; line-height: 1.5; }
.ae-catalog-hero-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.ae-catalog-stats { margin-bottom: 16px; }
.ae-catalog-banner { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.ae-catalog-banner-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.ae-catalog-banner a { color: #38128A; font-weight: 600; }
.ae-theme-health-banner {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.ae-theme-health-banner__copy { flex: 1 1 220px; min-width: 0; }
.ae-theme-health-banner__copy p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; }
.ae-theme-health-banner__checks {
  margin: 8px 0 0; padding-left: 1.1em; font-size: 12px; line-height: 1.4;
}
.ae-theme-health-banner__actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 0 1 auto;
}
.ae-te-health-slot { padding: 8px 12px 0; }
.ae-te-health-slot .ae-theme-health-banner { margin-bottom: 8px; }
@media (max-width: 480px) {
  .ae-theme-health-banner__actions { width: 100%; }
  .ae-theme-health-banner__actions .ae-btn { flex: 1 1 auto; text-align: center; }
}
.ae-catalog-ai-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 16px;
  background: linear-gradient(135deg, #faf5ff 0%, #f8fafc 100%);
  border: 1px solid #e9d5ff; border-radius: 12px;
}
.ae-catalog-ai-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #38128A; padding: 2px 8px; background: #fff; border-radius: 999px; border: 1px solid #e9d5ff;
}
.ae-catalog-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.ae-catalog-search { flex: 1; min-width: 200px; }
.ae-catalog-search-input {
  width: 100%; padding: 9px 12px 9px 36px; border: 1px solid #e5e7eb; border-radius: 10px;
  font-size: 13px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
}
.ae-catalog-search-input:focus { outline: none; border-color: #38128A; box-shadow: 0 0 0 3px rgba(56, 18, 138, 0.1); }
.ae-catalog-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-catalog-filter {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  text-decoration: none; color: #64748b; background: #fff; border: 1px solid #e5e7eb;
  transition: background .15s, border-color .15s, color .15s;
}
.ae-catalog-filter:hover { background: #f8fafc; color: #334155; }
.ae-catalog-filter.is-active { background: #38128A; border-color: #38128A; color: #fff; }
.ae-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ae-catalog-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .15s, border-color .15s, opacity .22s ease, transform .22s ease, filter .22s ease;
}
.ae-catalog-card.is-removing {
  opacity: 0; transform: scale(0.96) translateY(-6px); filter: blur(1px); pointer-events: none;
}
.ae-catalog-card:hover { border-color: #c7d2fe; box-shadow: 0 4px 16px rgba(56, 18, 138, 0.08); }
.ae-catalog-card-link { text-decoration: none; color: inherit; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ae-catalog-card-media { aspect-ratio: 4/3; background: #f8fafc; overflow: hidden; }
.ae-catalog-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ae-catalog-card-body { padding: 12px 14px; flex: 1; }
.ae-catalog-card-title { font-weight: 600; font-size: 14px; color: #1e293b; margin-bottom: 8px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ae-catalog-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: #64748b; }
.ae-catalog-card-actions {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  border-top: 1px solid #f1f5f9; background: #fafafa;
}
.ae-catalog-ask-btn { font-weight: 700; color: #38128A !important; }
.ae-catalog-empty {
  text-align: center; padding: 48px 24px; background: #fff; border: 1px dashed #e5e7eb; border-radius: 16px;
}
.ae-catalog-empty--compact { padding: 28px 18px; }
.ae-catalog-empty--compact .ae-catalog-empty-icon { font-size: 28px; margin-bottom: 8px; }
.ae-catalog-empty--compact h3 { font-size: 15px; }
.ae-catalog-empty--compact p { margin-bottom: 0; font-size: 13px; }
.ae-catalog-empty-icon { font-size: 40px; margin-bottom: 12px; }
.ae-catalog-empty h3 { margin: 0 0 8px; font-size: 18px; color: #1e293b; }
.ae-catalog-empty p { margin: 0 0 20px; color: #64748b; font-size: 14px; }
.ae-catalog-empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ae-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ae-modal-overlay[hidden] { display: none !important; }
.ae-modal { background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2); width: 100%; max-width: 480px; overflow: hidden; }
.ae-modal-sm { max-width: 440px; }
.ae-modal-md { max-width: 580px; }
.ae-modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.ae-modal-head h3 { margin: 4px 0 0; font-size: 18px; color: #1e293b; }
.ae-modal-head p { margin: 6px 0 0; font-size: 13px; color: #64748b; line-height: 1.45; }
.ae-modal-kicker { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #38128A; }
.ae-modal-body { padding: 16px 20px; }
.ae-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.ae-btn-danger { background: #dc2626; border: 1px solid #dc2626; color: #fff; }
.ae-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.ae-btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }
.ae-import-status { min-height: 18px; margin-top: 10px; }
.ae-product-editor { max-width: 1040px; margin: 0 auto; padding: 16px 20px 48px; }
.ae-product-editor.ae-product-editor-full { max-width: 1280px; }
.ae-product-editor-full .ae-product-panel-avo { margin-bottom: 16px; }
.ae-product-editor-full .ae-product-avo-tools { display: flex; flex-direction: column; gap: 16px; }
.ae-product-editor-full .ae-product-avo-tools > .grid {
  display: block;
  width: 100%;
  margin: 0;
}
.ae-product-editor-full .ae-product-avo-tools .col-span-12 {
  width: 100%;
  max-width: 100%;
  padding: 0;
}
.ae-product-editor-full .ae-product-avo-tools > .grid > .col-span-12 {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0;
}
.ae-product-editor-full .ae-product-avo-tools > .grid .border-b.pb-4 {
  display: none;
}
.ae-product-editor-full .text-primary { color: #38128A; }
.ae-product-editor-full .bg-white.rounded.shadow-md { border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: none; }
.ae-product-editor-full .field input:not([type="checkbox"]):not([type="radio"]),
.ae-product-editor-full .field select,
.ae-product-editor-full .field textarea,
.ae-product-editor-full .ae-select,
.ae-product-editor-full .ae-textarea {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.ae-product-editor-full .ae-field input:not([type="radio"]):not([type="checkbox"]),
.ae-product-editor-full .ae-field select,
.ae-product-editor-full .ae-field textarea { max-width: 100%; }
.ae-product-editor-full .ae-field-checkbox { display: flex; align-items: center; gap: 8px; }
.ae-product-editor-full .ae-field-pricing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ae-product-editor-full .ae-ai-synced-flash,
.ae-product-editor-full .tox.ae-ai-synced-flash {
  animation: ae-ai-sync-pulse 1.4s ease;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
  border-radius: 8px;
}
@keyframes ae-ai-sync-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  40% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.ae-collections-select {
  min-height: 140px;
  width: 100%;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.ae-collections-select option { padding: 6px 8px; border-radius: 4px; }
.ae-collections-select option:checked { background: #ede9fe linear-gradient(#ede9fe, #ede9fe); color: #38128A; }
.ae-product-editor-full .product-variant,
.ae-product-editor-full .variant-table { max-width: 100%; }
.ae-product-editor-full .sticky-bar-wrapper { display: none !important; }
.ae-product-empty-hint { font-size: 13px; color: #64748b; margin: 0; }

.ae-draft-banner {
  margin: 0 0 12px;
  padding: 0 20px;
}
.ae-draft-banner.hidden { display: none !important; }
.ae-draft-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
}
.ae-draft-banner-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

/* Studio unsaved-changes bar (replaces Avo full-screen sticky bar) */
.ae-unsaved-bar {
  position: fixed;
  top: 0;
  left: var(--ae-sidebar-width);
  right: 0;
  z-index: 10040;
  height: var(--ae-unsaved-bar-height, 52px);
  padding: 0;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    visibility 0.32s;
}
.ae-unsaved-bar.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ae-unsaved-bar-inner {
  max-width: none;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: linear-gradient(90deg, #2d0a6e 0%, #38128A 52%, #4c1d95 100%);
  border-bottom: 3px solid #f59e0b;
  border-radius: 0;
  box-shadow: 0 6px 28px rgba(45, 10, 110, 0.42), 0 2px 8px rgba(0, 0, 0, 0.14);
}
.ae-unsaved-bar-message {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.ae-unsaved-bar-icon,
.ae-unsaved-bar-save-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}
.ae-unsaved-bar-icon {
  filter: brightness(0) saturate(100%) invert(77%) sepia(61%) saturate(638%) hue-rotate(358deg) brightness(103%) contrast(96%);
}
.ae-unsaved-bar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ae-unsaved-bar .ae-btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.06);
}
.ae-unsaved-bar .ae-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.ae-unsaved-bar .ae-btn-primary {
  background: #fff;
  color: #38128A;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.ae-unsaved-bar .ae-btn-primary:hover {
  background: #f8fafc;
  color: #2d0a6e;
}
.ae-unsaved-bar .ae-unsaved-bar-save-icon {
  filter: brightness(0) saturate(100%) invert(14%) sepia(87%) saturate(3452%) hue-rotate(258deg) brightness(88%) contrast(101%);
}
.ae-unsaved-back-dialog { width: min(420px, calc(100vw - 32px)); }
.ae-product-editor-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ae-product-back { font-size: 13px; color: #64748b; text-decoration: none; flex-shrink: 0; }
.ae-product-back:hover { color: #38128A; }
.ae-product-editor-head-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ae-product-editor-head-main h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ae-product-editor-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.ae-product-editor-form { min-width: 0; }
.ae-product-panel {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px 20px; margin-bottom: 14px;
}
.ae-product-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ae-product-panel-head h2 { margin: 0; font-size: 14px; font-weight: 700; color: #1e293b; }
.ae-product-editor-full .ae-field > label:not(.ae-field-sublabel):not(.ae-checkbox-row) {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}
.ae-field-header {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.ae-field-header-section { margin-bottom: 16px; }
.ae-field-label-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.ae-field-label-hint {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: #64748b;
}
.ae-field-label-link {
  display: inline-block;
  margin-top: 4px;
  color: #38128A;
  font-weight: 600;
  text-decoration: none;
}
.ae-field-label-link:hover { text-decoration: underline; }
.ae-field-sublabel {
  display: block;
  margin: 0 0 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.ae-field-compact { margin-bottom: 0; }
.ae-product-panel-avo > .ae-field-compact:only-child { margin-bottom: 0; }

/* Essentials — merged title, pricing, content */
.ae-product-essentials .ae-product-panel-head { margin-bottom: 16px; }
.ae-product-storefront-details__hint { margin: -6px 0 16px; max-width: 62ch; }
.ae-product-storefront-details__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
@media (max-width: 900px) {
  .ae-product-storefront-details__grid { grid-template-columns: 1fr; }
}
.ae-essentials-group {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid #f1f5f9;
}
.ae-essentials-group:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}
.ae-essentials-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ae-essentials-subhead h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
}
.ae-essentials-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.ae-essentials-published,
.ae-essentials-product-type {
  margin: 0;
}
.ae-field-type-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}
.ae-segmented-control {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 320px;
  padding: 4px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  gap: 4px;
}
.ae-segment {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}
.ae-segment-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}
.ae-segment-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #64748b;
  transition: background .15s, color .15s, box-shadow .15s;
}
.ae-segment:has(.ae-segment-input:checked) .ae-segment-label {
  background: #fff;
  color: #38128A;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.ae-segment:hover .ae-segment-label {
  color: #334155;
}
.ae-segment:has(.ae-segment-input:checked):hover .ae-segment-label {
  color: #38128A;
}
.ae-segment-input:focus-visible + .ae-segment-label {
  outline: 2px solid #38128A;
  outline-offset: 1px;
}
.ae-essentials-status-grid .ae-segment-label {
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
}
.ae-product-essentials .ae-field-pricing { margin-bottom: 0; }
.ae-product-essentials .ae-extra-description:first-of-type { margin-top: 0; }

.ae-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.ae-input:focus {
  outline: none;
  border-color: #38128A;
  box-shadow: 0 0 0 3px rgba(56, 18, 138, 0.08);
}
.ae-input::placeholder { color: #94a3b8; }
.ae-collections-picker { width: 100%; }
.ae-collections-picker .selectize-control { width: 100%; }
.ae-collections-picker select#multiple-collection.selectized {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.ae-field-collections { margin-bottom: 0; }
.ae-product-editor-full .selectize-control.multi .selectize-input {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
.ae-product-editor-full .selectize-control.multi .selectize-input.focus {
  border-color: #38128A;
  box-shadow: 0 0 0 3px rgba(56, 18, 138, 0.08);
}
.ae-product-editor-full .selectize-control.multi .selectize-input > div.item {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  border-radius: 6px;
  font-size: 12px;
  padding: 2px 8px;
}
.ae-product-editor-full .selectize-dropdown {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.ae-extra-description { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #e5e7eb; }
.ae-extra-description.hidden { display: none !important; }
.ae-extra-description-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ae-btn-text { border: none; background: transparent; padding: 0; font-size: 12px; font-weight: 600; cursor: pointer; color: #38128A; }
.ae-btn-text-muted { color: #64748b; }
.ae-btn-text:hover { color: #2d0f6e; }
.ae-btn-add-description {
  margin-top: 12px;
  border: 1px dashed #c7d2fe;
  background: #faf5ff;
  color: #38128A;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ae-btn-add-description.hidden { display: none !important; }
.ae-btn-add-description:hover { background: #f3e8ff; }
.ae-textarea { min-height: 120px; resize: vertical; }
.ae-panel-hint {
  margin: -6px 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}
.ae-panel-hint-link {
  margin-left: 6px;
  color: #38128A;
  font-weight: 600;
  text-decoration: none;
}
.ae-panel-hint-link:hover { text-decoration: underline; }

/* Catalogue organization (Studio) */
.ae-tag-editor {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
  transition: border-color .15s, background .15s;
}
.ae-tag-editor:focus-within {
  border-color: #38128A;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(56, 18, 138, 0.08);
}
.ae-tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ae-tag-chips:empty { margin-bottom: 0; }
.ae-product-editor-full .ae-tag-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  font-size: 12px;
  color: #3730a3;
}
.ae-product-editor-full .ae-tag-chips .chip--button {
  cursor: pointer;
  padding: 0 2px;
  background: transparent;
  color: #64748b;
}
.ae-tag-input {
  width: 100%;
  border: none;
  padding: 4px 0;
  font-size: 13px;
  background: transparent;
}
.ae-tag-input:focus { outline: none; }

/* Stock panel */
.ae-product-tool-stock .ae-field-header-section { margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.ae-stock-summary { min-width: 0; }
.ae-stock-section-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ae-muted, #64748b);
}
.ae-stock-table-wrap {
  margin-top: 4px;
  border: 1px solid var(--ae-border, #e5e7eb);
  border-radius: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ae-surface, #fff);
}
.ae-stock-table-inner {
  display: block;
  width: 100%;
  min-width: 360px;
  font-size: 13px;
  --ae-stock-cols: minmax(160px, 1.5fr) minmax(120px, 1fr) minmax(148px, auto);
}
.ae-stock-table-inner--warehouse {
  --ae-stock-cols: minmax(140px, 1.2fr) minmax(110px, 0.9fr) minmax(150px, 1.1fr) minmax(148px, auto);
  min-width: 480px;
}
.ae-stock-table-head,
.ae-stock-table-row {
  display: grid;
  grid-template-columns: var(
    --ae-stock-cols,
    minmax(160px, 1.5fr) minmax(120px, 1fr) minmax(148px, auto)
  );
  align-items: center;
  width: 100%;
}
.ae-product-editor-full .ae-product-tool-stock .ae-stock-table-head,
.ae-product-editor-full .ae-product-tool-stock .ae-stock-table-row {
  display: grid !important;
  grid-template-columns: var(
    --ae-stock-cols,
    minmax(160px, 1.5fr) minmax(120px, 1fr) minmax(148px, auto)
  );
}
.ae-product-editor-full .ae-product-tool-stock .ae-stock-table-inner--warehouse .ae-stock-table-head,
.ae-product-editor-full .ae-product-tool-stock .ae-stock-table-inner--warehouse .ae-stock-table-row {
  grid-template-columns: minmax(140px, 1.2fr) minmax(110px, 0.9fr) minmax(150px, 1.1fr) minmax(148px, auto);
}
.ae-stock-table-body { display: block; min-width: 0; }
.ae-stock-table-head {
  background: #f8fafc;
  color: var(--ae-muted, #64748b);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--ae-border, #e5e7eb);
}
.ae-stock-table-head-cell {
  padding: 10px 12px;
  min-width: 0;
  white-space: nowrap;
}
.ae-stock-table-head-cell-qty {
  text-align: right;
  justify-self: stretch;
}
.ae-stock-table-row {
  border-bottom: 1px solid var(--ae-border, #e5e7eb);
  background: var(--ae-surface, #fff);
}
.ae-stock-table-row:last-child { border-bottom: none; }
.ae-stock-table-row:hover { background: #fafafa; }
.ae-stock-table-cell {
  padding: 10px 12px;
  min-width: 0;
}
.ae-stock-table-cell-variant { min-width: 0; }
.ae-stock-variant-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ae-text, #1e293b);
  word-break: break-word;
  line-height: 1.35;
}
.ae-stock-table-cell-sku { min-width: 0; }
.ae-code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-all;
}
.ae-stock-table-cell-warehouse { min-width: 0; }
.ae-stock-warehouse-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ae-stock-warehouse-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
}
.ae-stock-warehouse-name {
  color: #475569;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ae-stock-warehouse-qty {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--ae-text, #1e293b);
  font-variant-numeric: tabular-nums;
}
.ae-stock-table-cell-qty {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.ae-stock-qty-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}
.ae-stock-table-inner .ae-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  font-variant-numeric: tabular-nums;
}
.ae-stock-status-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #991b1b;
  white-space: nowrap;
}
.ae-stock-status-label--low { color: #92400e; }
.ae-stock-row--empty { background: #fffbfb; }
.ae-stock-row--low { background: #fffef8; }
.ae-stock-row--empty:hover { background: #fff5f5; }
.ae-stock-row--low:hover { background: #fffbeb; }
.ae-stock-form {
  border: 1px solid var(--ae-border, #e5e7eb);
  border-radius: 10px;
  padding: 16px;
  background: var(--ae-surface, #fff);
}
.ae-stock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.ae-stock-grid .ae-field { margin-bottom: 0; }
.ae-input-qty { max-width: 120px; }
.ae-stock-track {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ae-border, #e5e7eb);
}
.ae-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 560px;
  cursor: pointer;
  user-select: none;
}
.ae-checkbox-input {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  margin: 2px 0 0;
  padding: 0 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px;
  background: #fff !important;
  flex-shrink: 0;
  accent-color: #38128A;
  cursor: pointer;
  box-shadow: none !important;
}
.ae-checkbox-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ae-checkbox-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  margin: 0;
}
.ae-checkbox-hint {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  font-weight: 400;
}
.ae-product-editor-full .ae-checkbox-row .ae-checkbox-title { margin-bottom: 0; }

/* Variants (Shopify-like in Studio) */
.ae-product-tool-panel { margin-bottom: 0; }
.ae-product-tool-variants { overflow: hidden; }
.ae-product-tool-variants.hidden { display: none !important; }
.ae-variant-section-hint {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  text-align: left;
}
.ae-variant-section-hint.hidden { display: none; }
.ae-variant-studio-shell {
  min-width: 0;
  text-align: left;
}
.ae-variant-options-block {
  margin-bottom: 4px;
  text-align: left;
}
.ae-variant-options-block--populated {
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}
.ae-variant-add-option { padding: 2px 0 0; }
.ae-variant-add-option.border-b { border-bottom: none; }
.ae-btn-add-variant-option,
.ae-product-editor-full .ae-variant-add-option .add-new-option-layout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: #38128A;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}
.ae-btn-add-variant-option:hover,
.ae-product-editor-full .ae-variant-add-option .add-new-option-layout:hover { text-decoration: underline; }

/* Neutralize Avo custom.css inside Studio variants */
.ae-product-tool-variants .field-wrapper label,
.ae-product-tool-variants .inventory-section-main .field label {
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  font-family: inherit !important;
  display: block;
  margin: 0 0 5px;
}
.ae-product-tool-variants .field-wrapper input:not([type="checkbox"]):not([type="radio"]),
.ae-product-tool-variants input.undo-input,
.ae-product-tool-variants .select-box,
.ae-product-tool-variants .ae-variant-select {
  color: #1e293b !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
.ae-product-tool-variants .select2-container { width: 100% !important; max-width: none; }
.ae-product-tool-variants .select2-container .select2-selection--single {
  height: 38px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  background: #fff !important;
}
.ae-product-tool-variants .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px !important;
  color: #1e293b !important;
  font-size: 13px !important;
  padding-left: 10px;
}
.ae-product-tool-variants .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px !important;
  right: 6px;
}
.ae-product-tool-variants .select2-container--default.select2-container--open .select2-selection--single,
.ae-product-tool-variants .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #38128A !important;
  box-shadow: 0 0 0 3px rgba(56, 18, 138, 0.08) !important;
}
.ae-product-tool-variants .select2-dropdown {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ae-product-tool-variants .select2-results__option {
  font-size: 13px;
  padding: 8px 12px;
}
.ae-product-tool-variants .select2-results__option--highlighted.select2-results__option--selectable {
  background: #f5f3ff !important;
  color: #38128A !important;
}

/* Select2 dropdown is appended to body — global Studio class */
.select2-container--open .ae-studio-select2-dropdown {
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
  z-index: 9999;
}
.ae-studio-select2-dropdown .select2-results__option {
  font-size: 13px;
  padding: 8px 12px;
  color: #1e293b;
}
.ae-studio-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
  background: #f5f3ff !important;
  color: #38128A !important;
}
.ae-studio-select2-dropdown .select2-search--dropdown { display: none; }

/* Variant option cards */
.ae-variant-options-layout,
.ae-product-editor-full .variant-options-layout { padding-top: 0; }
.ae-variant-option-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin: 0 0 10px;
  background: #fff;
  overflow: hidden;
}
.ae-variant-option-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #f8fafc;
}
.ae-variant-option-summary-body {
  flex: 1;
  min-width: 0;
}
.ae-variant-option-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ae-variant-option-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  text-transform: capitalize;
  flex-shrink: 0;
}
.ae-variant-option-sep {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}
.ae-variant-option-edit-btn { flex-shrink: 0; margin-left: auto; }
.ae-variant-option-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.ae-variant-option-values span,
.ae-variant-option-values .chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}
.ae-variant-option-editor { padding: 0 14px 14px; background: #fff; }
.ae-variant-option-row,
.ae-variant-value-row {
  display: flex;
  gap: 10px;
}
.ae-variant-option-row-main {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 38px;
  column-gap: 10px;
  align-items: end;
}
.ae-variant-option-row-main .ae-variant-drag-row,
.ae-variant-option-row-main .ae-variant-icon-btn-row {
  width: 38px;
  height: 38px;
  align-self: end;
}
.ae-variant-value-row { align-items: center; }
.ae-variant-option-field { flex: 1; min-width: 0; margin-bottom: 0 !important; }
.ae-variant-values { margin-top: 14px; }
.ae-variant-values-head { margin-bottom: 8px; padding-left: 34px; }
.ae-variant-values-list { display: flex; flex-direction: column; gap: 8px; }
.ae-variant-value-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}
.ae-variant-value-input { flex: 1; min-width: 0; }
.ae-variant-option-errors { min-height: 0; padding: 4px 0 0 34px; }
.ae-variant-option-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.ae-variant-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #94a3b8;
  cursor: grab;
}
.ae-variant-drag-icon { width: 14px; height: 14px; opacity: .65; }
.ae-variant-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.ae-variant-icon-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
}
.ae-variant-icon { width: 14px; height: 14px; }
.ae-variant-option-card .item-view-section:not(.expand) { display: flex; }
.ae-variant-option-card .item-view-section.expand {
  height: 0 !important;
  overflow: hidden;
  padding: 0 !important;
  margin: 0;
  border: none;
}
.ae-variant-option-card .item-section.expand {
  height: 0 !important;
  overflow: hidden;
  padding: 0 !important;
}

.ae-product-editor-full .ae-variant-add-option .add-new-option-layout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #38128A;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}
.ae-product-editor-full .variant-table.ae-variant-table,
.ae-product-editor-full .variant-table.ae-variant-table-studio,
.ae-product-editor-full .ae-variant-table {
  margin: 14px 0 0;
  border: none;
  border-radius: 0;
  box-shadow: none !important;
  overflow: visible;
}
.ae-product-editor-full .ae-variant-table--empty {
  margin-top: 0;
}
.ae-product-editor-full .ae-variant-table--empty .ae-variant-bulk-bar,
.ae-product-editor-full .ae-variant-table--empty .ae-variant-bulk-actions,
.ae-product-editor-full .ae-variant-table--empty .ae-variant-table-wrap {
  display: none !important;
}
.ae-variant-table-wrap {
  margin-top: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}
.ae-variant-table-inner { display: block; width: 100%; min-width: 0; }
.ae-product-editor-full .variant.nested_form_fields,
.ae-product-editor-full .variant.flex.nested-form-fields,
.ae-product-editor-full .ae-variant-row.variant.nested-form-fields {
  display: grid;
  /* Low minimums: the 6 columns must fit the panel without horizontal
     scroll in the common case, otherwise the sticky first column hides the
     price column. */
  grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(88px, 1fr)) minmax(96px, auto);
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}
.ae-variant-title-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.ae-variant-new-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #38128A;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.ae-variant-table-checkbox,
.ae-studio-checkbox {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  margin: 0;
  padding: 0 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px;
  background: #fff !important;
  accent-color: #38128A;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: none !important;
}
.ae-variant-bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 14px;
  margin: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}
.ae-variant-bulk-bar.hidden { display: none; }
.ae-variant-bulk-actions {
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}
.ae-variant-bulk-actions.hidden { display: none; }
.ae-variant-bulk-actions-inner {
  padding: 10px 14px;
}
.ae-variant-bulk-actions-inner.hidden { display: none; }
.ae-variant-bulk-actions-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.ae-variant-bulk-actions-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.ae-variant-bulk-link-danger { color: #dc2626 !important; }
.ae-variant-bulk-link-danger:hover { color: #b91c1c !important; }
.ae-variant-bulk-modal-overlay {
  z-index: 10050 !important;
}
.ae-variant-bulk-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ae-variant-bulk-modal-body .ae-field {
  margin: 0;
}
.ae-variant-bulk-modal-body .ae-input {
  width: 100%;
}
.ae-variant-bulk-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.ae-variant-bulk-link,
.ae-variant-filter-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #38128A;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ae-variant-bulk-link:hover,
.ae-variant-filter-btn:hover { text-decoration: underline; }
.ae-variant-bulk-sep { color: #cbd5e1; user-select: none; }
.ae-variant-filter-dropdown { position: relative; display: inline-flex; align-items: center; }
.ae-variant-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 160px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ae-variant-filter-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}
.ae-variant-filter-menu label:hover { background: #f8fafc; }
.ae-variant-filter-menu input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  padding: 0 !important;
  accent-color: #38128A;
  margin: 0;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px;
  background: #fff !important;
  box-shadow: none !important;
}
.ae-variant-table-head {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(88px, 1fr)) minmax(96px, auto);
  align-items: center;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #e5e7eb;
}
.ae-variant-table-head-variant {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 12px;
  /* Guard against legacy .disable-scroll-left fixed widths leaking in. */
  min-width: 0;
  max-width: none;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  box-shadow: 6px 0 8px -6px rgba(15, 23, 42, 0.14);
}
.ae-variant-table-head-cell,
.ae-variant-table-head-actions {
  padding: 10px 12px;
}
.ae-variant-table-head-actions { border-left: 1px solid transparent; }
.ae-variant-row-variant {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Guard against legacy .disable-scroll-left fixed widths leaking in. */
  min-width: 0;
  max-width: none;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 10px 12px;
  box-shadow: 6px 0 8px -6px rgba(15, 23, 42, 0.14);
}
.ae-variant-row-field {
  display: flex;
  align-items: center;
  padding: 10px 12px;
}
.ae-variant-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  position: sticky;
  right: 0;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -6px 0 8px -6px rgba(15, 23, 42, 0.14);
}
.ae-variant-row-title {
  font-size: 13px;
  font-weight: 600;
  color: #38128A;
  text-decoration: none;
  word-break: break-word;
}
.ae-variant-row-title:hover { text-decoration: underline; }
.ae-variant-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}
.ae-variant-thumb-icon { width: 22px; height: 22px; object-fit: contain; }
.ae-product-editor-full .ae-variant-row:hover { background: #fafafa; }
.ae-product-editor-full .ae-variant-row:hover .ae-variant-row-variant,
.ae-product-editor-full .ae-variant-row:hover .ae-variant-row-actions { background: #fafafa; }
.ae-product-editor-full .variant-table .variant_title,
.ae-product-editor-full .variant-table .ae-variant-row-title {
  font-size: 13px;
  font-weight: 600;
  color: #38128A;
  text-decoration: none;
  word-break: break-word;
}
.ae-product-editor-full .variant-table .filter-options {
  padding: 10px 14px;
  margin: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  align-items: center;
  gap: 16px;
  list-style: none;
}
.ae-product-editor-full .variant-table .filter-options > div {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.ae-product-editor-full .variant-table .filter-options button {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #38128A;
  cursor: pointer;
}
.ae-product-editor-full .variant-table .filter-options button:hover { text-decoration: underline; }
.ae-product-editor-full .variant-table .table {
  display: block;
  width: 100%;
}
.ae-product-editor-full .variant-table .table > .flex.border-b {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(110px, 1fr)) minmax(120px, auto);
  align-items: center;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #e5e7eb;
}
.ae-product-editor-full .variant-table .table > .flex.border-b > div {
  padding: 10px 12px;
}
.ae-product-editor-full .variant-table .table > .flex.border-b > div:first-child {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}
.ae-product-editor-full .variant.nested_form_fields,
.ae-product-editor-full .variant.flex.nested-form-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(88px, 1fr)) minmax(96px, auto);
  align-items: stretch;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}
.ae-product-editor-full .variant.nested_form_fields > div,
.ae-product-editor-full .variant.flex.nested-form-fields > div:not(.ae-variant-row-variant):not(.ae-variant-row-field):not(.ae-variant-row-actions) {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  min-width: 0;
}
.ae-product-editor-full .variant.nested_form_fields > .variant-list,
.ae-product-editor-full .variant.flex.nested-form-fields > .variant-list {
  gap: 10px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 6px 0 8px -6px rgba(15, 23, 42, 0.14);
}
.ae-product-editor-full .variant.nested_form_fields > .actions-section,
.ae-product-editor-full .variant.flex.nested-form-fields > .actions-section {
  gap: 8px;
  justify-content: flex-start;
  position: sticky;
  right: 0;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -6px 0 8px -6px rgba(15, 23, 42, 0.14);
}
.ae-product-editor-full .variant.nested_form_fields:hover,
.ae-product-editor-full .variant.flex.nested-form-fields:hover { background: #fafafa; }
.ae-product-editor-full .variant.nested_form_fields:hover > .variant-list,
.ae-product-editor-full .variant.flex.nested-form-fields:hover > .variant-list,
.ae-product-editor-full .variant.nested_form_fields:hover > .actions-section,
.ae-product-editor-full .variant.flex.nested-form-fields:hover > .actions-section { background: #fafafa; }
.ae-product-editor-full .variant-table .variant-overflow {
  overflow-x: auto;
}
.ae-product-editor-full .variant-table .variant-item-image,
.ae-product-editor-full .variant-table .ae-variant-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}
.ae-product-editor-full .variant-table .ae-variant-row-field .ae-input,
.ae-product-editor-full .variant-table input:not([type="checkbox"]):not([type="radio"]),
.ae-product-editor-full .variant-table .variant_price,
.ae-product-editor-full .variant-table .variant_available,
.ae-product-editor-full .variant-table .variant_sku,
.ae-product-editor-full .variant-table .variant_barcode {
  width: 100%;
  max-width: 140px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #1e293b !important;
}
.ae-product-editor-full .variant-table .actions-section .ae-btn-ghost {
  padding: 4px 10px;
  min-height: 32px;
}
.ae-product-editor-full .editable-variant-modal:not(.hidden),
.ae-product-editor-full .editable-variant-image-modal:not(.hidden) {
  z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  padding: 24px 16px;
}
.ae-product-editor-full .editable-variant-modal:not(.hidden) > div,
.ae-product-editor-full .editable-variant-image-modal:not(.hidden) > div {
  width: 100%;
  max-width: 640px;
}
.ae-product-editor-full .editable-variant-modal .m-1,
.ae-product-editor-full .editable-variant-image-modal .m-1 {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}
.ae-product-editor-full .bulk-actions-menu .rounded-md.shadow-md {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: none;
  background: #fff;
}
.ae-product-editor-full .bulk-actions-menu-dropdown {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ae-product-editor-full .bulk-actions-menu-dropdown a {
  color: #334155;
  font-size: 13px;
}
.ae-product-editor-full .bulk-actions-menu-dropdown a:hover {
  background: #f8fafc;
  color: #38128A;
}
.ae-product-editor-full .select2-container .select2-selection--single {
  height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.ae-product-editor-full .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  color: #1e293b;
  font-size: 13px;
}
.ae-field-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ae-product-editor-savebar { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.ae-product-editor-savebar form { display: inline; }
.ae-product-preview {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; margin-bottom: 12px;
}
.ae-product-preview-media { aspect-ratio: 1; background: #f8fafc; }
.ae-product-preview-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ae-product-preview-meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b; }
.ae-product-preview-meta strong { font-size: 16px; color: #1e293b; }
.ae-product-copilot-panel {
  background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
  border: 1px solid #e9d5ff; border-radius: 12px; padding: 14px;
}
.ae-product-copilot-head p { margin: 6px 0 0; font-size: 12px; color: #64748b; line-height: 1.45; }
.ae-product-copilot-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ae-agent-chip-sm { font-size: 11px; padding: 4px 10px; }
.ae-agent-chip-block { width: 100%; text-align: left; justify-content: flex-start; }

/* Product media gallery */
.ae-product-media .ae-media-count { font-size: 12px; color: #64748b; }
.ae-media-dropzone {
  border: 2px dashed #d1d5db; border-radius: 12px; padding: 28px 20px; text-align: center;
  background: #fafafa; cursor: pointer; transition: border-color .15s, background .15s;
}
.ae-media-dropzone.is-dragover { border-color: #6366f1; background: #eef2ff; }
.ae-media-dropzone-icon {
  width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 999px;
  background: #fff; border: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #6366f1; font-weight: 300;
}
.ae-media-dropzone-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: #1e293b; }
.ae-media-dropzone-hint { margin: 0 0 12px; font-size: 12px; color: #64748b; }
.ae-media-status { font-size: 12px; margin: 10px 0 0; color: #64748b; }
.ae-media-status[data-state="error"] { color: #dc2626; }
.ae-media-status[data-state="loading"] { color: #4338ca; }
.ae-media-gallery { margin-top: 16px; }
.ae-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ae-media-empty { margin: 0; font-size: 13px; color: #94a3b8; padding: 8px 2px; }
.ae-media-card {
  border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; background: #fff;
}
.ae-media-card-preview { position: relative; aspect-ratio: 1; background: #f8fafc; }
.ae-media-card-media { width: 100%; height: 100%; object-fit: cover; display: block; }
.ae-media-badge {
  position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; background: rgba(15, 23, 42, .72); color: #fff; padding: 2px 6px; border-radius: 6px;
}
.ae-media-card-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 8px; background: linear-gradient(180deg, transparent 35%, rgba(15, 23, 42, .72));
  opacity: 0; transition: opacity .15s;
}
.ae-media-card:hover .ae-media-card-overlay { opacity: 1; }
.ae-media-card-btn {
  align-self: flex-end; border: none; border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.92); color: #1e293b; cursor: pointer;
}
.ae-media-card-btn-danger { color: #dc2626; font-size: 16px; line-height: 1; padding: 2px 8px; }
.ae-media-card-variant { width: 100%; }
.ae-media-variant-select {
  width: 100%; font-size: 11px; border-radius: 8px; border: 1px solid #e5e7eb; padding: 4px 6px; background: #fff;
}
.ae-media-card-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ae-media-card-name { font-size: 11px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-media-card-alt { font-size: 10px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-media-alt-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.ae-media-alt-modal.hidden { display: none; }
.ae-media-alt-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.ae-media-alt-dialog {
  position: relative; width: min(420px, calc(100vw - 32px)); background: #fff; border-radius: 14px;
  padding: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
}
.ae-media-alt-dialog h3 { margin: 0 0 12px; font-size: 16px; }
.ae-media-alt-dialog .ae-input { width: 100%; margin-bottom: 14px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; }
.ae-media-alt-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Copilot composer attachments (Cursor-like) */
.ae-copilot-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
}
.ae-copilot-attachments[hidden] { display: none !important; }
.ae-copilot-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(220px, 100%);
  padding: 4px 6px 4px 4px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  color: #334155;
}
.ae-te-design-shell .ae-copilot-composer-field .ae-copilot-attachment-chip {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: #e4e4e7;
}
.ae-te-design-shell .ae-copilot-composer-field .ae-copilot-selection-chip {
  color: #c7d2fe;
  background: rgba(99,102,241,0.16);
  border-color: rgba(129,140,248,0.35);
}
.ae-copilot-drawer .ae-copilot-composer-field .ae-copilot-attachment-chip {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
  background: #f8fafc;
  border-color: #e5e7eb;
}
.ae-copilot-drawer .ae-copilot-composer-field .ae-copilot-selection-chip {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #5850ec;
  background: #eef2ff;
  border-color: #c7d2fe;
  border-radius: 8px;
}
.ae-copilot-attachment-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.ae-copilot-attachment-file-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #eef2ff;
  flex-shrink: 0;
  font-size: 14px;
}
.ae-copilot-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ae-copilot-attachment-remove {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.ae-copilot-attachment-remove:hover { color: #475569; }
.ae-copilot-attach-icon { color: #64748b; flex-shrink: 0; }
.ae-copilot-attach-icon:hover { color: #38128A; background: #f8fafc; }
.ae-copilot-selection-refs {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ae-copilot-selection-refs[hidden] { display: none !important; }
.ae-copilot-selection-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 999px; padding: 3px 8px 3px 10px; max-width: 100%;
}
.ae-copilot-selection-chip-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.ae-copilot-selection-chip button {
  border: none; background: transparent; color: #64748b; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0;
}
.ae-copilot-selection-chip button:hover { color: #1e293b; }
.ae-copilot-annotation-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: #1e3a8a; background: #eff6ff; border: 1px solid #93c5fd;
  border-radius: 8px; padding: 3px 8px 3px 4px; max-width: 100%;
}
.ae-copilot-annotation-thumb {
  width: 40px; height: 28px; object-fit: cover; border-radius: 4px; border: 1px solid #bfdbfe;
  flex-shrink: 0;
}
.ae-copilot-annotation-chip-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.ae-copilot-file-input,
.ae-copilot-composer .sr-only[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
}
.ae-copilot-file-input::before,
.ae-copilot-file-input::after,
.ae-copilot-composer input[type="file"]::before,
.ae-copilot-composer input[type="file"]::after {
  content: none !important;
  display: none !important;
}

/* Product metafields (Studio) */
.ae-product-metafields { padding-bottom: 20px; }
.ae-product-metafields .ae-product-panel-head {
  padding: 18px 20px 0;
  margin-bottom: 0;
}
.ae-metafields-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ede9fe;
  color: #38128A;
  font-size: 11px;
  font-weight: 700;
}
.ae-metafields-count.hidden { display: none !important; }
.ae-metafields-intro {
  padding: 12px 20px 0;
}
.ae-metafields-intro .ae-field-label-hint { margin: 0 0 10px; }
.ae-metafields-liquid {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #475569;
}
.ae-metafields-liquid span { color: #94a3b8; }
.ae-metafields-list-wrap {
  padding: 16px 20px 0;
}
.ae-metafields-empty {
  padding: 20px 16px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  text-align: center;
}
.ae-metafields-empty p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}
.ae-metafields-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.ae-metafields-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ae-metafields-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.ae-metafields-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.ae-metafields-table td {
  padding: 12px;
  vertical-align: top;
  border-bottom: 1px solid #f1f5f9;
}
.ae-metafields-table tbody tr:last-child td { border-bottom: none; }
.ae-metafields-table tbody tr:hover { background: #fafafa; }
.ae-metafields-path {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: #38128A;
}
.ae-metafields-liquid-mini {
  display: block;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #94a3b8;
  word-break: break-all;
}
.ae-metafields-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ae-metafields-value {
  display: block;
  max-width: 320px;
  color: #334155;
  line-height: 1.45;
  word-break: break-word;
}
.ae-metafields-table-actions {
  width: 96px;
  text-align: right;
  white-space: nowrap;
}
.ae-metafields-delete {
  color: #dc2626 !important;
}
.ae-metafields-delete:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}
.ae-metafields-form {
  margin: 16px 20px 0;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.ae-metafields-form-head h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}
.ae-metafields-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ae-metafields-form-grid .ae-field { margin-bottom: 0; }
.ae-metafields-form-grid .ae-field-full { grid-column: 1 / -1; }
.ae-metafields-form-grid .ae-textarea {
  min-height: 88px;
  resize: vertical;
}
.ae-metafields-form-actions {
  margin-top: 14px;
}

/* Digital delivery (Studio) */
.ae-product-digital-delivery.hidden { display: none !important; }
.ae-product-digital-delivery .ae-product-panel-head {
  padding: 18px 20px 0;
  margin-bottom: 0;
}
.ae-digital-delivery-intro {
  padding: 10px 20px 0;
}
.ae-digital-delivery-intro .ae-field-label-hint { margin: 0; }
.ae-digital-delivery-group {
  padding: 16px 20px 0;
}
.ae-digital-delivery-group.ae-digital-delivery-settings {
  padding-bottom: 20px;
  margin-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.ae-digital-delivery-subhead h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.ae-digital-assets-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.ae-digital-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.ae-digital-asset-row:last-child { border-bottom: none; }
.ae-digital-asset-meta { min-width: 0; }
.ae-digital-asset-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  word-break: break-all;
}
.ae-digital-asset-size {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
}
.ae-digital-asset-delete {
  color: #dc2626 !important;
  flex-shrink: 0;
}
.ae-digital-asset-delete:hover {
  background: #fef2f2 !important;
}
.ae-digital-assets-empty {
  padding: 16px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  margin-bottom: 12px;
}
.ae-digital-assets-empty p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}
.ae-digital-files-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.ae-digital-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
}
.ae-digital-upload-status {
  font-size: 12px;
  color: #38128A;
  font-weight: 600;
}
.ae-digital-upload-status.hidden { display: none !important; }
.ae-digital-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ae-digital-settings-grid .ae-field { margin-bottom: 0; }
.ae-digital-settings-actions { margin-top: 14px; }
.ae-product-tool-stock.hidden { display: none !important; }

/* ——— Menu editor (Studio) ——— */
.ae-menu-card {
  margin-bottom: 12px;
  transition: opacity .22s ease, transform .22s ease, filter .22s ease, border-color .15s, box-shadow .15s;
}
.ae-menu-card-clickable:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 16px rgba(56, 18, 138, 0.08);
}
.ae-menu-card-link {
  flex: 1;
  min-width: 0;
  display: block;
  text-decoration: none;
  color: inherit;
}
.ae-menu-card-link:hover .ae-scenario-title {
  color: #38128A;
}
.ae-menu-card-preview { margin: 8px 0 0; }
.ae-menu-recipes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.ae-menu-recipes > form {
  display: flex;
  height: 100%;
  margin: 0;
  min-width: 0;
}
.ae-menu-recipes .ae-menu-recipe-card {
  flex: 1;
  height: 100%;
  min-height: 148px;
}
.ae-menu-recipes .ae-menu-recipe-subtitle {
  flex: 1;
  min-height: 2.75em;
  line-height: 1.45;
  font-size: 13px;
  color: #6b7280;
}
.ae-menu-recipes .ae-menu-recipe-status {
  margin-top: auto;
  padding-top: 8px;
}
.ae-menu-card.is-removing {
  opacity: 0;
  transform: scale(0.98) translateY(-4px);
  filter: blur(1px);
  pointer-events: none;
}
.ae-menu-empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 16px;
}
.ae-menu-empty p { margin: 0; color: var(--ae-muted); font-size: 14px; }
.ae-menu-editor { max-width: 960px; }
.ae-menu-editor-form { display: flex; flex-direction: column; gap: 16px; }
.ae-menu-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ae-field-hint { margin: 4px 0 0; font-size: 11px; color: var(--ae-muted); }
.ae-menu-items-panel .ae-product-panel-head { flex-direction: column; align-items: flex-start; }
.ae-menu-items-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.ae-menu-item {
  padding: 14px 14px 14px calc(14px + var(--ae-menu-depth, 0) * 16px);
  border: 1px solid var(--ae-border);
  border-radius: 10px;
  background: var(--ae-surface);
  border-left: 3px solid var(--ae-accent-border);
}
.ae-menu-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ae-menu-item-actions { margin-top: 10px; }
.ae-menu-item-remove { color: #b91c1c !important; }
.ae-menu-add-item { margin-top: 4px; }
.ae-menu-editor-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 4px;
  margin-top: 4px;
}
.ae-menu-create-hint { margin: 0; }
.ae-flash-error { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.ae-flash-success { background: #d1fae5; color: #065f46; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.ae-menu-items-panel .select2-container { width: 100% !important; }
.ae-menu-items-panel .select2-container .select2-selection--single {
  min-height: 38px;
  border: 1px solid var(--ae-border);
  border-radius: 8px;
}

/* --- Merchant OS: brief, plan, migration, home widgets --- */
.ae-next-step-card-shell {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
}
.ae-next-step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ae-next-step-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  min-width: 0;
}
.ae-next-step-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}
.ae-next-step-card-toggle span {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
}
.ae-next-step-card-shell.is-collapsed .ae-next-step-card-body { display: none; }
.ae-next-step-card-shell.is-collapsed .ae-next-step-card-toggle span {
  transform: rotate(-90deg);
}
.ae-next-step-card-footer { margin-top: 8px; }
.ae-section.ae-home-today { margin-bottom: 12px; }
.ae-section.ae-home-agentic-preview {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.ae-home-agentic-progressbar { margin: 8px 0 12px; }
.ae-home-agentic-stats { margin-top: 0; }
.ae-home-agentic-footer { margin: 8px 0 0; }
.ae-onboarding-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; background: var(--ae-accent-soft, #eef2ff);
  border: 1px solid var(--ae-accent-border, #c7d2fe); border-radius: 12px;
}
.ae-onboarding-banner strong { font-size: 15px; color: var(--ae-text, #111827); }
.ae-onboarding-banner p { margin: 4px 0 0; }
.ae-plan-progressbar {
  height: 8px; background: var(--ae-border, #e5e7eb); border-radius: 999px;
  overflow: hidden; margin: 10px 0;
}
.ae-plan-progressbar span { display: block; height: 100%; background: var(--ae-accent, #4f46e5); border-radius: 999px; transition: width .3s; }
.ae-home-tasks { list-style: none; margin: 8px 0 0; padding: 0; }
.ae-home-tasks li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--ae-border, #e5e7eb); font-size: 14px;
}
.ae-home-tasks li:last-child { border-bottom: none; }
.ae-home-tasks a { color: var(--ae-accent, #4f46e5); text-decoration: none; }
.ae-home-tasks a:hover { text-decoration: underline; }

.ae-brief-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ae-brief-form .ae-product-panel { margin-bottom: 16px; }
.ae-brief-project-types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ae-brief-project-type {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px;
  border: 2px solid var(--ae-border, #e5e7eb); border-radius: 10px; cursor: pointer;
}
.ae-brief-project-type:has(input:checked) { border-color: var(--ae-accent, #4f46e5); background: var(--ae-accent-soft, #eef2ff); }
.ae-brief-project-type input { margin-top: 3px; }
.ae-brief-project-type strong { display: block; font-size: 14px; }
.ae-brief-project-type .ae-hint { display: block; font-size: 12px; }

.ae-plan-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ae-border, #e5e7eb); margin-bottom: 16px; }
.ae-plan-tab {
  padding: 8px 16px; font-size: 14px; color: var(--ae-muted, #6b7280);
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
}
.ae-plan-tab.is-active { color: var(--ae-accent, #4f46e5); border-bottom-color: var(--ae-accent, #4f46e5); font-weight: 600; }
.ae-plan-phase { margin-bottom: 18px; }
.ae-plan-phase h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ae-muted, #6b7280); margin: 0 0 8px; }
.ae-plan-task {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  background: #fff; border: 1px solid var(--ae-border, #e5e7eb); border-radius: 10px; margin-bottom: 8px;
}
.ae-plan-task.is-done { opacity: .65; }
.ae-plan-task.is-done .ae-plan-task-title { text-decoration: line-through; }
.ae-plan-task-main { flex: 1; min-width: 0; }
.ae-plan-task-title { font-size: 14px; color: var(--ae-text, #111827); }
.ae-plan-task-desc { font-size: 12px; color: var(--ae-muted, #6b7280); margin-top: 2px; }
.ae-plan-task-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ae-muted, #6b7280); white-space: nowrap; }
.ae-plan-task input[type="checkbox"] { margin-top: 2px; }
.ae-plan-auto-badge {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: #dcfce7; color: #166534;
}
.ae-plan-add-task { display: flex; gap: 8px; margin-top: 10px; }
.ae-plan-add-task input[type="text"] { flex: 1; }
.ae-plan-add-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.ae-plan-add-inline input[type="text"] { flex: 1; min-width: 180px; }

.ae-plan-calendar { background: #fff; border: 1px solid var(--ae-border, #e5e7eb); border-radius: 12px; overflow: hidden; }
.ae-plan-calendar-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--ae-border, #e5e7eb); }
.ae-calendar-panel { min-width: 0; overflow: hidden; box-sizing: border-box; }
.ae-calendar-panel *, .ae-calendar-panel *::before, .ae-calendar-panel *::after { box-sizing: border-box; }
.ae-plan-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
.ae-plan-calendar-dow { padding: 8px 4px; font-size: 11px; text-transform: uppercase; color: var(--ae-muted, #6b7280); text-align: center; border-bottom: 1px solid var(--ae-border, #e5e7eb); min-width: 0; overflow: hidden; }
.ae-plan-calendar-cell { min-height: 84px; padding: 6px; border-bottom: 1px solid var(--ae-border, #e5e7eb); border-right: 1px solid var(--ae-border, #e5e7eb); font-size: 12px; min-width: 0; overflow: hidden; }
.ae-plan-calendar-dow:nth-child(7n), .ae-plan-calendar-cell:nth-child(7n) { border-right: none; }
.ae-plan-calendar-cell.is-other-month { background: #f9fafb; color: #d1d5db; }
.ae-plan-calendar-cell.is-today .ae-plan-calendar-day { background: var(--ae-accent, #4f46e5); color: #fff; border-radius: 999px; }
.ae-plan-calendar-day { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-weight: 600; }
.ae-plan-cal-item { display: block; margin-top: 4px; padding: 2px 6px; border-radius: 6px; background: var(--ae-accent-soft, #eef2ff); color: var(--ae-accent, #4f46e5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.ae-plan-cal-item.is-milestone { background: #fef3c7; color: #92400e; font-weight: 600; }

/* ---- Unified Planning calendar ---- */
.ae-cal-filters { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 0 14px; }
.ae-cal-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #374151; cursor: pointer; }
.ae-cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex: none; }
.ae-cal-item { display: flex; align-items: center; gap: 5px; width: 100%; max-width: 100%; min-width: 0; margin-top: 4px; padding: 2px 6px; border-radius: 6px; font-size: 11px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; background: #eef2ff; color: #4f46e5; }
.ae-cal-item .ae-cal-dot { flex: 0 0 auto; }
.ae-cal-item.is-done { opacity: .55; text-decoration: line-through; }
.ae-cal-item.is-paused { opacity: .65; filter: grayscale(0.35); }
.ae-cal-item.is-milestone, .ae-cal-filter.is-milestone { background: #fef3c7; color: #92400e; }
.ae-cal-filter.is-milestone { background: none; }
.ae-cal-item.is-goal { background: #fef3c7; color: #b45309; }
.ae-cal-item.is-task, .ae-cal-filter.is-task { color: #4f46e5; }
.ae-cal-item.is-task { background: #eef2ff; }
.ae-cal-item.is-campaign, .ae-cal-filter.is-campaign { color: #7c3aed; }
.ae-cal-item.is-campaign { background: #f3e8ff; }
.ae-cal-item.is-coupon, .ae-cal-item.is-gift_card, .ae-cal-filter.is-coupon { color: #0e7490; }
.ae-cal-item.is-coupon, .ae-cal-item.is-gift_card { background: #cffafe; }
.ae-cal-item.is-product_publish, .ae-cal-item.is-collection_publish, .ae-cal-filter.is-product_publish { color: #047857; }
.ae-cal-item.is-product_publish, .ae-cal-item.is-collection_publish { background: #d1fae5; }
.ae-cal-item.is-custom, .ae-cal-filter.is-custom { color: #334155; }
.ae-cal-item.is-custom { background: #e2e8f0; }
.ae-cal-item.is-retail, .ae-cal-item.is-fashion, .ae-cal-item.is-sport, .ae-cal-filter.is-retail { color: #be123c; }
.ae-cal-item.is-retail, .ae-cal-item.is-fashion, .ae-cal-item.is-sport { background: #ffe4e6; }
.ae-cal-item.is-holiday, .ae-cal-item.is-school_holiday, .ae-cal-filter.is-holiday { color: #6b7280; }
.ae-cal-item.is-holiday, .ae-cal-item.is-school_holiday { background: #f3f4f6; }
.ae-cal-remove { border: none; background: none; color: inherit; font-size: 13px; cursor: pointer; padding: 0 0 0 2px; margin-left: auto; opacity: .6; }
.ae-cal-remove:hover { opacity: 1; }
.ae-plan-calendar-cell { cursor: pointer; }
.ae-plan-calendar-cell:hover { background: #fafaff; }
.ae-plan-calendar-cell.is-other-month:hover { background: #f9fafb; }
.ae-cal-recipes { display: flex; flex-direction: column; gap: 10px; }
.ae-cal-recipe {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 12px 14px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 12px; font-size: 13px;
}
.ae-cal-recipe-main { flex: 1; min-width: 0; }
.ae-cal-recipe-head { display: flex; flex-direction: column; gap: 2px; }
.ae-cal-recipe-dates { font-size: 12px; color: #78716c; line-height: 1.4; }
.ae-cal-recipe-action { flex-shrink: 0; padding-top: 2px; }
.ae-cal-recipe-details { margin-top: 10px; }
.ae-cal-recipe-details summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: #4338ca; list-style: none;
}
.ae-cal-recipe-details summary::-webkit-details-marker { display: none; }
.ae-cal-recipe-details summary::before {
  content: '▸'; display: inline-block; margin-right: 6px; transition: transform .15s;
}
.ae-cal-recipe-details[open] summary::before { transform: rotate(90deg); }
.ae-cal-recipe-tasks {
  margin: 8px 0 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 8px;
}
.ae-cal-recipe-task { line-height: 1.4; }
.ae-cal-recipe-task-title { display: block; font-weight: 600; color: #1c1917; }
.ae-cal-recipe-task-meta { display: block; font-size: 11px; color: #78716c; margin-top: 2px; }
.ae-cal-quick-create { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); display: flex; align-items: center; justify-content: center; z-index: 80; }
.ae-cal-quick-create[hidden] { display: none; }
.ae-cal-quick-create .ae-product-panel { width: 420px; max-width: calc(100vw - 32px); }
.ae-cal-quick-create-fields { display: flex; flex-direction: column; gap: 10px; }
.ae-product-publish-at { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; }

.ae-goal-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ae-goal-card { padding: 16px; background: #fff; border: 1px solid var(--ae-border, #e5e7eb); border-radius: 12px; }
.ae-goal-card strong { font-size: 14px; }
.ae-goal-card .ae-hint { display: block; margin-top: 4px; }

.ae-migration-block { margin-bottom: 16px; }
.ae-migration-upload { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ae-migration-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ae-muted, #6b7280); }
.ae-migration-report { margin-top: 10px; padding: 10px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-size: 12px; color: #92400e; max-height: 220px; overflow: auto; }
.ae-migration-report ul { margin: 4px 0 0; padding-left: 18px; }

/* ---- Universal contacts import ---- */
.ae-ci-sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ae-ci-source { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 13px; font-weight: 600; color: #111827; cursor: pointer; background: #fff; transition: border-color .12s ease, box-shadow .12s ease; }
.ae-ci-source:hover { border-color: #c7d2fe; }
.ae-ci-source.is-selected, .ae-ci-source:has(input:checked) { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.ae-ci-mapping-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ae-ci-mapping-table th { text-align: left; font-weight: 600; color: #374151; padding: 8px 12px 8px 0; width: 200px; vertical-align: middle; }
.ae-ci-mapping-table td { padding: 6px 0; }
.ae-ci-mapping-table tr + tr th, .ae-ci-mapping-table tr + tr td { border-top: 1px solid #f3f4f6; }
.ae-ci-consent-options { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: #374151; }
.ae-ci-consent-options label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.ae-ci-consent-options input { margin-top: 2px; }
.ae-ci-sample-wrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 8px; }
.ae-ci-sample-table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.ae-ci-sample-table th, .ae-ci-sample-table td { padding: 6px 10px; border-bottom: 1px solid #f3f4f6; text-align: left; }
.ae-ci-sample-table th { background: #f9fafb; font-weight: 600; color: #6b7280; position: sticky; top: 0; }

@media (max-width: 768px) {
  /* Mobile: hide permanent sidebar crush; content gets the canvas. */
  .ae-shell-body { --ae-sidebar-width: 0px; }
  .ae-topbar-nav-toggle { display: inline-flex; }
  .ae-topbar-quicklinks { display: none; }
  .ae-topbar-divider { display: none; }
  .ae-sidebar {
    position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(280px, 86vw);
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: 8px 0 32px rgba(15, 23, 42, .18);
  }
  body.ae-mobile-nav-open .ae-sidebar { transform: translateX(0); }
  .ae-shell-topbar { left: 0 !important; }
  .ae-unsaved-bar { left: 0; }
  /* Force Copilot to bottom drawer — never side-dock on narrow viewports. */
  body.ae-copilot-side-layout { /* keep class for JS but neutralize layout */ }
  body.ae-copilot-side-layout .ae-shell,
  .ae-shell:has(.ae-copilot-drawer.is-side) {
    flex-direction: column;
  }
  body.ae-copilot-side-layout .ae-copilot-drawer.is-side,
  .ae-copilot-drawer.is-side {
    position: fixed !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100% !important; min-width: 0 !important; max-width: none !important;
    flex: none !important; height: var(--ae-copilot-height, 42vh) !important;
    max-height: 70vh; border-left: none; border-top: 1px solid #e5e7eb;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, .12); z-index: 35;
  }
  .ae-copilot-drawer.is-collapsed {
    height: 48px !important; max-height: 48px !important;
  }
  .ae-shell-content { padding-bottom: 72px; padding-top: 72px; }
  .ae-brief-project-types { grid-template-columns: 1fr; }
  .ae-goal-cards { grid-template-columns: 1fr; }
  .ae-product-editor-layout { grid-template-columns: 1fr; }
  .ae-catalog-hero { flex-direction: column; }
  .ae-field-inline { grid-template-columns: 1fr; }
  .ae-essentials-status-grid { grid-template-columns: 1fr; }
  .ae-segmented-control { max-width: none; }
  .ae-stock-grid { grid-template-columns: 1fr; }
  .ae-input-qty { max-width: none; }
  .ae-metafields-form-grid { grid-template-columns: 1fr; }
  .ae-metafields-value { max-width: none; }
  .ae-digital-settings-grid { grid-template-columns: 1fr; }
  .ae-menu-details-grid { grid-template-columns: 1fr; }
  .ae-menu-recipes { grid-template-columns: 1fr; }
  .ae-menu-item-grid { grid-template-columns: 1fr; }
  .ae-ci-sources { grid-template-columns: 1fr; }
  .ae-home-newsfeed-list { max-height: min(48vh, 360px); }
  .ae-home-newsfeed-link {
    align-items: flex-start; gap: 6px; padding: 5px 8px; min-height: 0;
  }
  .ae-home-newsfeed-title {
    white-space: normal; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .ae-home-newsfeed-meta { flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
}

/* Theme editor: usable canvas at phone width */
@media (max-width: 900px) {
  .ae-te-workspace { flex-direction: column; height: calc(100vh - 52px); }
  .ae-te-sidebar {
    width: 100%; max-height: 38vh; border-right: none; border-bottom: 1px solid var(--ae-te-border, #e5e7eb);
  }
  .ae-te-stage { flex: 1; min-height: 0; flex-direction: column; }
  .ae-te-preview { flex: 1; min-height: 220px; width: 100%; }
  .ae-te-stage .ae-copilot-drawer,
  .ae-te-stage .ae-copilot-drawer.is-side {
    position: relative !important;
    width: 100% !important; min-width: 0 !important; max-width: none !important;
    flex: 0 0 auto !important; height: 42px !important; max-height: 42px !important;
    border-left: none; border-top: 1px solid var(--ae-te-border, #e5e7eb);
  }
  .ae-te-stage .ae-copilot-drawer:not(.is-collapsed) {
    height: min(40vh, 280px) !important; max-height: 40vh !important;
  }
}

/* ====== Import mapping annotator ====== */
.ae-anno {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}
.ae-anno-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ae-anno-domain { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.ae-anno-feedback { margin: 0; padding: 8px 12px; border-radius: 8px; background: #ecfdf5; color: #065f46; font-size: 13px; }
.ae-anno-feedback.is-error { background: #fef2f2; color: #991b1b; }
.ae-anno-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  min-height: calc(100vh - 220px);
}
.ae-anno-palette {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.ae-anno-palette-title { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.ae-anno-label { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font-size: 13px; transition: border-color 0.15s, background 0.15s; }
.ae-anno-label:hover { border-color: var(--anno-color); }
.ae-anno-label.is-active { border-color: var(--anno-color); background: color-mix(in srgb, var(--anno-color) 8%, #fff); box-shadow: 0 0 0 1px var(--anno-color); }
.ae-anno-label.is-assigned .ae-anno-label-dot::after { content: '✓'; color: #fff; font-size: 9px; line-height: 1; }
.ae-anno-label-dot { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--anno-color); flex-shrink: 0; }
.ae-anno-label-name { display: flex; flex-direction: column; font-weight: 600; color: #111827; min-width: 0; }
.ae-anno-label-name small { font-weight: 400; color: #9ca3af; font-size: 11px; }
.ae-anno-label-preview { margin-left: auto; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #6b7280; flex-shrink: 0; }
.ae-anno-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 220px);
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: auto;
  padding: 16px;
}
.ae-anno-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
  width: 100%;
  min-height: 280px;
}
.ae-anno-error { color: #b91c1c; }
.ae-anno-canvas {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.ae-anno-canvas.is-tagging { cursor: crosshair; }
.ae-anno-screenshot { display: block; width: 100%; height: auto; margin: 0 auto; }
.ae-anno-hotspots { position: absolute; inset: 0; }
.ae-anno-hotspot { position: absolute; padding: 0; border: 1px dashed transparent; border-radius: 4px; background: transparent; cursor: pointer; }
.ae-anno-canvas.is-tagging .ae-anno-hotspot:hover { border-color: var(--anno-color); background: color-mix(in srgb, var(--anno-color) 14%, transparent); }
.ae-anno-hotspot.is-assigned { border: 2px solid var(--anno-color); background: color-mix(in srgb, var(--anno-color) 10%, transparent); }
.ae-anno-status-draft { background: #f3f4f6; color: #4b5563; }
.ae-anno-status-ready { background: #d1fae5; color: #065f46; }
.ae-anno-status-stale { background: #fef3c7; color: #92400e; }
.ae-import-modal .ae-modal-head { padding: 22px 24px 0; }
.ae-import-modal .ae-modal-body { padding: 18px 24px; }
.ae-import-modal .ae-modal-foot { padding: 0 24px 22px; }
.ae-import-url-input { padding: 12px 14px; font-size: 14px; }
.ae-import-guidance {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
}
.ae-import-guidance--ready {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.ae-import-guidance p { margin: 0; }
.ae-import-guidance-mapped { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ae-import-guidance a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ae-import-guidance--ready a { color: #15803d; }
.ae-import-modal-foot {
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.ae-import-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}
.ae-import-mappings-link { font-size: 12px; color: #6b7280; align-self: center; }
.ae-btn-secondary { background: #fff; border: 1px solid #d1d5db; color: #374151; }
.ae-btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }

@media (max-width: 900px) {
  .ae-anno-layout { grid-template-columns: 1fr; }
  .ae-anno-palette { position: static; }
}

/* === AI credits, top-up modal, model selector ============================ */
.ae-copilot-model-active {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ae-copilot-model-select {
  max-width: 120px; font-size: 11px; color: #d4d4d8;
  border: 1px solid #52525b; border-radius: 8px;
  padding: 4px 8px; background: #3f3f46; cursor: pointer;
}
.ae-te-design-shell .ae-copilot-composer .ae-copilot-model-select {
  max-width: 120px; font-size: 11px; color: #d4d4d8;
  border: 1px solid #52525b; border-radius: 8px;
  padding: 4px 8px; background: #3f3f46; cursor: pointer;
}
.ae-te-design-shell .ae-copilot-composer .ae-copilot-model-select:focus { outline: none; border-color: #818cf8; }
.ae-te-design-shell .ae-copilot-composer .ae-copilot-credits-badge {
  font-size: 11px; font-weight: 600; color: #a5b4fc; background: rgba(99,102,241,0.14);
  border: 1px solid rgba(129,140,248,0.35); border-radius: 999px;
  padding: 4px 9px; cursor: pointer; white-space: nowrap;
}
.ae-te-design-shell .ae-copilot-composer .ae-copilot-credits-badge.is-low {
  color: #fbbf24; background: rgba(245,158,11,0.12); border-color: rgba(251,191,36,0.35);
}
.ae-te-design-shell .ae-copilot-composer .ae-copilot-attach-icon {
  color: #a1a1aa; border-radius: 8px; width: 30px; height: 30px;
}
.ae-te-design-shell .ae-copilot-composer .ae-copilot-attach-icon:hover {
  color: #f4f4f5; background: rgba(255,255,255,0.06);
}
/* Legacy aliases — theme editor dark composer only */
.ae-te-design-shell .ae-copilot-composer-field .ae-copilot-stop-btn {
  color: #d4d4d8; background: rgba(255,255,255,0.06); border-radius: 8px; height: 30px; padding: 0 10px;
}
.ae-te-design-shell .ae-copilot-composer-field .ae-copilot-stop-btn:hover {
  background: rgba(255,255,255,0.1); color: #fff;
}
.ae-te-design-shell .ae-copilot-composer-field.is-dragover {
  outline: 2px dashed #818cf8; outline-offset: 2px;
}
.ae-te-design-shell .ae-copilot-model-select:focus { outline: none; border-color: #818cf8; }
.ae-te-design-shell .ae-copilot-credits-badge {
  font-size: 11px; font-weight: 600; color: #a5b4fc; background: rgba(99,102,241,0.14);
  border: 1px solid rgba(129,140,248,0.35); border-radius: 999px;
  padding: 4px 9px; cursor: pointer; white-space: nowrap;
}
.ae-te-design-shell .ae-copilot-credits-badge.is-low {
  color: #fbbf24; background: rgba(245,158,11,0.12); border-color: rgba(251,191,36,0.35);
}
.ae-ai-topup-root { display: contents; }
.ae-ai-topup-overlay {
  position: fixed; inset: 0; background: rgba(9, 9, 11, 0.62); z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.ae-ai-topup-overlay[hidden] { display: none !important; }
body.ae-ai-topup-open,
body.ae-studio-modal-open { overflow: hidden; }
.ae-storage-upgrade-spark { background: linear-gradient(135deg, #ecfeff 0%, #eef2ff 100%); }
.ae-ai-topup-modal {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid #e4e4e7; border-radius: 18px;
  padding: 28px 24px 22px; width: 100%; max-width: 520px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}
.ae-ai-topup-close {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; border-radius: 999px;
  background: #f4f4f5; color: #71717a; cursor: pointer;
  transition: background .15s, color .15s;
}
.ae-ai-topup-close:hover { background: #e4e4e7; color: #18181b; }
.ae-ai-topup-hero { text-align: center; padding: 0 28px 6px; }
.ae-ai-topup-spark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff 0%, #fef3c7 100%);
  font-size: 22px; margin-bottom: 12px;
}
.ae-ai-topup-hero h3 {
  margin: 0; font-size: 22px; font-weight: 700; color: #18181b; line-height: 1.25;
}
.ae-ai-topup-subtitle {
  margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: #52525b;
}
.ae-ai-topup-reason {
  margin: 12px 0 0; font-size: 13px; color: #92400e;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px;
}
.ae-ai-topup-packs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px;
}
.ae-ai-topup-pack, .ae-ai-pack-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 10px 14px; min-height: 118px;
  border: 1.5px solid #e4e4e7; border-radius: 14px; background: #fff;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.ae-ai-topup-pack:hover, .ae-ai-pack-card:hover {
  border-color: #a5b4fc; box-shadow: 0 8px 20px rgba(99,102,241,.12); transform: translateY(-1px);
}
.ae-ai-topup-pack.is-selected {
  border-color: #6366f1; background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
  box-shadow: 0 0 0 1px rgba(99,102,241,.35), 0 10px 24px rgba(99,102,241,.16);
}
.ae-ai-topup-pack.is-recommended { border-color: #c7d2fe; }
.ae-ai-topup-pack-badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe;
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.ae-ai-topup-pack-credits, .ae-ai-pack-credits { font-size: 20px; font-weight: 800; color: #18181b; margin-top: 4px; }
.ae-ai-topup-pack-label, .ae-ai-pack-label { font-size: 11px; color: #71717a; }
.ae-ai-topup-pack-price, .ae-ai-pack-price { font-size: 14px; font-weight: 700; color: #4f46e5; margin-top: 6px; }
.ae-ai-topup-pack-save { font-size: 10px; font-weight: 600; color: #16a34a; margin-top: 4px; }
.ae-ai-topup-footer { margin-top: 18px; text-align: center; }
.ae-ai-topup-cta {
  width: 100%; border: none; border-radius: 12px; padding: 13px 18px;
  font-size: 15px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 10px 24px rgba(79,70,229,.28);
  transition: transform .1s, box-shadow .15s, opacity .15s;
}
.ae-ai-topup-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(79,70,229,.34); }
.ae-ai-topup-cta:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.ae-ai-topup-hint { font-size: 12px; color: #71717a; margin: 10px 0 0; line-height: 1.45; }
.ae-ai-topup-dismiss {
  display: inline-block; margin-top: 10px; border: none; background: none;
  font-size: 12px; color: #71717a; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.ae-ai-topup-dismiss:hover { color: #3f3f46; }
.ae-ai-topup-error { font-size: 12px; color: #dc2626; margin-top: 10px; }
.ae-ai-topup-error[hidden] { display: none !important; }
.ae-ai-topup-loading {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: #4f46e5; margin-top: 10px;
}
.ae-ai-topup-loading[hidden] { display: none !important; }
.ae-ai-topup-spinner {
  width: 14px; height: 14px; border-radius: 999px;
  border: 2px solid rgba(99,102,241,.25); border-top-color: #6366f1;
  animation: ae-ai-topup-spin .8s linear infinite;
}
@keyframes ae-ai-topup-spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  .ae-ai-topup-packs { grid-template-columns: 1fr; }
  .ae-ai-topup-hero { padding: 0 8px 6px; }
}
.ae-ai-credits-panel { padding: 24px 0; border-bottom: 1px solid #e5e7eb; }
.ae-ai-credits-balance { display: flex; align-items: baseline; gap: 8px; }
.ae-ai-credits-amount { font-size: 32px; font-weight: 700; color: #111827; }
.ae-ai-credits-amount.is-low { color: #b45309; }
.ae-ai-credits-unit { font-size: 14px; color: #6b7280; }
.ae-ai-usage-row { display: grid; grid-template-columns: 140px 1fr 60px; gap: 10px; align-items: center; margin-bottom: 6px; }
.ae-ai-usage-label { font-size: 12px; color: #4b5563; }
.ae-ai-usage-bar { height: 8px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.ae-ai-usage-bar span { display: block; height: 100%; background: #6366f1; border-radius: 999px; }
.ae-ai-usage-value { font-size: 12px; color: #111827; text-align: right; }

/* === Storage page ======================================================== */
.ae-storage-gauge { height: 14px; border-radius: 999px; background: #f3f4f6; overflow: hidden; margin-top: 8px; }
.ae-storage-gauge span { display: block; height: 100%; background: #6366f1; border-radius: 999px; transition: width .3s; }
.ae-storage-gauge.is-warning span { background: #f59e0b; }
.ae-storage-gauge.is-full span { background: #dc2626; }
.ae-storage-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.ae-storage-tier { border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; text-align: center; }
.ae-storage-tier.is-current { border-color: #6366f1; background: #eef2ff; }
.ae-storage-tier h4 { margin: 0; font-size: 15px; font-weight: 700; color: #111827; }
.ae-storage-tier .price { font-size: 13px; color: #4f46e5; font-weight: 600; margin: 4px 0 10px; }
.ae-storage-files table { width: 100%; font-size: 13px; }
.ae-storage-files td, .ae-storage-files th { padding: 8px 6px; border-bottom: 1px solid #f3f4f6; text-align: left; }
.ae-storage-file-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ae-storage-action {
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  white-space: nowrap;
}
.ae-storage-action:hover { text-decoration: underline; color: #4338ca; }

/* === Creative studio ===================================================== */
.ae-creative-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .ae-creative-grid { grid-template-columns: 1fr; } }
.ae-creative-composer { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; position: sticky; top: 16px; }
.ae-creative-composer--dream {
  border-color: var(--ae-accent-border);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(99,102,241,.08), transparent 55%),
    #fff;
}
.ae-creative-composer-head { margin-bottom: 14px; }
.ae-creative-composer-head h4 { margin: 0 0 4px; font-size: 16px; color: var(--ae-text); }
.ae-creative-composer-head p { margin: 0; font-size: 12px; color: #64748b; line-height: 1.4; }
.ae-creative-composer textarea { width: 100%; min-height: 110px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; font-size: 13px; resize: vertical; }
.ae-creative-composer textarea.is-readonly { background: #f9fafb; color: #4b5563; cursor: default; }
.ae-creative-setup { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.ae-creative-setup-block { display: flex; flex-direction: column; gap: 6px; }
.ae-creative-setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ae-creative-setup-block--half { min-width: 0; }
.ae-creative-setup-label {
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b;
}
.ae-creative-setup-callout {
  margin: 0; padding: 8px 10px; border-radius: 8px;
  background: #eef2ff; color: #3730a3; font-size: 12px; line-height: 1.4;
}
.ae-creative-product-picker { display: flex; flex-direction: column; gap: 8px; }
.ae-creative-product-selected {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--ae-accent-border); background: #fafafe;
}
.ae-creative-product-selected-thumb,
.ae-creative-product-option-thumb {
  width: 40px; height: 40px; border-radius: 8px; overflow: hidden;
  background: #e5e7eb; flex-shrink: 0;
  display: grid; place-items: center;
}
.ae-creative-product-selected-thumb img,
.ae-creative-product-option-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ae-creative-product-option-placeholder { font-size: 14px; color: #818cf8; }
.ae-creative-product-selected-copy {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.ae-creative-product-selected-copy strong {
  font-size: 13px; color: var(--ae-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ae-creative-product-search { position: relative; }
.ae-creative-product-search-input { width: 100%; }
.ae-creative-product-status {
  margin: 4px 0 0; font-size: 11px; color: #64748b;
}
.ae-creative-product-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow: auto;
  background: #fff; border: 1px solid var(--ae-border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .12);
}
.ae-creative-product-option {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; background: transparent;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.ae-creative-product-option:hover,
.ae-creative-product-option.is-active { background: var(--ae-accent-soft); }
.ae-creative-product-option-copy {
  min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.ae-creative-product-option-copy strong {
  font-size: 13px; color: var(--ae-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ae-creative-product-option-copy small {
  font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .04em;
}
.ae-creative-product-empty {
  padding: 12px; font-size: 12px; color: #64748b; text-align: center;
}
.ae-creative-kind-switch, .ae-creative-duration-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ae-creative-kind, .ae-creative-duration {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ae-border);
  background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ae-creative-kind strong { font-size: 13px; color: var(--ae-text); }
.ae-creative-kind span, .ae-creative-duration { font-size: 11px; color: #64748b; }
.ae-creative-kind:hover, .ae-creative-duration:hover { border-color: var(--ae-accent); }
.ae-creative-kind.is-active, .ae-creative-duration.is-active {
  border-color: var(--ae-accent); background: var(--ae-accent-soft);
  box-shadow: 0 0 0 1px rgba(88,80,236,.12);
}
.ae-creative-duration { align-items: center; justify-content: center; font-weight: 650; color: var(--ae-text); min-height: 42px; }
.ae-creative-model-grid { display: flex; flex-direction: column; gap: 8px; }
.ae-creative-model-card {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ae-border);
  background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ae-creative-model-card:hover { border-color: var(--ae-accent); }
.ae-creative-model-card.is-active {
  border-color: var(--ae-accent); background: linear-gradient(180deg, #fafafe, #fff);
  box-shadow: 0 0 0 1px rgba(88,80,236,.14);
}
.ae-creative-model-card.is-recommended:not(.is-active) { border-color: #c7d2fe; }
.ae-creative-model-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ae-creative-model-card-top strong { font-size: 13px; color: var(--ae-text); }
.ae-creative-model-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: #e0e7ff; color: #3730a3;
}
.ae-creative-model-desc { font-size: 11px; color: #64748b; line-height: 1.35; }
.ae-creative-model-rate { font-size: 11px; font-weight: 600; color: #4f46e5; }
.ae-creative-native-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ae-creative-recipe-focus { margin: 12px 0; }
.ae-creative-recipe-focus-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; border-radius: 12px; color: #fff; margin-bottom: 8px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
}
.ae-creative-recipe-focus-card strong { font-size: 14px; }
.ae-creative-recipe-focus-card span { font-size: 12px; opacity: .92; line-height: 1.4; }
.ae-creative-recipe-more { margin-top: 4px; }
.ae-creative-recipe-more summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ae-accent); list-style: none;
}
.ae-creative-recipe-more summary::-webkit-details-marker { display: none; }
.ae-creative-recipe--sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ae-creative-source-empty {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 10px; padding: 12px; border-radius: 10px;
  border: 1px dashed var(--ae-accent-border); background: #fafafe;
}
.ae-creative-source-empty strong { font-size: 13px; color: var(--ae-text); }
.ae-creative-source-empty span { font-size: 12px; color: #64748b; line-height: 1.4; }
.ae-creative-context-product--missing { opacity: .85; cursor: default; }
.ae-creative-context-recipe-chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 650; padding: 4px 8px; border-radius: 999px;
  background: #eef2ff; color: #3730a3;
}
@media (max-width: 640px) {
  .ae-creative-setup-row { grid-template-columns: 1fr; }
}
.ae-link-subtle { color: #6366f1; text-decoration: none; }
.ae-link-subtle:hover { text-decoration: underline; }
.ae-creative-timeline { display: flex; flex-direction: column; gap: 20px; }
.ae-creative-attempts { display: flex; flex-direction: column; gap: 10px; }
.ae-creative-run,
.ae-creative-attempt {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 0;
  overflow: hidden;
}
.ae-creative-run.is-selected,
.ae-creative-attempt.is-selected { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.15); }
.ae-creative-run-batch { border-color: #c7d2fe; background: linear-gradient(180deg, #fafaff 0%, #fff 100%); padding: 14px 16px; }
.ae-creative-run-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ae-creative-run-title { margin: 0; font-size: 14px; font-weight: 600; color: #111827; }
.ae-creative-run-time { font-size: 11px; color: #9ca3af; }
.ae-creative-run-model { font-size: 11px; color: #6b7280; }
.ae-creative-run-prompt { font-size: 13px; color: #374151; line-height: 1.5; margin: 0 0 12px; white-space: pre-wrap; }
.ae-creative-run-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ae-creative-run-source { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid #e5e7eb; }
.ae-creative-run-result { aspect-ratio: 16/10; max-height: 320px; background: #f9fafb; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ae-creative-run-result img, .ae-creative-run-result video { width: 100%; height: 100%; object-fit: contain; }
.ae-creative-run-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.ae-creative-attempt-summary {
  list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; cursor: pointer; user-select: none;
}
.ae-creative-attempt-summary::-webkit-details-marker { display: none; }
.ae-creative-attempt-thumb {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(145deg, #eef2ff, #fce7f3);
  display: grid; place-items: center;
}
.ae-creative-attempt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ae-creative-attempt-thumb-icon { font-size: 14px; color: #6366f1; font-weight: 700; }
.ae-creative-attempt-thumb-spin { animation: ae-creative-spin 1.1s linear infinite; }
@keyframes ae-creative-spin { to { transform: rotate(360deg); } }
.ae-creative-attempt-summary-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ae-creative-attempt-summary-copy strong {
  font-size: 13px; color: var(--ae-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ae-creative-attempt-summary-copy small { font-size: 11px; color: #64748b; }
.ae-creative-attempt-chevron {
  width: 8px; height: 8px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg); transition: transform .18s ease; margin-right: 4px;
}
.ae-creative-attempt[open] .ae-creative-attempt-chevron { transform: rotate(225deg); }
.ae-creative-attempt-body { padding: 0 14px 14px; border-top: 1px solid #f1f5f9; padding-top: 12px; }

.ae-creative-destinations {
  margin-top: 4px; padding: 12px;
  border-radius: 12px;
  background: linear-gradient(160deg, #faf5ff 0%, #eef2ff 55%, #f0fdfa 100%);
  border: 1px solid #e0e7ff;
}
.ae-creative-destinations-lede {
  margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #4338ca;
}
.ae-creative-dest-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.ae-creative-dest-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid #c7d2fe;
  background: rgba(255,255,255,.88); text-align: left; cursor: pointer;
  font: inherit; color: inherit; text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ae-creative-dest-card strong { font-size: 13px; color: #111827; }
.ae-creative-dest-card span { font-size: 11px; color: #64748b; }
.ae-creative-dest-card:hover:not(:disabled) {
  border-color: var(--ae-accent); transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(67, 56, 202, .08);
}
.ae-creative-dest-card--primary {
  border-color: var(--ae-accent); background: #fff;
  box-shadow: 0 0 0 1px rgba(88,80,236,.12);
}
.ae-creative-dest-card:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.ae-creative-dest-secondary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.ae-creative-publish-sheet {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 42, .35);
  display: grid; place-items: center; padding: 16px;
}
.ae-creative-publish-sheet[hidden] { display: none !important; }
.ae-creative-publish-sheet-card {
  width: min(420px, 100%); background: #fff; border-radius: 14px;
  padding: 18px; box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column; gap: 12px;
}
.ae-creative-publish-sheet-card h3 { margin: 0; font-size: 16px; color: #111827; }
.ae-creative-publish-sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 640px) {
  .ae-creative-dest-grid { grid-template-columns: 1fr; }
}
.ae-creative-batch-progress { margin: 8px 0 12px; }
.ae-creative-batch-rows { display: flex; flex-direction: column; gap: 10px; }
.ae-creative-batch-row {
  display: grid;
  grid-template-columns: 88px 24px 1fr auto;
  grid-template-areas:
    "meta meta meta meta"
    "source arrow result actions";
  gap: 8px 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}
.ae-creative-batch-row-meta { grid-area: meta; display: flex; align-items: center; gap: 10px; font-size: 11px; color: #6b7280; }
.ae-creative-batch-row-index { font-weight: 600; color: #374151; }
.ae-creative-batch-row-time { color: #9ca3af; }
.ae-creative-batch-row-source { grid-area: source; }
.ae-creative-batch-row-arrow { grid-area: arrow; }
.ae-creative-batch-row-result { grid-area: result; }
.ae-creative-batch-row-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ae-creative-batch-row.is-selected { border-color: #16a34a; }
.ae-creative-batch-row-source, .ae-creative-batch-row-result { aspect-ratio: 1; background: #f9fafb; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ae-creative-batch-row-source img, .ae-creative-batch-row-result img { width: 100%; height: 100%; object-fit: cover; }
.ae-creative-batch-row-arrow { text-align: center; color: #9ca3af; font-size: 16px; }
.ae-creative-batch-row-placeholder { font-size: 11px; color: #9ca3af; padding: 8px; text-align: center; }
.ae-creative-batch-row-details { font-size: 11px; color: #6b7280; line-height: 1.4; }

/* Batch stack carousel (Affiner v3 — full-width hero) */
.ae-creative-batch-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  position: relative;
}
.ae-creative-batch-stack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}
.ae-creative-batch-stack-source-chip {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.ae-creative-batch-stack-source-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ae-creative-batch-stack-source-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1px 2px;
  font-size: 8px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.55);
  line-height: 1.2;
  pointer-events: none;
}
.ae-creative-stack-carousel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ae-creative-stack-hero-wrap {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 6px;
  align-items: center;
}
.ae-creative-stack-hero {
  position: relative;
  width: 100%;
  height: min(55vh, 520px);
  max-height: min(55vh, 520px);
  border-radius: 10px;
  overflow: hidden;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.ae-creative-stack-hero-slide {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}
.ae-creative-stack-hero-slide.is-active { display: block; }
.ae-creative-stack-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f3f4f6;
}
.ae-creative-stack-hero-error {
  padding: 16px;
  font-size: 12px;
  text-align: center;
}
.ae-creative-stack-hero-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}
.ae-creative-stack-nav {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ae-creative-stack-nav:hover { border-color: #6366f1; color: #4338ca; }
.ae-creative-stack-thumbs {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}
.ae-creative-stack-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
  scroll-snap-align: start;
}
.ae-creative-stack-thumb.is-selected {
  opacity: 1;
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
.ae-creative-stack-thumb.is-new {
  animation: stack-enter 0.45s ease-out;
}
.ae-creative-stack-thumb.is-loading { opacity: 0.85; }
.ae-creative-stack-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ae-creative-stack-thumb-label {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 8px;
  font-weight: 700;
  background: rgba(17, 24, 39, 0.75);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
}
.ae-creative-stack-thumb-failed {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 700;
  color: #b91c1c;
  background: #fef2f2;
}
.ae-creative-stack-thumb-discard {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.ae-creative-stack-thumb-discard:hover { background: #fef2f2; }
.ae-creative-stack-hero-slide.is-removing,
.ae-creative-stack-thumb.is-removing {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.6);
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.ae-creative-spinner--sm {
  width: 20px;
  height: 20px;
  margin: auto;
  border-width: 2px;
}

/* Inline Affiner panel (serial iterations) */
.ae-creative-refine-inline {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  background: #f8fafc;
}
.ae-creative-refine-inline[hidden] { display: none !important; }
.ae-creative-refine-inline-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.ae-creative-refine-inline-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b7280;
}
.ae-creative-refine-inline-error {
  margin: 0 0 8px;
  font-size: 12px;
  color: #b91c1c;
}
.ae-creative-refine-inline-prompt {
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  margin-bottom: 8px;
  background: #fff;
}
.ae-creative-refine-inline-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Legacy filmstrip (kept for turbo-safe fallbacks) */
.ae-creative-stack-filmstrip {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
.ae-creative-stack-item {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  opacity: 0.65;
  transform: scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  scroll-snap-align: end;
}
.ae-creative-stack-item.is-latest {
  width: 120px;
  height: 120px;
  opacity: 1;
  transform: scale(1);
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.ae-creative-stack-item.is-loading { opacity: 0.85; }
.ae-creative-stack-item.is-new {
  animation: stack-enter 0.45s ease-out;
}
@keyframes stack-enter {
  from { opacity: 0; transform: scale(0.85) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.ae-creative-stack-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ae-creative-stack-version {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 600;
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
}
.ae-creative-stack-meta { margin-top: 8px; font-size: 11px; color: #6b7280; }
.ae-creative-stack-prompt { margin: 4px 0 0; font-size: 12px; color: #374151; white-space: pre-wrap; }
.ae-creative-stack-actions { margin-top: 8px; justify-content: flex-start; }
.ae-creative-stack-actions [data-apply-to-product][hidden] { display: none !important; }
.ae-creative-stack-discard-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  cursor: pointer;
}
.ae-creative-stack-discard-btn:hover { background: #fef2f2; }
.ae-creative-batch-stack.is-selected { border-color: #16a34a; }
.ae-creative-stack-result { min-width: 0; width: 100%; }
.ae-creative-zoomable { position: relative; cursor: zoom-in; }
.ae-creative-zoomable img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ae-creative-magnifier {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  background-repeat: no-repeat;
  background-color: #f9fafb;
  z-index: 5;
  display: none;
}
.ae-creative-zoomable:hover .ae-creative-magnifier { display: block; }

.ae-creative-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ae-creative-lightbox-overlay[hidden] { display: none !important; }
.ae-creative-lightbox {
  background: #111827;
  border-radius: 14px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ae-creative-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #374151;
}
.ae-creative-lightbox-head h3 { margin: 0; font-size: 15px; color: #f9fafb; font-weight: 600; }
.ae-creative-lightbox-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.ae-creative-lightbox-close:hover { color: #fff; }
.ae-creative-lightbox-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #374151;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.ae-creative-lightbox-panel {
  display: flex;
  flex-direction: column;
  background: #1f2937;
  min-height: 200px;
}
.ae-creative-lightbox-panel-label {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  border-bottom: 1px solid #374151;
}
.ae-creative-lightbox-panel img {
  flex: 1;
  width: 100%;
  object-fit: contain;
  max-height: 70vh;
  background: #111827;
}
.ae-creative-lightbox-panel--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 13px;
  padding: 40px;
}

/* Refine modal overlay */
body.ae-creative-refine-open { overflow: hidden; }
.ae-creative-refine-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}
.ae-creative-refine-overlay[hidden] { display: none !important; }
.ae-creative-refine-popover {
  position: relative;
  z-index: 81;
  width: 100%;
  max-width: 420px;
  max-height: min(90vh, 560px);
  overflow: auto;
  padding: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
}
.ae-creative-refine-popover[hidden] { display: none !important; }
.ae-creative-refine-popover-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.ae-creative-refine-popover-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b7280;
}
.ae-creative-refine-popover-error {
  margin: 0 0 8px;
  font-size: 12px;
  color: #b91c1c;
}
.ae-creative-refine-popover textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  margin-bottom: 10px;
}
.ae-creative-refine-popover-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ae-creative-batch-row { position: relative; }
.ae-creative-recipes { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ae-creative-recipe { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid #e5e7eb; background: #f9fafb; cursor: pointer; }
.ae-creative-recipe:hover, .ae-creative-recipe.is-active { border-color: #6366f1; background: #eef2ff; color: #4338ca; }
.ae-creative-sources { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ae-creative-source { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0; background: none; }
.ae-creative-source img { width: 100%; height: 100%; object-fit: cover; }
.ae-creative-source.is-selected { border-color: #6366f1; }
.ae-creative-variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ae-creative-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.ae-creative-card.is-selected { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.2); }
.ae-creative-card-media { aspect-ratio: 1; background: #f9fafb; display: flex; align-items: center; justify-content: center; position: relative; }
.ae-creative-card-media img, .ae-creative-card-media video { width: 100%; height: 100%; object-fit: cover; }
.ae-creative-card-body { padding: 10px 12px; }
.ae-creative-card-prompt { font-size: 11px; color: #6b7280; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ae-creative-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: #9ca3af; }
.ae-creative-card-actions { display: flex; gap: 6px; padding: 0 12px 12px; flex-wrap: wrap; }
.ae-creative-spinner { width: 28px; height: 28px; border: 3px solid #e5e7eb; border-top-color: #6366f1; border-radius: 50%; animation: ae-spin 0.9s linear infinite; }
@keyframes ae-spin { to { transform: rotate(360deg); } }
.ae-creative-error { font-size: 12px; color: #dc2626; padding: 12px; }
.ae-creative-empty { text-align: center; color: #6b7280; padding: 60px 20px; border: 2px dashed #e5e7eb; border-radius: 12px; }
.ae-creative-empty--hub {
  padding: 48px 24px;
  background: linear-gradient(180deg, #fafafe 0%, #fff 70%);
  border-color: var(--ae-accent-border);
}
.ae-creative-empty-visual {
  display: flex; justify-content: center; gap: 10px; margin-bottom: 18px;
}
.ae-creative-empty-visual span {
  width: 54px; height: 72px; border-radius: 10px;
  background: linear-gradient(145deg, #c7d2fe, #e0e7ff);
  box-shadow: 0 8px 20px rgba(88, 80, 236, .12);
  transform: rotate(-6deg);
}
.ae-creative-empty-visual span:nth-child(2) {
  width: 64px; height: 64px; transform: none;
  background: linear-gradient(145deg, #a5b4fc, #818cf8);
}
.ae-creative-empty-visual span:nth-child(3) {
  width: 48px; height: 80px; transform: rotate(7deg);
  background: linear-gradient(145deg, #ddd6fe, #c4b5fd);
}
.ae-creative-sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ae-creative-sessions--gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ae-creative-session-card { display: block; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; color: inherit; text-decoration: none; }
.ae-creative-session-card:hover { border-color: #6366f1; }
.ae-creative-session-card--visual {
  padding: 0; overflow: hidden;
  transition: border-color .15s ease, transform .2s var(--becomy-ease-spring, ease), box-shadow .2s ease;
}
.ae-creative-session-card--visual:hover {
  border-color: var(--ae-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(17, 24, 39, .08);
}
.ae-creative-session-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, #eef2ff 0%, #f3f4f6 55%, #e5e7eb 100%);
  overflow: hidden;
}
.ae-creative-session-media img,
.ae-creative-session-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ae-creative-session-media.is-empty {
  display: grid; place-items: center;
}
.ae-creative-session-placeholder {
  font-size: 28px; color: #818cf8; opacity: .85;
}
.ae-creative-session-play {
  position: absolute; inset: auto auto 10px 10px;
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(17, 24, 39, .72); color: #fff;
  display: grid; place-items: center; font-size: 11px;
}
.ae-creative-session-kind {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
}
.ae-creative-session-body { padding: 12px 14px 14px; }
.ae-creative-session-body strong {
  display: block; font-size: 14px; line-height: 1.35; margin-bottom: 4px;
  color: var(--ae-text);
}
.ae-creative-session-link {
  margin: 6px 0 0; font-size: 12px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ae-creative-sessions-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.ae-creative-sessions-count {
  font-size: 12px; color: #64748b; white-space: nowrap; padding-bottom: 2px;
}
.ae-creative-sessions--entity { grid-template-columns: 1fr; }

/* Creative hub — inspiration / formats */
.ae-creative-hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .7fr);
  gap: 18px;
  align-items: stretch;
  padding: 18px 20px 16px;
  border-radius: 16px;
  border: 1px solid var(--ae-accent-border);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(99, 102, 241, .16), transparent 55%),
    radial-gradient(80% 70% at 0% 100%, rgba(167, 139, 250, .12), transparent 50%),
    linear-gradient(180deg, #fafafe 0%, #fff 100%);
  margin-bottom: 22px;
}
.ae-creative-hub .ae-hub-hero h1 { margin-bottom: 6px; }
.ae-creative-hub-inspiration { margin-top: 4px; }
.ae-creative-hub-eyebrow {
  margin: 0 0 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ae-accent);
}
.ae-creative-hub-lede {
  margin: 0; max-width: 46ch;
  font-size: 15px; line-height: 1.5; color: #4b5563;
}
.ae-creative-hub-actions { margin-top: 16px; }
.ae-creative-hub-cta-form { display: inline; }
.ae-creative-hub-hero-aside {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(199, 210, 254, .7);
  backdrop-filter: blur(6px);
}
.ae-creative-hub-power-value {
  display: block; font-size: 22px; font-weight: 700; color: var(--ae-text); line-height: 1.2;
}
.ae-creative-hub-power-label {
  display: block; margin-top: 2px; font-size: 12px; color: #64748b;
}
.ae-creative-hub-promise {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.ae-creative-hub-promise li {
  position: relative;
  padding-left: 16px;
  font-size: 13px; line-height: 1.4; color: #374151;
}
.ae-creative-hub-promise li::before {
  content: '';
  position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--ae-accent);
}
.ae-creative-format-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.ae-creative-format-form { margin: 0; }
.ae-creative-format-chip {
  width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 14px 14px 16px;
  border: 1px solid var(--ae-border);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .15s ease, transform .2s ease, box-shadow .2s ease;
}
.ae-creative-format-chip:hover {
  border-color: var(--ae-accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(88, 80, 236, .08);
}
.ae-creative-format-frame {
  width: 100%; height: 64px;
  display: grid; place-items: center;
  border-radius: 10px;
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(80% 80% at 20% 20%, rgba(255,255,255,.55), transparent 55%),
    linear-gradient(135deg, #e0e7ff, #f5f3ff 55%, #ede9fe);
}
.ae-creative-format-chip--portrait .ae-creative-format-frame {
  background:
    radial-gradient(70% 90% at 70% 30%, rgba(244,114,182,.35), transparent 50%),
    linear-gradient(160deg, #312e81, #6366f1 60%, #a78bfa);
}
.ae-creative-format-chip--square .ae-creative-format-frame {
  background:
    radial-gradient(60% 60% at 40% 40%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(135deg, #0f766e, #14b8a6 55%, #99f6e4);
}
.ae-creative-format-chip--landscape .ae-creative-format-frame {
  background:
    radial-gradient(90% 70% at 80% 20%, rgba(251,191,36,.35), transparent 50%),
    linear-gradient(120deg, #1e3a8a, #2563eb 50%, #38bdf8);
}
.ae-creative-format-frame span {
  display: block; border: 2px solid rgba(255,255,255,.92); border-radius: 4px;
  background: rgba(255,255,255,.18); box-shadow: 0 6px 16px rgba(15,23,42,.18);
}
.ae-creative-format-chip--portrait .ae-creative-format-frame span { width: 22px; height: 38px; }
.ae-creative-format-chip--square .ae-creative-format-frame span { width: 34px; height: 34px; }
.ae-creative-format-chip--landscape .ae-creative-format-frame span { width: 46px; height: 26px; }
.ae-creative-format-chip strong { font-size: 15px; color: var(--ae-text); }
.ae-creative-format-chip > span:last-child { font-size: 12px; color: #64748b; line-height: 1.35; }
.ae-creative-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.ae-creative-recipe-grid--video { margin-top: 10px; }
.ae-creative-recipe-form { margin: 0; }
.ae-creative-recipe-card {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
  border: 1px solid var(--ae-border);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .15s ease, transform .2s ease, box-shadow .2s ease;
}
.ae-creative-recipe-card:hover {
  border-color: var(--ae-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, .08);
}
.ae-creative-recipe-visual {
  position: relative;
  min-height: 128px;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 14px;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #4338ca);
}
.ae-creative-recipe-visual-glow {
  position: absolute; inset: -20% auto auto -10%;
  width: 70%; height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 70%);
  pointer-events: none;
}
.ae-creative-recipe-visual--packshot { background: linear-gradient(135deg, #64748b, #334155); }
.ae-creative-recipe-visual--lifestyle { background: linear-gradient(135deg, #0d9488, #115e59); }
.ae-creative-recipe-visual--model { background: linear-gradient(135deg, #db2777, #9d174d); }
.ae-creative-recipe-visual--promo { background: linear-gradient(135deg, #ea580c, #c2410c); }
.ae-creative-recipe-visual--storefront { background: linear-gradient(135deg, #4f46e5, #312e81); }
.ae-creative-recipe-visual--seasonal { background: linear-gradient(135deg, #059669, #065f46); }
.ae-creative-recipe-visual--ugc { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.ae-creative-recipe-visual--unboxing { background: linear-gradient(135deg, #2563eb, #1e3a8a); }
.ae-creative-recipe-visual--demo { background: linear-gradient(135deg, #0891b2, #155e75); }
.ae-creative-recipe-visual--video { background: linear-gradient(135deg, #111827, #4c1d95); }
.ae-creative-recipe-visual--default { background: linear-gradient(135deg, #6366f1, #4338ca); }
.ae-creative-recipe-glyph {
  font-size: 28px; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.ae-creative-recipe-kind {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(4px);
}
.ae-creative-recipe-body {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px 14px; flex: 1;
}
.ae-creative-recipe-body strong { font-size: 14px; color: var(--ae-text); line-height: 1.3; }
.ae-creative-recipe-blurb { font-size: 12px; color: #64748b; line-height: 1.4; flex: 1; }
.ae-creative-recipe-cta {
  margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ae-accent);
}
.ae-creative-recipe-video-head { margin-top: 22px; }
.ae-creative-recipe-video-head h3 {
  margin: 0 0 4px; font-size: 15px; font-weight: 650; color: var(--ae-text);
}
.ae-creative-recipe-video-head p { margin: 0; font-size: 13px; color: #64748b; }
@media (max-width: 900px) {
  .ae-creative-hub-hero { grid-template-columns: 1fr; padding: 18px; }
  .ae-creative-format-strip { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ae-creative-sessions--gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ae-creative-session-body { padding: 10px; }
  .ae-creative-session-body strong { font-size: 13px; }
  .ae-creative-hub-actions { flex-direction: column; align-items: stretch; }
  .ae-creative-hub-cta-form .ae-btn,
  .ae-creative-hub-actions .ae-btn { width: 100%; justify-content: center; }
}
.ae-creative-entity-sessions { margin-top: 0; }
.ae-restyle-progress-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.ae-restyle-progress-card.is-warning { border-color: #f59e0b; background: #fffbeb; }
.ae-restyle-progress-bar { height: 6px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.ae-restyle-progress-bar span { display: block; height: 100%; background: #6366f1; border-radius: 999px; transition: width 0.25s ease; }
.ae-copilot-restyle-mount { margin: 8px 0; }
.ae-ai-models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ae-ai-model-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; }
.ae-ai-model-card h4 { margin: 0 0 4px; font-size: 15px; color: #111827; display: flex; align-items: center; gap: 8px; }
.ae-ai-model-rates { font-size: 12px; color: #4b5563; margin-top: 8px; }
.ae-badge-byok { font-size: 10px; font-weight: 600; color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 8px; }

/* ==========================================================================
   Elevated Merchant OS — Copilot sidebar, topbar, marketing automations
   ========================================================================== */

/* Top navigation bar (non-shell pages keep legacy bar) */
.ae-topbar-v2:not(.ae-shell-topbar) {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ae-border);
  box-shadow: 0 1px 2px rgba(88, 80, 236, 0.04);
}
.ae-topbar-v2 .ae-topbar-inner {
  max-width: none;
  height: 100%;
  min-height: 0;
  padding: 0 20px;
  gap: 12px;
  align-items: center;
}
.ae-topbar-search {
  flex: 1;
  max-width: 480px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #e8e8f5;
  border-radius: var(--ae-radius);
  background: #fff;
  box-shadow: 0 1px 6px rgba(88, 80, 236, 0.08);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.ae-topbar-search:hover,
.ae-topbar-search:focus-visible {
  border-color: var(--ae-accent-border);
  box-shadow: 0 0 0 3px rgba(88, 80, 236, 0.08);
  outline: none;
}
.ae-topbar-search-icon { color: #94a3b8; flex-shrink: 0; display: flex; }
.ae-topbar-search-placeholder {
  flex: 1;
  font-size: 13px;
  color: #94a3b8;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ae-topbar-search-kbd {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.ae-topbar-quicklinks {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.ae-topbar-quicklink {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--ae-radius);
  transition: color .15s, background .15s;
}
.ae-topbar-quicklink:hover { color: var(--ae-accent); background: var(--ae-accent-soft); }
.ae-topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--ae-border);
  flex-shrink: 0;
}
.ae-topbar-utilities {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ae-topbar-credits-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: var(--ae-radius);
  background: transparent;
  color: #64748b;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  transition: background .15s, color .15s;
}
.ae-topbar-credits-chip:hover { background: #f1f5f9; color: #1e293b; }
.ae-topbar-credits-chip.is-low { color: #d97706; }
.ae-topbar-credits-chip.is-low:hover { background: #fffbeb; color: #b45309; }
.ae-topbar-credits-chip.is-empty {
  color: #dc2626;
  font-weight: 600;
  background: #fef2f2;
}
.ae-topbar-credits-chip.is-empty:hover { background: #fee2e2; color: #b91c1c; }
.ae-topbar-credits-icon { font-size: 13px; line-height: 1; }
.ae-topbar-credits-amount { font-variant-numeric: tabular-nums; }
.ae-topbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--ae-radius);
  background: transparent;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.ae-topbar-icon-btn:hover { background: #f1f5f9; color: #1e293b; }
.ae-topbar-icon-btn.is-active { color: #38128A; background: #eef2ff; }
.ae-topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ae-accent), #818cf8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ae-border);
}
.ae-notifications-wrap { position: relative; }

/* Copilot — native side panel */
body.ae-copilot-side-layout .ae-copilot-drawer,
.ae-copilot-drawer.is-side {
  flex: 0 0 var(--ae-copilot-width, 320px);
  width: var(--ae-copilot-width, 320px);
  min-width: var(--ae-copilot-width, 320px);
  border-left: 1px solid var(--ae-border);
  background: var(--ae-surface);
  box-shadow: -2px 0 16px rgba(88, 80, 236, 0.04);
}
.ae-copilot-drawer {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #374151;
  -webkit-font-smoothing: antialiased;
}
.ae-copilot-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--ae-border);
  background: var(--ae-surface);
  flex-shrink: 0;
}
.ae-copilot-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ae-copilot-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--ae-radius);
  background: var(--ae-accent-soft);
  color: var(--ae-accent);
  flex-shrink: 0;
}
.ae-copilot-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ae-text);
  letter-spacing: -0.02em;
}
.ae-copilot-header .ae-copilot-tabbar {
  border-bottom: 1px solid var(--ae-border);
  background: #fafaff;
}
.ae-copilot-drawer .ae-agent-body { padding: 0 12px 8px; }
.ae-copilot-drawer .ae-agent-conversation {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ae-copilot-drawer .ae-agent-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: #374151;
}

/* Empty state + suggestion chips */
.ae-copilot-drawer .ae-copilot-empty-state {
  gap: 10px;
  padding: 12px 2px 16px;
}
.ae-copilot-drawer .ae-copilot-empty-title {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #111827;
  letter-spacing: -0.01em;
}
.ae-copilot-drawer .ae-copilot-empty-hint {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: #9ca3af;
}
.ae-copilot-drawer .ae-copilot-empty-examples {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}
.ae-copilot-drawer .ae-agent-chip,
.ae-copilot-drawer .ae-copilot-empty-examples .ae-agent-chip,
.ae-copilot-drawer .ae-agent-msg-suggestions .ae-agent-chip {
  display: block;
  width: 100%;
  text-align: left;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: #374151;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  -webkit-font-smoothing: antialiased;
}
.ae-copilot-drawer .ae-agent-chip[hidden],
.ae-copilot-drawer .ae-copilot-section-chip[hidden] {
  display: none !important;
}
.ae-copilot-drawer .ae-agent-chip:hover,
.ae-copilot-drawer .ae-copilot-empty-examples .ae-agent-chip:hover,
.ae-copilot-drawer .ae-agent-msg-suggestions .ae-agent-chip:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}
.ae-copilot-drawer .ae-agent-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 4px;
}

/* Chat bubbles */
.ae-copilot-drawer .ae-agent-msg {
  max-width: 92%;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 0;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ae-copilot-drawer .ae-agent-msg-user {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  background: var(--ae-accent);
  color: #fff;
}
.ae-copilot-drawer .ae-agent-msg-user .ae-agent-msg-head { display: none; }
.ae-copilot-drawer .ae-agent-msg-user .ae-agent-msg-body {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: #fff;
}
.ae-copilot-drawer .ae-agent-msg-assistant {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  background: #f8f9fb;
  border: 1px solid #ececf1;
}
.ae-copilot-drawer .ae-agent-msg-assistant .ae-agent-msg-head {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
}
.ae-copilot-drawer .ae-agent-msg-assistant .ae-agent-msg-head span {
  color: var(--ae-accent);
  font-weight: 600;
}
.ae-copilot-drawer .ae-agent-msg-body {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: #374151;
}
.ae-copilot-drawer .ae-agent-msg-intro,
.ae-copilot-drawer .ae-agent-msg-outro {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
}
.ae-copilot-drawer .ae-agent-msg-meta {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
}
.ae-copilot-drawer .ae-agent-msg-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.ae-copilot-drawer .ae-agent-artifact {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--ae-radius);
}
.ae-copilot-drawer .ae-agent-artifact-label { color: #3b82f6; }

/* Composer — Cursor-style (controls inside typing card) */
.ae-copilot-drawer .ae-copilot-composer {
  --ae-composer-font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ae-composer-meta-size: 11px;
  --ae-composer-meta-color: #9ca3af;
  --ae-composer-meta-hover: #6b7280;
  --ae-composer-input-size: 13px;
  --ae-composer-input-color: #111827;
  --ae-composer-placeholder: #9ca3af;

  font-family: var(--ae-composer-font);
  font-size: var(--ae-composer-input-size);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ae-composer-input-color);
  background: linear-gradient(180deg, rgba(249,249,255,0) 0%, #f9f9ff 24%);
  border-top: 1px solid var(--ae-border);
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.ae-copilot-drawer .ae-copilot-composer-field {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  font-family: var(--ae-composer-font);
  font-size: var(--ae-composer-input-size);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ae-composer-input-color);
}
.ae-copilot-drawer .ae-copilot-composer-field > .ae-copilot-composer-main {
  flex: 1 1 auto;
  min-height: 0;
}
.ae-copilot-drawer .ae-copilot-composer-field > .ae-copilot-composer-foot {
  flex: 0 0 auto;
}
.ae-copilot-drawer .ae-copilot-composer-field:focus-within {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(88, 80, 236, 0.08);
}
.ae-copilot-drawer .ae-copilot-composer-main {
  flex: 1;
  min-width: 0;
}
.ae-copilot-drawer .ae-copilot-composer-field textarea {
  min-height: 56px;
  max-height: 160px;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: #111827;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  width: 100%;
  resize: none;
  -webkit-font-smoothing: antialiased;
}
.ae-copilot-drawer .ae-copilot-composer-field textarea::placeholder {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #9ca3af;
}
.ae-copilot-drawer .ae-copilot-composer-field textarea:focus { outline: none; box-shadow: none; }

.ae-copilot-drawer .ae-copilot-composer-field .ae-copilot-composer-foot {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-top: 8px;
  padding: 0;
  border: none;
  width: 100%;
  min-height: 28px;
  flex-shrink: 0;
}
.ae-copilot-drawer .ae-copilot-composer-foot-left,
.ae-copilot-drawer .ae-copilot-composer-foot-right {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 4px;
  min-width: 0;
}
.ae-copilot-drawer .ae-copilot-composer-foot-right {
  flex: 0 0 auto;
  margin-left: auto;
}
.ae-copilot-drawer .ae-copilot-composer-foot-left {
  flex: 1 1 auto;
  overflow: hidden;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-model-trigger {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 118px;
  padding: 0 2px;
  margin: 0 0 0 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  color: #9ca3af;
  cursor: pointer;
  transition: color .15s;
  -webkit-font-smoothing: antialiased;
  appearance: none;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-model-trigger:hover {
  color: #6b7280;
  background: transparent;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-model-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 80, 236, 0.12);
  border-radius: 3px;
}
.ae-copilot-drawer .ae-copilot-model-trigger-label {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-model-trigger:hover .ae-copilot-model-trigger-label {
  color: #6b7280;
}
.ae-copilot-drawer .ae-copilot-model-trigger-chevron {
  flex-shrink: 0;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  color: #d1d5db;
}
.ae-copilot-drawer .ae-copilot-model-menu {
  position: fixed;
  z-index: 10050;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 16px));
  max-height: min(280px, 40vh);
  overflow-y: auto;
  padding: 4px;
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: #374151;
  -webkit-font-smoothing: antialiased;
}
.ae-copilot-drawer .ae-copilot-model-menu[hidden] { display: none !important; }
.ae-copilot-drawer .ae-copilot-model-menu-item {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: #374151;
  text-align: left;
  cursor: pointer;
  appearance: none;
}
.ae-copilot-drawer .ae-copilot-model-menu-item:hover { background: #f3f4f6; }
.ae-copilot-drawer .ae-copilot-model-menu-item.is-active {
  color: #5850ec;
  background: #eef2ff;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-credits {
  flex: 0 0 auto;
  padding: 0 2px;
  margin: 0;
  border: none;
  background: transparent;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  color: #9ca3af;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  -webkit-font-smoothing: antialiased;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-credits:hover {
  color: #6b7280;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-credits.is-low {
  color: #d97706;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn,
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn.ae-copilot-attach-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent !important;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: color .15s, background .15s;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn svg circle {
  fill: none;
  stroke: currentColor;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn:hover {
  color: var(--ae-accent) !important;
  background: var(--ae-accent-soft);
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn.ae-copilot-stop-btn {
  flex: 0 0 auto;
  width: auto;
  height: 28px;
  padding: 0 10px;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  color: #64748b !important;
  background: #f1f5f9 !important;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn.ae-copilot-stop-btn[hidden] {
  display: none !important;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-foot-btn.ae-copilot-stop-btn:hover {
  color: #334155 !important;
  background: #e2e8f0 !important;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-send-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: none;
  background: var(--ae-accent) !important;
  color: #fff !important;
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  transition: background .15s, transform .1s;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-send-btn:hover {
  background: var(--ae-accent-hover) !important;
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-send-btn:active {
  transform: scale(0.96);
}
.ae-copilot-drawer .ae-copilot-composer-foot .ae-copilot-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ae-copilot-drawer .ae-copilot-model-select-native,
.ae-copilot-drawer .ae-copilot-composer .ae-copilot-model-select-native {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  appearance: none !important;
}

.ae-copilot-drawer .ae-copilot-input-hint {
  display: block;
  margin-top: 0;
  padding: 0 4px;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: #9ca3af;
  text-align: center;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
.ae-copilot-drawer .ae-copilot-composer-field.is-dragover {
  outline: 2px dashed var(--ae-accent);
  outline-offset: 2px;
}

/* Sidebar refresh */
.ae-sidebar {
  background: var(--ae-canvas);
  border-right: 1px solid var(--ae-border);
}
.ae-sidebar-logo-accent { color: var(--ae-accent); }
.ae-sidebar-link.is-active {
  color: var(--ae-accent);
  border-left-color: var(--ae-accent);
}
.ae-sidebar-link.is-active .ae-sidebar-icon { color: var(--ae-accent); }
.ae-btn-primary {
  background: var(--ae-accent);
  border-color: var(--ae-accent);
}
.ae-btn-primary:hover {
  background: var(--ae-accent-hover);
  border-color: var(--ae-accent-hover);
}

/* Feature hub page template (ae-hub-*). ae-ma-* aliases kept for marketing automations. */
.ae-hub-page, .ae-ma-page { max-width: none; width: 100%; margin: 0; padding: 24px 20px 48px; box-sizing: border-box; }
.ae-hub-hero, .ae-ma-hero { margin-bottom: 24px; }
.ae-hub-hero h1, .ae-ma-hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  color: var(--ae-text);
}
.ae-hub-hero p, .ae-ma-hero p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  max-width: 560px;
  line-height: 1.55;
}
.ae-hub-setup-card, .ae-ma-setup-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 28px;
  border-radius: var(--ae-radius);
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #faf5ff 100%);
  border: 1px solid var(--ae-accent-border);
  box-shadow: 0 2px 12px rgba(88, 80, 236, 0.06);
}
.ae-hub-setup-icon, .ae-ma-setup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--ae-radius);
  background: var(--ae-surface);
  color: var(--ae-accent);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(88, 80, 236, 0.1);
}
.ae-hub-setup-copy, .ae-ma-setup-copy { flex: 1; min-width: 200px; }
.ae-hub-setup-copy strong, .ae-ma-setup-copy strong { display: block; font-size: 14px; color: var(--ae-text); margin-bottom: 2px; }
.ae-hub-setup-copy span, .ae-ma-setup-copy span { font-size: 13px; color: #64748b; }
.ae-hub-section, .ae-ma-section { margin-bottom: 28px; }
.ae-hub-section-label, .ae-ma-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 12px;
}
.ae-hub-section h2, .ae-ma-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ae-text);
}
.ae-hub-section-desc, .ae-ma-section-desc { font-size: 13px; color: #64748b; margin: 0 0 14px; }
.ae-hub-templates, .ae-ma-templates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px) {
  .ae-hub-templates, .ae-ma-templates { grid-template-columns: 1fr; }
  .ae-topbar-quicklinks { display: none; }
}
.ae-hub-template-card, .ae-ma-template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px;
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  position: relative;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 1px 3px rgba(88, 80, 236, 0.04);
}
.ae-hub-template-card:hover, .ae-ma-template-card:hover {
  border-color: var(--ae-accent-border);
  box-shadow: 0 4px 16px rgba(88, 80, 236, 0.1);
  transform: translateY(-1px);
}
.ae-hub-template-icon, .ae-ma-template-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 4px;
}
.ae-hub-template-card strong, .ae-ma-template-card strong { font-size: 15px; color: var(--ae-text); }
.ae-hub-template-card .ae-hub-template-desc,
.ae-hub-template-card .ae-ma-template-desc,
.ae-ma-template-card .ae-hub-template-desc,
.ae-ma-template-card .ae-ma-template-desc { font-size: 13px; color: #64748b; line-height: 1.4; }
.ae-hub-template-footer, .ae-ma-template-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
}
.ae-hub-template-badge, .ae-ma-template-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.ae-hub-template-badge-standard, .ae-ma-template-badge-standard { background: #dbeafe; color: #1d4ed8; }
.ae-hub-template-badge-conversion, .ae-ma-template-badge-conversion { background: #d1fae5; color: #047857; }
.ae-hub-template-badge-retention, .ae-ma-template-badge-retention { background: #fef3c7; color: #b45309; }
.ae-hub-template-arrow, .ae-ma-template-arrow { color: #cbd5e1; font-size: 18px; line-height: 1; }
.ae-hub-template-card:hover .ae-hub-template-arrow,
.ae-ma-template-card:hover .ae-ma-template-arrow { color: var(--ae-accent); }
.ae-hub-blank-zone, .ae-ma-blank-zone {
  padding: 20px;
  border: 2px dashed #d1d5db;
  border-radius: var(--ae-radius);
  background: rgba(255, 255, 255, 0.6);
}
.ae-hub-blank-form, .ae-ma-blank-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.ae-hub-trigger-label, .ae-ma-trigger-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}
.ae-hub-trigger-select, .ae-ma-trigger-select {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--ae-surface);
  color: var(--ae-text);
}
.ae-hub-trigger-select:focus, .ae-ma-trigger-select:focus {
  outline: none;
  border-color: var(--ae-accent);
  box-shadow: 0 0 0 3px rgba(88, 80, 236, 0.12);
}
.ae-hub-blank-submit, .ae-ma-blank-submit {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #1e293b;
  border: none;
  border-radius: var(--ae-radius);
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}
.ae-hub-blank-submit:hover, .ae-ma-blank-submit:hover { background: #0f172a; }
.ae-hub-scenario-list, .ae-ma-scenario-list { display: flex; flex-direction: column; gap: 8px; }
.ae-hub-scenario-row, .ae-ma-scenario-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  box-shadow: 0 1px 3px rgba(88, 80, 236, 0.04);
}
.ae-hub-scenario-icon, .ae-ma-scenario-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ae-radius);
  background: var(--ae-accent-soft);
  color: var(--ae-accent);
  font-size: 18px;
  flex-shrink: 0;
}
.ae-hub-scenario-body, .ae-ma-scenario-body { flex: 1; min-width: 0; }
.ae-hub-scenario-title-row, .ae-ma-scenario-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.ae-hub-scenario-title, .ae-ma-scenario-title { font-weight: 600; font-size: 14px; color: var(--ae-text); }
.ae-hub-scenario-status, .ae-ma-scenario-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.ae-hub-scenario-status-draft, .ae-ma-scenario-status-draft { background: #f1f5f9; color: #64748b; }
.ae-hub-scenario-status-active, .ae-ma-scenario-status-active { background: #d1fae5; color: #047857; }
.ae-hub-scenario-status-paused, .ae-ma-scenario-status-paused { background: #fef3c7; color: #b45309; }
.ae-hub-scenario-meta, .ae-ma-scenario-meta { font-size: 12px; color: #94a3b8; }
.ae-hub-scenario-actions, .ae-ma-scenario-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ae-hub-scenario-analytics, .ae-ma-scenario-analytics {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--ae-radius);
}
.ae-hub-scenario-analytics:hover, .ae-ma-scenario-analytics:hover { color: var(--ae-accent); background: var(--ae-accent-soft); }
.ae-hub-scenario-open, .ae-ma-scenario-open {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--ae-radius);
  background: var(--ae-accent);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .15s;
}
.ae-hub-scenario-open:hover, .ae-ma-scenario-open:hover { background: var(--ae-accent-hover); color: #fff; }
.ae-hub-scenario-delete, .ae-ma-scenario-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--ae-radius);
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: color .15s, background .15s;
}
.ae-hub-scenario-delete:hover, .ae-ma-scenario-delete:hover { color: #dc2626; background: #fef2f2; }

/* Hub panels — charts, copy blocks, tables */
.ae-hub-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.ae-hub-panel {
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(88, 80, 236, 0.04);
}
.ae-hub-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ae-hub-panel-head h2,
.ae-hub-panel-head h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--ae-text);
}
.ae-hub-panel-desc { font-size: 13px; color: #64748b; margin: 4px 0 0; line-height: 1.45; }
.ae-hub-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ae-hub-code {
  display: block;
  padding: 12px 14px;
  border-radius: var(--ae-radius);
  background: #f8fafc;
  border: 1px solid var(--ae-border);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
  color: #334155;
}
.ae-hub-share-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.ae-hub-share-row .ae-hub-code {
  flex: 1 1 220px;
  margin: 0;
}
.ae-hub-share-row .ae-btn {
  align-self: center;
}
.ae-hub-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .ae-hub-charts-grid { grid-template-columns: 1fr; }
}
.ae-hub-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.ae-hub-discovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .ae-hub-discovery-grid { grid-template-columns: 1fr; }
}
.ae-hub-inline-list { display: flex; flex-direction: column; gap: 8px; }
.ae-hub-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
}
.ae-hub-source-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ae-hub-source-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.ae-hub-source-list li:last-child { border-bottom: none; }
.ae-hub-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.ae-hub-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 16px;
}
.ae-hub-hero-metric .ae-stat-value { font-size: 22px; font-weight: 700; color: var(--ae-text); }
.ae-hub-hero-metric .ae-stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.ae-hub-hero-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #64748b; margin-top: 6px; }
.ae-hub-hero-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.ae-hub-nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px;
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 1px 3px rgba(88, 80, 236, 0.04);
  min-height: 100%;
}
.ae-hub-nav-card:hover {
  border-color: var(--ae-accent-border);
  box-shadow: 0 4px 16px rgba(88, 80, 236, 0.1);
  transform: translateY(-1px);
}
.ae-hub-nav-card strong { font-size: 15px; color: var(--ae-text); }
.ae-hub-nav-card-hint { font-size: 13px; color: #64748b; line-height: 1.4; flex: 1; }
.ae-hub-nav-card-arrow {
  align-self: flex-end;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1;
  margin-top: 4px;
}
.ae-hub-nav-card:hover .ae-hub-nav-card-arrow { color: var(--ae-accent); }
.ae-hub-onboarding-checklist { margin-bottom: 28px; }
.ae-hub-page .ae-shipping-zones {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ae-shipping-rate-row {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  align-items: end;
}
.ae-shipping-rate-row.ae-shipping-rate-grid {
  grid-template-columns: var(--ae-rate-col-handle) minmax(0, 1fr) var(--ae-rate-col-actions);
}
.ae-shipping-rate-row.is-saved {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
  border-radius: 8px;
  transition: outline-color 0.3s ease;
}
.ae-shipping-rate-row .ae-shipping-rate-form {
  flex: 1 1 auto;
  margin-bottom: 0;
  min-width: 0;
}
.ae-shipping-rate-col-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
}
.ae-sortable-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: transparent;
  cursor: grab;
  opacity: 0.45;
  border-radius: 4px;
}
.ae-shipping-rate-row:hover .ae-sortable-handle { opacity: 1; }
.ae-sortable-handle:active { cursor: grabbing; }
.ae-shipping-rate-col-actions,
.ae-shipping-rate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  align-self: flex-end;
  padding-bottom: 12px;
}
.ae-shipping-rates-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ae-shipping-rate-grid {
  --ae-rate-col-handle: 28px;
  --ae-rate-col-name: 2fr;
  --ae-rate-col-type: 1fr;
  --ae-rate-col-price: 1fr;
  --ae-rate-col-actions: auto;
}
.ae-shipping-rate-columns {
  display: grid;
  grid-template-columns: var(--ae-rate-col-handle) var(--ae-rate-col-name) var(--ae-rate-col-type) var(--ae-rate-col-price) var(--ae-rate-col-actions);
  gap: 10px;
  align-items: end;
  padding: 0 12px 6px;
}
.ae-shipping-rate-columns--conditions {
  grid-template-columns: var(--ae-rate-col-handle) 1fr 1fr 1fr var(--ae-rate-col-actions);
  padding-top: 0;
  padding-bottom: 8px;
}
.ae-shipping-rate-col {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.ae-shipping-rate-form--new { margin-top: 12px; }
.ae-shipping-zone-edit-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ae-border); }
.ae-shipping-zone-edit-form .ae-shipping-rate-actions { padding-bottom: 0; align-self: stretch; width: 100%; }

/* ==========================================================================
   Becomy Studio motion signature — "Indigo Bloom"
   ========================================================================== */

:root {
  --becomy-ease-spring: cubic-bezier(0.22, 1.18, 0.36, 1);
  --becomy-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --becomy-ease-in: cubic-bezier(0.4, 0, 0.85, 0.09);
  --becomy-duration-fast: 200ms;
  --becomy-duration-base: 460ms;
  --becomy-duration-slow: 680ms;
  --becomy-stagger-step: 58ms;
}

[data-studio-motion-target="copilot"] { display: contents; }

.ae-shell-main { position: relative; }

/* Topbar bloom sweep on navigation */
.becomy-bloom-sweep {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}
.becomy-bloom-sweep::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(88, 80, 236, 0.15) 20%,
    rgba(88, 80, 236, 0.95) 50%,
    rgba(129, 140, 248, 0.85) 70%,
    transparent 100%
  );
  transform: translateX(-110%);
}
.becomy-bloom-sweep.becomy-bloom-active {
  opacity: 1;
}
.becomy-bloom-sweep.becomy-bloom-active::before {
  animation: becomy-bloom-sweep var(--becomy-duration-slow) var(--becomy-ease-out) forwards;
}

@keyframes becomy-bloom-sweep {
  0% { transform: translateX(-110%); opacity: 0.4; }
  18% { opacity: 1; }
  100% { transform: translateX(110%); opacity: 0.85; }
}

/* Shell entrance (first visit) */
.becomy-shell-enter .ae-sidebar {
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity var(--becomy-duration-base) var(--becomy-ease-out),
              transform var(--becomy-duration-base) var(--becomy-ease-spring);
}
.becomy-shell-enter.becomy-shell-enter-active .ae-sidebar {
  opacity: 1;
  transform: translateX(0);
}

.becomy-shell-enter .ae-shell-main {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity calc(var(--becomy-duration-base) + 80ms) var(--becomy-ease-out),
              transform calc(var(--becomy-duration-base) + 80ms) var(--becomy-ease-spring);
  transition-delay: 70ms;
}
.becomy-shell-enter.becomy-shell-enter-active .ae-shell-main {
  opacity: 1;
  transform: translateY(0);
}

/* Copilot panel entrance */
.becomy-copilot-enter .ae-copilot-drawer.is-side,
.becomy-copilot-enter .ae-copilot-drawer {
  opacity: 0;
  transform: translateX(20px);
  filter: blur(3px);
  transition:
    opacity var(--becomy-duration-base) var(--becomy-ease-out),
    transform var(--becomy-duration-base) var(--becomy-ease-spring),
    filter var(--becomy-duration-base) var(--becomy-ease-out);
  transition-delay: 140ms;
}
.becomy-copilot-enter.becomy-copilot-enter-active .ae-copilot-drawer.is-side,
.becomy-copilot-enter.becomy-copilot-enter-active .ae-copilot-drawer {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

.becomy-copilot-expanding .ae-copilot-drawer {
  animation: becomy-copilot-expand 0.42s var(--becomy-ease-spring) both;
}
.becomy-copilot-collapsing .ae-copilot-drawer {
  animation: becomy-copilot-collapse 0.32s var(--becomy-ease-in) both;
}

@keyframes becomy-copilot-expand {
  from { opacity: 0.82; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes becomy-copilot-collapse {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0.88; transform: translateX(6px); }
}

/* Page content transitions */
.ae-shell-content.becomy-content-exit {
  opacity: 0.55;
  transform: translateY(6px) scale(0.996);
  filter: blur(1.5px);
  transition:
    opacity 160ms var(--becomy-ease-in),
    transform 160ms var(--becomy-ease-in),
    filter 160ms var(--becomy-ease-in);
}

.ae-shell-content.becomy-content-enter,
.ae-shell-content.becomy-content-enter-full {
  opacity: 0;
  transform: translateY(18px) scale(0.992);
  filter: blur(4px);
}
.ae-shell-content.becomy-content-enter-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity var(--becomy-duration-base) var(--becomy-ease-out),
    transform var(--becomy-duration-base) var(--becomy-ease-spring),
    filter calc(var(--becomy-duration-base) + 60ms) var(--becomy-ease-out);
}
.ae-shell-content.becomy-content-enter-full.becomy-content-enter-active {
  transition-duration: calc(var(--becomy-duration-base) + 120ms);
}

/* Staggered children reveal */
.becomy-stagger > * {
  opacity: 0;
  transform: translateY(14px);
}
.becomy-stagger.becomy-stagger-active > * {
  animation: becomy-stagger-in var(--becomy-duration-base) var(--becomy-ease-spring) both;
}
.becomy-stagger.becomy-stagger-active > *:nth-child(1) { animation-delay: calc(var(--becomy-stagger-step) * 0); }
.becomy-stagger.becomy-stagger-active > *:nth-child(2) { animation-delay: calc(var(--becomy-stagger-step) * 1); }
.becomy-stagger.becomy-stagger-active > *:nth-child(3) { animation-delay: calc(var(--becomy-stagger-step) * 2); }
.becomy-stagger.becomy-stagger-active > *:nth-child(4) { animation-delay: calc(var(--becomy-stagger-step) * 3); }
.becomy-stagger.becomy-stagger-active > *:nth-child(5) { animation-delay: calc(var(--becomy-stagger-step) * 4); }
.becomy-stagger.becomy-stagger-active > *:nth-child(6) { animation-delay: calc(var(--becomy-stagger-step) * 5); }
.becomy-stagger.becomy-stagger-active > *:nth-child(7) { animation-delay: calc(var(--becomy-stagger-step) * 6); }
.becomy-stagger.becomy-stagger-active > *:nth-child(8) { animation-delay: calc(var(--becomy-stagger-step) * 7); }
.becomy-stagger.becomy-stagger-active > *:nth-child(n+9) { animation-delay: calc(var(--becomy-stagger-step) * 8); }

@keyframes becomy-stagger-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat message enter */
.becomy-msg-enter {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.38s var(--becomy-ease-out),
    transform 0.42s var(--becomy-ease-spring);
}
.becomy-msg-enter-user {
  transform: translateX(12px) translateY(6px);
}
.becomy-msg-enter-assistant {
  transform: translateX(-10px) translateY(8px);
}
.becomy-msg-enter-active {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

/* Command palette cinematic open */
.ae-command-palette-overlay.becomy-palette-opening {
  display: flex;
  animation: becomy-palette-overlay-in 0.28s var(--becomy-ease-out) both;
}
.ae-command-palette-overlay.becomy-palette-closing {
  display: flex;
  animation: becomy-palette-overlay-out 0.22s var(--becomy-ease-in) both;
}
.ae-command-palette-overlay.becomy-palette-opening .ae-command-palette {
  animation: becomy-palette-panel-in 0.36s var(--becomy-ease-spring) both;
}
.ae-command-palette-overlay.becomy-palette-closing .ae-command-palette {
  animation: becomy-palette-panel-out 0.2s var(--becomy-ease-in) both;
}

@keyframes becomy-palette-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes becomy-palette-overlay-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes becomy-palette-panel-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes becomy-palette-panel-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
}

/* Toast uses bloom accent on success path */
.ae-toast.visible {
  animation: becomy-toast-in 0.38s var(--becomy-ease-spring) both;
}
@keyframes becomy-toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .becomy-bloom-sweep,
  .becomy-shell-enter .ae-sidebar,
  .becomy-shell-enter .ae-shell-main,
  .becomy-copilot-enter .ae-copilot-drawer,
  .becomy-stagger > *,
  .becomy-msg-enter,
  .ae-command-palette-overlay.becomy-palette-opening,
  .ae-command-palette-overlay.becomy-palette-closing,
  .ae-shell-content.becomy-content-exit,
  .ae-shell-content.becomy-content-enter,
  .ae-shell-content.becomy-content-enter-full {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
  }
}

/* Orders index — --wide matches full-width catalog default */
.ae-catalog--wide { max-width: none; }
.ae-stat-card {
  display: flex; flex-direction: column; padding: 10px 14px; border-radius: 10px;
  border: 1px solid #e5e7eb; background: #fff; text-decoration: none; color: inherit;
  min-width: 88px;
}
.ae-stat-card.is-active { border-color: #38128A; background: #faf5ff; }
.ae-table-wrap {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: auto;
}
.ae-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ae-table th,
.ae-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; text-align: left; vertical-align: top; }
.ae-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; background: #fafafa; }
.ae-table tbody tr:hover { background: #fafafa; }
.ae-table tbody tr:last-child td { border-bottom: none; }
.ae-badge-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.ae-badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.ae-badge-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ae-badge-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ae-orders-toolbar { align-items: flex-start; }
.ae-orders-filters-row { margin-bottom: 16px; }
.ae-orders-date-form {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
}
.ae-orders-date-form label {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b;
}
.ae-input-sm { padding: 7px 10px; font-size: 13px; }
.ae-orders-bulk-bar {
  position: sticky; top: 84px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 12px;
  background: #38128A; color: #fff; border-radius: 10px;
}
.ae-orders-bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ae-orders-bulk-bar .ae-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.ae-orders-bulk-bar .ae-btn-danger { background: #dc2626; border-color: #dc2626; }
.ae-orders-col-check { width: 40px; }
.ae-orders-col-total { text-align: right; font-weight: 600; white-space: nowrap; }
.ae-orders-col-actions { width: 100px; }
.ae-orders-number { font-weight: 600; }
.ae-orders-customer,
.ae-orders-items { display: flex; flex-direction: column; gap: 2px; }
.ae-orders-pagination { margin-top: 16px; }
.ae-orders-pagination .pagy-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.ae-orders-pagination .page a,
.ae-orders-pagination .page.active,
.ae-orders-pagination .page.prev a,
.ae-orders-pagination .page.next a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid #e5e7eb; text-decoration: none; color: #334155; font-size: 13px;
}
.ae-orders-pagination .page.active { background: #38128A; border-color: #38128A; color: #fff; }
.ae-orders-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.ae-field-span-2 { grid-column: span 2; }
.ae-orders-line-item {
  display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center;
  margin-bottom: 8px;
}
.ae-orders-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Products index (aligned with orders list) */
.ae-products-table-wrap { margin-bottom: 0; }
.ae-products-table .ae-orders-col-actions { min-width: 200px; }
.ae-products-cell {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.ae-products-thumb-link { flex-shrink: 0; text-decoration: none; }
.ae-products-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  border: 1px solid #e5e7eb; background: #f8fafc; display: block;
}
.ae-products-info { min-width: 0; }
.ae-products-title {
  font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.35;
}
.ae-orders-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-table tbody tr.is-removing {
  opacity: 0; transform: translateX(-8px);
  transition: opacity .25s ease, transform .25s ease;
}

/* Campaign Desk (.ce-*) — Stitch-inspired canvas + chat rail */
.ce-body { background: #ece8e1; min-height: 100vh; }
.ce-topbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid #e2ddd4; }
.ce-chrome-fold {
  margin: 0; border-bottom: 1px solid #e2ddd4; background: #faf8f5;
}
.ce-chrome-fold-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: #44403c;
}
.ce-chrome-fold-summary::-webkit-details-marker { display: none; }
.ce-chrome-fold-summary .ae-hint { font-weight: 400; }
.ce-chrome-fold .ce-kpi-strip { margin: 0 12px 12px; }
.ce-chrome-fold--ai .ae-creative-sessions,
.ce-chrome-fold--ai > :not(summary) { margin: 0 12px 12px; }
.ce-moments {
  padding: 12px 16px 14px; background: #faf8f5; border-bottom: 1px solid #e2ddd4;
}
.ce-moments-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.ce-moments-head strong { font-size: 13px; color: #1c1917; }
.ce-moments-head .ae-hint { margin: 2px 0 0; }
.ce-moments-rail { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 40px; }
.ce-moment-pill {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px; border-radius: 12px; border: 1px solid #e7e0d6; background: #fff;
  cursor: pointer; text-align: left; min-width: 120px;
  transition: border-color .15s, box-shadow .15s;
}
.ce-moment-pill:hover { border-color: #38128A; box-shadow: 0 4px 12px rgba(28,25,23,.06); }
.ce-moment-pill strong { font-size: 12px; color: #1c1917; }
.ce-moment-pill span { font-size: 11px; color: #78716c; }
.ce-moments-detail {
  margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid #e7e0d6; background: #fff;
}
.ce-moments-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ce-moments-triggers { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ce-moment-trigger {
  width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid #f0ebe3;
  background: #faf8f5; cursor: pointer; font-size: 12px; color: #44403c;
}
.ce-moment-trigger:hover { border-color: #38128A; }
.ce-creative-plan { padding: 12px 16px 14px; }
.ce-creative-plan-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px;
}
.ce-creative-plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ce-creative-plan-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ce-creative-plan-card {
  display: flex; flex-direction: column; gap: 4px; min-width: 180px; max-width: 240px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid #e7e0d6; background: #fff;
  text-decoration: none; color: inherit;
}
.ce-creative-plan-card:hover { border-color: #38128A; }
.ce-product-tray-search { position: relative; margin: 0 0 8px; max-width: 420px; }
.ce-product-search-results {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e7e0d6; border-radius: 10px;
  box-shadow: 0 12px 28px rgba(28,25,23,.12); max-height: 280px; overflow: auto; padding: 6px;
}
.ce-product-search-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.ce-product-search-item:hover { background: #f5f3ff; }
.ce-rail--chat-only { width: 320px; }
.ce-rail--chat-only .ce-agent--rail { flex: 1; border-bottom: none; min-height: 0; }
.ce-card-modal-inner { max-width: 560px; box-sizing: border-box; }
.ce-card-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.ce-card-modal-head h2 { margin: 0; font-size: 18px; min-width: 0; }
.ce-card-modal-body { margin: 12px 0; max-height: 48vh; overflow: auto; -webkit-overflow-scrolling: touch; }
.ce-card-modal-cta { margin: 0 0 8px; }
.ce-card-modal-cta .ce-modal-creative-form { margin: 0; }
.ce-modal-creative-form { margin-bottom: 12px; }
.ce-modal-creative-form .ae-btn { width: 100%; }
body.ce-modal-open { overflow: hidden; }
.ae-creative-campaign-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  max-width: 280px;
}
.ae-creative-campaign-link .ae-input { font-size: 0.85rem; }
.ae-creative-session-card--campaign { border-left: 3px solid var(--ae-accent, #5b6cff); }
.ce-modal-preview-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; }
.ce-product-tray {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 16px 12px; background: #f7f4ef; border-bottom: 1px solid #e2ddd4;
  position: sticky; z-index: 30;
}
.ce-product-tray-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ce-product-tray-head strong { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #57534e; }
.ce-product-tray-rail {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin;
}
.ce-product-tray-empty { margin: 0; padding: 6px 0; }
.ce-product-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  max-width: 180px; padding: 6px 10px 6px 6px; border-radius: 12px;
  border: 1px solid #e7e0d6; background: #fff; cursor: grab; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ce-product-chip:hover { border-color: #38128A; box-shadow: 0 4px 12px rgba(28,25,23,.08); }
.ce-product-chip.is-dragging { opacity: .55; transform: scale(.98); }
.ce-product-chip-thumb {
  width: 36px; height: 36px; border-radius: 8px; background: #f0ebe3 center/cover no-repeat; flex-shrink: 0;
}
.ce-product-chip-title {
  font-size: 12px; font-weight: 600; color: #1c1917; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ce-desk-shell {
  display: flex; height: calc(100vh - 56px - 48px - 92px); min-height: 480px; overflow: hidden;
  background: #ece8e1;
}
.ce-desk-shell .ce-palette {
  width: 200px; flex-shrink: 0; background: #faf8f5; border-right: 1px solid #e2ddd4;
  padding: 12px; overflow-y: auto;
}
.ce-desk-shell .ae-palette-intro strong { color: #1c1917; }
.ce-desk {
  flex: 1; overflow: auto; position: relative;
  background-color: #f3efe8;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.55), transparent 55%),
    linear-gradient(180deg, rgba(28,25,23,.03), transparent 40%),
    radial-gradient(rgba(120,113,108,.22) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px;
  transition: box-shadow .2s, outline-color .2s;
}
.ce-desk.is-drop-target {
  outline: 2px dashed #38128A; outline-offset: -8px;
  box-shadow: inset 0 0 0 9999px rgba(56,18,138,.04);
}
.ce-desk-empty {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px; color: #57534e;
}
.ce-desk-empty.is-hidden,
.ce-desk-empty[hidden] { display: none; }
.ce-desk-empty-title { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: #1c1917; letter-spacing: -.02em; }
.ce-desk-empty-body { margin: 0 0 16px; font-size: 14px; max-width: 360px; line-height: 1.45; }
.ce-desk-empty-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; pointer-events: auto; }
.ce-canvas { position: relative; width: 2800px; height: 1800px; min-height: 100%; min-width: 100%; }
.ce-rail {
  width: 340px; flex-shrink: 0; display: flex; flex-direction: column;
  border-left: 1px solid #e2ddd4; background: #faf8f5; min-height: 0;
}
.ce-agent--rail {
  height: auto; flex: 1 1 55%; min-height: 220px; border-top: none; border-bottom: 1px solid #e2ddd4;
  display: flex; flex-direction: column;
}
.ce-rail .ce-panel {
  flex: 1 1 45%; min-height: 160px; overflow: auto; padding: 12px 14px; background: #fff;
}
.ce-rail .ce-panel h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #78716c; margin: 0 0 10px; }
.ce-desk-shell.ce-rail-chat-collapsed .ce-agent--rail { flex: 0 0 48px; min-height: 48px; }
.ae-campaigns-create-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 0; width: 100%; }
.ae-campaigns-create-form .ae-input { min-width: 240px; flex: 1; width: auto; }
.ae-campaigns-metrics-hint { margin: 0 0 12px; }
.ae-campaigns-table .ae-campaigns-name { font-weight: 600; color: #111827; text-decoration: none; }
.ae-campaigns-table .ae-campaigns-name:hover { color: #38128A; text-decoration: underline; }
.ae-campaigns-table .ae-campaigns-plan {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ae-campaigns-table .ae-campaigns-col-date { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13px; color: #475569; }
.ae-campaigns-table .ae-campaigns-col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ae-campaigns-table .ae-campaigns-col-action { text-align: right; width: 1%; white-space: nowrap; }
.ae-campaigns-table tbody tr.ae-campaigns-row:hover { background: #faf8ff; }
.ae-muted { color: #94a3b8; }
.ae-campaigns-table .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 900px) {
  .ae-campaigns-table .ae-campaigns-col-secondary { display: none; }
  .ae-campaigns-table .ae-campaigns-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ae-campaigns-table .ae-campaigns-col-action .ae-btn { padding: 5px 8px; font-size: 11px; }
  .ae-catalog--wide .ae-catalog-filters { width: 100%; }
}
@media (max-width: 640px) {
  .ae-campaigns-table .ae-campaigns-col-narrow-hide { display: none; }
  .ae-campaigns-create-form .ae-btn { width: 100%; }
}
.ce-credits-pill { font-size: 12px; padding: 6px 10px; background: #f3f4f6; border-radius: 999px; }
.ce-launch-preview { font-size: 13px; line-height: 1.5; }
.ce-launch-section { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #f3f4f6; }
.ce-launch-section h3 { font-size: 13px; margin: 0 0 6px; color: #374151; }
.ae-copilot-campaign-card {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  margin-top: 8px; padding: 11px 16px; border-radius: 10px; text-decoration: none;
  font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #38128A 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(56, 18, 138, 0.25);
}
.ae-copilot-campaign-card:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(56, 18, 138, 0.32); }
.ae-badge-ready { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.ae-badge-scheduled { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ae-badge-live { background: #d1fae5; color: #065f46; }
.ae-badge-paused { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.ae-badge-waiting { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; margin-left: 6px; }
.ae-badge-completed { background: #f3f4f6; color: #374151; }
.ce-lifecycle-controls { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ce-topbar .ae-badge-waiting { font-weight: 500; }
.ae-badge-archived { background: #f9fafb; color: #9ca3af; }
.ce-card {
  position: absolute; background: #fff; border: 1px solid #e7e0d6; border-radius: 14px;
  padding: 0; box-shadow: 0 8px 22px rgba(28,25,23,.08); cursor: grab; overflow: hidden;
}
.ce-card.selected { border-color: #38128A; box-shadow: 0 0 0 3px rgba(56,18,138,.16), 0 10px 24px rgba(28,25,23,.1); }
.ce-card-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px;
  border-bottom: 1px solid #f0ebe3; font-size: 13px;
}
.ce-card-head strong { flex: 1; min-width: 0; font-weight: 650; color: #1c1917; }
.ce-card-icon { font-size: 15px; line-height: 1; flex-shrink: 0; }
.ce-card-preview { padding: 10px 12px 12px; font-size: 12px; color: #57534e; line-height: 1.4; min-height: 36px; }
.ce-card-status { font-size: 10px; text-transform: uppercase; color: #78716c; flex-shrink: 0; }
.ce-card-thumbs { display: flex; gap: 4px; margin-bottom: 6px; }
.ce-card-thumb, .ce-card-media {
  display: inline-block; width: 36px; height: 36px; border-radius: 8px;
  background: #f0ebe3 center/cover no-repeat; border: 1px solid #e7e0d6;
}
.ce-card-media { width: 100%; height: 88px; border-radius: 10px; }
.ce-card-channel {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #38128A; background: #f3eefe; padding: 2px 6px; border-radius: 999px; margin-right: 4px;
}
.ce-card--email .ce-card-head { background: #ecfdf5; }
.ce-card--sms .ce-card-head { background: #fdf4ff; }
.ce-card--social .ce-card-head { background: #eff6ff; }
.ce-card--audience .ce-card-head { background: #fff7ed; }
.ce-card--visuals .ce-card-head, .ce-card--video .ce-card-head { background: #faf5ff; }
.ce-card--theme .ce-card-head { background: #fef3c7; }
.ce-card--products .ce-card-head { background: #f0fdf4; }
.ce-card--ad_budget .ce-card-head { background: #ecfeff; }
.ce-card-phone {
  border: 2px solid #1c1917; border-radius: 18px; background: #0c0a09; color: #fafaf9;
  padding: 8px 8px 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.ce-card-phone-notch {
  width: 36%; height: 5px; margin: 0 auto 8px; border-radius: 999px; background: #292524;
}
.ce-card-phone-body { background: #fafaf9; color: #1c1917; border-radius: 10px; padding: 8px; min-height: 72px; }
.ce-card-phone-body p { margin: 6px 0 0; font-size: 11px; line-height: 1.35; color: #44403c; }
.ce-card-phone-date { display: block; font-size: 10px; color: #78716c; margin-top: 4px; }
.ce-card-sms-bubble {
  background: #f3e8ff; border-radius: 14px 14px 14px 4px; padding: 10px 12px;
  font-size: 12px; color: #3b0764; line-height: 1.35;
}
.ce-card-letter {
  border: 1px solid #d6d3d1; border-radius: 8px; padding: 10px; background: #fffefb;
}
.ce-card-letter-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #a8a29e; }
.ce-card-letter strong { display: block; margin-top: 4px; font-size: 12px; color: #1c1917; }
.ce-card-banner-preview {
  background: linear-gradient(120deg, #1c1917 0%, #44403c 55%, #78716c 100%);
  color: #fafaf9; border-radius: 10px; padding: 14px 12px; font-size: 12px; font-weight: 650;
  min-height: 52px; display: flex; align-items: center;
}
.ce-card-spend strong { display: block; font-size: 15px; color: #0f766e; margin-bottom: 8px; }
.ce-card-spend-bars { display: flex; gap: 3px; height: 22px; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.ce-card-spend-meta { background: #1877f2; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; min-width: 0; }
.ce-card-spend-tt { background: #111827; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; min-width: 0; }
.ce-card-spend small { color: #78716c; font-size: 11px; }
.ce-card-video-mock {
  border-radius: 12px; background: #111827; color: #f8fafc; padding: 12px; min-height: 88px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
}
.ce-card-video-mock--vertical { width: 72px; min-height: 110px; margin: 0 auto; border-radius: 14px; }
.ce-card-video-mock span { font-size: 12px; font-weight: 650; }
.ce-card-video-mock small { font-size: 10px; color: #a8a29e; }
.ce-desk-zones {
  position: absolute; inset: 24px; z-index: 1; pointer-events: none;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; opacity: .55;
}
.ce-desk-zone {
  border: 1px dashed rgba(120,113,108,.35); border-radius: 16px; padding: 10px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #78716c;
}
.ce-status-generating { color: #d97706; }
.ce-status-ready { color: #059669; }
.ce-status-failed { color: #dc2626; }
.ce-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; box-sizing: border-box;
  /* Prefer visual viewport on mobile (layout viewport can be wider than clientWidth). */
  width: 100%;
  max-width: 100vw;
  max-width: 100svw;
  max-width: 100dvw;
  height: 100%;
  max-height: 100vh;
  max-height: 100svh;
  max-height: 100dvh;
}
.ce-modal[hidden] { display: none; }
.ce-modal-inner { background: #fff; border-radius: 12px; padding: 20px; max-width: 560px; width: 92%; max-height: 80vh; overflow: auto; box-sizing: border-box; }
.ce-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .ce-modal { align-items: flex-end; padding: 0; }
  .ce-modal-inner.ce-card-modal-inner {
    width: 100%;
    max-width: 100%;
    max-width: 100svw;
    max-width: 100dvw;
    max-height: 92vh;
    max-height: 92svh;
    border-radius: 16px 16px 0 0;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .ce-card-modal-body { max-height: 40vh; }
  .ce-card-modal-head { align-items: flex-start; }
  .ce-card-modal-cta .ae-btn,
  .ce-modal-actions .ae-btn { min-height: 44px; }
  .ce-modal-inner .ae-field input,
  .ce-modal-inner .ae-field select,
  .ce-modal-inner .ae-field textarea,
  .ce-modal-inner .ae-input { max-width: 100%; box-sizing: border-box; }
}
.ce-agent-msg { margin: 6px 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.ce-agent-msg-user { background: #f3eefe; }
.ce-agent-msg-assistant { background: #f5f5f4; border: 1px solid #e7e5e4; }
.ce-config-preview { font-size: 11px; max-height: 200px; overflow: auto; background: #f9fafb; padding: 8px; border-radius: 6px; }
.ce-alerts { margin-top: 12px; color: #b45309; font-size: 13px; }
.ce-product-picker {
  max-height: 220px; overflow-y: auto; margin-bottom: 12px;
  border: 1px solid #e7e0d6; border-radius: 8px; padding: 8px; background: #faf8f5;
}
.ce-product-picker-item {
  display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 2px; cursor: pointer;
}
.ce-product-picker-thumb {
  width: 28px; height: 28px; border-radius: 6px; background: #f0ebe3 center/cover no-repeat; flex-shrink: 0;
}
.ce-panel .ae-field { margin-bottom: 12px; }
@media (max-width: 960px) {
  .ce-desk-shell { flex-direction: column; height: auto; min-height: 70vh; }
  .ce-desk-shell .ce-palette { width: 100%; border-right: none; border-bottom: 1px solid #e2ddd4; max-height: 160px; }
  .ce-desk { min-height: 360px; }
  .ce-rail { width: 100%; border-left: none; border-top: 1px solid #e2ddd4; max-height: 420px; }
}

/* Campaign KPI strip */
.ce-kpi-strip { margin: 0 16px 16px; padding: 16px 20px; }
.ce-kpi-strip-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ce-kpi-settings-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ce-kpi-days-input { width: 72px; }
.ce-kpi-prelaunch { margin: 0 0 12px; }
.ce-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .ce-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ce-kpi-card { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; }
.ce-kpi-label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.ce-kpi-value { font-size: 22px; font-weight: 700; color: #38128A; }
.ce-kpi-blocks { display: flex; flex-wrap: wrap; gap: 16px 24px; font-size: 13px; }
.ce-kpi-block-stats { margin: 4px 0 0; color: #475569; }
.ce-kpi-conversion-hint { margin: 8px 0 0; width: 100%; }
.ce-kpi-top-badge { margin-left: 8px; font-size: 10px; text-transform: uppercase; background: #fef3c7; color: #92400e; padding: 2px 6px; border-radius: 999px; }
.ce-kpi-roas-badge { font-size: 12px; color: #475569; }
.ce-kpi-sort-active { font-weight: 700; color: #38128A; }

/* Agentic dashboard */
.ae-agentic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .ae-agentic-layout { grid-template-columns: 1fr; } }
.ae-agentic-hero .ae-section-head p { display: flex; align-items: center; gap: 8px; }
.ae-agentic-status { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; display: inline-block; flex-shrink: 0; }
.ae-agentic-status-active { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.ae-agentic-delta { font-size: 12px; margin-top: 4px; }
.ae-agentic-delta.is-up { color: #059669; }
.ae-agentic-delta.is-down { color: #dc2626; }
.ae-agentic-channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ae-agentic-channel-card { padding: 14px; }
.ae-agentic-channel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ae-agentic-channel-head h3 { font-size: 13px; margin: 0; font-weight: 600; }
.ae-agentic-channel-metrics { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.ae-agentic-sparkline { width: 100%; max-height: 48px; }
.ae-agentic-discovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 900px) { .ae-agentic-discovery-grid { grid-template-columns: 1fr; } }
.ae-agentic-search-row { display: flex; gap: 8px; margin-top: 10px; }
.ae-agentic-search-row .ae-input { flex: 1; }
.ae-agentic-rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.ae-agentic-rank { font-weight: 700; color: #6b7280; width: 28px; }
.ae-agentic-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: #f3f4f6; }
.ae-agentic-thumb-sm { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; margin-right: 4px; }
.ae-agentic-thumb-placeholder { display: inline-block; }
.ae-agentic-insight-row { padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.ae-agentic-thumb-row { margin-top: 6px; }
.ae-agentic-query-list { margin: 8px 0 0; padding-left: 18px; color: #374151; }
.ae-agentic-sidebar-card { margin-bottom: 12px; padding: 14px; }
.ae-agentic-sidebar-card h3 { font-size: 14px; margin: 0 0 10px; }
.ae-agentic-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.ae-agentic-channel-list, .ae-agentic-sources-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ae-agentic-channel-list li, .ae-agentic-sources-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.ae-agentic-channel-link { margin-left: auto; }
.ae-sidebar-new-badge { margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; background: #dbeafe; color: #1d4ed8; padding: 2px 6px; border-radius: 999px; }

/* Becomy Journal — correspondence */
.ae-journal-section { margin-bottom: 32px; }

.ae-correspondence,
.ae-correspondence-page {
  --ae-letter-serif: "Lora", Georgia, "Times New Roman", serif;
  --ae-letter-hand: "Caveat", "Segoe Script", cursive;
  --ae-paper-in: #fffdf8;
  --ae-paper-out: #f8fcfb;
  --ae-paper-line: rgba(120, 53, 15, 0.06);
  --ae-ink: #3d2f24;
  --ae-ink-muted: #7c6a5c;
  --ae-stamp: #6d28d9;
  --ae-thread: #d4c4b0;
}

.ae-correspondence-hero,
.ae-correspondence-page-hero {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px;
}
.ae-correspondence-page-hero { margin-bottom: 20px; }
.ae-correspondence-page-hero--entry h1 { margin: 8px 0 0; font-size: 22px; }
.ae-correspondence-hero-icon {
  flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center;
  font-size: 22px; border-radius: 14px;
  background: linear-gradient(145deg, #faf5ff, #ede9fe);
  border: 1px solid #ddd6fe; box-shadow: 0 2px 8px rgba(109, 40, 217, 0.08);
}
.ae-correspondence-hero-icon--large { width: 52px; height: 52px; font-size: 26px; }
.ae-correspondence-hero-copy h1,
.ae-correspondence-hero-copy h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.02em; }
.ae-correspondence-hero-copy p { margin: 0; font-size: 14px; color: #6b7280; line-height: 1.5; }
.ae-correspondence-back { margin: 0 0 4px; font-size: 13px; }
.ae-correspondence-back a { color: #6d28d9; text-decoration: none; }
.ae-correspondence-back a:hover { text-decoration: underline; }

.ae-correspondence-disclaimer {
  margin: 0 0 20px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: linear-gradient(135deg, #faf5ff 0%, #fffdf8 100%);
  border: 1px dashed #d8b4fe; color: #5b21b6;
}

.ae-correspondence-featured { display: flex; flex-direction: column; gap: 0; margin-bottom: 8px; }
.ae-correspondence-compose { margin-top: 4px; }
.ae-correspondence-compose--reply { margin-top: -6px; scroll-margin-top: 88px; }
#letter-reply { scroll-margin-top: 88px; }
.ae-correspondence-compose--note {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid #e7e5e4;
}
.ae-correspondence-compose--note.ae-correspondence-compose--collapsed {
  padding: 22px 22px 20px;
  background: linear-gradient(135deg, #fafaf9 0%, #f5f3ff 100%);
  border: 1px dashed #d6d3d1;
  border-radius: 12px;
}
.ae-correspondence-compose--note .ae-letter-paper--compose {
  background: linear-gradient(180deg, #faf5ff 0%, #fffdf8 100%);
  border-color: #ddd6fe;
}
.ae-correspondence-compose-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -8px 0 20px;
  color: #a8a29e;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ae-correspondence-compose-divider::before,
.ae-correspondence-compose-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e7e5e4;
}
.ae-correspondence-compose--collapsed [data-journal-compose-target="noteSection"] { display: none; }
.ae-correspondence-compose--collapsed [data-journal-compose-target="expandedHeader"] { display: none; }
.ae-correspondence-compose:not(.ae-correspondence-compose--collapsed) [data-journal-compose-target="collapsedPrompt"] { display: none; }
.ae-correspondence-compose:not(.ae-correspondence-compose--collapsed) [data-journal-compose-target="collapsedHeader"] { display: none; }
.ae-correspondence-compose-collapsed {
  margin-top: 4px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
}
.ae-correspondence-compose-collapsed-prompt { margin: 0; }
.ae-correspondence-compose-collapsed-actions { margin-top: 12px; }
.ae-correspondence-compose-collapsed-remaining { margin-top: 10px; color: #78716c; }
.ae-correspondence-history-head--compact h2 {
  font-size: 15px;
  font-weight: 600;
  color: #57534e;
}
.ae-correspondence-compose-note-banner {
  margin: 0 0 12px 24px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
}
.ae-correspondence-compose-collapse-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px 24px;
}
.ae-correspondence-compose--collapsed [data-journal-compose-target="collapseBar"] { display: none !important; }
.ae-letter-compose-hint--quota { margin-top: 10px; margin-bottom: 0; font-size: 12px; color: #a8a29e; }

.ae-letter-paper {
  position: relative; padding: 22px 22px 20px; margin: 0;
  border-radius: 4px 14px 14px 4px;
  box-shadow: 0 1px 2px rgba(61, 47, 36, 0.06), 0 8px 24px rgba(61, 47, 36, 0.07);
  background-color: var(--ae-paper-in);
  background-image:
    linear-gradient(var(--ae-paper-line) 1px, transparent 1px);
  background-size: 100% 28px;
  background-position: 0 18px;
  border: 1px solid #e8dfd2;
}
.ae-letter-paper--outgoing {
  --ae-paper-in: var(--ae-paper-out);
  border-color: #cfe8e4;
  border-radius: 14px 4px 4px 14px;
  margin-left: 24px;
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.05), 0 6px 18px rgba(15, 118, 110, 0.06);
}
.ae-letter-paper--incoming { margin-right: 8px; }
.ae-letter-paper--featured { padding: 26px 26px 22px; }
.ae-letter-paper--compact { padding: 16px 18px; box-shadow: 0 1px 6px rgba(61, 47, 36, 0.05); }
.ae-letter-paper--compact.ae-letter-paper--outgoing { margin-left: 16px; }
.ae-letter-paper--thread { padding: 18px 20px; }
.ae-letter-paper--compose {
  background-image: none;
  background: linear-gradient(180deg, var(--ae-paper-out) 0%, #f3faf9 100%);
}

.ae-letter-stamp {
  position: absolute; top: 16px; right: 18px; width: 54px; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed var(--ae-stamp); border-radius: 50%; opacity: 0.55;
  transform: rotate(-12deg);
}
.ae-letter-stamp-mark {
  font-family: var(--ae-letter-serif); font-size: 18px; font-weight: 700; color: var(--ae-stamp); line-height: 1;
}
.ae-letter-stamp-label {
  font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ae-stamp);
}

.ae-letter-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(120, 53, 15, 0.12);
}
.ae-letter-paper--outgoing .ae-letter-header { border-bottom-color: rgba(15, 118, 110, 0.15); }
.ae-letter-routing { flex: 1; min-width: 180px; }
.ae-letter-route { margin: 0 0 4px; font-size: 13px; color: var(--ae-ink-muted); }
.ae-letter-route strong { color: var(--ae-ink); font-weight: 600; }
.ae-letter-route-label {
  display: inline-block; min-width: 2.5rem; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: #a8a29e; margin-right: 6px;
}
.ae-letter-kind { margin: 6px 0 0; font-size: 12px; color: #8b7355; font-style: italic; }
.ae-letter-kind--hand { font-family: var(--ae-letter-hand); font-size: 18px; font-style: normal; color: #0f766e; }
.ae-letter-date { font-size: 12px; color: var(--ae-ink-muted); white-space: nowrap; padding-top: 2px; }

.ae-letter-body {
  font-family: var(--ae-letter-serif); font-size: 16px; line-height: 1.75; color: var(--ae-ink);
  white-space: pre-wrap;
}
.ae-letter-paper--compact .ae-letter-body { font-size: 14px; line-height: 1.65; }
.ae-letter-body p { margin: 0 0 0.85em; }
.ae-letter-body p:last-child { margin-bottom: 0; }

.ae-letter-footer { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(120, 53, 15, 0.15); }
.ae-letter-read-link { font-size: 13px; font-weight: 600; color: #6d28d9; text-decoration: none; }
.ae-letter-read-link:hover { text-decoration: underline; }

.ae-letter-compose-label { display: block; margin: 0 0 8px; font-size: 12px; color: var(--ae-ink-muted); }
.ae-letter-compose-hint { margin: 8px 0 0; font-size: 12px; color: var(--ae-ink-muted); }
.ae-letter-textarea {
  width: 100%; min-height: 140px; resize: vertical; padding: 12px 14px;
  font-family: var(--ae-letter-serif); font-size: 16px; line-height: 1.7; color: var(--ae-ink);
  background: rgba(255, 255, 255, 0.65); border: 1px solid #d6cfc4; border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(61, 47, 36, 0.04);
}
.ae-letter-textarea:focus {
  outline: none; border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}
.ae-letter-textarea::placeholder { color: #b8a99a; font-style: italic; }
.ae-letter-countdown { margin: 8px 0 0; font-size: 12px; color: #b45309; font-weight: 500; }

.ae-correspondence-reply-branch {
  width: 2px; height: 20px; margin: 0 0 0 42px;
  background: linear-gradient(180deg, var(--ae-thread), transparent);
}
.ae-correspondence-reply-branch--featured { height: 28px; margin-left: 48px; }
.ae-correspondence-reply-meta { margin: 6px 0 0 24px; font-size: 12px; color: #0f766e; }
.ae-correspondence-reply-meta--muted { color: #a8a29e; font-style: italic; }

.ae-correspondence-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.ae-journal-improve-error { margin-top: 8px; color: #b45309; }
.ae-journal-improve-coach { border-color: #c4b5fd; background: #f5f3ff; }
.ae-journal-compose-field { position: relative; }
.ae-journal-compose-textarea::placeholder {
  color: #b8a99a;
  font-style: italic;
  transition: opacity 0.35s ease;
}
.ae-journal-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-style: normal;
  vertical-align: middle;
  border: 1px solid transparent;
  background: #f5f5f4;
  color: #57534e;
}
.ae-journal-tier-badge-emoji { font-size: 12px; line-height: 1; }
.ae-journal-tier-badge-label { letter-spacing: 0.02em; }
.ae-journal-tier-badge--bronze { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.ae-journal-tier-badge--silver { background: #f3f4f6; border-color: #d1d5db; color: #374151; }
.ae-journal-tier-badge--gold { background: #fef9c3; border-color: #facc15; color: #854d0e; }
.ae-journal-tier-badge--platinum { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.ae-journal-tier-badge--diamond { background: #ecfeff; border-color: #67e8f9; color: #0e7490; }
.ae-journal-tier-badge--ruby { background: #ffe4e6; border-color: #fda4af; color: #9f1239; }
.ae-correspondence-thread-item--milestone .ae-correspondence-thread-dot {
  border-color: #a78bfa;
  background: #ede9fe;
}
.ae-correspondence-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.ae-btn--seal { box-shadow: 0 2px 8px rgba(109, 40, 217, 0.2); }

.ae-correspondence-history { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e7e5e4; }
.ae-correspondence-history--compact { margin-top: 24px; }
.ae-correspondence-history-head { margin-bottom: 16px; }
.ae-correspondence-history-head h2,
.ae-correspondence-history-head h3 { margin: 0 0 4px; font-size: 16px; }
.ae-correspondence-history-head p { margin: 0; font-size: 13px; color: #6b7280; }

.ae-correspondence-thread {
  position: relative; display: flex; flex-direction: column; gap: 0;
  padding-left: 20px;
}
.ae-correspondence-thread::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--ae-thread) 0%, rgba(212, 196, 176, 0.2) 100%);
  border-radius: 2px;
}
.ae-correspondence-thread-item {
  position: relative; padding: 0 0 24px;
}
.ae-correspondence-thread-item--compact { padding-bottom: 18px; }
.ae-correspondence-thread-item--current .ae-correspondence-thread-dot {
  background: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}
.ae-correspondence-thread-item:last-child { padding-bottom: 0; }
.ae-correspondence-thread-marker {
  position: absolute; left: -20px; top: 18px; width: 16px; display: flex; justify-content: center;
}
.ae-correspondence-thread-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ae-thread); box-shadow: 0 0 0 2px #fff;
}
.ae-correspondence-thread-content { display: flex; flex-direction: column; gap: 0; }

.ae-correspondence-empty {
  padding: 32px 20px; text-align: center; color: #6b7280; font-size: 14px;
  background: #fafaf9; border: 1px dashed #e7e5e4; border-radius: 12px;
}

.ae-correspondence-page .ae-catalog-hero { display: none; }

/* Legacy class kept for specs */
.ae-journal-disclaimer {
  margin: 0 0 20px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: linear-gradient(135deg, #faf5ff 0%, #fffdf8 100%);
  border: 1px dashed #d8b4fe; color: #5b21b6;
}

@media (max-width: 640px) {
  .ae-letter-paper--outgoing,
  .ae-letter-paper--compact.ae-letter-paper--outgoing { margin-left: 0; }
  .ae-letter-paper--incoming { margin-right: 0; }
  .ae-letter-paper--featured { padding: 20px 16px 18px; }
  .ae-correspondence-thread { padding-left: 16px; }
  .ae-correspondence-compose--reply,
  #letter-reply { scroll-margin-top: 72px; }
}

/* Shipping admin (Studio) */
.ae-card-section {
  margin-bottom: 1.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.ae-card-section:last-child { margin-bottom: 0; }
.ae-card-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}
.ae-card-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
}
.ae-card-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ae-card-section-body { padding: 16px 18px; }
.ae-shipping-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.ae-shipping-row .ae-field { margin-bottom: 0; flex: 1 1 140px; min-width: 0; }
.ae-shipping-row .ae-field-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}
.ae-shipping-zone {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.ae-shipping-zone + .ae-shipping-zone { margin-top: 12px; }
.ae-shipping-zone-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ae-shipping-zone-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.ae-shipping-zone-meta {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}
.ae-shipping-rate-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
}
.ae-shipping-rate-form .ae-field { margin-bottom: 0; min-width: 0; }
.ae-shipping-rate-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.ae-shipping-rate-form:not(.ae-shipping-rate-form--new):not(.ae-shipping-zone-edit-form) {
  display: grid;
  grid-template-columns: var(--ae-rate-col-name) var(--ae-rate-col-type) var(--ae-rate-col-price) var(--ae-rate-col-actions);
  gap: 10px;
  align-items: end;
}
.ae-shipping-rate-form:not(.ae-shipping-rate-form--new) .ae-shipping-rate-fields {
  display: contents;
}
.ae-shipping-rate-form:not(.ae-shipping-rate-form--new) .ae-shipping-rate-fields-primary {
  display: contents;
}
.ae-shipping-rate-form:not(.ae-shipping-rate-form--new) .ae-shipping-rate-type-fields {
  display: contents;
}
.ae-shipping-rate-form:not(.ae-shipping-rate-form--new) .ae-shipping-rate-fields-conditions {
  grid-column: 1 / -1;
}
.ae-shipping-rate-form:not(.ae-shipping-rate-form--new) .ae-shipping-rate-col-actions {
  grid-column: 4;
  grid-row: 1;
  padding-bottom: 0;
}
.ae-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ae-shipping-rate-fields-primary {
  display: grid;
  grid-template-columns: var(--ae-rate-col-name) var(--ae-rate-col-type) var(--ae-rate-col-price) var(--ae-rate-col-actions);
  gap: 10px;
  align-items: end;
}
.ae-shipping-rate-fields-conditions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.ae-shipping-rate-fields-conditions > .ae-shipping-rate-col-handle,
.ae-shipping-rate-fields-conditions > .ae-shipping-rate-col-actions-spacer {
  display: none;
}
.ae-shipping-rate-fields-primary > .ae-shipping-rate-col-handle {
  display: none;
}
.ae-shipping-rate-type-fields {
  display: contents;
}
.ae-shipping-rate-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.ae-shipping-rate-fields--labeled .ae-field label.ae-sr-only {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0 0 4px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.ae-shipping-rate-price-hint {
  margin-top: 4px;
  font-size: 11px;
}
.ae-shipping-rate-error {
  grid-column: 1 / -1;
  color: #991b1b;
  font-size: 13px;
  margin: 0;
}
.ae-shipping-rate-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.ae-shipping-rate-form--new.ae-shipping-rate-grid {
  display: grid;
  grid-template-columns: var(--ae-rate-col-handle) 1fr;
  gap: 10px;
  align-items: start;
}
.ae-shipping-rate-form--new .ae-shipping-rate-form-body {
  min-width: 0;
}
.ae-shipping-rate-form--new .ae-shipping-rate-fields-primary {
  grid-template-columns: 1fr;
}
.ae-shipping-rate-form--new .ae-shipping-rate-fields--labeled .ae-field label.ae-sr-only {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0 0 4px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
}
@media (max-width: 768px) {
  .ae-shipping-rate-columns { display: none; }
  .ae-shipping-rate-fields-primary {
    grid-template-columns: 1fr;
  }
  .ae-shipping-rate-fields-conditions {
    grid-template-columns: 1fr;
  }
  .ae-shipping-rate-row.ae-shipping-rate-grid {
    grid-template-columns: 1fr;
  }
  .ae-shipping-rate-col-handle { display: none; }
  .ae-shipping-rate-fields--labeled .ae-field label.ae-sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0 0 4px;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
  }
}
.ae-shipping-profile {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.ae-shipping-profile:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.ae-shipping-countries-select {
  flex: 1 1 100%;
  width: 100%;
}
.ae-shipping-countries-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ae-shipping-country-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}
.ae-shipping-country-option:has(input:checked) {
  border-color: #6366f1;
  background: #eef2ff;
}
.ae-shipping-country-code {
  color: #94a3b8;
  font-size: 12px;
}
.ae-shipping-countries-empty {
  margin-bottom: 6px;
}
.ae-shipping-zone-edit-form {
  flex-direction: column;
  align-items: stretch;
}
.ae-field-full {
  flex: 1 1 100% !important;
  min-width: 100% !important;
}

/* Trophy shelf — legend revenue milestones (Dashboard + Carnet compact) */
.ae-trophy-shelf-section { margin-bottom: 8px; }
.ae-trophy-shelf {
  background: linear-gradient(135deg, #faf5ff 0%, #eef2ff 55%, #f8fafc 100%);
  border: 1px solid #e0e7ff;
  border-radius: 14px;
  padding: 18px 20px;
}
.ae-trophy-shelf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ae-trophy-shelf-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #312e81;
}
.ae-trophy-shelf-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}
.ae-trophy-shelf-journal-link {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  white-space: nowrap;
}
.ae-trophy-shelf-journal-link:hover { text-decoration: underline; }
.ae-trophy-warmup,
.ae-trophy-next-legend { margin-bottom: 16px; }
.ae-trophy-warmup-copy,
.ae-trophy-next-legend-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #1f2937;
}
.ae-trophy-warmup-remaining,
.ae-trophy-warmup-revenue {
  font-size: 13px;
  color: #6b7280;
}
.ae-trophy-warmup-revenue { margin: 8px 0 0; }
.ae-trophy-progress {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.ae-trophy-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .3s ease;
}
.ae-trophy-shelf-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.ae-trophy-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-align: center;
  min-width: 0;
}
.ae-trophy-icon {
  font-size: 28px;
  line-height: 1;
  filter: grayscale(1);
  opacity: .35;
}
.ae-trophy-slot-name {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.2;
}
.ae-trophy-threshold,
.ae-trophy-progress-label,
.ae-trophy-earned-at {
  font-size: 10px;
  color: #9ca3af;
}
.ae-trophy-slot--earned {
  background: rgba(255, 255, 255, .75);
  border-color: #c7d2fe;
}
.ae-trophy-slot--earned .ae-trophy-icon {
  filter: none;
  opacity: 1;
}
.ae-trophy-slot--earned .ae-trophy-slot-name { color: #312e81; }
.ae-trophy-slot--current,
.ae-trophy-slot--in_progress {
  background: #fff;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .15);
}
.ae-trophy-slot--current .ae-trophy-icon,
.ae-trophy-slot--in_progress .ae-trophy-icon {
  filter: none;
  opacity: 1;
  animation: ae-trophy-pulse 2s ease-in-out infinite;
}
.ae-trophy-slot--current .ae-trophy-slot-name,
.ae-trophy-slot--in_progress .ae-trophy-slot-name { color: #4338ca; }
.ae-trophy-slot--dream {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .2);
}
.ae-trophy-shelf--legend_focus .ae-trophy-slot--current {
  transform: scale(1.04);
}
@keyframes ae-trophy-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.ae-trophy-shelf-compact {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  background: #f8fafc;
}
.ae-trophy-compact-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ae-trophy-compact-icon { font-size: 22px; line-height: 1; }
.ae-trophy-compact-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: #374151;
  min-width: 0;
}
.ae-trophy-compact-copy strong { color: #1f2937; }
.ae-trophy-progress--compact { margin-top: 8px; height: 6px; }
.ae-trophy-compact-amounts {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}
.ae-trophy-compact-earned {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.ae-trophy-compact-earned-icon { font-size: 16px; line-height: 1; }
@media (max-width: 720px) {
  .ae-trophy-shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ae-trophy-shelf-head { flex-direction: column; }
}

.ae-referral-peak-card { margin-bottom: 8px; }
.ae-referral-peak-card__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ae-referral-peak-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .ae-referral-peak-card__inner { flex-direction: column; align-items: stretch; }
  .ae-referral-peak-card__actions { width: 100%; }
  .ae-referral-peak-card__actions .ae-btn { flex: 1 1 auto; text-align: center; }
}

/* ---------------------------------------------------------------------------
   Dropshipping AliExpress (studio/dropshipping)
--------------------------------------------------------------------------- */
.ae-ds-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.ae-ds-search-input { flex: 1 1 260px; min-width: 0; width: auto; }
.ae-ds-search-select { flex: 0 1 190px; width: auto; min-width: 0; }
.ae-ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.ae-ds-card {
  display: flex;
  flex-direction: column;
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  overflow: hidden;
}
.ae-ds-card-media {
  aspect-ratio: 1 / 1;
  background: #f6f7f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ae-ds-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ae-ds-card-media-empty { font-size: 28px; opacity: .4; }
.ae-ds-card-body {
  padding: 10px 12px 4px;
  flex: 1 1 auto;
}
.ae-ds-card-title {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ae-ds-card-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.ae-ds-card-price { font-size: 14px; }
.ae-ds-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
}
.ae-ds-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.ae-ds-manual-connect {
  margin: -6px 0 16px;
}
.ae-ds-manual-connect summary { cursor: pointer; margin-bottom: 8px; }
.ae-ds-imported-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ae-ds-imported-header h2 { margin: 0; }
.ae-ds-row-icon { font-size: 18px; }
.ae-ds-row-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 8px;
  border: 1px solid #e5e7eb; background: #f8fafc; flex-shrink: 0;
}
.ae-ds-row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Inventory index — unified table with filters and inline stock editing */
.ae-stats-row--spaced { gap: 12px; margin: 4px 0 20px; }
.ae-stat-card--link { transition: border-color .15s ease, background .15s ease; }
.ae-stat-card--link:hover { border-color: #94a3b8; }
.ae-stat-card--warning .ae-stat-value { color: #b45309; }
.ae-stat-card--danger .ae-stat-value { color: #b91c1c; }
.ae-inv-supplier-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--ae-border);
  border-radius: 10px;
  background: var(--ae-surface);
}
.ae-inv-supplier-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ae-inv-results-count { margin: 0 0 8px; }
.ae-inv-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.ae-inv-stock-input {
  width: 76px;
  text-align: right;
}
.ae-inv-stock-input--low { border-color: #fde68a; background: #fffbeb; }
.ae-inv-stock-input--out { border-color: #fecaca; background: #fef2f2; }
.ae-inv-stock-state { font-size: 12px; white-space: nowrap; }
.ae-inv-stock-state--ok { color: #047857; }
.ae-inv-stock-state--error { color: #b91c1c; max-width: 180px; white-space: normal; }
.ae-inv-table td:first-child { min-width: 240px; max-width: 420px; }
.ae-inv-table .ae-code {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.ae-inv-variant-title { display: block; }
.ae-inv-details {
  min-width: 170px;
}
.ae-inv-details .ae-hint,
.ae-inv-details .ae-link { display: block; margin-top: 4px; }

.ae-ds-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ae-canvas, #f9f9ff);
  padding: 8px 0 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--ae-border);
}
.ae-ds-toolbar .ae-ds-search { margin-bottom: 8px; }
.ae-ds-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ae-ds-chip {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--ae-border);
  border-radius: 999px;
  font-size: 12px;
  color: inherit;
  text-decoration: none;
  background: var(--ae-surface);
  transition: border-color .15s ease, background .15s ease;
}
.ae-ds-chip:hover { border-color: #94a3b8; }
.ae-ds-chip--active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.ae-ds-results-count { margin: 0 0 10px; }
.ae-ds-card-resale {
  font-size: 12px;
  color: #047857;
  white-space: nowrap;
}
.ae-ds-card-imported {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ae-ds-card-status {
  flex: 1 1 100%;
  font-size: 11px;
  color: #b45309;
}
.ae-ds-btn-pending {
  opacity: .7;
  cursor: progress;
  animation: ae-ds-pulse 1.2s ease-in-out infinite;
}
@keyframes ae-ds-pulse {
  0%, 100% { opacity: .7; }
  50% { opacity: .45; }
}
@media (max-width: 640px) {
  .ae-ds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ae-ds-search .ae-btn { flex: 1 1 100%; }
  .ae-ds-toolbar { position: static; border-bottom: 0; padding-bottom: 0; }
  .ae-ds-card-actions { flex-direction: column; align-items: stretch; }
  .ae-ds-card-actions .ae-btn { text-align: center; }
  .ae-ds-card-imported { justify-content: center; }
}

/* Marketing audiences (segments) */
.ae-inline-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.ae-inline-filter .ae-input { min-width: 220px; max-width: 320px; }
.ae-audience-presets { margin-top: 28px; }
.ae-audience-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.ae-audience-preset-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.ae-audience-preset-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 1px 3px rgba(56, 18, 138, 0.08);
}
.ae-audience-preset-card strong {
  font-size: 14px;
  color: #1e293b;
}
.ae-audience-preset-card span {
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}
.ae-audience-kind-control { max-width: 360px; }
.ae-audience-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.ae-audience-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.ae-audience-rule-row .ae-input { min-width: 0; }
.ae-audience-rule-remove {
  min-width: 36px;
  padding-inline: 0;
  font-size: 18px;
  line-height: 1;
}
.ae-audience-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.ae-audience-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.ae-audience-stat {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ae-audience-stat strong { font-size: 18px; color: #1e293b; }
.ae-audience-stat-rules { font-size: 13px; font-weight: 500; }
.ae-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}
.ae-audience-danger { margin-top: 28px; border-top: 1px solid #e5e7eb; padding-top: 16px; }
.ae-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff;
}
.ae-btn-danger:hover { background: #fef2f2; }
@media (max-width: 640px) {
  .ae-audience-rule-row {
    grid-template-columns: 1fr;
  }
  .ae-audience-rule-remove { justify-self: start; }
}


/* —— Marketing email snippets workspace —— */
.ae-snippet-page { max-width: none; }
.ae-snippet-recipes-section { margin-top: 8px; }
.ae-snippet-recipes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.ae-snippet-recipe-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  min-height: 120px;
}
.ae-snippet-recipe-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 6px 20px rgba(79, 70, 229, .08);
  transform: translateY(-1px);
}
.ae-snippet-recipe-emoji { font-size: 22px; line-height: 1; }
.ae-snippet-recipe-card strong { font-size: 14px; color: #111827; }
.ae-snippet-recipe-card span:last-child { font-size: 12px; color: #6b7280; line-height: 1.45; }

.ae-snippet-list { display: flex; flex-direction: column; gap: 10px; }
.ae-snippet-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.ae-snippet-row-title { font-size: 15px; font-weight: 650; color: #111827; }
.ae-snippet-row-subject { font-size: 12px; color: #4f46e5; margin-top: 4px; word-break: break-word; }
.ae-snippet-row-excerpt { font-size: 13px; color: #6b7280; margin: 6px 0 0; line-height: 1.45; }
.ae-snippet-row-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.ae-snippet-workspace {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(360px, 1.4fr) minmax(220px, 300px);
  gap: 16px;
  align-items: start;
  margin-top: 8px;
  overflow: visible;
}
.ae-snippet-sidebar,
.ae-snippet-preview-pane {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.ae-snippet-sidebar-block + .ae-snippet-sidebar-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f3f4f6; }
.ae-snippet-sidebar h2,
.ae-snippet-preview-toolbar strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
  margin: 0 0 6px;
  font-weight: 700;
}
.ae-snippet-recipe-stack { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ae-snippet-recipe-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ae-snippet-recipe-chip:hover { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }

.ae-snippet-tag-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af;
  margin: 12px 0 6px;
  font-weight: 700;
}
.ae-snippet-tags { display: flex; flex-direction: column; gap: 6px; }
.ae-snippet-tag {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  cursor: grab;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ae-snippet-tag:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .08);
}
.ae-snippet-tag:active { cursor: grabbing; }
.ae-snippet-tag-label { font-size: 12px; font-weight: 650; color: #111827; }
.ae-snippet-tag code {
  font-size: 10px;
  color: #6366f1;
  background: transparent;
  padding: 0;
  word-break: break-all;
}
.ae-snippet-workspace.is-dragging-tag .ae-snippet-dropzone {
  outline: 2px dashed #a5b4fc;
  outline-offset: 2px;
  border-radius: 10px;
}
.ae-snippet-dropzone.is-drop-target {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  background: #eef2ff;
  border-radius: 10px;
}

.ae-snippet-main {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px 18px;
  min-width: 0;
}
.ae-snippet-body-field .tox-tinymce { border-radius: 8px !important; border-color: #e5e7eb !important; min-height: 320px; }
.ae-snippet-body-field .tox-editor-header { background: #fafafa; border-bottom: 1px solid #e5e7eb; }
.ae-snippet-body-field .tox-toolbar-overlord,
.ae-snippet-body-field .tox-toolbar__primary {
  flex-wrap: wrap !important;
  white-space: normal !important;
}
.ae-snippet-body-field .tox-toolbar__group { flex-wrap: wrap; }
/* TinyMCE dialogs/menus above sticky sidebars + Copilot */
.ae-snippet-page .tox-tinymce-aux,
.ae-snippet-form .tox-tinymce-aux,
.tox-tinymce-aux {
  z-index: 10050 !important;
}
.ae-snippet-page .tox-dialog-wrap,
.ae-snippet-form .tox-dialog-wrap {
  z-index: 10060 !important;
}
.ae-snippet-main { overflow: visible; }
.ae-snippet-workspace { overflow: visible; }

.ae-snippet-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ae-snippet-viewport-toggle { display: flex; gap: 4px; }
.ae-snippet-viewport-toggle .ae-btn.is-active {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
.ae-snippet-preview-meta { font-size: 11px; color: #9ca3af; margin: 0 0 10px; }
.ae-snippet-preview-viewport {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  justify-content: center;
}
.ae-snippet-preview-viewport[data-mode="mobile"] .ae-snippet-preview-frame {
  width: 100%;
  max-width: 280px;
}
.ae-snippet-preview-frame {
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.ae-snippet-preview-chrome {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
}
.ae-snippet-preview-from {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.ae-snippet-preview-subject {
  display: block;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}
.ae-snippet-preview-body {
  padding: 16px 14px 18px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  min-height: 180px;
}
.ae-snippet-preview-body p { margin: 0 0 12px; }
.ae-snippet-preview-body a { color: #4f46e5; }
.ae-snippet-preview-empty { color: #94a3b8; font-style: italic; }

@media (max-width: 1100px) {
  .ae-snippet-workspace {
    grid-template-columns: 1fr;
  }
  .ae-snippet-sidebar,
  .ae-snippet-preview-pane {
    position: static;
    max-height: none;
  }
}
@media (max-width: 640px) {
  .ae-snippet-recipes { grid-template-columns: 1fr; }
  .ae-snippet-row { flex-direction: column; }
  .ae-snippet-row-actions { width: 100%; }
  .ae-snippet-row-actions .ae-btn { flex: 1; text-align: center; }
}
