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

    /* ════════════════════════════════════════════════════════════════
       Macondo design-system mapping.
       The whole app reads ~15 CSS vars below; each maps onto a Macondo
       semantic token (defined in ds/tokens/colors.css). Light values live
       in :root; the `.dark` class (added by the head bridge that mirrors
       app.js's data-theme attribute) swaps the underlying primitives, so
       every var re-resolves to its dark value automatically.
       Interactive accent = orange; primary buttons are monochrome.
       ════════════════════════════════════════════════════════════════ */
    :root {
      --bg: var(--background);                 /* warm neutral ground #f8f6f4 */
      --bg-sidebar: var(--background);         /* sidebar sits on the ground */
      --bg-card: var(--surface-primary);       /* white surfaces */
      --bg-input: var(--surface-primary);      /* white inputs w/ hairline border */
      --bg-hover: var(--surface-hover);
      --border: var(--border-primary);
      --border-focus: var(--border-focused);   /* orange focus */
      --text: var(--typography-primary);
      --text-secondary: var(--typography-secondary);
      --text-muted: var(--typography-tertiary);
      --accent: var(--orange-400);             /* #e58638 interactive accent */
      --accent-hover: var(--orange-500);
      --accent-glow: var(--orange-100);        /* soft orange tint for fills/rings */
      --success: var(--success-text);
      --warning: var(--warning-text);
      --error: var(--critical-text);
      --radius: var(--border-radius-300);      /* 12px — buttons/inputs */
      --radius-lg: var(--border-radius-400);   /* 16px — cards/containers */
      --transition: all 0.15s ease;
    }

    /* ── Theme Toggle ─────────────────────────────────── */
    .theme-toggle {
      display: flex; align-items: center; justify-content: center;
      gap: 8px; padding: 8px 14px; border-radius: 10px;
      border: 1px solid transparent; background: transparent;
      color: var(--text-secondary); font-family: inherit; font-size: 0.72rem;
      font-weight: 600; cursor: pointer; transition: var(--transition); width: 100%;
    }
    .theme-toggle:hover { background: var(--bg-hover); color: var(--text); }
    .theme-toggle svg { width: 14px; height: 14px; }

    body {
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      height: 100vh;
      overflow: hidden;
    }

    /* ══ Layout — warm shell, floating content panel ══ */
    .app {
      display: grid;
      grid-template-columns: 220px 1fr;
      height: 100vh;
      background: var(--bg);
    }

    /* ══ Sidebar (no border — sits on the page background) ══ */
    .sidebar {
      background: var(--bg-sidebar);
      display: flex;
      flex-direction: column;
      padding: 24px 0 16px;
      overflow-y: auto;
    }

    .sidebar-logo {
      padding: 0 20px 20px;
    }

    .sidebar-logo h1 {
      font-size: 0.95rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--text);
    }
    .sidebar-logo h1 svg { color: var(--accent); }

    .sidebar-logo .subtitle {
      font-size: 0.68rem;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .nav-section-label {
      font-size: 0.72rem;
      line-height: 16px;
      font-weight: 500;
      color: var(--text-muted);
      height: 32px;
      display: flex;
      align-items: center;
      padding: 0 20px;
      margin-top: 8px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 0 10px 4px;
      padding: 8px 10px;
      min-height: 32px;
      border-radius: 10px;
      cursor: pointer;
      transition: var(--transition);
      font-size: 0.84rem;
      font-weight: 500;
      color: var(--text-secondary);
    }

    .nav-item:hover { background: var(--bg-hover); color: var(--text); }

    /* White pill with a soft shadow; text/icon keep the CMS orange accent */
    .nav-item.active {
      background: var(--bg-card);
      color: var(--accent);
      font-weight: 600;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
    }

    .nav-icon { width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-muted); }
    .nav-icon svg { width: 18px; height: 18px; }
    .nav-item:hover .nav-icon { color: var(--text-secondary); }
    .nav-item.active .nav-icon { color: var(--accent); }

    .sidebar-footer {
      margin-top: auto;
      padding: 16px 12px 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .domain-badge {
      font-size: 0.72rem; color: var(--text-muted); padding: 8px 12px;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 8px; font-family: 'SF Mono', Consolas, monospace;
      text-align: center;
    }

    /* ══ Sidebar Overlay (mobile only) ═══════════════ */
    .sidebar-overlay { display: none; }

    /* ══ Content Panel — floating card inset from the shell ══ */
    .content {
      margin: 24px 24px 24px 0;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 32px;
      overflow-y: auto;
      min-height: 0;
    }

    .page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 28px;
    }

    .page-header h2 {
      font-size: 1.75rem;
      line-height: 2.25rem;
      font-weight: 600;
    }

    .page-desc {
      font-size: 0.875rem;
      line-height: 1.25rem;
      color: var(--text-secondary);
      margin-top: 4px;
    }

    /* ── Cards ──────────────────────────────────────── */
    .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }

    .card, .stat-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 20px;
      transition: var(--transition);
    }

    /* Metric tiles sit on the warm background tint inside the white panel */
    .stat-card { background: var(--bg); }
    .stat-card:hover { border-color: var(--border-secondary); }

    .card-title {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }

    .stat-label {
      font-size: 0.75rem; line-height: 1rem; font-weight: 500;
      color: var(--text-secondary); margin-bottom: 8px;
    }
    .stat-value { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em; }
    .stat-change { font-size: 0.75rem; margin-top: 4px; color: var(--text-secondary); }
    .stat-change.up { color: var(--success); }
    .stat-change.down { color: var(--error); }

    /* ── Tables ─────────────────────────────────────── */
    .table-container {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
    }
    .table-header {
      display: flex; justify-content: space-between; align-items: center;
      padding: 16px 20px; border-bottom: 1px solid var(--border);
    }
    .table-header h3 { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
    table { width: 100%; border-collapse: collapse; }
    th {
      text-align: left; padding: 12px 20px; font-size: 0.68rem; font-weight: 700;
      color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
      border-bottom: 1px solid var(--border);
    }
    td { padding: 14px 20px; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background: var(--bg-hover); }
    .code-cell {
      font-family: 'SF Mono', Consolas, monospace; color: var(--accent);
      font-weight: 500; font-size: 0.82rem;
    }
    .url-cell { color: var(--text-secondary); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tag {
      display: inline-flex; padding: 2px 8px; font-size: 0.68rem; border-radius: 50px;
      background: var(--accent-glow); color: var(--accent); font-weight: 600; margin-right: 4px;
    }
    .status-active { color: var(--success); font-weight: 500; }
    .status-inactive { color: var(--text-muted); }
    .clicks-badge {
      display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
      background: var(--surface-secondary); border-radius: 50px; font-size: 0.78rem;
      font-weight: 500; color: var(--text-secondary);
    }

    /* ── Buttons (CX Center style) ────────────────── */
    .btn {
      display: inline-flex; align-items: center; justify-content: center;
      gap: 6px; padding: 9px 14px; border-radius: var(--radius);
      border: 1px solid var(--border); background: var(--bg-card);
      color: var(--text-secondary); font-family: inherit; font-size: 0.78rem;
      font-weight: 600; cursor: pointer; transition: var(--transition);
      text-decoration: none;
    }
    .btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-secondary); }
    /* Primary = monochrome near-black w/ inverse text (Macondo), NOT a colored fill */
    .btn-primary { background: var(--surface-inverse-primary); border-color: var(--surface-inverse-primary); color: var(--typography-inverse-primary); }
    .btn-primary:hover { background: var(--surface-inverse-hover); border-color: var(--surface-inverse-hover); color: var(--typography-inverse-primary); }
    .btn-danger { background: transparent; color: var(--critical-text); border-color: var(--critical-border); }
    .btn-danger:hover { background: var(--critical-surface); color: var(--critical-text); }
    .btn-sm { padding: 6px 10px; font-size: 0.72rem; }
    /* Segmented selections read as the orange accent */
    .range-btn.active, .gran-btn.active, .metric-btn.active { background: var(--accent); color: var(--white); border-color: var(--accent); }

    /* ── Modal ──────────────────────────────────────── */
    .modal-overlay {
      position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center; z-index: 1000;
      opacity: 0; pointer-events: none; transition: opacity 0.2s;
    }
    .modal-overlay.active { opacity: 1; pointer-events: auto; }
    .modal {
      background: var(--surface-base); border: 1px solid var(--border); border-radius: var(--border-radius-card-lg);
      width: 520px; max-width: 90vw; max-height: 80vh; overflow-y: auto; padding: 28px;
      box-shadow: var(--shadow-popup);
      transform: scale(0.95); transition: transform 0.2s;
    }
    .modal-overlay.active .modal { transform: scale(1); }
    .modal h3 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }

    /* ── Forms (CX Center tokens) ─────────────────── */
    .form-group { margin-bottom: 16px; }
    .form-group label {
      display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px;
      text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
    }
    .form-input {
      width: 100%; padding: 10px 14px; background: var(--bg-input);
      border: 1px solid var(--border-secondary); border-radius: var(--radius); color: var(--text);
      font-size: 0.88rem; font-family: inherit; outline: none; transition: var(--transition);
    }
    .form-input:focus { border-color: var(--border-focused); box-shadow: 0 0 0 1px var(--background), 0 0 0 3px var(--border-focused); }
    .form-input::placeholder { color: var(--text-muted); }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

    /* ── QR Preview ─────────────────────────────────── */
    .qr-preview {
      background: white; border-radius: var(--radius); padding: 24px; text-align: center;
      display: inline-block;
    }
    .qr-preview img { width: 200px; height: 200px; }

    /* ── Toast (CX Center style) ──────────────────── */
    .toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px; }
    .toast {
      padding: 12px 18px; border-radius: 8px; font-size: 0.82rem; font-weight: 500;
      backdrop-filter: blur(12px); min-width: 280px; max-width: 480px; text-align: center;
      transform: translateY(-40px); opacity: 0;
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; border: 1px solid;
    }
    .toast.show { transform: translateY(0); opacity: 1; }
    .toast.success { background: var(--success-surface); color: var(--success-text); border-color: var(--success-border); }
    .toast.error { background: var(--critical-surface); color: var(--critical-text); border-color: var(--critical-border); }
    .toast.info { background: var(--info-surface); color: var(--info-text); border-color: var(--info-border); }

    /* ── Empty State ───────────────────────────────── */
    .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
    .empty-state .emoji { font-size: 2.5rem; margin-bottom: 12px; }
    .empty-state h4 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 4px; }
    .empty-state p { font-size: 0.82rem; margin-bottom: 20px; }

    /* ── Skeleton / Search ─────────────────────────── */
    .skeleton { background: linear-gradient(90deg, var(--surface-secondary) 25%, var(--surface-hover) 50%, var(--surface-secondary) 75%);
      background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; height: 20px; }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

    .search-bar { display: flex; gap: 10px; align-items: center; }
    .search-input {
      flex: 1; padding: 9px 14px; background: var(--bg-input); border: 1px solid var(--border);
      border-radius: 8px; color: var(--text); font-size: 0.82rem; outline: none;
      transition: var(--transition); font-family: inherit;
    }
    .search-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }

    /* ══ Login Screen ═════════════════════════════════ */
    /* Login — matched to the Spoonity Links sign-in (split-screen, light). */
    .login-screen {
      position: fixed; inset: 0; z-index: 5000; display: flex; gap: 16px; padding: 16px;
      background: #f0f0f0; font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }
    .login-left {
      flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow-y: auto;
    }
    .login-wordmark { height: 40px; width: auto; align-self: flex-start; margin: 24px 0 0 24px; flex: 0 0 auto; }
    .login-card {
      flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 32px;
    }
    .login-form-col { width: 100%; max-width: 540px; }
    .login-hero {
      flex: 0 1 45%; max-width: 720px; border-radius: 16px;
      background: #f0f0f0 url('/dashboard/assets/signin-hero.jpg') center/cover no-repeat;
    }
    @media (max-width: 860px) { .login-hero { display: none; } }
    .login-title {
      font-size: 40px; line-height: 52px; font-weight: 400; color: #111827; margin: 0 0 24px;
    }
    .login-sub { color: #9ca3af; font-size: 13px; font-weight: 500; margin: -16px 0 18px; }
    .login-fields { display: flex; flex-direction: column; gap: 16px; }
    /* Floating-label field: placeholder=" " lets :placeholder-shown drive the label. */
    .login-field { position: relative; }
    .login-input {
      width: 100%; height: 48px; padding: 20px 12px 6px; border-radius: 12px;
      border: 1px solid #dcdcdc; background: #ffffff; color: #111827;
      font-size: 15px; font-family: inherit; box-sizing: border-box; outline: none;
      transition: box-shadow .15s ease;
    }
    .login-input:focus { box-shadow: 0 0 0 2px #edaa73; }
    .login-float-label {
      position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
      color: #9ca3af; font-size: 15px; pointer-events: none; transform-origin: 0 0;
      transition: all .2s ease;
    }
    .login-input:focus + .login-float-label,
    .login-input:not(:placeholder-shown) + .login-float-label {
      top: 13px; font-size: 11px;
    }
    .login-btn {
      width: 100%; height: 40px; border-radius: 12px; border: none; color: #fff;
      background: #111827; font-size: 13px; font-weight: 500; cursor: pointer;
      margin-top: 20px; font-family: inherit; transition: background .15s ease;
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .login-btn:hover:not(:disabled) { background: #000; }
    .login-btn:disabled { background: #9ca3af; color: #e7e7e7; cursor: default; }
    .login-btn-ghost {
      width: 100%; height: 40px; border-radius: 12px; background: transparent;
      color: #4a5565; border: 1px solid #dcdcdc; font-size: 13px; font-weight: 500;
      cursor: pointer; margin-top: 14px; font-family: inherit;
    }
    .login-btn-ghost:hover { background: #e7e7e7; }
    .login-error {
      background: #fbe8ec; color: #c3223f; padding: 9px 11px; border-radius: 10px;
      font-size: 13px; margin: 0 0 12px; border: 1px solid #f2aeba; display: none;
    }
    #vendor-list { max-height: 440px; overflow-y: auto; margin-top: 8px; }
    .vendor-item {
      width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
      border: 1px solid #e7e7e7; background: #ffffff; cursor: pointer; margin-top: 6px;
      color: #111827; font-family: inherit; display: block;
    }
    .vendor-item:hover { background: #e7e7e7; }
    .vendor-item .vname { font-weight: 600; font-size: 13px; color: #111827; }
    .vendor-item .vid { font-size: 11px; color: #9ca3af; }
    .login-view { animation: login-view-in .3s cubic-bezier(.2,.8,.2,1); }
    @keyframes login-view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

    /* ── Sidebar user section ─────────────────────── */
    .user-badge {
      padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 8px; font-size: 0.75rem; margin-bottom: 6px;
    }
    .user-badge .user-email {
      color: var(--text-secondary); white-space: nowrap; overflow: hidden;
      text-overflow: ellipsis; margin-bottom: 4px; font-weight: 500;
    }
    .user-badge .vendor-name {
      color: var(--accent); font-weight: 600; font-size: 0.72rem;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .sidebar-btn {
      display: flex; align-items: center; justify-content: center;
      gap: 6px; padding: 8px 14px; border-radius: 10px;
      border: 1px solid transparent; background: transparent;
      color: var(--text-secondary); font-family: inherit; font-size: 0.72rem;
      font-weight: 600; cursor: pointer; transition: var(--transition); width: 100%;
    }
    .sidebar-btn:hover { background: var(--bg-hover); color: var(--text); }
    .sidebar-btn.danger { color: var(--error); border-color: rgba(239,68,68,0.15); }
    .sidebar-btn.danger:hover { background: rgba(239,68,68,0.06); }

    /* ── Sidebar Toggle (hamburger) ──────────────── */
    .sidebar-toggle {
      display: none; position: fixed; top: 12px; left: 12px; z-index: 1100;
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
      padding: 8px; cursor: pointer; color: var(--text-secondary);
      transition: var(--transition);
    }
    .sidebar-toggle:hover { background: var(--bg-hover); color: var(--text); }

    /* ── Pagination ───────────────────────────────── */
    .pagination {
      display: flex; justify-content: space-between; align-items: center;
      padding: 12px 20px; border-top: 1px solid var(--border);
      font-size: 0.75rem; color: var(--text-muted);
    }
    .pagination-info { font-weight: 500; }
    .pagination-controls { display: flex; gap: 4px; }
    .pagination-controls button {
      padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
      background: var(--bg-card); color: var(--text-secondary); font-family: inherit;
      font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: var(--transition);
    }
    .pagination-controls button:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
    .pagination-controls button:disabled { opacity: 0.3; cursor: not-allowed; }
    .pagination-controls button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

    /* ── Responsive: Tablet (<=1024px) ────────────── */
    @media (max-width: 1024px) {
      .content { padding: 24px 20px; }
      .cards-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    }

    /* ── Responsive: Mobile (<=768px) ─────────────── */
    @media (max-width: 768px) {
      .sidebar-toggle { display: flex; }
      .app { grid-template-columns: 1fr; }
      .sidebar {
        position: fixed; left: -260px; top: 0; bottom: 0; width: 250px;
        z-index: 1050; transition: left 0.25s ease;
        box-shadow: none;
      }
      .sidebar.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
      .sidebar-overlay {
        display: block;
        position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1040;
        opacity: 0; pointer-events: none; transition: opacity 0.25s;
      }
      .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
      .content { margin: 12px; padding: 60px 16px 20px; }
      .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
      .cards-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
      .form-row { grid-template-columns: 1fr; }
      table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .stat-value { font-size: 1.4rem; }
      .modal { width: 95vw; padding: 20px; max-height: 90vh; }
      .table-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    }

    /* ── Responsive: Small Mobile (<=480px) ────────── */
    @media (max-width: 480px) {
      .cards-grid { grid-template-columns: 1fr; }
      .stat-value { font-size: 1.2rem; }
      .content { margin: 8px; padding: 56px 12px 16px; }
    }

    /* ══ Preview Panel ════════════════════════════════ */
    .editor-layout {
      display: flex;
      gap: 0;
      align-items: flex-start;
    }

    .editor-main {
      flex: 1;
      min-width: 0;
    }

    .preview-panel {
      position: sticky;
      top: 16px;
      width: 0;
      opacity: 0;
      overflow: hidden;
      transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.35s ease;
      margin-left: 0;
      flex-shrink: 0;
    }

    .preview-panel.open {
      width: 320px;
      opacity: 1;
      margin-left: 24px;
    }

    .preview-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius) var(--radius) 0 0;
      border-bottom: none;
    }

    .preview-toolbar-left {
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .preview-device-switcher {
      display: flex;
      gap: 2px;
    }

    .preview-device-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 28px;
      border-radius: 6px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: var(--transition);
    }

    .preview-device-btn:hover {
      background: var(--bg-hover);
      color: var(--text-secondary);
    }

    .preview-device-btn.active {
      background: var(--accent-glow);
      color: var(--accent);
      border-color: var(--orange-200);
    }

    .preview-viewport {
      padding: 24px 16px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 0 0 var(--radius) var(--radius);
      display: flex;
      justify-content: center;
      min-height: 500px;
    }

    .preview-device-frame {
      width: 280px;
      height: 580px;
      background: #0f172a;
      border-radius: 32px;
      border: 3px solid #334155;
      box-shadow: 0 0 0 1px rgba(148,163,184,0.06), 0 8px 32px rgba(0,0,0,0.25);
      overflow: hidden;
      position: relative;
      transition: width 0.3s ease, height 0.3s ease;
    }

    .preview-notch {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 120px;
      height: 24px;
      background: #0f172a;
      border-radius: 0 0 16px 16px;
      z-index: 10;
      border: 2px solid #334155;
      border-top: none;
    }

    .preview-notch::before {
      content: '';
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: 50px;
      height: 5px;
      background: #475569;
      border-radius: 50px;
    }

    @media (max-width: 1200px) {
      .preview-panel.open {
        width: 280px;
        margin-left: 16px;
      }
      .preview-device-frame {
        width: 250px;
        height: 520px;
      }
    }

    @media (max-width: 1024px) {
      .preview-panel {
        display: none;
      }
    }

    /* ══ Drag and Drop ════════════════════════════════ */
    .block-item[draggable="true"] {
      cursor: default;
      transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    }

    .block-item .block-drag {
      cursor: grab;
    }

    .block-item .block-drag:active {
      cursor: grabbing;
    }

    .block-item.dragging {
      opacity: 0.4;
      transform: scale(0.98);
      box-shadow: none;
    }

    .block-item.drag-over {
      border-color: var(--accent) !important;
      box-shadow: 0 0 0 2px var(--accent-glow), 0 4px 12px rgba(0,0,0,0.08);
      transform: scale(1.01);
    }

    .block-item.drag-over::before {
      content: '';
      position: absolute;
      top: -3px;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--accent);
      border-radius: 50px;
    }

    /* ══ Schedule Bar ═════════════════════════════════ */
    .schedule-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      padding: 8px 14px;
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 0.72rem;
      color: var(--text-secondary);
      flex-wrap: wrap;
    }

    .schedule-status {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 10px;
      border-radius: 50px;
      font-size: 0.62rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .schedule-status.live {
      background: var(--success-surface);
      color: var(--success-text);
    }

    .schedule-status.scheduled {
      background: var(--info-surface);
      color: var(--info-text);
    }

    .schedule-status.expired {
      background: var(--critical-surface);
      color: var(--critical-text);
    }

    .schedule-divider {
      color: var(--text-muted);
      font-size: 0.6rem;
    }

    .schedule-presets {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
