    :root {
      /* Surfaces */
      --bg: #0b0c0f;
      --surface: #14161c;
      --card: #1a1d26;
      --border: #2a2e3a;
      --border-subtle: #22252f;

      /* Blue palette — Option A */
      --blue: #4F8EF7;
      --blue-dim: rgba(79, 142, 247, 0.10);
      --blue-glow: rgba(79, 142, 247, 0.22);
      --blue-hover: #6ba3f9;
      --blue-dark: #3a72d4;

      /* Indigo accent — Option C (highlights, badges) */
      --indigo: #7C86FF;
      --indigo-dim: rgba(124, 134, 255, 0.10);

      /* Slate — Option B (secondary, muted accents) */
      --slate: #6C8EBF;
      --slate-dim: rgba(108, 142, 191, 0.10);

      /* Semantic */
      --green: #4ade80;
      --green-dim: rgba(74, 222, 128, 0.12);
      --red: #f87171;
      --red-dim: rgba(248, 113, 113, 0.12);
      --amber: #fbbf24;
      --amber-dim: rgba(251, 191, 36, 0.12);

      /* Text */
      --text: #eef0f6;
      --text-2: #b0b8cc;
      --muted: #6b7288;

      --sidebar-w: 224px;
      --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
    }

    html.light {
      --bg: #f0f2f8;
      --surface: #ffffff;
      --card: #f7f8fc;
      --border: #dde1ee;
      --border-subtle: #eaecf5;

      --blue: #3a72d4;
      --blue-dim: rgba(58, 114, 212, 0.08);
      --blue-glow: rgba(58, 114, 212, 0.18);
      --blue-hover: #2d5fbc;
      --blue-dark: #2450a0;

      --indigo: #5c68e8;
      --indigo-dim: rgba(92, 104, 232, 0.08);

      --slate: #4a6a9a;
      --slate-dim: rgba(74, 106, 154, 0.08);

      --green: #16a34a;
      --green-dim: rgba(22, 163, 74, 0.10);
      --red: #dc2626;
      --red-dim: rgba(220, 38, 38, 0.10);
      --amber: #d97706;
      --amber-dim: rgba(217, 119, 6, 0.10);

      --text: #111827;
      --text-2: #4b5563;
      --muted: #9ca3af;
    }

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

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--font-ui);
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      overflow-x: hidden;
      /* Disable overscroll bounce on the body. Without this the sticky
         .app-header rubber-bands downward when the user scrolls past the
         page end — visually reads as "the black bar is shifting." */
      overscroll-behavior-y: none;
    }
    html { overscroll-behavior-y: none; }

    /* ── APP HEADER (chrome bar) ───────────────────────────────────────
       Always-visible dark bar at the top of every page. Houses identity
       and global actions only — per-page tools live in .topbar below. */
    .app-header {
      flex-shrink: 0;
      height: 48px;
      background: #0d1117;
      color: #e6e9ef;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 16px;
      border-bottom: 1px solid #1f2530;
      z-index: 200;
      position: sticky;
      top: 0;
    }
    .app-header-left,
    .app-header-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .app-header-center {
      flex: 1;
    }
    .app-brand {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 700;
      color: #f5f7fa;
      letter-spacing: 0.2px;
    }
    .app-store-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      height: 30px;
      padding: 0 10px;
      background: #1a2030;
      border: 1px solid #2a3142;
      color: #d6dae6;
      font-family: inherit;
      font-size: 12px;
      font-weight: 600;
      border-radius: 6px;
      cursor: pointer;
      transition: background .12s ease;
    }
    .app-store-badge:hover { background: #232b3d; }
    .app-store-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #22c55e;
      box-shadow: 0 0 0 2px rgba(34, 197, 94, .18);
    }
    .app-icon-btn {
      width: 32px;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: 1px solid transparent;
      border-radius: 6px;
      color: #d6dae6;
      cursor: pointer;
      transition: background .12s ease;
    }
    .app-icon-btn i { color: inherit !important; }
    .app-icon-btn:hover { background: #1a2030; }
    .app-user-avatar {
      width: 32px;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #4F8EF7, #43c6ac);
      color: #fff;
      border: 0;
      border-radius: 50%;
      font-family: inherit;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.5px;
      cursor: pointer;
      transition: transform .12s ease;
    }
    .app-user-avatar:hover { transform: scale(1.05); }

    /* Wrapper for sidebar + main, sitting below the chrome header.
       Body is now column-flex; this is its row-flex child. */
    .app-body {
      flex: 1;
      display: flex;
      min-height: 0;
    }

    /* Dark-mode chrome — light-mode's hardcoded #0d1117 looks identical
       to the dark-mode body bg (#0e1116), erasing the chrome's edge.
       Lift the chrome to the same surface tone the sidebar uses so it
       reads as a distinct layer above the body in dark mode too. */
    html:not(.light) .app-header {
      background: var(--ui-surface-strong);
      border-bottom-color: var(--ui-line);
    }
    html:not(.light) .app-store-badge {
      background: rgba(255, 255, 255, 0.04);
      border-color: var(--ui-line);
      color: var(--ui-text-soft);
    }
    html:not(.light) .app-store-badge:hover {
      background: rgba(255, 255, 255, 0.07);
    }
    html:not(.light) .app-icon-btn:hover {
      background: rgba(255, 255, 255, 0.06);
    }
    .notif-wrap-header .notif-bell-header {
      color: #a9b2c7;
    }

    /* ── SIDEBAR ─────────────────────────────────────────────────── */
    .sidebar {
      width: var(--sidebar-w);
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 48px;         /* sit below the 48px chrome header */
      left: 0;
      bottom: 0;
      z-index: 100;
    }

    .sidebar-nav {
      flex: 1;
      padding: 16px 0;
      overflow-y: auto;
    }

    .nav-section-label {
      font-size: 10px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 1px;
      padding: 12px 20px 6px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 20px;
      cursor: pointer;
      font-size: 13px;
      color: var(--muted);
      border-left: 2px solid transparent;
      position: relative;
      transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
      will-change: transform;
    }

    .nav-item:hover {
      color: var(--text);
      background: var(--blue-dim);
      transform: translateX(5px);
    }

    .nav-item.active {
      color: var(--blue);
      border-left-color: var(--blue);
      background: var(--blue-dim);
      transform: translateX(4px);
    }

    .nav-item.active span {
      font-weight: 700;
    }

    .nav-item img {
      flex-shrink: 0;
      opacity: 0.55;
      transition: opacity 0.18s, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* ─── Polish bulk-edit table ─────────────────────────────────────── */
    .polish-table thead th {
      background: rgba(67, 198, 172, 0.06);
      color: var(--text);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 700;
      padding: 11px 10px;
      text-align: left;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 1;
    }

    /* Light theme: re-tint so header reads dark-on-light, not grey-on-grey. */
    html.light .polish-table thead th {
      background: rgba(67, 198, 172, 0.08);
      color: #1a2332;
      border-bottom-color: rgba(0, 0, 0, 0.08);
    }

    .polish-table tbody td {
      padding: 8px 10px;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
      color: var(--text);
    }

    .polish-table tbody tr:hover {
      background: rgba(67, 198, 172, 0.04);
    }

    .polish-table tbody tr.row-selected {
      background: rgba(67, 198, 172, 0.08);
    }

    /* Flash highlight when a row is jumped-to from Pre-flight's "Fix →" link.
       Bright teal glow that fades over ~2.4s so the user's eye can find
       the row even in a long table. */
    @keyframes polishRowFlash {
      0% {
        background: rgba(67, 198, 172, 0.45);
        box-shadow: inset 4px 0 0 var(--blue);
      }

      40% {
        background: rgba(67, 198, 172, 0.30);
        box-shadow: inset 4px 0 0 var(--blue);
      }

      100% {
        background: rgba(67, 198, 172, 0.00);
        box-shadow: inset 4px 0 0 transparent;
      }
    }

    .polish-table tbody tr.row-flash {
      animation: polishRowFlash 2.4s ease-out;
    }

    .polish-cell-input {
      width: 100%;
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text);
      font-size: 12px;
      padding: 5px 8px;
      border-radius: 5px;
      font-family: inherit;
      box-sizing: border-box;
      transition: border-color 0.15s, background 0.15s;
    }

    /* Hover lifts the border so users see the field is interactive. */
    .polish-cell-input:hover {
      border-color: var(--blue);
    }

    .polish-cell-input:focus {
      outline: none;
      border-color: var(--blue);
      background: rgba(67, 198, 172, 0.05);
    }

    /* Dirty = staged change not yet sent to server. Cleared on save. */
    .polish-cell-input.dirty {
      border-color: var(--amber);
      background: rgba(228, 248, 160, 0.04);
    }

    /* Light theme: lift contrast so inputs visibly look editable. */
    html.light .polish-cell-input {
      border-color: rgba(0, 0, 0, 0.12);
      background: #fff;
    }

    html.light .polish-cell-input:hover {
      border-color: var(--blue);
    }

    html.light .polish-cell-input:focus {
      border-color: var(--blue);
      background: #fff;
    }

    /* Numeric inputs need extra width because of the spinner control. */
    .polish-cell-input[type="number"] {
      padding-right: 4px;
    }

    /* Quantity column specifically — Chrome's spinner eats ~16px on the right. */
    .polish-table td.polish-qty-cell .polish-cell-input {
      min-width: 56px;
    }

    /* ─── AI Suggest cell (Phase 6) ───────────────────────────────────── */
    .polish-ai-cell {
      display: flex;
      align-items: center;
      gap: 6px;
      font-variant-numeric: tabular-nums;
    }

    .polish-ai-btn {
      background: rgba(228, 248, 160, 0.07);
      color: var(--amber);
      border: 1px solid rgba(228, 248, 160, 0.25);
      font-size: 10px;
      font-weight: 600;
      padding: 4px 9px;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-family: inherit;
      transition: background 0.15s, border-color 0.15s;
    }

    .polish-ai-btn:hover {
      background: rgba(228, 248, 160, 0.14);
      border-color: rgba(228, 248, 160, 0.5);
    }

    .polish-ai-value {
      font-size: 12px;
      color: var(--text);
      font-weight: 600;
      cursor: help;
      border-bottom: 1px dashed rgba(228, 248, 160, 0.4);
    }

    .polish-ai-use-btn {
      background: var(--amber);
      color: #001;
      border: 0;
      font-size: 9px;
      font-weight: 700;
      padding: 3px 7px;
      border-radius: 4px;
      cursor: pointer;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-family: inherit;
      transition: filter 0.12s;
    }

    .polish-ai-use-btn:hover {
      filter: brightness(1.15);
    }

    /* Buttons inside the Polish AI Toolbar. Each one is a coloured
       gradient pill — visually distinct from the muted Pricing strip
       so users see at a glance that these spend AI credits. */
    .polish-ai-tool-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 600;
      padding: 6px 12px;
      border-radius: 7px;
      border: 1px solid rgba(67, 198, 172, 0.45);
      background: linear-gradient(135deg, rgba(67, 198, 172, 0.16), rgba(228, 248, 160, 0.10));
      color: var(--text);
      cursor: pointer;
      font-family: inherit;
      transition: all 0.15s ease;
      line-height: 1.2;
    }

    .polish-ai-tool-btn:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(67, 198, 172, 0.20);
      border-color: var(--blue);
      background: linear-gradient(135deg, rgba(67, 198, 172, 0.24), rgba(228, 248, 160, 0.16));
    }

    .polish-ai-tool-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }

    .polish-ai-tool-btn.running {
      background: linear-gradient(135deg, rgba(228, 248, 160, 0.30), rgba(67, 198, 172, 0.18));
      border-color: var(--amber);
      color: var(--amber);
    }

    html.light .polish-ai-tool-btn {
      background: linear-gradient(135deg, rgba(67, 198, 172, 0.12), rgba(228, 248, 160, 0.08));
    }

    /* Spinner used in the Push tab's live progress card while a row is
       mid-flight. Blue ring with a teal arc that rotates. */
    .pq-push-spinner {
      display: inline-block;
      width: 14px;
      height: 14px;
      border: 2px solid rgba(67, 134, 255, 0.20);
      border-top-color: var(--blue);
      border-radius: 50%;
      animation: pq-push-spin 0.8s linear infinite;
    }

    @keyframes pq-push-spin {
      to {
        transform: rotate(360deg);
      }
    }

    .polish-ai-spinner {
      width: 12px;
      height: 12px;
      border: 2px solid rgba(228, 248, 160, 0.2);
      border-top-color: var(--amber);
      border-radius: 50%;
      display: inline-block;
      animation: polishAiSpin 0.8s linear infinite;
    }

    @keyframes polishAiSpin {
      to {
        transform: rotate(360deg);
      }
    }

    /* Brief pulse on the Final Price input when "use" copies a value into
       it — visual confirmation that something happened. */
    .polish-pulse-once {
      animation: polishPulse 0.8s ease-out;
    }

    @keyframes polishPulse {
      0% {
        box-shadow: 0 0 0 0 rgba(228, 248, 160, 0.5);
      }

      40% {
        box-shadow: 0 0 0 6px rgba(228, 248, 160, 0);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(228, 248, 160, 0);
      }
    }

    /* ─── Pre-flight dots + statuses ───────────────────────────────────── */
    .pf-dots {
      display: inline-flex;
      gap: 6px;
      align-items: center;
    }

    /* Wrapper to host the hover tooltip without breaking the inline flow */
    .pf-dot-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
    }

    .pf-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      display: inline-block;
      flex-shrink: 0;
      cursor: help;
      transition: transform 0.15s;
    }

    .pf-dot-wrap:hover .pf-dot {
      transform: scale(1.25);
    }

    .pf-dot.pass {
      background: var(--green);
      box-shadow: 0 0 0 2px rgba(67, 198, 172, 0.15);
    }

    .pf-dot.fail {
      background: var(--red);
      box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
    }

    /* Custom hover bubble — appears on hover and reads the failing check
       label + fix instruction. Native title= attributes were unreliable
       on a 12px element with no content. */
    .pf-dot-tip {
      position: absolute;
      bottom: calc(100% + 8px);
      left: 50%;
      transform: translateX(-50%);
      background: #14202b;
      color: #fff;
      font-size: 11px;
      line-height: 1.4;
      padding: 8px 11px;
      border-radius: 7px;
      box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
      white-space: normal;
      width: 220px;
      z-index: 100;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.12s, transform 0.18s;
      transform: translate(-50%, 4px);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .pf-dot-tip::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 5px solid transparent;
      border-top-color: #14202b;
    }

    .pf-dot-wrap:hover .pf-dot-tip {
      opacity: 1;
      transform: translate(-50%, 0);
    }

    .pf-dot-tip-label {
      font-weight: 700;
      margin-bottom: 3px;
      display: block;
    }

    .pf-dot-tip-fix {
      color: rgba(255, 255, 255, 0.75);
    }

    .pf-dot.pass+.pf-dot-tip {
      border-color: rgba(67, 198, 172, 0.3);
    }

    .pf-dot.fail+.pf-dot-tip {
      border-color: rgba(220, 38, 38, 0.3);
    }

    /* Last-row tooltips would clip below the table — flip them to render
       below the dot instead of above. Apply via JS class when needed. */
    .pf-dot-wrap.tip-below .pf-dot-tip {
      bottom: auto;
      top: calc(100% + 8px);
      transform: translate(-50%, -4px);
    }

    .pf-dot-wrap.tip-below .pf-dot-tip::after {
      top: auto;
      bottom: 100%;
      border-top-color: transparent;
      border-bottom-color: #14202b;
    }

    .pf-dot-wrap.tip-below:hover .pf-dot-tip {
      transform: translate(-50%, 0);
    }

    .pf-status-ready {
      font-size: 11px;
      padding: 3px 9px;
      border-radius: 10px;
      background: rgba(67, 198, 172, 0.14);
      color: var(--green);
      font-weight: 700;
      white-space: nowrap;
    }

    .pf-status-blocked {
      font-size: 11px;
      padding: 3px 9px;
      border-radius: 10px;
      background: rgba(220, 38, 38, 0.10);
      color: var(--red);
      font-weight: 600;
      white-space: nowrap;
      cursor: help;
    }

    .polish-row-status {
      font-size: 12px;
      padding: 5px 12px;
      border-radius: 8px;
      font-weight: 700;
      display: inline-block;
      line-height: 1.2;
    }

    .polish-row-status.clean {
      background: rgba(28, 140, 76, 0.10);
      color: #1c8c4c;
    }

    .polish-row-status.saved {
      background: rgba(28, 140, 76, 0.12);
      color: #1c8c4c;
    }

    .polish-row-status.saving {
      background: rgba(74, 159, 232, 0.12);
      color: #2563eb;
    }

    .polish-row-status.error {
      background: rgba(220, 38, 38, 0.12);
      color: #dc2626;
    }

    .polish-row-status.dirty {
      background: rgba(234, 179, 8, 0.14);
      color: #b45309;
    }

    /* Tags input — when it has value, render with a soft purple pill tint.
       Targeted via the [list=polish-tag-suggestions] attribute so no markup
       change is needed. The :not(:placeholder-shown) selector switches
       the styling once the user types or a value is pre-filled. */
    .polish-cell-input[list="polish-tag-suggestions"]:not(:placeholder-shown) {
      background: rgba(121, 80, 212, 0.10) !important;
      color: #7950d4 !important;
      border-color: rgba(121, 80, 212, 0.22) !important;
      font-weight: 600;
    }
    .polish-cell-input[list="polish-tag-suggestions"]:not(:placeholder-shown)::placeholder {
      color: rgba(121, 80, 212, 0.4) !important;
    }
    html:not(.light) .polish-cell-input[list="polish-tag-suggestions"]:not(:placeholder-shown) {
      background: rgba(121, 80, 212, 0.10) !important;
      color: #7950d4 !important;
      border-color: rgba(121, 80, 212, 0.22) !important;
    }

    /* Polish row actions cell — three pill-style icon buttons (Edit, AI, Kebab) */
    .polish-actions-cell {
      white-space: nowrap;
      text-align: right;
    }
    .polish-action-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 9px;
      border: 1px solid #e6e8ee;
      background: #ffffff;
      color: #4a5160;
      cursor: pointer;
      transition: all 0.15s;
      margin-left: 4px;
      font-size: 14px;
    }
    .polish-action-btn:hover {
      background: #f3f4f7;
      border-color: #c4c9d4;
      color: #1f2433;
    }
    .polish-action-btn.polish-action-edit {
      border-color: rgba(37, 99, 235, 0.30);
      color: #2563eb;
    }
    .polish-action-btn.polish-action-edit:hover {
      background: rgba(37, 99, 235, 0.08);
      border-color: #2563eb;
    }
    .polish-action-btn.polish-action-ai {
      border-color: rgba(67, 198, 172, 0.30);
      color: #43c6ac;
    }
    .polish-action-btn.polish-action-ai:hover {
      background: rgba(67, 198, 172, 0.08);
      border-color: #43c6ac;
    }

    /* Polish row kebab dropdown menu items */
    .polish-kebab-item {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 10px 14px;
      border: none;
      background: transparent;
      color: #1f2433;
      font-size: 13px;
      font-weight: 500;
      text-align: left;
      cursor: pointer;
      transition: background 0.12s;
      font-family: inherit;
    }
    .polish-kebab-item:hover {
      background: #f3f4f7;
    }
    .polish-kebab-item i {
      font-size: 14px;
      color: #6b7280;
      width: 16px;
      text-align: center;
    }
    .polish-kebab-item-danger {
      color: #dc2626;
    }
    .polish-kebab-item-danger i { color: #dc2626; }
    .polish-kebab-item-danger:hover {
      background: rgba(220, 38, 38, 0.06);
    }

    .polish-img {
      width: 48px;
      height: 48px;
      border-radius: 6px;
      background: rgba(0, 0, 0, 0.3);
      object-fit: cover;
      border: 1px solid var(--border);
    }

    .polish-img-clickable {
      cursor: zoom-in;
      transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
    }

    .polish-img-clickable:hover {
      transform: scale(1.06);
      border-color: var(--blue);
      box-shadow: 0 0 0 2px rgba(67, 198, 172, 0.2);
    }

    /* Polish details modal — image reorder grid */
    .polish-img-tile {
      position: relative;
      aspect-ratio: 1 / 1;
      border-radius: 6px;
      overflow: hidden;
      border: 2px solid var(--border);
      background: rgba(0, 0, 0, 0.25);
      cursor: grab;
      transition: border-color 0.15s, opacity 0.15s, transform 0.18s;
      user-select: none;
    }

    .polish-img-tile.dragging {
      opacity: 0.4;
      cursor: grabbing;
    }

    .polish-img-tile.drop-target {
      border-color: var(--blue);
      transform: scale(1.04);
    }

    .polish-img-tile img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      pointer-events: none;
    }

    .polish-img-tile-order {
      position: absolute;
      top: 4px;
      left: 4px;
      background: rgba(0, 0, 0, 0.7);
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 4px;
      pointer-events: none;
    }

    .polish-img-tile-order.first {
      background: var(--blue);
      color: #001;
    }

    .polish-img-tile-remove {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 20px;
      height: 20px;
      border: 0;
      background: rgba(220, 38, 38, 0.85);
      color: #fff;
      font-size: 14px;
      line-height: 1;
      border-radius: 50%;
      cursor: pointer;
      opacity: 0;
      transition: opacity 0.15s;
      font-family: inherit;
    }

    .polish-img-tile:hover .polish-img-tile-remove {
      opacity: 1;
    }

    /* Description-mode toggle pills (Plain/HTML) */
    .polish-desc-mode-btn.active {
      background: var(--blue-dim);
      color: var(--blue);
    }

    .polish-desc-mode-btn:not(.active):hover {
      background: rgba(255, 255, 255, 0.04);
      color: var(--text);
    }

    .polish-fx-preview {
      font-size: 11px;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }

    .polish-source {
      font-size: 11px;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }

    /* Pipeline stage number chip — small, subtle, becomes blue when active. */
    .stage-num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      flex-shrink: 0;
      font-size: 10px;
      font-weight: 700;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid var(--border);
      border-radius: 50%;
      transition: color 0.18s, background 0.18s, border-color 0.18s;
    }

    .nav-item:hover .stage-num,
    .nav-item.active .stage-num {
      color: var(--blue);
      background: var(--blue-dim);
      border-color: var(--blue);
    }

    .nav-item.locked .stage-num {
      opacity: 0.4;
    }

    .nav-item:hover img,
    .nav-item.active img {
      opacity: 1;
      filter: brightness(0) saturate(100%) invert(52%) sepia(70%) saturate(500%) hue-rotate(195deg) brightness(100%);
    }

    .nav-badge {
      margin-left: auto;
      background: var(--blue);
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 7px;
      border-radius: 10px;
      display: none;
      flex-shrink: 0;
      min-width: 18px;
      text-align: center;
      white-space: nowrap;
    }

    .nav-badge.visible {
      display: block;
    }

    /* Stop sidebar labels from wrapping when paired with a 3-digit badge. */
    .nav-item>span:not(.stage-num):not(.nav-badge) {
      flex: 1 1 auto;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* ── STORE TABS BAR ─────────────────────────────────────────── */
    .store-tabs-bar {
      position: fixed;
      top: 105px;        /* 48 chrome + 57 topbar */
      left: var(--sidebar-w);
      right: 0;
      z-index: 49;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 0;
      overflow-x: auto;
      scrollbar-width: none;
      padding: 0 4px;
      min-height: 38px;
    }

    .store-tabs-bar::-webkit-scrollbar {
      display: none;
    }

    .store-tab {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 0 14px 0 12px;
      height: 38px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 500;
      color: var(--muted);
      white-space: nowrap;
      border-bottom: 2px solid transparent;
      flex-shrink: 0;
      transition: color 0.15s, border-color 0.15s, background 0.15s;
      position: relative;
    }

    .store-tab:hover {
      color: var(--text);
      background: var(--blue-dim);
    }

    .store-tab.active {
      color: var(--blue);
      border-bottom-color: var(--blue);
      font-weight: 700;
    }

    .store-tab .tab-favicon {
      width: 14px;
      height: 14px;
      border-radius: 3px;
      flex-shrink: 0;
      object-fit: cover;
    }

    .store-tab .tab-close {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      opacity: 0;
      transition: opacity 0.15s, background 0.15s;
      flex-shrink: 0;
      color: var(--muted);
    }

    .store-tab:hover .tab-close {
      opacity: 1;
    }

    .store-tab .tab-close:hover {
      background: var(--red-dim);
      color: var(--red);
    }

    .store-tab .tab-count {
      font-size: 10px;
      font-weight: 700;
      color: var(--blue);
      background: var(--blue-dim);
      padding: 1px 5px;
      border-radius: 8px;
    }

    .store-tab-add {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 30px;
      height: 38px;
      cursor: pointer;
      color: var(--muted);
      font-size: 16px;
      flex-shrink: 0;
      transition: color 0.15s;
    }

    .store-tab-add:hover {
      color: var(--blue);
    }

    .main {
      padding-top: 97px;
    }

    /* topbar 57px + tabs 38px + 2px border */

    /* ── NEW TAB INPUT ───────────────────────────────────────────── */
    .new-tab-input-wrap {
      display: none;
      align-items: center;
      gap: 6px;
      padding: 0 8px;
      flex-shrink: 0;
      animation: fadeSlideIn 0.15s ease;
    }

    .new-tab-input-wrap.open {
      display: flex;
    }

    @keyframes fadeSlideIn {
      from {
        opacity: 0;
        transform: translateX(-6px);
      }

      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    .new-tab-url-input {
      background: var(--card);
      border: 1px solid var(--blue);
      color: var(--text);
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 12px;
      outline: none;
      width: 260px;
    }

    .new-tab-url-input::placeholder {
      color: var(--muted);
    }

    .sidebar-footer {
      padding: 16px 20px;
      border-top: 1px solid var(--border);
    }

    .status-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--muted);
      display: inline-block;
      margin-right: 6px;
    }

    .status-dot.online {
      background: var(--blue);
      box-shadow: 0 0 6px var(--blue);
    }

    .server-status {
      font-size: 11px;
      color: var(--muted);
    }

    /* ── MAIN ────────────────────────────────────────────────────── */
    .main {
      margin-left: var(--sidebar-w);
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: calc(100vh - 48px);  /* below chrome header */
    }

    /* ── TOPBAR ──────────────────────────────────────────────────── */
    .topbar {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 10px 20px;
      display: flex;
      align-items: center;
      gap: 10px;
      position: fixed;
      top: 48px;         /* below chrome header */
      left: var(--sidebar-w);
      right: 0;
      z-index: 50;
      height: 57px;
    }

    .nav-item.locked {
      opacity: 0.35;
      pointer-events: none;
      cursor: default;
    }

    .scrape-toggle {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 7px 12px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 12px;
      color: var(--text);
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
      transition: border-color .15s ease, background .15s ease;
    }

    .scrape-toggle:hover {
      border-color: var(--blue);
    }

    .scrape-toggle input {
      width: 14px;
      height: 14px;
      accent-color: var(--blue);
      cursor: pointer;
      margin: 0;
    }

    .url-input {
      flex: 1;
      background: var(--card);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 10px 16px;
      border-radius: 8px;
      font-size: 13px;
      outline: none;
      transition: border-color 0.2s;
    }

    .url-input:focus {
      border-color: var(--blue);
    }

    .url-input::placeholder {
      color: var(--muted);
    }

    .btn {
      padding: 10px 20px;
      border-radius: 8px;
      border: none;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
    }

    .btn-primary {
      background: var(--blue);
      color: #fff;
    }

    .btn-primary:hover {
      background: var(--blue-hover);
    }

    .btn-primary:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* ── Feature cards (Enrich + QC panels) ───────────────────────────── */
    .feature-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 20px;
      margin-top: 24px;
    }

    .feature-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
      position: relative;
      overflow: hidden;
    }

    .feature-card::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, var(--blue-glow) 0%, transparent 55%);
      opacity: 0;
      transition: opacity .25s ease;
      pointer-events: none;
    }

    .feature-card:hover {
      border-color: var(--blue);
      transform: translateY(-2px);
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--blue-glow);
    }

    .feature-card:hover::before {
      opacity: 1;
    }

    .feature-card>* {
      position: relative;
      z-index: 1;
    }

    .feature-icon {
      width: 46px;
      height: 46px;
      border-radius: 12px;
      background: var(--blue-glow);
      border: 1px solid var(--blue);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
    }

    .feature-title {
      font-size: 15px;
      font-weight: 650;
      color: var(--text);
      letter-spacing: -0.01em;
    }

    .feature-desc {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.5;
      min-height: 38px;
    }

    .feature-input {
      width: 100%;
      padding: 10px 12px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text);
      font-size: 13px;
      transition: border-color .15s ease;
    }

    .feature-input:focus {
      outline: none;
      border-color: var(--blue);
      box-shadow: 0 0 0 3px var(--blue-glow);
    }

    .feature-inputs-row {
      display: flex;
      gap: 8px;
    }

    .feature-btn {
      width: 100%;
      padding: 11px 16px;
      background: var(--blue);
      color: #fff;
      border: none;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: background .15s ease, transform .1s ease;
      margin-top: auto;
    }

    .feature-btn:hover {
      background: var(--blue-hover);
      transform: translateY(-1px);
    }

    .feature-btn:active {
      transform: translateY(0);
    }

    .feature-card.qc-card {
      cursor: pointer;
    }

    .feature-card.qc-card .feature-icon {
      background: var(--green-dim, rgba(74, 222, 128, 0.14));
      border-color: var(--green);
    }

    /* ── Publish Pipeline Wizard ────────────────────────────────────── */
    .wizard-progress {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 20px 24px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      margin-bottom: 18px;
    }

    .wiz-step {
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      padding: 6px 12px;
      border-radius: 10px;
      transition: background 0.15s;
    }

    .wiz-step:hover {
      background: var(--card);
    }

    .wiz-step-num {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--card);
      border: 1.5px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 13px;
      color: var(--muted);
      transition: all 0.2s;
    }

    .wiz-step-label {
      font-size: 13px;
      font-weight: 600;
      color: var(--muted);
      transition: color 0.2s;
    }

    .wiz-step.active .wiz-step-num {
      background: var(--blue);
      border-color: var(--blue);
      color: #fff;
      box-shadow: 0 0 0 4px rgba(67, 198, 172, 0.15);
    }

    .wiz-step.active .wiz-step-label {
      color: var(--text);
    }

    .wiz-step.done .wiz-step-num {
      background: var(--green, #4ade80);
      border-color: var(--green, #4ade80);
      color: #fff;
    }

    .wiz-step.done .wiz-step-label {
      color: var(--text-2);
    }

    .wiz-line {
      flex: 1;
      height: 2px;
      background: var(--border);
      border-radius: 2px;
    }

    .wiz-panel {
      display: none;
    }

    .wiz-panel.active {
      display: block;
      animation: wizFadeIn 0.2s ease;
    }

    @keyframes wizFadeIn {
      from {
        opacity: 0;
        transform: translateY(4px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .wiz-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 20px;
      padding-top: 16px;
      border-top: 1px solid var(--border);
    }

    /* Tabs inside Step 3 */
    .wiz-tabs {
      display: flex;
      gap: 4px;
      padding: 4px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 16px;
    }

    .wiz-tab {
      flex: 1;
      text-align: center;
      padding: 10px 14px;
      border-radius: 9px;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.15s;
    }

    .wiz-tab:hover {
      color: var(--text-2);
      background: rgba(255, 255, 255, 0.02);
    }

    .wiz-tab.active {
      background: var(--surface);
      color: var(--text);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .wiz-tab-panel {
      display: none;
    }

    .wiz-tab-panel.active {
      display: block;
      animation: wizFadeIn 0.15s ease;
    }

    /* Margin preset buttons */
    .margin-preset {
      background: var(--card);
      border: 1px solid var(--border);
      color: var(--text-2);
      font-size: 11px;
      font-weight: 600;
      padding: 6px 10px;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .margin-preset:hover {
      background: var(--blue-dim);
      border-color: var(--blue);
      color: var(--blue);
      transform: translateY(-1px);
    }

    .margin-preset.active {
      background: var(--blue);
      border-color: var(--blue);
      color: #fff;
    }

    /* Checklist gate */
    .checklist-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 8px;
      background: var(--card);
      border: 1px solid var(--border);
    }

    .checklist-item.pass {
      border-color: var(--green, #4ade80);
      background: rgba(74, 222, 128, 0.06);
    }

    .checklist-item.fail {
      border-color: var(--red, #ef4444);
      background: rgba(239, 68, 68, 0.06);
    }

    .checklist-item .check-icon {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      flex-shrink: 0;
    }

    .checklist-item.pass .check-icon {
      background: var(--green, #4ade80);
      color: #fff;
    }

    .checklist-item.fail .check-icon {
      background: var(--red, #ef4444);
      color: #fff;
    }

    .checklist-item.pending .check-icon {
      background: var(--border);
      color: var(--muted);
    }

    /* Push button disabled state */
    .btn-primary[disabled] {
      opacity: 0.4;
      cursor: not-allowed;
      pointer-events: none;
    }

    .result-panel {
      margin-top: 24px;
      padding: 18px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      font-family: var(--font-ui);
      font-size: 12px;
      color: var(--muted);
      line-height: 1.6;
      max-height: 520px;
      overflow: auto;
    }

    /* ── QC Result UI ─────────────────────────────────────────────────── */
    #qc-result {
      margin-top: 24px;
    }

    .qc-loading,
    .qc-error,
    .qc-empty {
      padding: 20px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      color: var(--muted);
      font-size: 13px;
    }

    .qc-error {
      color: #f87171;
      border-color: #7f1d1d;
    }

    .qc-empty {
      color: var(--green);
    }

    .qc-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 12px;
      margin-bottom: 20px;
    }

    .qc-stat {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px 20px;
      text-align: left;
    }

    .qc-stat-num {
      font-size: 28px;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.02em;
      line-height: 1.1;
    }

    .qc-stat-label {
      font-size: 11px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-top: 4px;
    }

    .qc-stat-good {
      border-color: var(--green);
    }

    .qc-stat-good .qc-stat-num {
      color: var(--green);
    }

    .qc-stat-warn {
      border-color: #f59e0b;
    }

    .qc-stat-warn .qc-stat-num {
      color: #f59e0b;
    }

    .qc-stat-bad {
      border-color: #f87171;
    }

    .qc-stat-bad .qc-stat-num {
      color: #f87171;
    }

    .qc-subsection {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 16px 20px;
      margin-bottom: 14px;
    }

    .qc-subtitle {
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      padding-bottom: 12px;
      margin-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }

    .qc-row {
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }

    .qc-row:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    .qc-row-key {
      font-size: 13px;
      color: var(--text);
      font-weight: 500;
      margin-bottom: 6px;
      word-break: break-word;
    }

    .qc-row-meta {
      font-size: 12px;
      color: var(--muted);
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
    }

    .qc-pill {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 500;
    }

    .qc-pill-bad {
      background: rgba(248, 113, 113, 0.14);
      color: #f87171;
      border: 1px solid rgba(248, 113, 113, 0.3);
    }

    .qc-pill-muted {
      background: var(--bg);
      color: var(--muted);
      border: 1px solid var(--border);
    }

    /* ── Product description rendering (preserves HTML, RTL-aware) ────── */
    .product-desc {
      font-size: 14px;
      line-height: 1.75;
      color: var(--text);
      unicode-bidi: plaintext;
    }

    .product-desc p {
      margin: 0 0 10px 0;
    }

    .product-desc p:last-child {
      margin-bottom: 0;
    }

    .product-desc ul,
    .product-desc ol {
      margin: 10px 0;
      padding-inline-start: 22px;
    }

    .product-desc li {
      margin: 4px 0;
    }

    .product-desc strong,
    .product-desc b {
      color: var(--text);
      font-weight: 650;
    }

    .product-desc h1,
    .product-desc h2,
    .product-desc h3,
    .product-desc h4 {
      font-size: 15px;
      font-weight: 600;
      margin: 12px 0 6px 0;
      color: var(--text);
    }

    .product-desc a {
      color: var(--blue);
      text-decoration: underline;
    }

    .product-desc br {
      display: block;
      content: '';
      margin: 4px 0;
    }

    /* Auto-detect Arabic → RTL */
    .product-desc:lang(ar),
    .product-desc[dir="rtl"] {
      direction: rtl;
      text-align: right;
    }

    .btn-outline {
      background: transparent;
      color: var(--text);
      border: 1px solid var(--border);
    }

    .btn-outline:hover {
      border-color: var(--blue);
      color: var(--blue);
    }

    .btn-ghost {
      background: transparent;
      color: var(--muted);
      border: none;
      padding: 10px 14px;
    }

    .btn-ghost:hover {
      color: var(--text);
      background: var(--card);
    }

    .btn-danger {
      background: var(--red);
      color: #fff;
    }

    .btn-danger:hover {
      opacity: 0.85;
    }

    .btn-yellow {
      background: var(--indigo);
      color: #fff;
    }

    .btn-yellow:hover {
      opacity: 0.85;
    }

    /* ── CONTENT ─────────────────────────────────────────────────── */
    .content {
      padding: 28px;
      flex: 1;
    }

    /* ── EMPTY STATE ─────────────────────────────────────────────── */
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 60vh;
      text-align: center;
      gap: 16px;
    }

    .empty-icon {
      font-size: 56px;
      opacity: 0.3;
    }

    .empty-title {
      font-size: 20px;
      font-weight: 600;
      color: var(--text);
    }

    .empty-sub {
      font-size: 14px;
      color: var(--muted);
      max-width: 340px;
      line-height: 1.6;
    }

    .feature-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
      margin-top: 8px;
    }

    .pill {
      background: var(--card);
      border: 1px solid var(--border);
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 12px;
      color: var(--muted);
    }

    .pill.teal {
      border-color: var(--blue);
      color: var(--blue);
      background: var(--blue-dim);
    }

    .pill.indigo {
      border-color: var(--indigo);
      color: var(--indigo);
      background: var(--indigo-dim);
    }

    .pill.slate {
      border-color: var(--slate);
      color: var(--slate);
      background: var(--slate-dim);
    }

    /* ── LOADING ─────────────────────────────────────────────────── */
    .loading-state {
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 60vh;
      gap: 20px;
    }

    .spinner {
      width: 48px;
      height: 48px;
      border: 3px solid var(--border);
      border-top-color: var(--blue);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .loading-text {
      font-size: 15px;
      color: var(--muted);
    }

    .loading-steps {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 8px;
    }

    .loading-step {
      font-size: 12px;
      color: var(--muted);
      display: flex;
      align-items: center;
      gap: 8px;
      transition: color 0.3s;
    }

    .loading-step.done {
      color: var(--blue);
    }

    .loading-step .step-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--border);
      flex-shrink: 0;
    }

    .loading-step.done .step-dot {
      background: var(--blue);
    }

    /* ── STAT CARDS ──────────────────────────────────────────────── */
    .stat-cards {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 16px;
      margin-bottom: 28px;
    }

    .stat-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .stat-card:hover {
      border-color: var(--blue);
      background: var(--blue-dim);
    }

    .stat-card.active-card {
      border-color: var(--blue);
      background: var(--blue-dim);
    }

    .stat-label {
      font-size: 11px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .stat-value {
      font-size: 32px;
      font-weight: 700;
      color: var(--text);
      margin: 6px 0 4px;
      line-height: 1;
    }

    .stat-sub {
      font-size: 12px;
      color: var(--muted);
    }

    .stat-icon {
      font-size: 20px;
      margin-bottom: 10px;
    }

    /* ── TECH STRIP ──────────────────────────────────────────────── */
    .tech-strip {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px 20px;
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
      margin-bottom: 28px;
      align-items: center;
    }

    .tech-item {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .tech-item-label {
      font-size: 10px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .tech-item-value {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .tech-badge {
      background: var(--blue-dim);
      border: 1px solid var(--blue);
      color: var(--blue);
      padding: 2px 8px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
    }

    .pixel-badge {
      background: var(--indigo-dim);
      border: 1px solid var(--indigo);
      color: var(--indigo);
      padding: 2px 8px;
      border-radius: 6px;
      font-size: 11px;
    }

    /* ── SECTION ─────────────────────────────────────────────────── */
    .section {
      display: none;
    }

    .section.active {
      display: block;
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%      { opacity: 0.5; transform: scale(1.3); }
    }

    /* ─── Launch stat cards ──────────────────────────────────────────── */
    /* Background uses var(--card) so light mode = near-white, dark mode =
       themed dark surface. Earlier hardcoded #fff broke dark mode. */
    .launch-stat-card {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 16px 18px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 14px;
      cursor: pointer;
      transition: all 0.15s ease;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
    .launch-stat-card:hover {
      transform: translateY(-2px);
      border-color: var(--blue);
      box-shadow: 0 6px 16px rgba(58, 114, 212, 0.10);
    }
    .launch-stat-card.active {
      border-color: var(--blue);
      background: linear-gradient(135deg, rgba(74,159,232,0.06), rgba(74,159,232,0.02));
    }
    .launch-stat-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .launch-stat-body { flex: 1; min-width: 0; }
    .launch-stat-label {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
      letter-spacing: 0.2px;
      margin-bottom: 2px;
    }
    .launch-stat-value {
      font-size: 24px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.1;
      letter-spacing: -0.5px;
    }
    .launch-stat-sub {
      font-size: 10px;
      color: var(--muted);
      margin-top: 2px;
    }

    /* ─── Launch section headers ─────────────────────────────────────── */
    .launch-section {
      margin-bottom: 28px;
    }
    .launch-section-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
      cursor: pointer;
      user-select: none;
    }
    .launch-section-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.2px;
    }
    .launch-section-count {
      background: var(--bg-2);
      color: var(--text-2);
      font-size: 10px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 10px;
    }
    .launch-section-chevron {
      margin-left: auto;
      color: var(--muted);
      transition: transform 0.2s;
    }
    .launch-section.collapsed .launch-section-chevron {
      transform: rotate(-90deg);
    }
    .launch-section.collapsed .launch-section-body {
      display: none;
    }

    /* ─── Launch cards (grid + horizontal compact variants) ──────────── */
    .launch-card {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: all 0.15s ease;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
    .launch-card:hover {
      transform: translateY(-2px);
      border-color: var(--text-2);
      box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }
    .launch-card-thumb {
      width: 100%;
      aspect-ratio: 16/9;
      object-fit: cover;
      background: #fafafa;
      display: block;
    }
    .launch-card-body {
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .launch-card-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      padding: 3px 8px;
      border-radius: 6px;
      width: fit-content;
    }
    .launch-card-name {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.3;
      letter-spacing: -0.2px;
    }
    .launch-card-handle {
      font-size: 11px;
      color: var(--muted);
    }
    .launch-card-dates {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--text-2);
    }
    .launch-card-progress {
      height: 5px;
      background: var(--bg-2);
      border-radius: 3px;
      overflow: hidden;
      position: relative;
    }
    .launch-card-progress-bar {
      height: 100%;
      background: var(--green);
      border-radius: 3px;
      transition: width 0.4s ease;
    }
    .launch-card-progress-bar.queued { background: var(--amber, #f0a832); }
    .launch-card-progress-bar.generating { background: var(--blue); }
    .launch-card-progress-bar.draft     { background: var(--text-2); }
    .launch-card-progress-bar.live      { background: var(--green); }
    .launch-card-actions {
      display: flex;
      gap: 6px;
      margin-top: 6px;
    }
    .launch-card-btn {
      padding: 7px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.15s;
    }
    .launch-card-btn:hover { background: var(--bg-2); border-color: var(--text-2); }
    .launch-card-btn.primary {
      background: var(--blue);
      color: #fff;
      border-color: var(--blue);
    }
    .launch-card-btn.primary:hover { background: #3a8fd9; }
    .launch-card-kebab {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      transition: all 0.15s;
      position: relative;
    }
    .launch-card-kebab:hover { background: var(--bg-2); color: var(--text); }

    /* Horizontal compact card (for live / drafts / archived rows) */
    .launch-card-row {
      display: grid;
      grid-template-columns: 80px 1fr 200px auto;
      gap: 14px;
      align-items: center;
      padding: 12px 14px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      transition: all 0.15s;
      cursor: pointer;
    }
    .launch-card-row:hover {
      border-color: var(--text-2);
      box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }
    .launch-card-row.archived { opacity: 0.65; }
    .launch-card-row-thumb {
      width: 70px;
      height: 56px;
      object-fit: cover;
      border-radius: 8px;
      background: #fafafa;
    }
    .launch-card-row-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    /* ─── Image Studio v2 — mockup parity ────────────────────────────── */
    .ist-v2-header {
      display: flex;
      align-items: flex-start;
      gap: 24px;
      max-width: 1480px;
      margin: 24px auto 18px;
      flex-wrap: wrap;
    }
    .ist-v2-title {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .ist-v2-title-icon {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      background: linear-gradient(135deg, #e0eaff, #cfdcff);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .ist-wizard {
      margin-left: auto;
      display: inline-flex;
      align-items: center;
      gap: 0;
    }
    .ist-wizard-step {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      opacity: 0.55;
      transition: opacity 0.2s;
    }
    .ist-wizard-step.active { opacity: 1; }
    .ist-wizard-step.done   { opacity: 1; }
    .ist-wizard-icon {
      width: 40px;
      height: 40px;
      border-radius: 11px;
      background: var(--bg);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .ist-wizard-step.active .ist-wizard-icon {
      border-color: var(--blue);
      background: linear-gradient(135deg, rgba(74,159,232,0.1), transparent);
    }
    .ist-wizard-step.done .ist-wizard-icon {
      border-color: var(--green);
      background: linear-gradient(135deg, rgba(28,140,76,0.1), transparent);
    }
    .ist-wizard-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-2);
    }
    .ist-wizard-step.active .ist-wizard-label { color: var(--blue); }
    .ist-wizard-bar {
      width: 56px;
      height: 1px;
      background: var(--border);
      margin: 0 4px 22px;
    }

    /* Flat settings row — mockup parity: card-style row, More-settings as
       standalone button OUTSIDE the row, labels are normal-case, lighter. */
    /* ─── V2 settings toolbar ──────────────────────────────────────────
       Compact premium toolbar (not a stats card). ONE rounded white bar
       holds Mode / Hero ref / Quality / Aspect / Scenes / Est. cost +
       More settings — all cells, no gap between row and More-settings.
       Subtle 1px dividers between each cell. */
    .ist-v2-settings-wrap {
      display: flex;
      align-items: stretch;
      gap: 0;
      max-width: 1480px;
      margin: 0 auto 22px;
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
      overflow: hidden;
    }
    .ist-v2-settings-row {
      display: flex;
      align-items: stretch;
      gap: 0;
      background: transparent;
      border: none;
      border-radius: 0;
      padding: 0;
      flex: 1;
      box-shadow: none;
      overflow: visible;
    }
    .ist-v2-setting {
      flex: 1;
      min-width: 0;
      padding: 10px 16px 12px;
      border-right: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 6px;
      background: #ffffff;
    }
    .ist-v2-setting:last-child { border-right: none; }
    .ist-v2-setting-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-2, #4a5160);
      margin-bottom: 0;
      letter-spacing: 0;
      text-transform: none;
      line-height: 1;
    }
    /* Compact dropdown — looks like a real select, smaller than before,
       chevron clearly visible, consistent size across Mode/Quality/Aspect/Scenes.
       Each property uses !important to defeat the global select rule
       (`select { background: rgba(...) !important }` at the bottom of this
       file) which would otherwise wipe out background-image via shorthand. */
    .ist-v2-setting-input {
      width: 100% !important;
      padding: 8px 32px 8px 12px !important;
      border-radius: 9px !important;
      border: 1px solid var(--border) !important;
      background-color: #ffffff !important;
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555c72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>") !important;
      background-repeat: no-repeat !important;
      background-position: right 10px center !important;
      background-size: 11px 11px !important;
      font-size: 13px !important;
      font-weight: 700 !important;
      color: var(--text) !important;
      cursor: pointer !important;
      line-height: 1.2 !important;
      min-height: 0 !important;
      box-shadow: none !important;
      -webkit-appearance: none !important;
      appearance: none !important;
      transition: border-color 0.15s !important;
    }
    .ist-v2-setting-input:hover { border-color: var(--text-2) !important; }
    /* :focus needs to re-declare background-image because two global rules
       (one in the light/dark theme block, one in the focus-ring block) use
       `background: <color> !important` on every focused select — which
       resets background-image to `none` and the chevron disappears. We
       re-state every background-related property here, all !important. */
    .ist-v2-setting-input:focus,
    .ist-v2-setting-input:focus-visible,
    .ist-v2-setting-input:active {
      outline: none !important;
      border-color: var(--blue) !important;
      background-color: #ffffff !important;
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555c72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>") !important;
      background-repeat: no-repeat !important;
      background-position: right 10px center !important;
      background-size: 11px 11px !important;
      box-shadow: 0 0 0 3px rgba(74,159,232,0.15) !important;
    }
    /* Hero ref cell: small pill-style control with the label text + toggle. */
    .ist-v2-setting-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      cursor: pointer;
      padding: 7px 12px;
      border-radius: 9px;
      border: 1px solid var(--border);
      background: #ffffff;
      transition: border-color 0.15s;
      min-height: 32px;
    }
    .ist-v2-setting-toggle:hover { border-color: var(--text-2); }
    .ist-v2-setting-toggle span:first-child {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.2;
    }
    .ist-v2-pill-toggle {
      width: 32px;
      height: 18px;
      background: #7950d4;
      border-radius: 999px;
      position: relative;
      transition: background 0.2s;
      flex-shrink: 0;
      cursor: pointer;
    }
    .ist-v2-pill-toggle-dot {
      position: absolute;
      top: 2px;
      right: 2px;
      width: 14px;
      height: 14px;
      background: #fff;
      border-radius: 50%;
      box-shadow: 0 1px 3px rgba(0,0,0,0.25);
      transition: right 0.2s;
    }
    .ist-v2-pill-toggle.off { background: var(--border); }
    .ist-v2-pill-toggle.off .ist-v2-pill-toggle-dot { right: 16px; }
    /* Est. cost cell — smaller, vertically centered, no padding bloat. */
    .ist-v2-setting.cost-cell { justify-content: center; }
    .ist-v2-cost {
      font-size: 16px;
      font-weight: 700;
      color: var(--green);
      letter-spacing: -0.2px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      line-height: 1.1;
    }
    /* More-settings: lives as the rightmost cell of the toolbar bar.
       No own border/radius/shadow — separated from Est. cost by the
       same 1px subtle divider used between every other cell. Same height
       as the rest of the bar. */
    .ist-v2-more-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 0 22px;
      background: #ffffff;
      border: none;
      border-left: 1px solid var(--border-subtle);
      border-radius: 0;
      color: var(--text);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.15s;
      flex-shrink: 0;
    }
    .ist-v2-more-btn:hover {
      background: var(--bg-2);
    }

    /* Sticky footer */
    .ist-v2-footer {
      position: sticky;
      bottom: 0;
      display: flex;
      align-items: center;
      gap: 18px;
      padding: 16px 28px;
      background: rgba(255,255,255,0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-top: 1px solid var(--border);
      max-width: 1480px;
      margin: 24px auto 0;
      border-radius: 14px 14px 0 0;
      z-index: 50;
      flex-wrap: wrap;
    }
    .ist-v2-footer-stats {
      display: flex;
      gap: 32px;
    }
    .ist-v2-stat-value {
      font-size: 22px;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.4px;
      line-height: 1;
    }
    .ist-v2-stat-label {
      font-size: 10px;
      font-weight: 600;
      color: var(--muted);
      letter-spacing: 0.3px;
      text-transform: uppercase;
      margin-top: 4px;
    }
    .ist-v2-footer-actions {
      margin-left: auto;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .ist-v2-footer-btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 10px 18px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s;
    }
    .ist-v2-footer-btn:hover {
      background: var(--bg-2);
      border-color: var(--text-2);
      transform: translateY(-1px);
      box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }
    .ist-v2-footer-btn.primary {
      background: linear-gradient(135deg, #7950d4 0%, #6943c8 100%);
      color: #fff;
      border-color: transparent;
      box-shadow: 0 4px 12px rgba(121,80,212,0.3);
    }
    .ist-v2-footer-btn.primary:hover {
      box-shadow: 0 6px 16px rgba(121,80,212,0.4);
    }
    .ist-v2-footer-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      transform: none;
    }

    /* V2 source product card — mockup-style empty + filled. Sized to feel
       generous: ~120px thumbnail, ~22px title, bigger meta chips. */
    .ist-v2-source {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 22px 26px;
      max-width: 1480px;
      margin: 0 auto 16px;
      display: flex;
      align-items: center;
      gap: 26px;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
      min-height: 140px;
    }
    .ist-v2-source.empty {
      background: var(--bg-2, #f8f9fb);
      border-style: dashed;
      min-height: 96px;
      padding: 18px 22px;
    }
    .ist-v2-source-thumb {
      width: 120px;
      height: 120px;
      border-radius: 14px;
      object-fit: cover;
      flex-shrink: 0;
      background: var(--bg-2);
    }
    .ist-v2-source.empty .ist-v2-source-thumb,
    .ist-v2-source-thumb.empty {
      width: 56px;
      height: 56px;
      border: 1.5px dashed var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg);
      border-radius: 12px;
    }
    .ist-v2-source-info { flex: 1; min-width: 0; }
    .ist-v2-source-title {
      font-size: 22px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.25;
      margin-bottom: 10px;
      letter-spacing: -0.4px;
    }
    .ist-v2-source.empty .ist-v2-source-title {
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 4px;
    }
    /* Source-card meta column: two stacked rows. Row 1 = domain link +
       Shopify badge. Row 2 = price + image count + Single product. */
    .ist-v2-source-meta {
      display: flex;
      flex-direction: column;
      gap: 10px;
      font-size: 13px;
      color: var(--muted);
    }
    .ist-v2-source-meta-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .ist-v2-source-meta-row:empty { display: none; }
    .ist-v2-source-domain {
      font-size: 13px;
      color: var(--muted);
      font-weight: 500;
    }
    .ist-v2-source-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 13px;
      background: var(--bg-2);
      border-radius: 9px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-2);
    }
    .ist-v2-source-pill.shopify {
      background: #95bf471a;
      color: #5e8d2e;
    }
    .ist-v2-source-pill.purple {
      background: rgba(121,80,212,0.1);
      color: #7950d4;
    }
    .ist-v2-source-actions {
      display: flex;
      gap: 10px;
    }
    .ist-v2-source-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 13px 22px;
      border-radius: 11px;
      border: 1.5px solid var(--blue);
      background: rgba(74,159,232,0.04);
      color: var(--blue);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s;
    }
    .ist-v2-source-btn:hover { background: var(--blue); color: #fff; }
    .ist-v2-source-btn.ghost {
      border-color: var(--border);
      background: var(--bg);
      color: var(--text);
    }
    .ist-v2-source-btn.ghost:hover {
      background: var(--bg-2);
      color: var(--text);
    }

    /* V2 scene cards — horizontal row, square thumbs */
    .ist-v2-grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 14px;
      max-width: 1480px;
      margin: 0 auto 20px;
    }
    .ist-v2-grid[data-scenes="3"]  { grid-template-columns: repeat(3, 1fr); }
    .ist-v2-grid[data-scenes="12"] { grid-template-columns: repeat(6, 1fr); }  /* row 1 of 6 + row 2 of 6 */
    @media (max-width: 1280px) {
      .ist-v2-grid { grid-template-columns: repeat(3, 1fr); }
    }
    @media (max-width: 720px) {
      .ist-v2-grid { grid-template-columns: repeat(2, 1fr); }
    }
    .ist-v2-scene {
      background: #ffffff;
      border: 1px solid #e6e8ee;
      border-radius: 18px;
      overflow: hidden;
      transition: all 0.15s;
      box-shadow: 0 1px 2px rgba(0,0,0,0.04);
      display: flex;
      flex-direction: column;
      padding: 12px;
    }
    .ist-v2-scene:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(15,20,35,0.08);
    }
    .ist-v2-scene.selected {
      border-color: #7950d4;
      box-shadow: 0 0 0 3px rgba(121,80,212,0.15);
    }
    /* Thumb area: inset from the card with rounded corners — matches the
       reference where the image sits as a rounded panel inside the card. */
    .ist-v2-scene-thumb {
      position: relative;
      width: 100%;
      aspect-ratio: 1;
      background: #f3f4f7;
      border-radius: 14px;
      overflow: hidden;
    }
    .ist-v2-scene-thumb.clickable {
      cursor: zoom-in;
    }
    .ist-v2-scene-thumb img,
    .ist-v2-scene-thumb video {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    /* READY/WAITING/GENERATING/FAILED badges. READY uses the soft purple
       tint the reference shows — solid color, no backdrop blur. */
    .ist-v2-scene-badge {
      position: absolute;
      top: 12px;
      left: 12px;
      padding: 5px 12px;
      border-radius: 8px;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
    .ist-v2-scene-badge.ready      { background: rgba(121,80,212,0.14); color: #7950d4; }
    .ist-v2-scene-badge.waiting    { background: rgba(44,52,66,0.85);   color: #fff; backdrop-filter: blur(6px); }
    .ist-v2-scene-badge.generating { background: rgba(74,159,232,0.92); color: #fff; }
    .ist-v2-scene-badge.failed     { background: rgba(248,113,113,0.92); color: #fff; }
    .ist-v2-scene-kebab {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 30px;
      height: 30px;
      border-radius: 8px;
      background: rgba(255,255,255,0.95);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 6px rgba(15,20,35,0.08);
      transition: background 0.15s, transform 0.15s;
    }
    .ist-v2-scene-kebab:hover { background: #fff; transform: scale(1.05); }
    /* Per-scene approval tick.
       Three states:
         .is-hidden    image not done yet → not rendered (CSS hides too as fallback)
         .is-pending   image done, not approved → outline pill, faint grey check on hover
         .is-approved  approved → SOLID green fill + bold white check (matches spec) */
    .ist-v2-scene-check {
      position: absolute;
      top: 12px;
      right: 50px;
      width: 24px;
      height: 24px;
      border-radius: 7px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s;
      z-index: 1;
      padding: 0;
    }
    .ist-v2-scene-check.is-hidden { display: none; }
    .ist-v2-scene-check.is-pending {
      background: rgba(255, 255, 255, 0.92);
      border: 1.5px solid rgba(15, 20, 35, 0.14);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    }
    .ist-v2-scene-check.is-pending:hover {
      border-color: #1c8c4c;
      background: rgba(28, 140, 76, 0.10);
    }
    .ist-v2-scene-check.is-approved {
      background: #1c8c4c;
      border: 1.5px solid #1c8c4c;
      box-shadow: 0 2px 6px rgba(28, 140, 76, 0.32);
    }
    .ist-v2-scene-check.is-approved:hover {
      background: #167a40;
      border-color: #167a40;
    }
    /* Soft green ring around the whole scene card when approved — strong
       visual signal at a glance which scenes are locked in. */
    .ist-v2-scene.is-approved {
      border-color: rgba(28, 140, 76, 0.45);
      box-shadow: 0 0 0 3px rgba(28, 140, 76, 0.12);
    }
    /* Card body: tighter top padding (thumb already has 12px from card),
       generous bottom for the Generate button. */
    .ist-v2-scene-body {
      padding: 14px 6px 4px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex: 1;
    }
    .ist-v2-scene-title {
      font-size: 15px;
      font-weight: 800;
      color: #1f2433;
      letter-spacing: -0.3px;
      line-height: 1.2;
    }
    .ist-v2-scene-desc {
      font-size: 12px;
      color: #6b7280;
      line-height: 1.4;
      margin-bottom: 12px;
      min-height: 34px;
    }
    .ist-v2-scene-btn {
      width: 100%;
      padding: 12px 16px;
      border-radius: 12px;
      border: 1px solid #c9dcf3;
      background: rgba(74,159,232,0.07);
      color: #4a9fe8;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.15s;
    }
    .ist-v2-scene-btn:hover {
      background: #4a9fe8;
      color: #ffffff;
      border-color: #4a9fe8;
    }
    .ist-v2-scene-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .ist-v2-scene-btn:disabled:hover {
      background: rgba(74,159,232,0.07);
      color: #4a9fe8;
      border-color: #c9dcf3;
    }
    .ist-v2-scene-btn.regen {
      background: #ffffff;
      border-color: #e6e8ee;
      color: #4a5160;
    }
    .ist-v2-scene-btn.regen:hover {
      background: #f3f4f7;
      border-color: #c4c9d4;
      color: #1f2433;
    }

    /* ─── Calendar redesign ──────────────────────────────────────────── */
    .cal-view-tabs {
      display: flex;
      gap: 0;
      padding: 4px;
      background: var(--bg-2);
      border-radius: 10px;
      width: fit-content;
    }
    .cal-view-tab {
      padding: 6px 14px;
      border: none;
      background: transparent;
      color: var(--text-2);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      border-radius: 7px;
      transition: all 0.15s;
    }
    .cal-view-tab:hover { color: var(--text); }
    .cal-view-tab.active {
      background: var(--bg);
      color: var(--blue);
      box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }
    .cal-stat-card {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 18px 20px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      cursor: pointer;
      transition: all 0.15s;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
    .cal-stat-card:hover {
      transform: translateY(-2px);
      border-color: var(--text-2);
      box-shadow: 0 6px 16px rgba(0,0,0,0.07);
    }
    .cal-stat-card.active {
      border-color: var(--blue);
      background: linear-gradient(135deg, rgba(74,159,232,0.05), transparent);
    }
    .cal-stat-icon {
      width: 44px;
      height: 44px;
      border-radius: 50%;   /* circular per mockup */
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .cal-stat-label {
      font-size: 12px;
      color: var(--muted);
      font-weight: 500;
      letter-spacing: 0;
      text-transform: none;
    }
    .cal-stat-value {
      font-size: 30px;     /* bumped per mockup */
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.7px;
      line-height: 1.05;
      margin: 4px 0;
    }
    .cal-stat-sub {
      font-size: 11px;
      color: var(--muted);
      letter-spacing: 0;
      text-transform: none;
    }

    /* Strip the ugly native date-picker arrow from inline calendar date inputs */
    #cal-filter-date-from::-webkit-calendar-picker-indicator,
    #cal-filter-date-to::-webkit-calendar-picker-indicator,
    #launches-date-from::-webkit-calendar-picker-indicator,
    #launches-date-to::-webkit-calendar-picker-indicator {
      opacity: 0;
      cursor: pointer;
      position: absolute;
      right: 0;
      width: 100%;
      height: 100%;
    }
    #cal-filter-date-from, #cal-filter-date-to,
    #launches-date-from, #launches-date-to {
      position: relative;
      font-family: inherit;
    }

    .cal-issue-pill {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .cal-issue-pill:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }
    .cal-issue-pill .cal-issue-icon {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .cal-issue-pill .cal-issue-text {
      display: flex;
      flex-direction: column;
      line-height: 1.2;
    }
    .cal-issue-pill .cal-issue-count {
      font-size: 13px;
      font-weight: 700;
    }
    .cal-issue-pill .cal-issue-label {
      font-size: 10px;
      color: var(--muted);
    }

    .cal-bulk-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 11px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      font-size: 12px;
      font-weight: 600;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.12s;
    }
    .cal-bulk-btn:hover { background: var(--bg-2); }

    .cal-day-section {
      margin-bottom: 22px;
    }
    .cal-day-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 4px 0 12px;
      cursor: pointer;
      user-select: none;
    }
    .cal-day-chevron {
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      transition: transform 0.2s;
    }
    .cal-day-section.collapsed .cal-day-chevron { transform: rotate(-90deg); }
    .cal-day-section.collapsed .cal-day-body { display: none; }
    .cal-day-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.2px;
    }
    .cal-day-meta {
      font-size: 11px;
      color: var(--muted);
    }
    .cal-day-add {
      margin-left: auto;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 12px;
      border: 1px dashed var(--border);
      background: transparent;
      color: var(--blue);
      font-size: 11px;
      font-weight: 600;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .cal-day-add:hover { background: rgba(74,159,232,0.06); border-color: var(--blue); border-style: solid; }

    .cal-post-row {
      display: grid;
      grid-template-columns: 24px 84px 1fr 180px 280px 32px;
      gap: 16px;
      align-items: center;
      padding: 14px 18px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 10px;
      transition: all 0.12s;
    }
    .cal-post-row:hover { border-color: var(--text-2); box-shadow: 0 3px 10px rgba(0,0,0,0.04); }
    .cal-post-row.selected { background: linear-gradient(90deg, rgba(74,159,232,0.06), transparent); border-color: var(--blue); }
    .cal-post-thumb {
      width: 76px;
      height: 76px;
      border-radius: 10px;
      object-fit: cover;
      background: var(--bg-2);
    }
    .cal-post-main {
      display: flex;
      flex-direction: column;
      gap: 5px;
      min-width: 0;
    }
    .cal-post-line1 {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      flex-wrap: wrap;
    }
    .cal-post-time {
      font-weight: 700;
      color: var(--text);
    }
    .cal-post-product {
      color: var(--text);
      font-weight: 600;
    }
    .cal-post-postn {
      color: var(--muted);
    }
    .cal-post-line2 {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 10px;
      color: var(--muted);
      flex-wrap: wrap;
    }
    .cal-post-tag {
      padding: 2px 7px;
      background: var(--bg-2);
      border-radius: 5px;
      color: var(--text-2);
      font-weight: 600;
    }
    .cal-post-caption {
      font-size: 11px;
      color: var(--text-2);
      line-height: 1.45;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .cal-post-status-col {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 10px;
      color: var(--muted);
    }
    .cal-post-sync {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: var(--green);
      font-weight: 600;
    }
    .cal-post-sync.unsynced {
      color: var(--amber, #d18a1a);
    }
    .cal-post-actions {
      display: flex;
      gap: 6px;
    }
    .cal-post-action-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 10px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      font-size: 11px;
      font-weight: 600;
      border-radius: 7px;
      cursor: pointer;
      transition: all 0.12s;
    }
    .cal-post-action-btn:hover { background: var(--bg-2); border-color: var(--text-2); }

    /* Brand pills — distinct colors per brand */
    .cal-brand-pill {
      display: inline-block;
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: #fff;
    }
    .cal-brand-pill.ibraq    { background: #16786f; }
    .cal-brand-pill.junaid   { background: #2a2a35; }
    .cal-brand-pill.assaf    { background: #14213d; }
    .cal-brand-pill.marshoud { background: #8b5a2b; }
    .cal-brand-pill.maqam    { background: #6b5b48; }
    .cal-brand-pill.ysl      { background: #000; }

    /* Status pills inside calendar rows */
    .cal-status-pill {
      display: inline-block;
      padding: 3px 9px;
      border-radius: 5px;
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
    .cal-status-pill.ready,
    .cal-status-pill.scheduled-future { background: #dcf7e6; color: #1c8c4c; }
    .cal-status-pill.scheduled        { background: #e0eaff; color: #3a8fd9; }
    .cal-status-pill.posted           { background: #f1e8ff; color: #7950d4; }
    .cal-status-pill.draft            { background: #fff1d6; color: #d18a1a; }
    .cal-status-pill.failed           { background: #ffe2e2; color: #c8392c; }

    /* ─── New Launch modal — type cards + product rows ───────────────── */
    .launch-type-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      background: var(--bg);
      border: 2px solid var(--border);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .launch-type-card:hover {
      border-color: var(--text-2);
    }
    .launch-type-card.selected {
      border-color: var(--blue);
      background: linear-gradient(135deg, rgba(74,159,232,0.06), rgba(74,159,232,0.02));
    }
    .launch-type-icon {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .launch-type-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 2px;
    }
    .launch-type-sub {
      font-size: 11px;
      color: var(--muted);
    }

    /* Create Launch modal — premium light SaaS treatment matching the mockup. */
    #launches-new-modal.launch-create-backdrop {
      background: rgba(15, 23, 42, 0.56) !important;
      backdrop-filter: blur(12px) saturate(0.92) !important;
      -webkit-backdrop-filter: blur(12px) saturate(0.92) !important;
      padding: 28px !important;
    }
    #launches-new-modal .launches-new-modal-v2 {
      width: min(94vw, 680px) !important;
      max-width: 680px !important;
      border-radius: 18px !important;
      border: 1px solid rgba(213, 222, 236, 0.96) !important;
      background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
      box-shadow:
        0 28px 80px rgba(15, 23, 42, 0.26),
        0 12px 30px rgba(15, 23, 42, 0.14) !important;
      color: #10182b !important;
      overflow: hidden !important;
    }
    #launches-new-modal .modal-body {
      padding: 18px 28px 18px !important;
      scrollbar-width: thin;
      scrollbar-color: rgba(148, 163, 184, 0.52) transparent;
    }
    #launches-new-modal .modal-body::-webkit-scrollbar { width: 8px; }
    #launches-new-modal .modal-body::-webkit-scrollbar-thumb {
      background: rgba(148, 163, 184, 0.45);
      border-radius: 999px;
    }
    #launches-new-modal .modal-close {
      position: static !important;
      margin-left: auto !important;
      width: 34px !important;
      height: 34px !important;
      padding: 0 !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      border-radius: 10px !important;
      color: #1f2937 !important;
      font-size: 18px !important;
      transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease !important;
    }
    #launches-new-modal .modal-close:hover {
      background: #f3f6fb !important;
      color: #0f172a !important;
      transform: translateY(-1px);
    }
    #launches-new-modal .launch-type-card {
      box-sizing: border-box !important;
      height: 78px;
      min-height: 78px;
      padding: 14px 18px !important;
      border: 1px solid #dbe4f0 !important;
      border-radius: 12px !important;
      background: #ffffff !important;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.035);
    }
    #launches-new-modal .launch-type-card:hover {
      border-color: #abc5fb !important;
      transform: translateY(-1px);
      box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
    }
    #launches-new-modal .launch-type-card.selected {
      border: 2px solid #2563eb !important;
      background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%) !important;
      box-shadow: 0 16px 34px rgba(37, 99, 235, 0.10);
    }
    #launches-new-modal .launch-type-icon {
      width: 44px !important;
      height: 44px !important;
      border-radius: 12px !important;
    }
    #launches-new-modal .launch-type-title {
      color: #111827 !important;
      font-size: 13px !important;
      font-weight: 760 !important;
      letter-spacing: -0.12px;
    }
    #launches-new-modal .launch-type-sub {
      color: #70809a !important;
      font-size: 12px !important;
      line-height: 1.28;
    }
    #launches-new-modal input,
    #launches-new-modal select {
      height: 42px !important;
      border: 1px solid #dbe4f0 !important;
      border-radius: 10px !important;
      background-color: #ffffff !important;
      color: #10182b !important;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
      transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
    }
    #launches-new-modal input:focus,
    #launches-new-modal select:focus {
      outline: none !important;
      border-color: #2563eb !important;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
    }
    #launches-new-modal select {
      padding-right: 36px !important;
      background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236B7A90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
      background-repeat: no-repeat !important;
      background-position: right 12px center !important;
      background-size: 16px !important;
    }
    #launches-product-search {
      background: #fbfcff !important;
    }
    #launches-product-list {
      border: 1px solid #dbe4f0 !important;
      border-radius: 12px !important;
      background: #f8fbff !important;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 12px 28px rgba(15, 23, 42, 0.06) !important;
    }
    #launches-new-modal #launches-readiness-panel,
    #launches-new-modal #launches-output-preview {
      display: none !important;
    }
    .launch-product-row {
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr) minmax(130px, 168px) auto;
      gap: 12px;
      align-items: center;
      padding: 10px 14px;
      cursor: pointer;
      transition: background 0.12s;
      border-bottom: 1px solid var(--border-subtle);
    }
    #launches-new-modal .launch-product-row {
      min-height: 68px;
      padding: 10px 14px !important;
      background: transparent;
      border-bottom-color: #e2e8f0 !important;
    }
    #launches-new-modal .launch-product-row:hover {
      background: #f1f6ff !important;
    }
    #launches-new-modal .launch-product-row.selected {
      background: linear-gradient(90deg, rgba(37, 99, 235, 0.11), rgba(37, 99, 235, 0.045)) !important;
    }
    #launches-new-modal .launch-product-row.selected::after {
      color: #2563eb !important;
      font-size: 16px !important;
    }
    .launch-product-row:last-child { border-bottom: none; }
    .launch-product-row:hover { background: var(--bg-2); }
    .launch-product-row.selected {
      background: linear-gradient(90deg, rgba(74,159,232,0.08), rgba(74,159,232,0.02));
    }
    .launch-product-row.selected::after {
      content: '✓';
      color: var(--blue);
      font-weight: 700;
      font-size: 14px;
    }
    .launch-product-thumb-wrap {
      position: relative;
      width: 50px;
      height: 50px;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid var(--border-subtle);
      background: var(--bg-2);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    #launches-new-modal .launch-product-thumb-wrap {
      width: 48px !important;
      height: 48px !important;
      border-radius: 9px !important;
      border-color: #e2e8f0 !important;
      background: #ffffff !important;
    }
    .launch-product-thumb {
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: #fff;
      display: block;
    }
    .launch-product-thumb-fallback {
      position: absolute;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      font-size: 18px;
    }
    .launch-product-thumb-wrap.missing .launch-product-thumb-fallback,
    .launch-product-thumb-wrap:not(:has(img)) .launch-product-thumb-fallback {
      display: flex;
    }
    .launch-product-main {
      min-width: 0;
    }
    .launch-product-info-row {
      display: flex;
      align-items: baseline;
      gap: 8px;
      min-width: 0;
    }
    .launch-product-handle {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      white-space: nowrap;
    }
    #launches-new-modal .launch-product-handle,
    #launches-new-modal .launch-product-title {
      color: #10182b !important;
      font-size: 13px !important;
      font-weight: 760 !important;
    }
    #launches-new-modal .launch-product-sub,
    #launches-new-modal .launch-product-launch-note {
      color: #70809a !important;
      font-size: 10px !important;
    }
    .launch-product-title {
      font-size: 12px;
      color: var(--text-2);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .launch-product-sub {
      font-size: 10px;
      color: var(--muted);
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .launch-product-status {
      display: grid;
      justify-items: end;
      gap: 4px;
      min-width: 0;
    }
    .launch-product-launch-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 21px;
      padding: 0 8px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 780;
      white-space: nowrap;
      border: 1px solid transparent;
    }
    #launches-new-modal .launch-product-launch-badge {
      min-height: 22px !important;
      font-size: 9.5px !important;
      box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
    }
    .launch-product-launch-badge.none {
      color: #64748b;
      background: rgba(100, 116, 139, 0.10);
      border-color: rgba(100, 116, 139, 0.14);
    }
    .launch-product-launch-badge.ready {
      color: #15803d;
      background: rgba(34, 197, 94, 0.12);
      border-color: rgba(34, 197, 94, 0.20);
    }
    .launch-product-launch-badge.active {
      color: #2563eb;
      background: rgba(37, 99, 235, 0.11);
      border-color: rgba(37, 99, 235, 0.18);
    }
    .launch-product-launch-badge.draft {
      color: #b45309;
      background: rgba(245, 158, 11, 0.13);
      border-color: rgba(245, 158, 11, 0.22);
    }
    .launch-product-launch-badge.failed {
      color: #dc2626;
      background: rgba(239, 68, 68, 0.12);
      border-color: rgba(239, 68, 68, 0.22);
    }
    .launch-product-launch-note {
      max-width: 100%;
      color: var(--muted);
      font-size: 9px;
      line-height: 1.25;
      text-align: right;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    @media (max-width: 720px) {
      .launch-product-row {
        grid-template-columns: 52px minmax(0, 1fr) auto;
      }
      .launch-product-thumb-wrap {
        width: 46px;
        height: 46px;
      }
      .launch-product-status {
        grid-column: 2 / -1;
        justify-items: start;
        margin-top: -4px;
      }
      .launch-product-launch-note {
        text-align: left;
      }
    }
    #launches-new-modal .modal-footer {
      padding: 16px 28px 22px !important;
      background: rgba(248, 250, 252, 0.72) !important;
      border-top: 1px solid #e2e8f0 !important;
      box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.035);
    }
    #launches-new-modal .modal-footer button {
      height: 42px !important;
      border-radius: 10px !important;
      font-weight: 720 !important;
      letter-spacing: -0.05px;
    }
    #launches-save-draft-btn {
      color: #526077 !important;
    }
    #launches-save-draft-btn:hover {
      background: #eef4ff !important;
      color: #2563eb !important;
    }
    #launches-queue-btn {
      min-width: 140px;
      justify-content: center;
      background: linear-gradient(135deg, #2563eb, #2f6df2) !important;
      box-shadow: 0 12px 26px rgba(37, 99, 235, 0.26);
      opacity: 1 !important;
    }
    #launches-queue-btn:disabled {
      cursor: not-allowed !important;
      background: #8fb0f0 !important;
      box-shadow: none !important;
      opacity: 0.72 !important;
    }
    #launches-queue-btn.is-ready:not(:disabled):hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 32px rgba(37, 99, 235, 0.32);
    }

    /* ─── Kebab menu popover ─────────────────────────────────────────── */
    /* z-index must exceed any modal-backdrop (9000) so kebabs opened from
       inside a modal — e.g. the launch-detail modal — render ABOVE the
       modal card instead of clipped behind it. */
    .launch-kebab-menu {
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 4px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 10px;
      /* Same heavy shadow as the dashboard kebab — keeps the menu reading
         as solidly "above" the content even in low-contrast dark mode. */
      box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 4px 12px rgba(0, 0, 0, 0.25);
      min-width: 180px;
      z-index: 99999;
      overflow: hidden;
      opacity: 1;
    }
    html.light .launch-kebab-menu {
      box-shadow:
        0 18px 50px rgba(15, 20, 35, 0.18),
        0 4px 12px rgba(15, 20, 35, 0.08);
    }
    .launch-kebab-menu button {
      width: 100%;
      text-align: left;
      padding: 9px 14px;
      border: none;
      background: transparent;
      font-size: 12px;
      color: var(--text);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 9px;
      transition: background 0.12s;
    }
    .launch-kebab-menu button:hover { background: var(--bg-2); }
    .launch-kebab-menu button.danger { color: var(--red); }
    .launch-kebab-menu button.danger:hover { background: rgba(248,113,113,0.08); }
    .launch-kebab-menu .menu-divider {
      height: 1px;
      background: var(--border-subtle);
      margin: 4px 0;
    }


    @keyframes pulse-bar {

      0%,
      100% {
        width: 20%;
        opacity: 0.7;
      }

      50% {
        width: 70%;
        opacity: 1;
      }
    }

    .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      flex-wrap: wrap;
      gap: 10px;
    }

    .section-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--text);
    }

    .section-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    /* ── SEARCH / FILTER ─────────────────────────────────────────── */
    .filter-bar {
      display: flex;
      gap: 10px;
      margin-bottom: 16px;
      flex-wrap: wrap;
      align-items: center;
    }

    .search-input {
      background: var(--card);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 12px;
      outline: none;
      width: 220px;
      transition: border-color 0.2s;
    }

    .search-input:focus {
      border-color: var(--blue);
    }

    .search-input::placeholder {
      color: var(--muted);
    }

    .view-toggle {
      display: flex;
      gap: 4px;
    }

    .view-btn {
      padding: 7px 10px;
      background: var(--card);
      border: 1px solid var(--border);
      color: var(--muted);
      border-radius: 6px;
      cursor: pointer;
      font-size: 14px;
      transition: all 0.15s;
    }

    .view-btn.active {
      border-color: var(--blue);
      color: var(--blue);
      background: var(--blue-dim);
    }

    /* ── PRODUCTS TABLE ──────────────────────────────────────────── */
    .table-wrap {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
    }

    table {
      width: 100%;
      border-collapse: collapse;
    }

    thead th {
      text-align: left;
      padding: 12px 16px;
      font-size: 11px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
    }

    tbody tr {
      border-bottom: 1px solid var(--border);
      transition: background 0.1s;
      cursor: pointer;
    }

    tbody tr:last-child {
      border-bottom: none;
    }

    tbody tr:hover {
      background: rgba(255, 255, 255, 0.03);
    }

    td {
      padding: 12px 16px;
      font-size: 13px;
      vertical-align: middle;
    }

    .td-thumb {
      width: 48px;
      height: 48px;
      border-radius: 8px;
      object-fit: cover;
      background: var(--border);
      cursor: zoom-in;
    }

    .td-thumb-placeholder {
      width: 48px;
      height: 48px;
      border-radius: 8px;
      background: var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
    }

    .td-title {
      font-weight: 500;
      max-width: 260px;
    }

    .td-title a {
      color: var(--text);
      text-decoration: none;
    }

    .td-title a:hover {
      color: var(--blue);
    }

    .td-price {
      color: var(--blue);
      font-weight: 600;
    }

    .td-compare {
      color: var(--muted);
      text-decoration: line-through;
      font-size: 11px;
    }

    .td-badge {
      display: inline-flex;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
    }

    .badge-available {
      background: var(--green-dim);
      color: var(--green);
    }

    .badge-unavailable {
      background: var(--red-dim);
      color: var(--red);
    }

    /* ── PRODUCTS GRID ───────────────────────────────────────────── */
    .products-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 16px;
    }

    .product-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      transition: all 0.15s;
      cursor: pointer;
    }

    .product-card:hover {
      border-color: var(--blue);
      transform: translateY(-2px);
    }

    .product-card-img {
      width: 100%;
      height: 180px;
      object-fit: cover;
      background: var(--border);
      display: block;
    }

    .product-card-img-placeholder {
      width: 100%;
      height: 180px;
      background: var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 36px;
    }

    .product-card-body {
      padding: 12px;
    }

    .product-card-title {
      font-size: 13px;
      font-weight: 500;
      margin-bottom: 6px;
      line-height: 1.4;
    }

    .product-card-price {
      font-size: 14px;
      font-weight: 700;
      color: var(--blue);
    }

    .product-card-cat {
      font-size: 11px;
      color: var(--muted);
      margin-top: 4px;
    }

    /* ── BANNERS GRID ────────────────────────────────────────────── */
    .banners-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 16px;
    }

    .banner-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      cursor: pointer;
      transition: all 0.15s;
    }

    .banner-card:hover {
      border-color: var(--blue);
      transform: translateY(-2px);
    }

    .banner-card img {
      width: 100%;
      height: 180px;
      object-fit: cover;
      display: block;
      background: var(--border);
    }

    .banner-card-meta {
      padding: 10px 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .banner-size {
      font-size: 11px;
      color: var(--muted);
    }

    .banner-type {
      font-size: 11px;
      color: var(--blue);
    }

    /* ── CONTENT SECTION ─────────────────────────────────────────── */
    .info-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 16px;
    }

    .info-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
    }

    .info-card-title {
      font-size: 12px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 14px;
    }

    .info-link-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 0;
      border-bottom: 1px solid var(--border);
      font-size: 13px;
    }

    .info-link-item:last-child {
      border-bottom: none;
    }

    .info-link-item a {
      color: var(--text);
      text-decoration: none;
    }

    .info-link-item a:hover {
      color: var(--blue);
    }

    .info-meta-row {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .info-meta-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .info-meta-label {
      font-size: 11px;
      color: var(--muted);
    }

    .info-meta-value {
      font-size: 13px;
      color: var(--text);
      line-height: 1.4;
    }

    /* ── MARKETING SECTION ───────────────────────────────────────── */
    .social-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 20px;
    }

    .social-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--card);
      border: 1px solid var(--border);
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 13px;
      text-decoration: none;
      color: var(--text);
      transition: all 0.15s;
    }

    .social-chip:hover {
      border-color: var(--blue);
      color: var(--blue);
    }

    /* ── PAGINATION ──────────────────────────────────────────────── */
    .pagination {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 20px;
      flex-wrap: wrap;
      gap: 10px;
    }

    .pagination-info {
      font-size: 12px;
      color: var(--muted);
    }

    .pagination-controls {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .page-btn {
      padding: 6px 12px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      cursor: pointer;
      font-size: 12px;
      transition: all 0.15s;
    }

    .page-btn:hover {
      border-color: var(--blue);
      color: var(--blue);
    }

    .page-btn.active {
      background: var(--blue);
      color: #000;
      border-color: var(--blue);
      font-weight: 700;
    }

    .page-btn:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }

    /* ── IMAGE PREVIEW MODAL ─────────────────────────────────────── */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.92);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(8px);
    }

    .modal-overlay.open {
      display: flex;
    }

    .modal-content {
      position: relative;
      width: min(1180px, calc(100vw - 48px));
      max-height: calc(100vh - 48px);
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
      padding: 14px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 22px;
      background: rgba(10, 14, 22, 0.76);
      box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
    }

    .modal-stage {
      position: relative;
      width: 100%;
      height: clamp(420px, 72vh, 780px);
      overflow: hidden;
      display: grid;
      place-items: center;
      border-radius: 18px;
      background-color: #070a10;
      background-position: center;
      background-size: contain;
      background-repeat: no-repeat;
      isolation: isolate;
    }

    .modal-stage::before {
      content: "";
      position: absolute;
      inset: -34px;
      z-index: -2;
      background: inherit;
      filter: blur(28px) saturate(1.08);
      transform: scale(1.06);
    }

    .modal-stage::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      background:
        linear-gradient(180deg, rgba(7, 10, 16, 0.08), rgba(7, 10, 16, 0.20)),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.08), rgba(7, 10, 16, 0.32));
    }

    .modal-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: center center;
      border-radius: 16px;
      box-shadow: 0 22px 70px rgba(0, 0, 0, 0.44);
      cursor: zoom-in;
      transition: transform 0.18s ease;
      transform-origin: center center;
      z-index: 1;
    }

    .modal-img.zoomed {
      cursor: zoom-out;
      transform: scale(2);
    }

    .modal-img.zoomed.pan-ready {
      cursor: grab;
    }

    .modal-img.zoomed.panning {
      cursor: grabbing;
      transition: none;
    }

    .modal-close {
      position: absolute;
      top: 22px;
      right: 22px;
      z-index: 3;
      background: rgba(8, 12, 20, 0.62);
      border: 1px solid rgba(255, 255, 255, 0.18);
      color: #fff;
      width: 38px;
      height: 38px;
      border-radius: 12px;
      cursor: pointer;
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s;
    }

    .modal-close:hover {
      border-color: rgba(255, 255, 255, 0.36);
      background: rgba(255, 255, 255, 0.12);
      color: #fff;
    }

    .modal-info {
      min-height: 42px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      color: rgba(255, 255, 255, 0.76);
      font-size: 13px;
      line-height: 1.35;
    }

    .modal-info strong {
      display: block;
      color: #fff;
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 0;
    }

    .modal-info span,
    .modal-info small {
      color: rgba(255, 255, 255, 0.62);
      font-size: 12px;
      font-weight: 500;
    }

    .modal-nav {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .modal-footer-actions {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
    }

    .modal-nav-btn {
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 0 16px;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.055));
      color: rgba(255, 255, 255, 0.86);
      font: inherit;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
      transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, color 0.16s ease;
    }

    .modal-nav-btn:hover:not(:disabled) {
      transform: translateY(-1px);
      border-color: rgba(255, 255, 255, 0.28);
      background: rgba(255, 255, 255, 0.13);
    }

    .modal-nav-btn:disabled {
      opacity: 0.36;
      cursor: default;
    }

    a#modal-download-btn.btn.btn-outline {
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 0 18px;
      border-radius: 12px;
      border-color: rgba(87, 129, 255, 0.46) !important;
      background: linear-gradient(180deg, rgba(87, 129, 255, 0.26), rgba(87, 129, 255, 0.14)) !important;
      color: #dbe7ff !important;
      font-weight: 850;
      text-decoration: none !important;
      box-shadow: 0 12px 28px rgba(34, 94, 255, 0.16), inset 0 1px 0 rgba(255,255,255,0.12);
    }

    a#modal-download-btn.btn.btn-outline:hover {
      transform: translateY(-1px);
      border-color: rgba(130, 160, 255, 0.72) !important;
      background: linear-gradient(180deg, rgba(87, 129, 255, 0.34), rgba(87, 129, 255, 0.20)) !important;
      color: #ffffff !important;
    }

    @media (max-width: 760px) {
      .modal-content {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: 10px;
        border-radius: 18px;
      }

      .modal-stage {
        height: 68vh;
        border-radius: 14px;
      }

      .modal-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }
    }

    .modal-actions {
      display: flex;
      gap: 8px;
    }

    /* ── PRODUCT DETAIL MODAL ────────────────────────────────────── */
    .detail-modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.55);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      /* No live backdrop-filter anymore — the .me-blurred-bg child below
         is a one-time snapshot of the dashboard, blurred once at capture
         time, then static for the lifetime of the modal. Scrolling the
         modal over it is free (no per-frame blur kernel). */
      isolation: isolate;
    }

    /* Pre-rendered, pre-blurred snapshot of the page behind the modal.
       Filled in by manageCaptureBlurredBg() on modal open. Scaled 1.05×
       so the blur edges don't fade at the viewport edges. */
    .me-blurred-bg {
      position: absolute;
      inset: 0;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      filter: blur(20px) saturate(125%) brightness(0.8);
      transform: scale(1.05);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.25s ease-out;
    }

    .me-blurred-bg.ready {
      opacity: 1;
    }

    /* Above the blurred bg, below page chrome. */
    #manage-edit-modal>.detail-modal {
      position: relative;
      z-index: 1;
    }

    .detail-modal-overlay.open {
      display: flex;
    }

    .detail-modal {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      width: min(700px, 92vw);
      max-height: 88vh;
      overflow-y: auto;
      position: relative;
      /* Promote to its own compositor layer so the modal's scroll repaints
         don't invalidate the overlay (and vice versa). `contain` further tells
         the browser the modal's layout/paint is self-contained. */
      will-change: transform;
      contain: layout paint;
      /* Smooth out flick scrolling on touchpads/Macs. */
      -webkit-overflow-scrolling: touch;
    }

    /* Chip-based pickers for metaobject_reference / list.metaobject_reference
       metafields. Replaces the giant <select multiple size="8"> listbox UI
       which forced users to scroll through 50+ fragrance notes inline. */
    .mf-chips-row {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-bottom: 8px;
      min-height: 22px;
    }

    .mf-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 3px 4px 3px 10px;
      background: rgba(67, 198, 172, 0.12);
      border: 1px solid rgba(67, 198, 172, 0.4);
      border-radius: 99px;
      font-size: 11px;
      color: var(--text);
      font-weight: 500;
    }

    .mf-chip button {
      border: 0;
      background: rgba(255, 255, 255, 0.45);
      width: 16px;
      height: 16px;
      border-radius: 50%;
      cursor: pointer;
      color: var(--muted);
      padding: 0;
      line-height: 1;
      font-size: 13px;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s;
    }

    .mf-chip button:hover {
      background: #fee2e2;
      color: #ef4444;
    }

    .mf-chips-empty {
      font-size: 11px;
      color: var(--muted);
      font-style: italic;
      padding: 3px 0;
    }

    /* Modal close button — was unstyled (default browser button + raw SVG)
       which looked very Windows XP. Now a proper circular icon button that
       inherits theme colors via CSS variables, with a hover lift. */
    .detail-modal-close {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--card);
      border: 1px solid var(--border);
      cursor: pointer;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text);
      font-family: inherit;
      transition: background 0.15s, border-color 0.15s, transform 0.15s;
      z-index: 5;
    }

    .detail-modal-close:hover {
      background: var(--surface);
      border-color: var(--blue);
      transform: scale(1.07);
    }

    .detail-modal-close:active {
      transform: scale(0.96);
    }

    .detail-modal-close img {
      width: 16px;
      height: 16px;
      /* Theme-aware tint: brightness(0)+invert renders the icon as a flat
         grey regardless of the iconify default color, then hover bumps it
         brighter. Works in both light and dark themes. */
      filter: brightness(0) saturate(100%) invert(50%);
      transition: filter 0.15s;
      pointer-events: none;
    }

    .detail-modal-close:hover img {
      filter: brightness(0) saturate(100%) invert(28%);
    }

    html:not(.light) .detail-modal-close:hover img {
      filter: brightness(0) saturate(100%) invert(85%);
    }

    .mf-add-select {
      width: 100%;
      font-size: 11px;
      padding: 5px 9px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 7px;
      color: var(--text);
      cursor: pointer;
      transition: border-color 0.15s;
    }

    .mf-add-select:hover:not(:disabled) {
      border-color: var(--blue);
    }

    .mf-add-select:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* Wide variant — used for the product detail modal so perfume pages
       with tall images + long Arabic descriptions have room to breathe */
    .detail-modal.wide {
      width: min(1400px, 95vw);
      max-height: 92vh;
    }

    /* Floating editor — Live Store Manager's product editor takes ~75% of
       the viewport, centered, with the blurred overlay showing through
       around the edges. Big enough for the 4-col grid, small enough that
       the dashboard underneath stays as visual context. */
    .detail-modal.fullscreen {
      width: 75vw;
      max-width: 75vw;
      height: 85vh;
      max-height: 85vh;
      border-radius: 18px;
      /* Smaller shadow blur — large box-shadow blur radii are surprisingly
         expensive to repaint while the modal's content scrolls. */
      box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
      /* Force a fresh stacking context so the modal's compositor layer is
         truly independent of the overlay's backdrop-filter. */
      isolation: isolate;
    }

    /* On small screens (<1100px viewport) take more of the screen so the
       2-col fallback grid still has room. */
    @media (max-width: 1100px) {
      .detail-modal.fullscreen {
        width: 92vw;
        max-width: 92vw;
        height: 92vh;
        max-height: 92vh;
      }
    }

    /* Multi-column form grid for the product editor. Replaces the previous
       single-column scroll-fest with a 4-col layout where each section
       declares how many columns it spans (visual density-driven). */
    .me-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 14px;
      align-content: start;
    }

    .me-grid>details {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px 14px;
      margin: 0 !important;
      min-width: 0;
      /* prevents grid items from blowing out width on long content */
      /* Per-section paint isolation — when the user scrolls the modal, only
         the visible cells repaint, instead of the whole grid invalidating. */
      contain: layout paint style;
      /* When collapsed, shrink to the summary line height so the panel
         doesn't stretch to match neighboring cells in the same grid row.
         Open panels still grid-stretch normally to align with their row.
         Without this, a collapsed Basics next to an open SEO + Tags row
         leaves a large white panel where the closed details still occupies
         the full row height. */
      align-self: start;
    }

    .me-grid>details[open] {
      /* Open cells stretch back to fill the row, matching neighboring
         open cells visually. */
      align-self: stretch;
    }

    .me-grid>details[open]>summary {
      margin-bottom: 6px;
    }

    /* Smooth collapse hint — animates the chevron rotation only (animating
       height of <details> requires JS; the layout shift is fast enough on
       its own that a chevron rotation feels intentional). */
    .me-grid>details>summary {
      transition: color 0.15s ease;
    }

    .me-grid>details>summary:hover {
      color: var(--blue);
    }

    .me-grid>details>summary {
      font-size: 12px;
      font-weight: 700;
      color: var(--text);
      cursor: pointer;
    }

    .me-grid>details.me-span-2 {
      grid-column: span 2;
    }

    .me-grid>details.me-span-3 {
      grid-column: span 3;
    }

    .me-grid>details.me-span-4 {
      grid-column: span 4;
    }

    /* Below 1100px viewport, fall back to 2-col so things stay legible. */
    @media (max-width: 1100px) {
      .me-grid {
        grid-template-columns: repeat(2, 1fr);
      }

      .me-grid>details.me-span-2,
      .me-grid>details.me-span-3,
      .me-grid>details.me-span-4 {
        grid-column: span 2;
      }
    }

    /* Below 700px (phone) drop to 1-col. */
    @media (max-width: 700px) {
      .me-grid {
        grid-template-columns: 1fr;
      }

      .me-grid>details {
        grid-column: span 1 !important;
      }
    }

    /* Compact internal grid for the metafield rows so 8-9 chip fields
       fit in 2-3 columns instead of one giant vertical column. */
    .me-grid>details.me-span-4 #m-edit-metafields {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 8px;
    }

    .me-grid>details.me-span-4 #m-edit-metafields>[data-mf-row] {
      margin-bottom: 0 !important;
    }

    .detail-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 24px;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      background: var(--surface);
      z-index: 1;
    }

    .detail-modal-title {
      font-size: 15px;
      font-weight: 600;
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .detail-modal-body {
      padding: 24px;
      display: flex;
      gap: 24px;
    }

    .detail-modal.wide .detail-modal-body {
      padding: 20px 24px 24px;
      gap: 28px;
      align-items: start;
    }

    /* Left column (images) */
    .detail-images {
      width: 260px;
      flex-shrink: 0;
    }

    .detail-modal.wide .detail-images {
      flex: 1 1 0;
      width: auto;
      max-width: 560px;
      min-width: 0;
      position: sticky;
      top: 0;
    }

    .detail-main-img {
      width: 100%;
      height: 220px;
      object-fit: cover;
      border-radius: 10px;
      background: var(--border);
      cursor: zoom-in;
    }

    .detail-modal.wide .detail-main-img {
      height: auto;
      aspect-ratio: 1;
      max-height: 62vh;
      object-fit: contain;
      background: #111;
      padding: 8px;
    }

    .detail-thumbs {
      display: flex;
      gap: 8px;
      margin-top: 10px;
      flex-wrap: wrap;
    }

    .detail-thumb {
      width: 52px;
      height: 52px;
      border-radius: 6px;
      object-fit: cover;
      cursor: pointer;
      border: 2px solid transparent;
      transition: border-color 0.15s;
    }

    .detail-thumb.selected {
      border-color: var(--blue);
    }

    /* Right column (info cards) */
    .detail-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-width: 0;
    }

    .detail-modal.wide .detail-info {
      flex: 1.2 1 0;
      gap: 12px;
      max-height: calc(92vh - 80px);
      overflow-y: auto;
      padding-right: 4px;
    }

    .detail-field {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .detail-field-label {
      font-size: 11px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      font-weight: 700;
    }

    .detail-field-value {
      font-size: 13px;
      color: var(--text);
      line-height: 1.5;
    }

    .detail-field-value.price {
      font-size: 22px;
      font-weight: 700;
      color: var(--blue);
    }

    /* Card-style wrapper for the wide modal so each section stops swimming */
    .detail-modal.wide .detail-field {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
      gap: 6px;
    }

    /* Condensed row for price/stock/sku so they sit side-by-side */
    .detail-modal.wide .detail-meta-row {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 12px;
    }

    @media (max-width: 700px) {
      .detail-modal.wide .detail-meta-row {
        grid-template-columns: 1fr;
      }

      .detail-modal.wide .detail-main-img {
        max-height: 45vh;
      }
    }

    /* Description card holds its own scroll so the modal doesn't balloon
       on 3000-word perfume descriptions */
    .detail-modal.wide .detail-desc-card {
      max-height: 42vh;
      overflow-y: auto;
    }

    /* Never let an image/element inside the description punch out of the card */
    .detail-modal.wide .product-desc img,
    .detail-modal.wide .product-desc video,
    .detail-modal.wide .product-desc iframe,
    .detail-modal.wide .product-desc table {
      max-width: 100%;
      height: auto;
    }

    .detail-modal.wide .product-desc {
      font-size: 13.5px;
      word-break: break-word;
    }

    /* ── TOAST ───────────────────────────────────────────────────── */
    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: var(--card);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 12px 20px;
      border-radius: 10px;
      font-size: 13px;
      z-index: 2000;
      transform: translateY(80px);
      opacity: 0;
      transition: all 0.3s;
      max-width: 320px;
    }

    .toast.show {
      transform: translateY(0);
      opacity: 1;
    }

    .toast.success {
      border-color: var(--blue);
    }

    .toast.error {
      border-color: var(--red);
    }

    /* ── PROGRESS BAR ────────────────────────────────────────────── */
    .progress-bar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: var(--border);
      z-index: 9999;
      display: none;
    }

    .progress-bar.active {
      display: block;
    }

    .progress-fill {
      height: 100%;
      background: var(--blue);
      width: 0%;
      transition: width 0.4s ease;
      box-shadow: 0 0 8px var(--blue);
    }

    /* ── SKELETON ────────────────────────────────────────────────── */
    @keyframes shimmer {
      0% {
        background-position: -400px 0;
      }

      100% {
        background-position: 400px 0;
      }
    }

    .skeleton {
      background: linear-gradient(90deg, var(--border) 25%, var(--card) 50%, var(--border) 75%);
      background-size: 800px 100%;
      animation: shimmer 1.4s infinite;
      border-radius: 6px;
    }

    /* ── COPY BUTTON ─────────────────────────────────────────────── */
    .copy-btn {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 12px;
      color: var(--muted);
      padding: 2px 6px;
      border-radius: 4px;
      transition: all 0.15s;
    }

    .copy-btn:hover {
      color: var(--blue);
      background: var(--blue-dim);
    }

    /* ── EMPTY HISTORY ───────────────────────────────────────────── */
    .history-empty {
      padding: 8px 20px;
      font-size: 11px;
      color: var(--muted);
      font-style: italic;
    }

    /* ── SCROLLBAR ───────────────────────────────────────────────── */
    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: var(--muted);
    }

    /* ── PRODUCT TAG BADGES ──────────────────────────────────────── */
    .tag-badge {
      display: inline-flex;
      align-items: center;
      padding: 1px 7px;
      border-radius: 10px;
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
      user-select: none;
      transition: all 0.15s;
      white-space: nowrap;
    }

    .tag-push {
      background: var(--green-dim);
      color: var(--green);
      border: 1px solid var(--green);
    }

    .tag-skip {
      background: var(--red-dim);
      color: var(--red);
      border: 1px solid var(--red);
    }

    .tag-review {
      background: var(--amber-dim);
      color: var(--amber);
      border: 1px solid var(--amber);
    }

    .tag-edit {
      background: var(--indigo-dim);
      color: var(--indigo);
      border: 1px solid var(--indigo);
    }

    .tag-none {
      background: var(--card);
      color: var(--muted);
      border: 1px dashed var(--border);
    }

    .tag-badge:hover {
      opacity: 0.75;
      transform: scale(1.05);
    }

    /* ── BULK EDIT PANEL ─────────────────────────────────────────── */
    .bulk-edit-panel {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: 12px;
    }

    .bulk-edit-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      cursor: pointer;
      user-select: none;
      transition: background 0.15s;
    }

    .bulk-edit-header:hover {
      background: var(--blue-dim);
    }

    .bulk-edit-body {
      padding: 16px;
      display: none;
      flex-direction: column;
      gap: 10px;
      border-top: 1px solid var(--border);
    }

    .bulk-edit-body.open {
      display: flex;
    }

    .bulk-edit-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .bulk-edit-row label {
      font-size: 11px;
      color: var(--text-2);
      min-width: 150px;
      font-weight: 500;
    }

    .bulk-input {
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 12px;
      outline: none;
      transition: border-color 0.2s;
      flex: 1;
      min-width: 100px;
    }

    .bulk-input:focus {
      border-color: var(--blue);
    }

    .edits-pending-badge {
      display: none;
      background: var(--amber-dim);
      border: 1px solid var(--amber);
      color: var(--amber);
      font-size: 10px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 8px;
    }

    .edits-pending-badge.visible {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    /* ── AI SCOUT SECTION ────────────────────────────────────────── */
    .scout-layout {
      display: grid;
      grid-template-columns: clamp(260px, 22%, 360px) 1fr;
      gap: 16px;
      align-items: start;
    }

    .scout-config-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      position: sticky;
      top: 100px;
    }

    .scout-label {
      font-size: 11px;
      color: var(--text-2);
      font-weight: 600;
      margin-bottom: 4px;
    }

    .scout-results-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      min-height: 400px;
    }

    .scout-tier {
      margin-bottom: 20px;
    }

    .scout-tier-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 700;
    }

    .scout-tier-green {
      background: var(--green-dim);
      color: var(--green);
      border: 1px solid var(--green);
    }

    .scout-tier-yellow {
      background: var(--amber-dim);
      color: var(--amber);
      border: 1px solid var(--amber);
    }

    .scout-tier-red {
      background: var(--red-dim);
      color: var(--red);
      border: 1px solid var(--red);
    }

    .scout-product-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-bottom: 6px;
      transition: border-color 0.15s;
    }

    .scout-product-row:hover {
      border-color: var(--blue);
    }

    .scout-product-info {
      flex: 1;
      min-width: 0;
    }

    .scout-product-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .scout-product-meta {
      font-size: 11px;
      color: var(--muted);
      margin-top: 2px;
    }

    .scout-product-reason {
      font-size: 11px;
      color: var(--text-2);
      margin-top: 3px;
      font-style: italic;
      line-height: 1.4;
    }

    .range-input {
      width: 100%;
      accent-color: var(--blue);
      cursor: pointer;
    }

    /* ── PUSH HISTORY ────────────────────────────────────────────── */
    .push-history-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 0;
      border-bottom: 1px solid var(--border-subtle);
      font-size: 11px;
    }

    .push-history-item:last-child {
      border-bottom: none;
    }

    .push-history-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    /* ── COLLECTION MAPPING ──────────────────────────────────────── */
    .coll-map-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 0;
      border-bottom: 1px solid var(--border-subtle);
    }

    .coll-map-row:last-child {
      border-bottom: none;
    }

    .coll-map-cat {
      font-size: 11px;
      color: var(--text);
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* ── PRICE PREVIEW ───────────────────────────────────────────── */
    .price-preview {
      font-size: 10px;
      color: var(--amber);
      margin-top: 2px;
    }

    /* ── RESPONSIVE ──────────────────────────────────────────────── */
    @media (max-width: 768px) {
      .sidebar {
        width: 60px;
      }

      .sidebar-logo .logo-text,
      .sidebar-logo .logo-sub,
      .nav-item span,
      .nav-section-label {
        display: none;
      }

      .main {
        margin-left: 60px;
      }

      .detail-modal-body {
        flex-direction: column;
      }

      .detail-images {
        width: 100%;
      }

      /* Store-tabs bar pushes off right edge on small screens */
      .store-tabs-bar {
        left: 60px;
      }

      /* Topbar shouldn't wrap the URL input across multiple rows */
      .topbar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
      }

      .topbar .scrape-toggle,
      .topbar .btn {
        font-size: 12px;
      }

      /* Content padding tightens */
      .content {
        padding: 14px;
      }

      /* Section headers stack their actions */
      .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }

      .section-actions {
        width: 100%;
        flex-wrap: wrap;
      }

      /* Product table: hide SKU + category columns on phones — they'd
         truncate to dots anyway. Keep image, title, price, status, tag. */
      .table-wrap table th:nth-child(4),
      .table-wrap table td:nth-child(4),
      .table-wrap table th:nth-child(5),
      .table-wrap table td:nth-child(5) {
        display: none;
      }

      /* Stat cards: 2-wide grid instead of 6-wide */
      .stat-cards {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      /* Product detail modal: drop to single column */
      .detail-modal.wide .detail-modal-body {
        grid-template-columns: 1fr !important;
      }

      .detail-modal.wide .detail-info {
        max-height: none;
      }

      /* Scout layout: stack config above results */
      .scout-layout {
        grid-template-columns: 1fr !important;
      }

      /* Money tab fee grids */
      .detail-meta-row {
        grid-template-columns: 1fr !important;
      }
    }

    @media (max-width: 480px) {
      .sidebar {
        display: none;
      }

      .main {
        margin-left: 0;
      }

      .store-tabs-bar {
        left: 0;
      }
    }

    /* ── Hover tooltip system ────────────────────────────────────
       Usage: add  data-tip="explanation"  to any element.
       Optional: data-tip-pos="top|bottom|left|right" (default top)
       JS in initTooltipFlip() auto-flips to opposite side if it would overflow viewport. */
    [data-tip] {
      position: relative;
    }

    [data-tip]::before,
    [data-tip]::after {
      opacity: 0;
      pointer-events: none;
      transition: opacity .15s ease-out, transform .15s ease-out;
      z-index: 9999;
    }

    [data-tip]::before {
      content: attr(data-tip);
      position: absolute;
      left: 50%;
      bottom: calc(100% + 10px);
      transform: translate(-50%, 4px);
      background: #0a0c12;
      color: #eef0f6;
      border: 1px solid #2a2f3d;
      border-radius: 6px;
      padding: 7px 10px;
      font-size: 11px;
      font-weight: 500;
      line-height: 1.4;
      white-space: normal;
      width: max-content;
      max-width: min(260px, 90vw);
      box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    }

    [data-tip]::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: calc(100% + 4px);
      transform: translate(-50%, 4px);
      border: 6px solid transparent;
      border-top-color: #0a0c12;
    }

    [data-tip]:hover::before,
    [data-tip]:hover::after,
    [data-tip]:focus-visible::before,
    [data-tip]:focus-visible::after {
      opacity: 1;
      transform: translate(-50%, 0);
      transition-delay: .3s;
    }

    /* Lift the host element's stacking context on hover so the tooltip
       pseudo-elements render above sibling elements (stat cards, dashboard
       content). Without this, .btn:hover's `transform: translateY(-1px)`
       creates an isolated stacking context and the next sibling block can
       render OVER the tooltip even though the pseudo has z-index:9999. */
    [data-tip]:hover,
    [data-tip]:focus-visible {
      z-index: 9998;
    }

    /* Positions (top is default from base rule above) */
    [data-tip-pos="bottom"]::before {
      bottom: auto;
      top: calc(100% + 10px);
      transform: translate(-50%, -4px);
    }

    [data-tip-pos="bottom"]::after {
      bottom: auto;
      top: calc(100% + 4px);
      border-top-color: transparent;
      border-bottom-color: #0a0c12;
      transform: translate(-50%, -4px);
    }

    [data-tip-pos="bottom"]:hover::before,
    [data-tip-pos="bottom"]:hover::after {
      transform: translate(-50%, 0);
    }

    [data-tip-pos="right"]::before {
      bottom: auto;
      left: calc(100% + 10px);
      top: 50%;
      transform: translate(-4px, -50%);
    }

    [data-tip-pos="right"]::after {
      bottom: auto;
      left: calc(100% + 4px);
      top: 50%;
      border-top-color: transparent;
      border-right-color: #0a0c12;
      transform: translate(-4px, -50%);
    }

    [data-tip-pos="right"]:hover::before,
    [data-tip-pos="right"]:hover::after {
      transform: translate(0, -50%);
    }

    [data-tip-pos="left"]::before {
      bottom: auto;
      right: calc(100% + 10px);
      left: auto;
      top: 50%;
      transform: translate(4px, -50%);
    }

    [data-tip-pos="left"]::after {
      bottom: auto;
      right: calc(100% + 4px);
      left: auto;
      top: 50%;
      border-top-color: transparent;
      border-left-color: #0a0c12;
      transform: translate(4px, -50%);
    }

    [data-tip-pos="left"]:hover::before,
    [data-tip-pos="left"]:hover::after {
      transform: translate(0, -50%);
    }

    /* Help icon — small ? bubble next to labels */
    .help-dot {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 15px;
      height: 15px;
      border-radius: 50%;
      background: var(--blue);
      color: #06121a;
      font-size: 10px;
      font-weight: 800;
      cursor: help;
      margin-left: 6px;
      border: none;
      box-shadow: 0 0 0 2px rgba(67, 198, 172, 0.18);
      transition: all .15s;
      flex-shrink: 0;
    }

    .help-dot:hover {
      background: #5dd9bf;
      color: #000;
      box-shadow: 0 0 0 3px rgba(67, 198, 172, 0.35);
      transform: scale(1.1);
    }

    /* ── SIGN-IN MODAL ─────────────────────────────────────────────────── */
    .login-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.55);
      backdrop-filter: blur(6px);
      z-index: 10100;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .login-overlay.open {
      display: flex;
    }

    .login-card {
      width: 100%;
      max-width: 380px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 32px 30px 26px;
      box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .login-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-bottom: 6px;
    }

    .login-logo-mark {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: var(--blue);
      display: inline-block;
      box-shadow: 0 0 0 4px rgba(67, 134, 255, 0.18);
      font-size: 0;
    }

    .login-logo-text {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      letter-spacing: 0.02em;
    }

    .login-title {
      font-size: 22px;
      font-weight: 700;
      color: var(--text);
      text-align: center;
      margin: 4px 0 0;
    }

    .login-sub {
      font-size: 13px;
      color: var(--muted);
      text-align: center;
      margin: 0 0 8px;
    }

    .login-error {
      font-size: 12px;
      color: #f87171;
      background: rgba(248, 113, 113, 0.1);
      border: 1px solid rgba(248, 113, 113, 0.3);
      border-radius: 6px;
      padding: 8px 10px;
    }

    .login-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      align-self: flex-start;
      margin-bottom: -4px;
    }

    .login-input {
      width: 100%;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      color: var(--text);
      font-size: 14px;
      font-family: inherit;
      box-sizing: border-box;
      transition: border-color 0.15s;
    }

    .login-input:focus {
      outline: none;
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(67, 134, 255, 0.12);
    }

    .login-btn {
      width: 100%;
      padding: 12px 16px;
      background: var(--blue);
      color: #fff;
      border: 0;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.15s;
      font-family: inherit;
    }

    .login-btn:hover:not(:disabled) {
      background: #5b8df8;
    }

    .login-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .login-cancel {
      background: transparent;
      border: 0;
      color: var(--muted);
      font-size: 12px;
      cursor: pointer;
      padding: 8px 4px;
      margin-top: -2px;
      font-family: inherit;
    }

    .login-cancel:hover {
      color: var(--text);
    }

    /* --- Apple-style polish layer -----------------------------------------
       A visual refinement pass that keeps the current HTML/JS intact while
       making the app feel calmer, denser, and more premium. */
    :root {
      --panel: rgba(255, 255, 255, 0.72);
      --panel-solid: #ffffff;
      --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.055);
      --shadow-float: 0 18px 42px rgba(15, 23, 42, 0.10);
      --ring: 0 0 0 4px rgba(37, 99, 235, 0.12);
      --radius-lg: 8px;
      --radius-md: 8px;
      --radius-sm: 6px;
    }

    html.light {
      --bg: #f5f7fb;
      --surface: rgba(255, 255, 255, 0.78);
      --card: rgba(255, 255, 255, 0.72);
      --panel: rgba(255, 255, 255, 0.86);
      --panel-solid: #ffffff;
      --border: rgba(148, 163, 184, 0.28);
      --border-subtle: rgba(148, 163, 184, 0.18);
      --text: #0f172a;
      --text-2: #475569;
      --muted: #94a3b8;
      --blue: #2563eb;
      --blue-hover: #1d4ed8;
      --blue-dim: rgba(37, 99, 235, 0.09);
      --green: #10b981;
      --green-dim: rgba(16, 185, 129, 0.11);
    }

    body {
      font-family: var(--font-ui);
      background:
        linear-gradient(180deg, #f8fafc 0%, #eef2f9 100%);
      letter-spacing: 0;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }

    .sidebar {
      background: rgba(255, 255, 255, 0.82);
      border-right: 1px solid var(--border-subtle);
      box-shadow: 14px 0 35px rgba(15, 23, 42, 0.035);
      backdrop-filter: blur(22px) saturate(150%);
    }

    .sidebar-logo {
      padding: 22px 18px 20px;
      border-bottom: 1px solid var(--border-subtle);
    }

    /* Reset the inline blue-glow box-shadow Codex was doubling on top of
       and replace with a single, tighter shadow on just the icon tile. */
    .sidebar-logo>div:first-child>div:first-child {
      box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28) !important;
      border-radius: 9px !important;
    }

    .sidebar-logo .logo-text {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: -0.2px;
      line-height: 1.2;
    }

    .sidebar-logo .logo-sub {
      font-size: 10.5px;
      color: var(--muted);
      letter-spacing: 0.01em;
      margin-top: 2px;
    }

    .sidebar-nav {
      padding: 18px 10px;
    }

    .nav-section-label {
      padding: 14px 12px 7px;
      color: #9aa6b8;
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.12em;
    }

    .nav-item {
      margin: 2px 0;
      padding: 9px 11px;
      border-left: 0;
      border-radius: 8px;
      color: #8996aa;
      font-weight: 560;
      transform: none !important;
    }

    .nav-item:hover {
      background: rgba(37, 99, 235, 0.055);
      color: var(--text);
    }

    .nav-item.active {
      background: rgba(37, 99, 235, 0.10);
      color: var(--blue);
      box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
    }

    .nav-item.active::before {
      content: "";
      width: 3px;
      height: 18px;
      border-radius: 999px;
      background: var(--blue);
      position: absolute;
      left: -10px;
    }

    .stage-num {
      width: 19px;
      height: 19px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.7);
      border-color: rgba(148, 163, 184, 0.34);
      font-size: 10px;
      font-weight: 700;
    }

    .nav-item.active .stage-num,
    .nav-item:hover .stage-num {
      background: #fff;
      color: var(--blue);
      border-color: rgba(37, 99, 235, 0.34);
      box-shadow: 0 5px 13px rgba(37, 99, 235, 0.11);
    }

    .sidebar-footer {
      margin: 0 10px 12px;
      padding: 13px 10px;
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.62);
    }

    .topbar {
      height: 64px;
      padding: 10px 22px;
      background: rgba(255, 255, 255, 0.78);
      border-bottom: 1px solid var(--border-subtle);
      backdrop-filter: blur(24px) saturate(165%);
      box-shadow: 0 10px 34px rgba(15, 23, 42, 0.04);
    }

    .main {
      padding-top: 64px;
    }

    .content {
      padding: 44px 28px 56px;
    }

    .url-input,
    .search-input,
    .bulk-input,
    .feature-input,
    select,
    textarea {
      background: rgba(255, 255, 255, 0.76) !important;
      border-color: rgba(148, 163, 184, 0.30) !important;
      border-radius: 8px !important;
      color: var(--text);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
      transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    }

    .url-input {
      height: 38px;
      font-size: 13px;
      background: rgba(255, 255, 255, 0.88) !important;
    }

    .url-input:focus,
    .search-input:focus,
    .bulk-input:focus,
    .feature-input:focus,
    select:focus,
    textarea:focus {
      outline: none;
      border-color: rgba(37, 99, 235, 0.55) !important;
      box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.8);
      background: #fff !important;
    }

    .btn,
    button.btn,
    .login-btn {
      min-height: 36px;
      border-radius: 8px !important;
      font-weight: 700;
      letter-spacing: 0;
      transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    }

    .btn:hover:not(:disabled),
    .login-btn:hover:not(:disabled) {
      transform: translateY(-1px);
    }

    .btn-primary,
    .login-btn {
      background: linear-gradient(180deg, #3978f6 0%, #2364dc 100%) !important;
      color: #fff !important;
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    .btn-primary:hover:not(:disabled),
    .login-btn:hover:not(:disabled) {
      box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    .btn-outline,
    .btn-ghost {
      background: rgba(255, 255, 255, 0.56) !important;
      border: 1px solid rgba(148, 163, 184, 0.25) !important;
      color: #475569 !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
    }

    .btn-outline:hover,
    .btn-ghost:hover {
      background: #fff !important;
      border-color: rgba(37, 99, 235, 0.34) !important;
      color: var(--blue) !important;
    }

    .section.active>div[style*="max-width"] {
      animation: appFadeUp 0.24s ease-out both;
    }

    @keyframes appFadeUp {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .section h1,
    .empty-title,
    .login-title {
      letter-spacing: 0;
      font-weight: 760;
    }

    .section p,
    .empty-sub {
      color: #8693a8 !important;
      line-height: 1.5;
    }

    .feature-card,
    .stat-card,
    .tech-strip,
    .table-wrap,
    .detail-modal,
    .login-card,
    .polish-table,
    .ist-card,
    .ist-scene-card,
    .qc-card {
      background: var(--panel) !important;
      border-color: rgba(148, 163, 184, 0.26) !important;
      box-shadow: var(--shadow-soft);
      backdrop-filter: blur(18px) saturate(145%);
    }

    .feature-card,
    .stat-card,
    .tech-strip,
    .detail-modal,
    .login-card {
      border-radius: var(--radius-lg) !important;
    }

    .feature-card:hover,
    .stat-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-float);
      border-color: rgba(37, 99, 235, 0.28) !important;
    }

    .empty-state {
      min-height: calc(100vh - 190px);
      gap: 14px;
    }

    .empty-icon {
      color: rgba(37, 99, 235, 0.24);
      opacity: 1;
      filter: drop-shadow(0 14px 24px rgba(37, 99, 235, 0.10));
    }

    .empty-title {
      font-size: 20px;
      color: #0f172a;
    }

    .pill {
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.74);
      border-color: rgba(37, 99, 235, 0.22);
      color: var(--blue);
      font-size: 11px;
      font-weight: 650;
    }

    .polish-table {
      overflow: hidden;
      border-collapse: separate !important;
      border-spacing: 0;
    }

    .polish-table thead th {
      background: rgba(248, 250, 252, 0.86) !important;
      color: #64748b !important;
      border-bottom-color: rgba(148, 163, 184, 0.22) !important;
    }

    .polish-table tbody td {
      border-bottom-color: rgba(148, 163, 184, 0.16) !important;
    }

    .polish-table tbody tr:hover {
      background: rgba(37, 99, 235, 0.035) !important;
    }

    .polish-cell-input {
      min-height: 34px;
      background: rgba(255, 255, 255, 0.82) !important;
      border-radius: 8px !important;
    }

    .cull-row,
    .ist-queue-row,
    .push-row {
      border-color: rgba(148, 163, 184, 0.18) !important;
    }

    .login-overlay {
      background: rgba(15, 23, 42, 0.42);
      backdrop-filter: blur(18px) saturate(120%);
    }

    .login-card {
      max-width: 400px;
      padding: 34px 32px 28px;
      box-shadow: 0 34px 90px rgba(15, 23, 42, 0.22);
    }

    .login-input {
      height: 44px;
      background: rgba(248, 250, 252, 0.9) !important;
    }

    div[style*="border:1px dashed var(--border)"] {
      background: rgba(255, 255, 255, 0.52) !important;
      border-color: rgba(148, 163, 184, 0.25) !important;
      border-radius: 8px !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
    }

    div[style*="background:var(--card);border:1px solid var(--border)"] {
      background: var(--panel) !important;
      border-color: rgba(148, 163, 184, 0.26) !important;
      box-shadow: var(--shadow-soft);
      backdrop-filter: blur(18px) saturate(145%);
    }

    @media (max-width: 768px) {
      .topbar {
        left: 0;
        height: auto;
        min-height: 104px;
        padding: 8px 12px 10px;
        display: grid;
        grid-template-columns: 1fr 96px 44px;
        align-items: center;
        gap: 7px;
      }

      .topbar>div:first-child {
        grid-column: 1 / -1;
        width: 100%;
      }

      .topbar .url-input {
        width: 100%;
      }

      .topbar .btn {
        justify-content: center;
        padding: 8px 12px !important;
      }

      .main {
        margin-left: 0;
        padding-top: 112px;
        padding-bottom: 76px;
      }

      .content {
        padding: 20px 14px 32px;
      }

      .sidebar {
        display: flex !important;
        width: auto;
        height: 66px;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        border-right: 0;
        border-top: 1px solid var(--border-subtle);
        z-index: 120;
      }

      .sidebar-logo,
      .sidebar-footer,
      .nav-section-label,
      .nav-badge,
      .nav-item[data-section="manage"]~.nav-item {
        display: none !important;
      }

      .sidebar-nav {
        width: 100%;
        padding: 8px 10px;
        display: grid;
        grid-template-columns: repeat(6, minmax(48px, 1fr));
        gap: 4px;
        overflow: hidden;
      }

      .nav-item {
        min-width: 0;
        height: 50px;
        margin: 0;
        padding: 5px 4px;
        justify-content: center;
        flex-direction: column;
        gap: 2px;
        border-radius: 14px;
        font-size: 10px;
      }

      .nav-item span:not(.stage-num) {
        display: block !important;
        font-size: 9px;
        max-width: 58px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .nav-item img {
        width: 15px;
        height: 15px;
      }

      .stage-num {
        position: absolute;
        top: 4px;
        left: 8px;
        width: 14px;
        height: 14px;
        font-size: 8px;
      }

      .nav-item.active::before {
        display: none;
      }

      .section h1 {
        font-size: 21px !important;
      }

      .empty-state {
        min-height: calc(100vh - 240px);
      }

      div[style*="max-width:1400px"],
      div[style*="max-width:1200px"],
      div[style*="max-width:1100px"] {
        padding-left: 14px !important;
        padding-right: 14px !important;
      }
    }

    /* ── IMAGE STUDIO — REDESIGN v2 ───────────────────────────────────── */
    /* Whole tab caps at ~1500px and centers itself so a 27" 5K display
       doesn't blow the layout into half-empty whitespace.
       Bottom padding leaves room for the sticky status bar. */
    #section-image-studio {
      max-width: 1500px;
      margin: 0 auto;
      padding-bottom: 80px;
    }

    .ist-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      margin-bottom: 14px;
    }

    /* Header row: title block + mode tabs + settings pill */
    .ist-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 18px;
      padding: 18px 0 14px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 18px;
      flex-wrap: wrap;
    }

    .ist-top-title h1 {
      font-size: 22px;
      font-weight: 700;
      color: var(--text);
      margin: 0 0 4px;
    }

    .ist-top-sub {
      font-size: 12px;
      color: var(--muted);
      margin: 0;
      max-width: 540px;
      line-height: 1.45;
    }

    .ist-top-controls {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
    }

    /* ─── Cull list rows ───────────────────────────────────────────────── */
    .cull-row {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background 0.12s;
    }

    .cull-row:last-child {
      border-bottom: 0;
    }

    .cull-row:hover {
      background: rgba(67, 198, 172, 0.04);
    }

    .cull-row.selected {
      background: rgba(67, 198, 172, 0.08);
    }

    .cull-row input[type="checkbox"] {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      cursor: pointer;
      accent-color: var(--blue);
    }

    .cull-row img.cull-thumb {
      width: 56px;
      height: 56px;
      flex-shrink: 0;
      object-fit: cover;
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid var(--border);
    }

    .cull-row-body {
      flex: 1 1 auto;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .cull-row-title {
      font-size: 13px;
      color: var(--text);
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .cull-row-meta {
      font-size: 11px;
      color: var(--muted);
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }

    .cull-row-price {
      font-variant-numeric: tabular-nums;
      font-size: 13px;
      color: var(--text);
      font-weight: 600;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .cull-row-source {
      font-size: 12px;
      color: var(--muted);
      flex-shrink: 0;
    }

    /* Light theme — invert backgrounds */
    html.light .cull-row:hover {
      background: rgba(67, 198, 172, 0.07);
    }

    html.light .cull-row.selected {
      background: rgba(67, 198, 172, 0.12);
    }

    /* Pipeline queue panel — products that have been culled INTO Image Studio
       waiting for image generation. Click a row to load it into the studio. */
    .ist-queue-panel {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 18px;
      overflow: hidden;
    }

    .ist-queue-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      background: rgba(67, 198, 172, 0.05);
    }

    .ist-queue-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 700;
      color: var(--text);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .ist-queue-count {
      background: var(--blue);
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 7px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
    }

    .ist-queue-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 8px;
      padding: 10px 14px;
      max-height: 240px;
      overflow-y: auto;
    }

    .ist-queue-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      cursor: pointer;
      transition: border-color 0.15s, transform 0.18s, background 0.15s;
      text-align: left;
    }

    .ist-queue-item:hover {
      border-color: var(--blue);
      transform: translateY(-1px);
      background: var(--blue-dim);
    }

    .ist-queue-item img {
      width: 38px;
      height: 38px;
      border-radius: 6px;
      object-fit: cover;
      flex-shrink: 0;
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid var(--border);
    }

    .ist-queue-item-title {
      flex: 1 1 auto;
      font-size: 12px;
      color: var(--text);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ist-queue-item-meta {
      font-size: 10px;
      color: var(--muted);
    }

    .ist-queue-empty {
      padding: 24px 14px;
      text-align: center;
      color: var(--muted);
      font-size: 12px;
    }

    /* Mode tabs — pill segmented control */
    .ist-mode-tabs {
      display: inline-flex;
      padding: 3px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      gap: 2px;
    }

    .ist-mode-tab {
      background: transparent;
      border: 0;
      padding: 7px 14px;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      cursor: pointer;
      border-radius: 7px;
      transition: all 0.15s;
      font-family: inherit;
    }

    .ist-mode-tab:hover:not(.active) {
      background: var(--surface);
      color: var(--text);
    }

    .ist-mode-tab.active {
      background: var(--blue);
      color: #fff;
    }

    /* Settings pill */
    .ist-settings-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 12px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      cursor: pointer;
      font-size: 11px;
      color: var(--text);
      font-family: inherit;
      transition: border-color 0.15s;
    }

    .ist-settings-pill:hover {
      border-color: var(--blue);
    }

    .ist-settings-pill.open {
      border-color: var(--blue);
      background: rgba(67, 134, 255, 0.06);
    }

    .ist-pill-chev {
      font-size: 9px;
      color: var(--muted);
      transition: transform 0.2s;
    }

    .ist-settings-pill.open .ist-pill-chev {
      transform: rotate(180deg);
    }

    /* Settings drawer — slides down below the header */
    .ist-drawer {
      display: none;
      padding: 16px 18px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 14px;
    }

    .ist-drawer.open {
      display: block;
    }

    .ist-drawer-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 16px;
      margin-bottom: 14px;
    }

    .ist-drawer-h {
      font-size: 11px;
      font-weight: 600;
      color: var(--text);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 8px;
    }

    .ist-drawer-section {
      padding-top: 12px;
      border-top: 1px solid var(--border);
      margin-top: 4px;
    }

    .ist-drawer-footer {
      display: flex;
      justify-content: space-between;
      padding-top: 12px;
      margin-top: 12px;
      border-top: 1px solid var(--border);
    }

    /* Source strip — slim card, two states (empty / filled) */
    /* ─── Image Studio: source card ──────────────────────────────────
       This is the ONLY source-card style in the system. The mockup look
       (big thumbnail, title, meta pills, action buttons) lives directly
       on these legacy classes — no parallel .ist-v2-source layer. The
       outer .ist-source-strip just holds the empty + filled child cards;
       both child cards have their own background + border + padding. */
    .ist-source-strip {
      background: transparent;
      border: none;
      border-radius: 0;
      padding: 0;
      max-width: 1480px;
      margin: 0 auto 16px;
      box-shadow: none;
      transition: none;
    }
    .ist-source-strip.over .ist-source-empty,
    .ist-source-strip.over .ist-source-filled {
      border-color: #7950d4;
      background: rgba(121,80,212,0.04);
    }

    /* Empty state — slim dashed card with "Pick a product to start" */
    .ist-source-empty {
      display: flex;
      align-items: center;
      gap: 18px;
      padding: 18px 22px;
      background: #ffffff;
      border: 1px dashed #d6d9e0;
      border-radius: 16px;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
      min-height: 96px;
      transition: border-color 0.15s;
    }
    .ist-source-empty-icon {
      width: 56px;
      height: 56px;
      flex-shrink: 0;
      border-radius: 12px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #9ca3af;
      font-size: 22px;
      font-weight: 300;
      border: 1.5px dashed #d6d9e0;
    }
    .ist-source-empty-content {
      flex: 1;
      min-width: 0;
    }
    .ist-source-empty-title {
      font-size: 15px;
      font-weight: 700;
      color: #1f2433;
      margin-bottom: 4px;
      letter-spacing: -0.2px;
    }
    .ist-source-empty-sub {
      font-size: 12px;
      color: #6b7280;
      line-height: 1.4;
    }
    .ist-source-empty-actions {
      display: flex;
      gap: 10px;
      flex-shrink: 0;
    }

    /* Filled state — full mockup card */
    .ist-source-filled {
      display: flex;
      align-items: center;
      gap: 20px;
      padding: 18px 22px;
      background: #ffffff;
      border: 1px solid #e6e8ee;
      border-radius: 14px;
      box-shadow: 0 1px 2px rgba(15,20,35,0.04);
      min-height: 112px;
      transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    }
    .ist-source-filled:hover {
      border-color: #d9deea;
      box-shadow: 0 10px 28px rgba(15,20,35,0.06);
    }
    .ist-source-thumb {
      width: 96px;
      height: 96px;
      flex-shrink: 0;
      box-sizing: border-box;
      padding: 8px;
      border-radius: 16px;
      overflow: hidden;
      background: linear-gradient(180deg, #f7f8fb 0%, #eef2f7 100%);
      border: 1px solid #e1e6ef;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 8px 20px rgba(15, 23, 42, 0.05);
      cursor: zoom-in;
    }
    .ist-source-thumb img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      border-radius: 11px;
      background: #ffffff;
    }
    .ist-source-info {
      flex: 1;
      min-width: 0;
    }
    .ist-source-name {
      font-size: 19px;
      font-weight: 700;
      color: #1f2433;
      margin-bottom: 8px;
      line-height: 1.25;
      letter-spacing: -0.4px;
      /* clamp to 2 lines so long titles don't blow up the row */
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    /* The .ist-source-desc div renders the meta rows (domain + pills).
       Each row is a flex line with gap. */
    .ist-source-desc {
      font-size: 13px;
      color: #6b7280;
      line-height: 1.4;
      max-height: none;
      overflow: visible;
      text-overflow: clip;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .ist-source-meta-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .ist-source-meta-row:empty { display: none; }
    .ist-source-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 11px;
      background: #f3f4f7;
      border-radius: 9px;
      font-size: 12px;
      font-weight: 600;
      color: #4a5160;
    }
    .ist-source-pill.shopify {
      background: rgba(149,191,71,0.12);
      color: #5e8d2e;
    }
    .ist-source-pill.purple {
      background: rgba(121,80,212,0.10);
      color: #7950d4;
    }
    /* Linked/unlinked status — kept for legacy hooks; visually hidden in
       the v2 card since the pills already convey "linked product" via
       the domain + shopify badges. */
    .ist-source-status {
      display: none;
    }
    .ist-source-actions {
      display: flex;
      gap: 10px;
      flex-shrink: 0;
      align-items: center;
      margin-left: auto;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    /* Buttons inside the source card — Change product / Upload product image */
    .ist-source-actions .btn,
    .ist-source-empty-actions .btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 42px;
      padding: 0 18px !important;
      border-radius: 11px !important;
      font-size: 13px !important;
      font-weight: 700 !important;
      cursor: pointer;
      transition: all 0.15s;
      line-height: 1 !important;
      box-shadow: none !important;
    }
    .ist-source-actions .ist-source-clear-btn {
      width: 42px;
      padding-left: 0 !important;
      padding-right: 0 !important;
      justify-content: center;
    }
    .ist-source-actions .btn-outline,
    .ist-source-empty-actions .btn-primary {
      background: rgba(74,159,232,0.04) !important;
      border: 1.5px solid #4a9fe8 !important;
      color: #4a9fe8 !important;
    }
    .ist-source-actions .btn-outline:hover,
    .ist-source-empty-actions .btn-primary:hover {
      background: #4a9fe8 !important;
      color: #ffffff !important;
    }
    .ist-source-empty-actions .btn-outline,
    .ist-source-actions .btn-ghost {
      background: #ffffff !important;
      border: 1px solid #e6e8ee !important;
      color: #4a5160 !important;
    }
    .ist-source-empty-actions .btn-outline:hover,
    .ist-source-actions .btn-ghost:hover {
      background: #f3f4f7 !important;
      border-color: #c4c9d4 !important;
      color: #1f2433 !important;
    }

    /* Product meta collapsible card */
    .ist-meta-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 14px 16px;
      margin-bottom: 14px;
    }

    .ist-meta-card[open]>summary {
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 12px;
    }

    .ist-meta-summary {
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      list-style: none;
      font-size: 12px;
      color: var(--text);
    }

    .ist-meta-summary::-webkit-details-marker {
      display: none;
    }

    .ist-meta-chev {
      font-size: 10px;
      color: var(--muted);
      transition: transform 0.2s;
    }

    details[open]>summary>.ist-meta-chev {
      transform: rotate(180deg);
    }

    .ist-meta-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    /* Primary action row — cost on left, big button on right */
    .ist-action-row {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px 18px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 14px;
    }

    .ist-action-cost {
      flex: 1;
      min-width: 200px;
    }

    .ist-action-cost-line {
      font-size: 13px;
      color: var(--text);
      font-weight: 500;
    }

    .ist-action-btn {
      padding: 12px 28px;
      border-radius: 10px;
      border: 0;
      background: var(--blue);
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      min-width: 220px;
      transition: background 0.15s, opacity 0.15s;
      font-family: inherit;
    }

    .ist-action-btn:hover:not(:disabled) {
      background: #5b8df8;
    }

    .ist-action-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    .ist-action-btn.busy {
      opacity: 0.85;
      cursor: progress;
    }

    /* Slim thinking feed — only visible during brief, drops to status afterward */
    .ist-thinking-feed {
      padding: 12px 16px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 14px;
    }

    .ist-thinking-h {
      font-size: 11px;
      font-weight: 600;
      color: var(--text);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 8px;
    }

    .ist-thinking-step {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 4px 0;
      font-size: 12px;
      color: var(--text);
      opacity: 0;
      transform: translateY(4px);
      transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .ist-thinking-step.show {
      opacity: 1;
      transform: translateY(0);
    }

    .ist-thinking-step.done {
      color: var(--muted);
    }

    .ist-thinking-step .ist-step-icon {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
    }

    .ist-thinking-step.active .ist-step-icon::before {
      content: '';
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--blue);
      box-shadow: 0 0 0 0 rgba(67, 134, 255, 0.7);
      animation: ist-pulse 1.4s ease-out infinite;
    }

    .ist-thinking-step.done .ist-step-icon::before {
      content: url("https://api.iconify.design/lucide/check.svg");
      color: var(--green, #43c6ac);
    }

    @keyframes ist-pulse {
      0% {
        box-shadow: 0 0 0 0 rgba(67, 134, 255, 0.6);
      }

      70% {
        box-shadow: 0 0 0 8px rgba(67, 134, 255, 0);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(67, 134, 255, 0);
      }
    }

    /* Gallery wrap */
    .ist-gallery-wrap {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      margin-bottom: 14px;
    }

    .ist-gallery-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 14px;
      gap: 12px;
      flex-wrap: wrap;
    }

    .ist-gallery-h-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
    }

    /* Variant pills above each card's prompt textarea */
    .ist-card-variants {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-bottom: 6px;
    }

    .ist-variant-pill {
      font-size: 10px;
      padding: 3px 9px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
      color: var(--muted);
      cursor: pointer;
      font-family: inherit;
      transition: all 0.15s;
    }

    .ist-variant-pill:hover {
      color: var(--text);
      border-color: var(--blue);
    }

    .ist-variant-pill.active {
      background: var(--blue);
      color: #fff;
      border-color: var(--blue);
      font-weight: 600;
    }

    .ist-variant-label {
      font-size: 10px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      font-weight: 600;
      margin-bottom: 4px;
    }

    /* Custom note expander */
    .ist-custom-note {
      margin-top: 4px;
    }

    .ist-custom-note-summary {
      cursor: pointer;
      list-style: none;
      font-size: 10px;
      color: var(--blue);
      padding: 2px 0;
    }

    .ist-custom-note-summary::-webkit-details-marker {
      display: none;
    }

    .ist-custom-note textarea {
      width: 100%;
      min-height: 36px;
      max-height: 90px;
      padding: 6px 8px;
      font-size: 10px;
      border: 1px solid var(--border);
      border-radius: 4px;
      background: var(--surface);
      color: var(--text);
      font-family: inherit;
      line-height: 1.4;
      box-sizing: border-box;
      resize: vertical;
      margin-top: 4px;
    }

    .ist-signature-expand {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 14px;
      margin-bottom: 14px;
    }

    .ist-signature-expand[open]>summary {
      padding-bottom: 6px;
      border-bottom: 1px solid var(--border);
    }

    .ist-signature-expand>summary {
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      list-style: none;
      font-size: 12px;
      color: var(--text);
      font-weight: 600;
    }

    .ist-signature-expand>summary::-webkit-details-marker {
      display: none;
    }

    /* Sticky bottom status bar — always visible, anchored to viewport bottom */
    .ist-status-bar {
      position: sticky;
      bottom: 0;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.06);
      flex-wrap: wrap;
      backdrop-filter: blur(8px);
      z-index: 10;
    }

    .ist-status-left {
      font-size: 12px;
      color: var(--muted);
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .ist-status-left strong,
    .ist-status-left .ist-strong {
      color: var(--text);
      font-weight: 600;
    }

    .ist-status-sep {
      opacity: 0.5;
    }

    .ist-status-right {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    details.ist-card[open]>summary {
      margin-bottom: 14px;
    }

    details.ist-card>summary {
      cursor: pointer;
      list-style: none;
    }

    details.ist-card>summary::-webkit-details-marker {
      display: none;
    }

    .ist-card-h {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .ist-label {
      display: block;
      font-size: 11px;
      font-weight: 500;
      color: var(--muted);
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .ist-req {
      color: #f87171;
    }

    .ist-hint {
      font-size: 11px;
      color: var(--muted);
      font-weight: normal;
      text-transform: none;
      letter-spacing: 0;
    }

    .ist-input {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      color: var(--text);
      font-size: 13px;
      font-family: inherit;
      box-sizing: border-box;
    }

    .ist-input:focus {
      outline: none;
      border-color: var(--blue);
    }

    textarea.ist-input {
      resize: vertical;
      min-height: 60px;
    }

    /* Size picker — three tiles instead of a buried dropdown. */
    .ist-size-picker {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    .ist-size-opt {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      padding: 10px 4px;
      border: 1.5px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      cursor: pointer;
      transition: all 0.15s;
    }

    .ist-size-opt:hover {
      border-color: var(--blue);
      background: rgba(67, 134, 255, 0.06);
    }

    /* Active state matches .pq-mode-opt.is-active in the Provider toggle:
       solid blue fill + white text. Needs !important to win over the
       light-theme override at line ~6510 which forces a white background
       on every .ist-size-opt regardless of state. */
    .ist-size-opt.selected {
      border-color: var(--blue) !important;
      background: var(--blue) !important;
      box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08) !important;
    }
    .ist-size-opt.selected .ist-size-label,
    .ist-size-opt.selected .ist-size-sub {
      color: #fff !important;
    }
    .ist-size-opt.selected .ist-size-sub {
      opacity: 0.85;
    }
    .ist-size-opt.selected:hover {
      background: var(--blue) !important;
      border-color: var(--blue) !important;
    }

    .ist-size-opt input[type="radio"] {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .ist-size-label {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
    }

    .ist-size-sub {
      font-size: 10px;
      color: var(--muted);
    }

    .ist-checkbox-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px 12px;
      max-height: 280px;
      overflow-y: auto;
      padding: 4px;
    }

    .ist-checkbox-row {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 7px 10px;
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.1s;
    }

    .ist-checkbox-row:hover {
      background: var(--surface);
    }

    .ist-checkbox-row input[type="checkbox"] {
      margin: 0;
      flex-shrink: 0;
      cursor: pointer;
    }

    .ist-cb-label {
      font-size: 12px;
      font-weight: 500;
      color: var(--text);
      line-height: 1.3;
      flex: 1;
      min-width: 0;
    }

    .ist-brief-status {
      margin-top: 10px;
      font-size: 12px;
      color: var(--muted);
    }

    .ist-brief-status.error {
      color: #f87171;
    }

    .ist-brief-status.success {
      color: var(--green, #43c6ac);
    }

    /* Live thinking feed shown while the brief request is in flight. */
    .ist-thinking-feed {
      margin-top: 14px;
      padding: 12px 14px;
      background: linear-gradient(135deg, rgba(67, 134, 255, 0.06), rgba(67, 134, 255, 0.02));
      border: 1px solid rgba(67, 134, 255, 0.18);
      border-radius: 10px;
    }

    .ist-thinking-h {
      font-size: 11px;
      font-weight: 600;
      color: var(--blue);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 8px;
    }

    .ist-thinking-step {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 4px 0;
      font-size: 12px;
      color: var(--text);
      opacity: 0;
      transform: translateY(4px);
      transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .ist-thinking-step.show {
      opacity: 1;
      transform: translateY(0);
    }

    .ist-thinking-step.done {
      color: var(--muted);
    }

    .ist-thinking-step .ist-step-icon {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
    }

    .ist-thinking-step.active .ist-step-icon::before {
      content: '';
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--blue);
      box-shadow: 0 0 0 0 rgba(67, 134, 255, 0.7);
      animation: ist-pulse 1.4s ease-out infinite;
    }

    .ist-thinking-step.done .ist-step-icon::before {
      content: url("https://api.iconify.design/lucide/check.svg");
      color: var(--green, #43c6ac);
    }

    @keyframes ist-pulse {
      0% {
        box-shadow: 0 0 0 0 rgba(67, 134, 255, 0.6);
      }

      70% {
        box-shadow: 0 0 0 8px rgba(67, 134, 255, 0);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(67, 134, 255, 0);
      }
    }

    .ist-signature {
      padding: 0;
    }

    .ist-signature-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px 18px;
    }

    .ist-sig-item {
      font-size: 12px;
      line-height: 1.5;
      padding: 7px 10px;
      border-radius: 6px;
      transition: background 0.15s;
    }

    .ist-sig-item.primary {
      background: rgba(67, 198, 172, 0.04);
      border: 1px solid rgba(67, 198, 172, 0.18);
    }

    .ist-sig-item.detected:hover {
      background: rgba(67, 198, 172, 0.07);
    }

    .ist-sig-item.missing {
      background: rgba(228, 248, 160, 0.04);
      border: 1px dashed rgba(228, 248, 160, 0.25);
    }

    .ist-sig-item-k {
      font-weight: 700;
      color: var(--green, #43c6ac);
      display: block;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 2px;
    }

    .ist-sig-item.missing .ist-sig-item-k {
      color: var(--amber, #e4f8a0);
    }

    .ist-sig-item-v {
      color: var(--text);
      opacity: 0.92;
      cursor: pointer;
      display: block;
    }

    .ist-sig-item-v:hover {
      opacity: 1;
      text-decoration: underline;
      text-decoration-color: rgba(67, 198, 172, 0.3);
      text-underline-offset: 3px;
    }

    .ist-sig-empty {
      font-style: italic;
    }

    /* auto-fit so cards stay at a sensible ~260-300px wide regardless of
       viewport. On 1100-1500px viewports you get 3-4 columns; on 27" 5K
       you get all 6 in one row at a comfortable size. */
    .ist-source-link {
      padding: 10px 14px;
      border-radius: 8px;
      font-size: 12px;
      color: var(--text);
      margin-bottom: 14px;
      line-height: 1.5;
    }

    .ist-source-link.linked {
      background: rgba(67, 134, 255, 0.08);
      border: 1px solid rgba(67, 134, 255, 0.25);
    }

    .ist-source-link.linked strong {
      color: var(--blue);
    }

    .ist-source-link.unlinked {
      background: rgba(245, 158, 11, 0.08);
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .ist-source-link.unlinked strong {
      color: var(--amber, #f59e0b);
    }

    /* Bulk progress modal — one row per product, status + progress bar. */
    .ist-bulk-modal-body {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .ist-bulk-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 4px 0 10px;
      font-size: 12px;
      color: var(--muted);
      border-bottom: 1px solid var(--border);
    }

    .ist-bulk-row {
      display: flex;
      gap: 12px;
      align-items: center;
      padding: 10px 12px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      transition: border-color 0.2s, background 0.2s;
    }

    .ist-bulk-row.done {
      border-color: rgba(67, 198, 172, 0.4);
      background: rgba(67, 198, 172, 0.05);
    }

    .ist-bulk-row.partial {
      border-color: rgba(245, 158, 11, 0.4);
      background: rgba(245, 158, 11, 0.05);
    }

    .ist-bulk-row.failed {
      border-color: rgba(248, 113, 113, 0.4);
      background: rgba(248, 113, 113, 0.05);
    }

    .ist-bulk-row img {
      width: 44px;
      height: 44px;
      object-fit: cover;
      border-radius: 6px;
      flex-shrink: 0;
    }

    .ist-bulk-row-thumb {
      width: 44px;
      height: 44px;
      border-radius: 6px;
      background: var(--surface);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }

    .ist-bulk-row-body {
      flex: 1;
      min-width: 0;
    }

    .ist-bulk-row-title {
      font-size: 12px;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 4px;
    }

    .ist-bulk-row-status {
      font-size: 11px;
      color: var(--muted);
      margin-bottom: 4px;
    }

    .ist-bulk-row-progress {
      height: 4px;
      background: var(--surface);
      border-radius: 2px;
      overflow: hidden;
    }

    .ist-bulk-row-progress-bar {
      height: 100%;
      background: var(--blue);
      width: 0;
      transition: width 0.3s ease-out;
    }

    .ist-bulk-row.done .ist-bulk-row-progress-bar {
      background: var(--green, #43c6ac);
    }

    .ist-bulk-row.partial .ist-bulk-row-progress-bar {
      background: var(--amber, #f59e0b);
    }

    .ist-bulk-row.failed .ist-bulk-row-progress-bar {
      background: #f87171;
    }

    .ist-bulk-row-icon {
      font-size: 18px;
      flex-shrink: 0;
      min-width: 22px;
      text-align: center;
    }

    .ist-bulk-summary {
      padding: 12px 14px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-top: 8px;
      font-size: 12px;
    }

    .ist-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 14px;
    }

    @media (max-width: 700px) {
      .ist-grid {
        grid-template-columns: 1fr;
      }

      .ist-source-row {
        grid-template-columns: 1fr;
      }

      .ist-settings-grid {
        grid-template-columns: 1fr;
      }
    }

    .ist-scene-card {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 0;
      overflow: hidden;
      transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
      display: flex;
      flex-direction: column;
    }

    .ist-scene-card.approved {
      border-color: var(--green, #43c6ac);
      box-shadow: 0 0 0 2px rgba(67, 198, 172, 0.3);
    }

    .ist-scene-card.skipped {
      opacity: 0.5;
    }

    .ist-scene-card.failed {
      border-color: #f87171;
    }

    /* Image area — dark cinematic placeholder when empty/generating. */
    .ist-scene-img-wrap {
      aspect-ratio: 4 / 5;
      background: radial-gradient(ellipse at center, #1a1816 0%, #0c0a09 75%);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      position: relative;
    }

    .ist-scene-img-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      cursor: zoom-in;
    }

    .ist-scene-status {
      font-size: 11px;
      color: rgba(255, 255, 255, 0.55);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 14px;
      padding: 20px;
      text-align: center;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      font-weight: 500;
    }

    .ist-scene-status.gen {
      color: rgba(255, 140, 90, 0.85);
    }

    .ist-scene-status.empty {
      color: rgba(255, 255, 255, 0.35);
      text-transform: none;
      letter-spacing: 0;
      font-size: 11px;
      font-weight: normal;
    }

    /* Glowing ring spinner — bigger, warmer than the inline blue one. */
    .ist-glow-spinner {
      width: 56px;
      height: 56px;
      position: relative;
    }

    .ist-glow-spinner::before,
    .ist-glow-spinner::after {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 2px solid transparent;
    }

    .ist-glow-spinner::before {
      border-top-color: rgba(255, 120, 80, 0.95);
      border-right-color: rgba(255, 120, 80, 0.4);
      animation: ist-spin 1.2s linear infinite;
      box-shadow: 0 0 22px 2px rgba(255, 120, 80, 0.45);
    }

    .ist-glow-spinner::after {
      border: 1px solid rgba(255, 120, 80, 0.18);
    }

    @keyframes ist-spin {
      to {
        transform: rotate(360deg);
      }
    }

    /* Smaller inline spinner for the brief status row. */
    .ist-spinner {
      width: 22px;
      height: 22px;
      border: 2px solid var(--border);
      border-top-color: var(--blue);
      border-radius: 50%;
      animation: ist-spin 0.7s linear infinite;
    }

    .ist-scene-body {
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex: 1;
    }

    .ist-scene-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--text);
      opacity: 0.85;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
    }

    .ist-scene-meta {
      font-size: 10px;
      color: var(--muted);
      font-weight: 400;
      text-transform: none;
      letter-spacing: 0;
    }

    /* Tiny aspect-ratio picker on each scene card. */
    .ist-ar-select {
      font-size: 10px;
      padding: 2px 4px 2px 6px;
      border-radius: 5px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      cursor: pointer;
      font-family: inherit;
      appearance: none;
      -webkit-appearance: none;
      padding-right: 18px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23666'%3E%3Cpath d='M3 4l3 3 3-3'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 4px center;
      background-size: 9px;
    }

    .ist-ar-select:hover {
      border-color: var(--blue);
    }

    .ist-ar-select:focus {
      outline: none;
      border-color: var(--blue);
    }

    .ist-ar-select:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* Per-card prompt textarea — appears once brief returns; editable. */
    .ist-card-prompt {
      width: 100%;
      min-height: 70px;
      max-height: 140px;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--surface);
      color: var(--text);
      font-size: 11px;
      font-family: inherit;
      line-height: 1.45;
      box-sizing: border-box;
      resize: vertical;
    }

    .ist-card-prompt:focus {
      outline: none;
      border-color: var(--blue);
    }

    .ist-card-prompt[disabled] {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .ist-card-prompt-skel {
      height: 70px;
      border-radius: 6px;
      background: linear-gradient(110deg, var(--surface) 30%, var(--bg) 50%, var(--surface) 70%);
      background-size: 200% 100%;
      animation: ist-shimmer 1.4s linear infinite;
    }

    @keyframes ist-shimmer {
      to {
        background-position: -200% 0;
      }
    }

    .ist-scene-actions {
      display: flex;
      gap: 6px;
      margin-top: auto;
    }

    .ist-scene-actions button {
      flex: 1;
      padding: 6px 8px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      transition: all 0.15s;
    }

    .ist-scene-actions button:hover:not(:disabled) {
      background: var(--border);
    }

    .ist-scene-actions button.primary {
      background: rgba(67, 134, 255, 0.15);
      border-color: rgba(67, 134, 255, 0.4);
      color: var(--blue);
    }

    .ist-scene-actions button.approve {
      background: rgba(67, 198, 172, 0.15);
      border-color: rgba(67, 198, 172, 0.4);
      color: var(--green, #43c6ac);
    }

    .ist-scene-actions button.approve.active {
      background: var(--green, #43c6ac);
      color: #001;
      border-color: var(--green, #43c6ac);
    }

    .ist-scene-actions button:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .ist-scene-error {
      font-size: 11px;
      color: #f87171;
      padding: 6px 8px;
      background: rgba(248, 113, 113, 0.1);
      border-radius: 4px;
      line-height: 1.4;
    }

    /* Tiny ribbon at top of hero card showing the locked reference, plus the
       per-card '+ Reference' button on non-hero cards. */
    .ist-ref-ribbon {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      background: rgba(67, 134, 255, 0.1);
      border-bottom: 1px solid rgba(67, 134, 255, 0.18);
      font-size: 10px;
      color: var(--blue);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 600;
    }

    .ist-ref-ribbon img {
      width: 26px;
      height: 26px;
      border-radius: 4px;
      object-fit: cover;
      flex-shrink: 0;
      cursor: zoom-in;
    }

    .ist-ref-ribbon-text {
      flex: 1;
      min-width: 0;
      line-height: 1.25;
    }

    .ist-ref-ribbon-text .sub {
      display: block;
      color: var(--muted);
      font-weight: 400;
      text-transform: none;
      letter-spacing: 0;
      font-size: 10px;
      opacity: 0.85;
    }

    .ist-ref-ribbon button {
      font-size: 10px;
      padding: 3px 8px;
      border-radius: 5px;
      border: 1px solid rgba(67, 134, 255, 0.3);
      background: transparent;
      color: var(--blue);
      cursor: pointer;
    }

    .ist-ref-ribbon button:hover:not(:disabled) {
      background: rgba(67, 134, 255, 0.15);
    }

    .ist-ref-ribbon.user-ref {
      background: rgba(67, 198, 172, 0.1);
      border-bottom-color: rgba(67, 198, 172, 0.18);
      color: var(--green, #43c6ac);
    }

    .ist-ref-ribbon.user-ref button {
      border-color: rgba(67, 198, 172, 0.3);
      color: var(--green, #43c6ac);
    }

    .ist-ref-ribbon.user-ref button:hover:not(:disabled) {
      background: rgba(67, 198, 172, 0.15);
    }

    .ist-add-ref-btn {
      width: 100%;
      padding: 6px;
      border-radius: 6px;
      border: 1px dashed var(--border);
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font-size: 11px;
      transition: all 0.15s;
    }

    .ist-add-ref-btn:hover:not(:disabled) {
      border-color: var(--blue);
      color: var(--blue);
      border-style: solid;
    }

    .ist-add-ref-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    /* --- Product design-system refinement ---------------------------------
       CSS-only pass: no workflow functions changed. This layer makes the app
       feel quieter and more deliberate by enforcing one visual language for
       controls, surfaces, tables, selections, and mobile navigation. */
    :root {
      --ui-bg-top: #f9fbff;
      --ui-bg-bottom: #eef3f9;
      --ui-surface: rgba(255, 255, 255, 0.88);
      --ui-surface-strong: #ffffff;
      --ui-surface-muted: rgba(248, 250, 252, 0.88);
      --ui-line: rgba(148, 163, 184, 0.24);
      --ui-line-strong: rgba(100, 116, 139, 0.30);
      --ui-text: #0f172a;
      --ui-text-soft: #475569;
      --ui-muted: #8a97aa;
      --ui-blue: #2563eb;
      --ui-blue-hover: #1d4ed8;
      --ui-blue-soft: rgba(37, 99, 235, 0.075);
      --ui-green: #10b981;
      --ui-green-soft: rgba(16, 185, 129, 0.10);
      --ui-amber: #d97706;
      --ui-amber-soft: rgba(217, 119, 6, 0.10);
      --ui-red: #dc2626;
      --ui-red-soft: rgba(220, 38, 38, 0.09);
      --ui-radius: 8px;
      --ui-radius-sm: 6px;
      --ui-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.055);
      --ui-shadow-2: 0 16px 36px rgba(15, 23, 42, 0.10);
      --ui-focus: 0 0 0 4px rgba(37, 99, 235, 0.13);
    }

    /* Dark theme — the toggle adds .light to <html>; the absence of .light
       (default if user explicitly chose dark) needs darker --ui-* values
       so the modern UI surfaces (command panel, stat strip, edit modals,
       toolbar, etc.) flip from white to slate-black. Without this, the
       older :root dark vars (--bg/--surface/--card) flip but the newer
       --ui-* palette stays light, leaving the page half-dark with white
       cards floating on a dark background — exactly the "dark mode looks
       broken" symptom. */
    /* Dark theme — designed to feel lifted, not punched-through. The
       background sits at #0e1014 (a soft slate-black, not pure black),
       surfaces are TWO steps lighter so cards visually float above the
       page instead of disappearing into it. Borders are translucent
       slate-blue at low opacity for warmth (avoids the "graphite scratch"
       look pure-grey lines give in dark mode). Compare: Linear / Notion
       / GitHub dark all use this lifted-neutral pattern. */
    html:not(.light) {
      /* Base canvas — soft slate-black, slightly warm. The legacy
         body bg (set elsewhere) is darker; we override that below. */
      --ui-bg-top: #11141a;
      --ui-bg-bottom: #0e1116;
      /* Surfaces sit ABOVE the base by a couple of steps so cards
         float visually. Translucent so the background gradient bleeds
         through subtly when the panel sits on the radial-gradient hero. */
      --ui-surface: rgba(28, 33, 44, 0.92);
      --ui-surface-strong: #1c2230;
      --ui-surface-muted: rgba(22, 26, 35, 0.88);
      /* Lines — translucent slate-blue, low opacity so dividers feel
         like seams, not gashes. */
      --ui-line: rgba(148, 163, 184, 0.14);
      --ui-line-strong: rgba(148, 163, 184, 0.24);
      /* Text — slate-100 / slate-300 / slate-400 progression. Avoid
         pure white (#ffffff is harsh on dark); slate-100 reads more
         comfortable for long sessions. */
      --ui-text: #e6ecf3;
      --ui-text-soft: #b8c2cf;
      --ui-muted: #7c8694;
      /* Accents — lower saturation than light mode equivalents.
         Saturated #2563eb on a black background feels electric;
         soft-blue at #5b8def is calmer and equally legible. */
      --ui-blue: #5b8def;
      --ui-blue-hover: #7ba4f5;
      --ui-blue-soft: rgba(91, 141, 239, 0.14);
      --ui-green: #5ed896;
      --ui-green-soft: rgba(94, 216, 150, 0.14);
      --ui-amber: #fbbf24;
      --ui-amber-soft: rgba(251, 191, 36, 0.14);
      --ui-red: #f87171;
      --ui-red-soft: rgba(248, 113, 113, 0.14);
      /* Shadows — short + diffuse so cards lift gently. */
      --ui-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.40), 0 8px 24px rgba(0, 0, 0, 0.28);
      --ui-shadow-2: 0 16px 36px rgba(0, 0, 0, 0.40);
      --ui-focus: 0 0 0 3px rgba(91, 141, 239, 0.28);
      /* Override the legacy --bg too so the body fills with the lifted
         tone instead of the harsh #0b0c0f baked in at :root. The legacy
         vars cascade through dozens of older components so this single
         line repaints the whole app. */
      --bg: var(--ui-bg-bottom);
      --surface: var(--ui-surface-strong);
      --card: var(--ui-surface-strong);
      --border: var(--ui-line);
      --border-subtle: rgba(148, 163, 184, 0.08);
      --panel: var(--ui-surface);
      --text: var(--ui-text);
      --text-2: var(--ui-text-soft);
      --muted: var(--ui-muted);
    }

    /* Dashboard hero panel — softer radial highlights so the corner
       glows are felt, not seen. The base layer is a near-opaque dark
       slate so content reads cleanly over it. */
    html:not(.light) #section-dashboard .ui-command-panel {
      background:
        radial-gradient(900px 220px at -8% -40%, rgba(91, 141, 239, 0.13), transparent 65%),
        radial-gradient(700px 200px at 108% 130%, rgba(67, 198, 172, 0.10), transparent 65%),
        var(--ui-surface-strong);
      border-color: var(--ui-line);
    }

    html:not(.light) #section-dashboard .ui-stat-card {
      background-color: var(--ui-surface);
      border-color: var(--ui-line);
    }

    html:not(.light) #section-dashboard .ui-stat-card:hover {
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.36);
    }

    html:not(.light) #section-dashboard>.section-header .section-title {
      background: linear-gradient(135deg, #e6ecf3 30%, #93b1ff 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    html:not(.light) #section-dashboard>.section-header {
      border-bottom-color: var(--ui-line);
    }

    /* Pipeline stage chips — translucent over the dashboard panel so
       they pick up the panel's gradient subtly. Active state uses the
       calmer dark-mode blue. */
    html:not(.light) #section-dashboard .ui-stage-chip {
      background: rgba(255, 255, 255, 0.03);
      border-color: rgba(148, 163, 184, 0.16);
      color: var(--ui-text-soft);
    }

    html:not(.light) #section-dashboard .ui-stage-chip:hover:not(.active) {
      background: rgba(255, 255, 255, 0.06);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36);
      border-color: rgba(148, 163, 184, 0.30);
    }

    html:not(.light) #section-dashboard .ui-stage-chip.active {
      background: linear-gradient(180deg, rgba(91, 141, 239, 0.20), rgba(91, 141, 239, 0.08));
      border-color: rgba(91, 141, 239, 0.42);
      box-shadow: 0 4px 14px rgba(91, 141, 239, 0.20);
      color: #cdddff;
    }

    html:not(.light) #section-dashboard .ui-stage-chip strong {
      color: var(--ui-text);
    }

    /* Toolbar — keep focus glow visible on dark. */
    html:not(.light) #section-dashboard .ui-toolbar:focus-within {
      border-color: rgba(91, 141, 239, 0.40);
      box-shadow: 0 4px 16px rgba(91, 141, 239, 0.16);
    }

    html:not(.light) #section-dashboard .ui-toolbar input,
    html:not(.light) #section-dashboard .ui-toolbar select {
      background: var(--ui-surface) !important;
      border-color: var(--ui-line) !important;
      color: var(--ui-text);
    }

    /* Library table rows + hover — match the lifted-neutral pattern. */
    html:not(.light) #section-dashboard .ui-table-shell {
      background: var(--ui-surface-strong);
      border-color: var(--ui-line);
    }

    html:not(.light) #section-dashboard .ui-table-shell tbody tr:hover {
      background-color: rgba(91, 141, 239, 0.06);
    }

    html:not(.light) #section-dashboard .ui-table-shell thead {
      background: var(--ui-surface) !important;
    }

    /* Store Manager grid header in dark — match panel surface. */
    html:not(.light) .manage-grid-head {
      background: var(--ui-surface);
    }

    html:not(.light) .manage-grid-head .manage-sort:hover {
      background: rgba(91, 141, 239, 0.12);
      color: var(--ui-text);
    }

    /* Edit modal (Store Manager and elsewhere) — the <details> cards
       inherit --ui-surface so they pick up the lifted neutral. Border
       gets the soft slate-blue. */
    html:not(.light) .me-grid>details {
      background: var(--ui-surface-strong);
      border-color: var(--ui-line);
    }

    html:not(.light) .me-grid>details>summary {
      color: var(--ui-text);
    }

    /* Header bar (top of page with import URL field + Clear / theme toggle) —
       give it a darker tint than the page so it visually anchors. The
       Maqam Atelier sidebar logo also needs adjusted contrast. */
    html:not(.light) header,
    html:not(.light) .header {
      background: var(--ui-surface-strong);
      border-bottom-color: var(--ui-line);
    }

    html:not(.light) #url-input {
      background: var(--ui-surface) !important;
      color: var(--ui-text);
      border-color: var(--ui-line);
    }

    html:not(.light) #url-input::placeholder {
      color: var(--ui-muted);
    }

    /* Sidebar — give the sidebar a touch of separation from the page bg. */
    html:not(.light) .sidebar,
    html:not(.light) aside.sidebar {
      background: var(--ui-surface-strong);
      border-right-color: var(--ui-line);
    }

    /* Footer status pill (Server online / Khaled / AI cost / Cache MB) —
       bright cyan-ish text on white was fine; in dark it needs a
       muted variant of the same hue. */
    html:not(.light) .footer-status,
    html:not(.light) .status-pill {
      background: var(--ui-surface);
      border-color: var(--ui-line);
    }

    /* ─── DARK THEME — defeat hardcoded white !important fills ────────────
       The light-mode design pass shipped a few rules that hardcoded white
       backgrounds with !important on universal selectors (.topbar, every
       input/select/textarea, .btn-outline, .btn-ghost). They render the
       header bar, URL field, filter inputs, and ghost/outline buttons as
       white pills regardless of theme. Var-based dark color cannot defeat
       those without matching specificity + !important — so we restate
       the defaults here, scoped to html:not(.light), with the same weight. */

    /* Topbar (header strip with the Import URL input + Clear / theme toggle). */
    html:not(.light) .topbar {
      background: var(--ui-surface-strong) !important;
      border-bottom-color: var(--ui-line) !important;
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.20) !important;
    }

    /* All form inputs — search boxes, URL field, filter selects, textareas.
       Cover the inline-styled lib-search variants too. */
    html:not(.light) .url-input,
    html:not(.light) .search-input,
    html:not(.light) .bulk-input,
    html:not(.light) .feature-input,
    html:not(.light) input[type="text"],
    html:not(.light) input[type="search"],
    html:not(.light) input[type="number"],
    html:not(.light) input[type="email"],
    html:not(.light) input[type="password"],
    html:not(.light) input[type="url"],
    html:not(.light) select,
    html:not(.light) textarea {
      background: var(--ui-surface) !important;
      border-color: var(--ui-line) !important;
      color: var(--ui-text) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
    }

    html:not(.light) input::placeholder,
    html:not(.light) textarea::placeholder {
      color: var(--ui-muted) !important;
      opacity: 1;
      /* Firefox dims placeholders by default — undo */
    }

    /* URL input gets a touch more presence so it reads as the primary
       input on the topbar. */
    html:not(.light) .url-input {
      background: var(--ui-surface-strong) !important;
    }

    /* Focused inputs in dark — keep the blue ring + brighter border. */
    html:not(.light) .url-input:focus,
    html:not(.light) .search-input:focus,
    html:not(.light) input:focus,
    html:not(.light) select:focus,
    html:not(.light) textarea:focus {
      border-color: rgba(91, 141, 239, 0.55) !important;
      box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.18) !important;
      background: var(--ui-surface-strong) !important;
    }

    /* Outline + ghost buttons — the ones used for row actions ("Imaging",
       "Polish") and filter Clear. Light mode forces these to white with
       slate text; in dark that becomes invisible-on-invisible. Restate
       the dark equivalents at matching specificity. */
    html:not(.light) .btn-outline,
    html:not(.light) .btn-ghost {
      background: rgba(255, 255, 255, 0.04) !important;
      border-color: rgba(148, 163, 184, 0.22) !important;
      color: var(--ui-text-soft) !important;
      box-shadow: none !important;
    }

    html:not(.light) .btn-outline:hover,
    html:not(.light) .btn-ghost:hover {
      background: rgba(91, 141, 239, 0.12) !important;
      border-color: rgba(91, 141, 239, 0.45) !important;
      color: #cdddff !important;
    }

    /* Disabled state — muted further so it reads as "not actionable". */
    html:not(.light) .btn-outline:disabled,
    html:not(.light) .btn-ghost:disabled {
      background: rgba(255, 255, 255, 0.02) !important;
      border-color: rgba(148, 163, 184, 0.10) !important;
      color: var(--ui-muted) !important;
      opacity: 0.6;
    }

    /* Code / monospace inputs (e.g. body_html textarea in the edit modal,
       SKU fields). Slightly different surface so they read as code, not
       prose. */
    html:not(.light) textarea[style*="monospace"],
    html:not(.light) textarea.search-input[style*="monospace"] {
      background: rgba(15, 18, 24, 0.85) !important;
    }

    html.light {
      --bg: #f3f6fb;
      --surface: var(--ui-surface);
      --card: var(--ui-surface);
      --panel: var(--ui-surface);
      --border: var(--ui-line);
      --border-subtle: rgba(148, 163, 184, 0.16);
      --text: var(--ui-text);
      --text-2: var(--ui-text-soft);
      --muted: var(--ui-muted);
      --blue: var(--ui-blue);
      --blue-hover: var(--ui-blue-hover);
      --blue-dim: var(--ui-blue-soft);
      --green: var(--ui-green);
      --green-dim: var(--ui-green-soft);
      --amber: var(--ui-amber);
      --amber-dim: var(--ui-amber-soft);
      --red: var(--ui-red);
      --red-dim: var(--ui-red-soft);
    }

    * {
      letter-spacing: 0 !important;
      box-sizing: border-box;
    }

    body {
      background: linear-gradient(180deg, var(--ui-bg-top) 0%, var(--ui-bg-bottom) 100%) !important;
      color: var(--ui-text);
    }

    .content {
      padding: 40px 28px 56px;
    }

    .sidebar,
    .topbar {
      background: rgba(255, 255, 255, 0.82) !important;
      border-color: rgba(148, 163, 184, 0.18) !important;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 32px rgba(15, 23, 42, 0.045) !important;
    }

    .sidebar-logo {
      padding: 24px 18px 20px;
    }

    .nav-item {
      min-height: 38px;
      border-radius: var(--ui-radius) !important;
      color: #64748b !important;
      gap: 9px;
    }

    .nav-item:hover {
      background: rgba(37, 99, 235, 0.052) !important;
      color: var(--ui-text) !important;
    }

    .nav-item.active {
      background: rgba(37, 99, 235, 0.092) !important;
      color: var(--ui-blue) !important;
      box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14) !important;
    }

    .nav-item.active::before {
      left: -8px;
      height: 20px;
      width: 3px;
    }

    .stage-num {
      background: rgba(255, 255, 255, 0.84) !important;
      border: 1px solid rgba(148, 163, 184, 0.30) !important;
      color: #64748b;
    }

    .topbar {
      height: 62px;
      padding: 10px 20px;
      gap: 10px;
    }

    .url-input,
    .search-input,
    .bulk-input,
    .feature-input,
    .ist-input,
    .login-input,
    select,
    textarea {
      min-height: 36px;
      border-radius: var(--ui-radius) !important;
      border: 1px solid rgba(148, 163, 184, 0.28) !important;
      background: rgba(255, 255, 255, 0.82) !important;
      color: var(--ui-text) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
    }

    .url-input:focus,
    .search-input:focus,
    .bulk-input:focus,
    .feature-input:focus,
    .ist-input:focus,
    .login-input:focus,
    select:focus,
    textarea:focus,
    button:focus-visible,
    [role="button"]:focus-visible {
      outline: none !important;
      border-color: rgba(37, 99, 235, 0.56) !important;
      box-shadow: var(--ui-focus) !important;
    }

    .btn,
    button.btn,
    .login-btn,
    .ist-action-btn,
    .ist-mode-tab,
    .ist-settings-pill {
      min-height: 36px;
      border-radius: var(--ui-radius) !important;
      font-weight: 650 !important;
      line-height: 1.15;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.15s ease;
    }

    .btn:hover:not(:disabled),
    .login-btn:hover:not(:disabled),
    .ist-action-btn:hover:not(:disabled) {
      transform: translateY(-1px);
    }

    .btn:active:not(:disabled),
    .login-btn:active:not(:disabled),
    .ist-action-btn:active:not(:disabled) {
      transform: translateY(0);
    }

    .btn-primary,
    .login-btn,
    .ist-action-btn,
    .ist-mode-tab.active {
      background: linear-gradient(180deg, #3676f4 0%, var(--ui-blue) 100%) !important;
      border: 1px solid rgba(29, 78, 216, 0.22) !important;
      color: #fff !important;
      box-shadow: 0 9px 18px rgba(37, 99, 235, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
    }

    .btn-primary:hover:not(:disabled),
    .login-btn:hover:not(:disabled),
    .ist-action-btn:hover:not(:disabled),
    .ist-mode-tab.active:hover {
      background: linear-gradient(180deg, #2f6ff0 0%, var(--ui-blue-hover) 100%) !important;
      box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
    }

    .btn-outline,
    .btn-ghost,
    .ist-settings-pill,
    .ist-mode-tabs,
    .ist-size-opt,
    .ist-variant-pill,
    .ist-scene-actions button {
      background: rgba(255, 255, 255, 0.68) !important;
      border: 1px solid rgba(148, 163, 184, 0.26) !important;
      color: var(--ui-text-soft) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70) !important;
    }

    .btn-ghost {
      background: transparent !important;
      border-color: transparent !important;
      box-shadow: none !important;
    }

    .btn-outline:hover:not(:disabled),
    .btn-ghost:hover:not(:disabled),
    .ist-settings-pill:hover,
    .ist-scene-actions button:hover:not(:disabled) {
      background: #fff !important;
      border-color: rgba(37, 99, 235, 0.28) !important;
      color: var(--ui-blue) !important;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.055) !important;
    }

    .btn-danger,
    button[style*="color:var(--red)"],
    button[style*="color: var(--red)"] {
      color: var(--ui-red) !important;
      border-color: rgba(220, 38, 38, 0.22) !important;
      background: rgba(255, 255, 255, 0.72) !important;
      box-shadow: none !important;
    }

    .btn-danger:hover:not(:disabled),
    button[style*="color:var(--red)"]:hover:not(:disabled),
    button[style*="color: var(--red)"]:hover:not(:disabled) {
      background: var(--ui-red-soft) !important;
      color: var(--ui-red) !important;
      border-color: rgba(220, 38, 38, 0.36) !important;
    }

    .btn:disabled,
    button:disabled,
    .ist-action-btn:disabled {
      opacity: 0.48 !important;
      cursor: not-allowed !important;
      transform: none !important;
      box-shadow: none !important;
    }

    .feature-card,
    .stat-card,
    .tech-strip,
    .table-wrap,
    .detail-modal,
    .login-card,
    .polish-table,
    .ist-card,
    .ist-scene-card,
    .qc-card,
    .ist-source-strip,
    .ist-meta-card,
    .ist-action-row,
    .ist-gallery-wrap,
    .ist-drawer,
    .ist-status-bar,
    .ist-queue-panel,
    div[style*="background:var(--card);border:1px solid var(--border)"],
    div[style*="background:var(--card);border: 1px solid var(--border)"] {
      border-radius: var(--ui-radius) !important;
      background: var(--ui-surface) !important;
      border-color: var(--ui-line) !important;
      box-shadow: var(--ui-shadow-1) !important;
      backdrop-filter: blur(16px) saturate(140%);
    }

    div[style*="border:1px dashed var(--border)"],
    div[style*="border: 1px dashed var(--border)"] {
      border-radius: var(--ui-radius) !important;
      background: rgba(255, 255, 255, 0.58) !important;
      border-color: rgba(148, 163, 184, 0.30) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
    }

    .feature-card:hover,
    .stat-card:hover,
    .ist-queue-item:hover,
    .ist-scene-card:hover {
      box-shadow: var(--ui-shadow-2) !important;
      border-color: rgba(37, 99, 235, 0.26) !important;
    }

    .section h1,
    .ist-top-title h1 {
      color: var(--ui-text) !important;
      font-size: 22px !important;
      font-weight: 750 !important;
      line-height: 1.16;
    }

    .section p,
    .empty-sub,
    .ist-top-sub,
    .ist-hint {
      color: var(--ui-muted) !important;
      line-height: 1.48;
    }

    .nav-section-label,
    .ist-drawer-h,
    .ist-label,
    th,
    [style*="text-transform:uppercase"],
    [style*="text-transform: uppercase"] {
      letter-spacing: 0 !important;
    }

    .pill,
    .nav-badge,
    [style*="border-radius:99px"],
    [style*="border-radius: 99px"] {
      border-radius: 999px !important;
    }

    .polish-table,
    table {
      border-collapse: separate !important;
      border-spacing: 0;
    }

    .polish-table thead th,
    table thead th {
      background: rgba(248, 250, 252, 0.92) !important;
      color: #64748b !important;
      font-size: 11px !important;
      font-weight: 700 !important;
      border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
    }

    .polish-table tbody td,
    table tbody td {
      border-bottom-color: rgba(148, 163, 184, 0.14) !important;
    }

    .polish-table tbody tr:hover,
    table tbody tr:hover {
      background: rgba(37, 99, 235, 0.032) !important;
    }

    tr[style*="background:var(--blue-dim)"],
    div[style*="background:var(--blue-dim);border:1px solid var(--blue)"],
    div[style*="background: var(--blue-dim);border: 1px solid var(--blue)"] {
      background: rgba(37, 99, 235, 0.055) !important;
      border-color: rgba(37, 99, 235, 0.18) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
    }

    div[style*="background:rgba(0,0,0,0.15)"],
    div[style*="background: rgba(0,0,0,0.15)"] {
      background: rgba(248, 250, 252, 0.88) !important;
    }

    input[type="checkbox"],
    input[type="radio"] {
      accent-color: var(--ui-blue);
    }

    .polish-cell-input {
      min-height: 34px;
      border-radius: var(--ui-radius-sm) !important;
      font-size: 12px;
    }

    .ist-top {
      padding: 16px 0 16px;
      border-color: rgba(148, 163, 184, 0.18) !important;
    }

    .ist-source-empty-icon,
    .ist-source-thumb,
    .ist-queue-item,
    .ist-bulk-row,
    .ist-signature-expand,
    .ist-source-link {
      border-radius: var(--ui-radius) !important;
    }

    .ist-action-row {
      align-items: center;
      padding: 14px 16px;
    }

    .ist-action-btn {
      min-height: 42px;
      min-width: 210px;
      padding: 11px 24px;
      font-size: 14px;
    }

    .ist-scene-img-wrap {
      background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%) !important;
      border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .ist-scene-status {
      color: #64748b !important;
      letter-spacing: 0 !important;
      text-transform: none !important;
    }

    .ist-scene-status.empty {
      color: #94a3b8 !important;
    }

    .ist-status-bar {
      bottom: 12px;
      margin-top: 18px;
      background: rgba(255, 255, 255, 0.86) !important;
      box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.78), 0 16px 36px rgba(15, 23, 42, 0.12) !important;
    }

    .empty-state {
      min-height: calc(100vh - 210px);
    }

    .empty-title {
      font-size: 20px !important;
      font-weight: 730 !important;
    }

    .login-card {
      border-radius: var(--ui-radius) !important;
    }

    .ui-empty-command {
      max-width: 720px;
      margin: 28px auto;
      padding: 48px 28px;
      text-align: center;
      border: 1px dashed rgba(148, 163, 184, 0.30);
      border-radius: var(--ui-radius);
      background: rgba(255, 255, 255, 0.64);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
    }

    .ui-empty-icon {
      width: 64px;
      height: 64px;
      margin: 0 auto 16px;
      border-radius: var(--ui-radius);
      display: grid;
      place-items: center;
      background: rgba(37, 99, 235, 0.08);
      border: 1px solid rgba(37, 99, 235, 0.14);
    }

    .ui-empty-command h3 {
      margin: 0 0 8px;
      font-size: 20px;
      line-height: 1.2;
      color: var(--ui-text);
    }

    .ui-empty-command p {
      margin: 0 auto;
      max-width: 500px;
      color: var(--ui-muted);
      font-size: 13px;
      line-height: 1.55;
    }

    .ui-empty-steps {
      display: flex;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 20px;
    }

    .ui-empty-steps span {
      padding: 6px 10px;
      border: 1px solid rgba(148, 163, 184, 0.22);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.74);
      color: var(--ui-text-soft);
      font-size: 11px;
      font-weight: 650;
    }

    .ui-command-panel {
      display: grid;
      grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr) auto;
      gap: 16px;
      align-items: center;
      margin-bottom: 18px;
      padding: 18px;
      border: 1px solid var(--ui-line);
      border-radius: var(--ui-radius);
      background: rgba(255, 255, 255, 0.78);
      box-shadow: var(--ui-shadow-1);
      backdrop-filter: blur(16px) saturate(140%);
    }

    .ui-eyebrow {
      margin-bottom: 6px;
      color: var(--ui-muted);
      font-size: 11px;
      font-weight: 750;
      text-transform: uppercase;
    }

    .ui-command-copy h2,
    .push-review-main h2 {
      margin: 0 0 6px;
      color: var(--ui-text);
      font-size: 22px;
      line-height: 1.15;
      font-weight: 760;
    }

    .ui-command-copy p,
    .push-review-main p {
      margin: 0;
      color: var(--ui-muted);
      font-size: 13px;
      line-height: 1.48;
    }

    .ui-command-flow {
      display: grid;
      grid-template-columns: repeat(5, minmax(72px, 1fr));
      gap: 8px;
    }

    .ui-stage-chip {
      min-height: 52px;
      padding: 8px 10px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
      gap: 3px;
      border: 1px solid rgba(148, 163, 184, 0.24);
      border-radius: var(--ui-radius);
      background: rgba(255, 255, 255, 0.62);
      color: var(--ui-text-soft);
      cursor: pointer;
      font-family: inherit;
      text-align: left;
    }

    .ui-stage-chip span {
      font-size: 11px;
      font-weight: 650;
    }

    .ui-stage-chip strong {
      color: var(--ui-text);
      font-size: 18px;
      line-height: 1;
      font-variant-numeric: tabular-nums;
    }

    .ui-stage-chip.active {
      background: rgba(37, 99, 235, 0.08);
      border-color: rgba(37, 99, 235, 0.22);
      color: var(--ui-blue);
    }

    .ui-command-action {
      min-width: 170px;
      min-height: 42px;
      white-space: nowrap;
    }

    .ui-stat-strip {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }

    .ui-stat-card,
    .ui-toolbar,
    .ui-table-shell,
    .ui-analytics-card {
      border: 1px solid var(--ui-line);
      border-radius: var(--ui-radius);
      background: rgba(255, 255, 255, 0.78);
      box-shadow: var(--ui-shadow-1);
    }

    .ui-stat-card {
      padding: 12px 14px;
    }

    .ui-stat-label {
      margin-bottom: 7px;
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--ui-muted);
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .ui-stat-value {
      color: var(--ui-text);
      font-size: 20px;
      font-weight: 760;
      font-variant-numeric: tabular-nums;
    }

    .ui-toolbar {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      padding: 12px;
      margin-bottom: 10px;
    }

    .ui-bulk-bar,
    .ui-sticky-footer {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      padding: 10px 14px;
      border: 1px solid rgba(37, 99, 235, 0.18) !important;
      border-radius: var(--ui-radius) !important;
      background: rgba(37, 99, 235, 0.055) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70) !important;
    }

    .ui-table-shell {
      overflow: hidden;
    }

    .ui-section-label {
      margin: 28px 4px 10px;
      color: var(--ui-muted);
      font-size: 11px;
      font-weight: 750;
      text-transform: uppercase;
    }

    .ui-analytics-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
      gap: 14px;
    }

    .ui-analytics-card {
      padding: 16px;
    }

    .ui-analytics-title {
      margin-bottom: 12px;
      color: var(--ui-muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .pf-check-cell {
      display: flex;
      flex-direction: column;
      gap: 7px;
      min-width: 190px;
    }

    .pf-check-summary {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      color: var(--ui-muted);
      font-size: 11px;
    }

    .pf-check-summary strong {
      color: var(--ui-text-soft);
      font-weight: 700;
    }

    .push-review-panel {
      display: grid !important;
      grid-template-columns: minmax(260px, 1fr) auto auto auto auto auto;
      gap: 12px !important;
      align-items: center !important;
      padding: 16px !important;
    }

    .push-review-panel>div[style="flex:1"] {
      display: none !important;
    }

    .push-review-main {
      min-width: 260px;
      max-width: 520px;
    }

    .push-review-panel>.push-review-main+div {
      margin-left: auto;
    }

    #pq-target-store {
      min-width: 220px;
    }

    .push-review-panel>div:not(.push-review-main) {
      color: var(--ui-muted) !important;
      font-size: 11px !important;
      font-weight: 700;
      text-transform: uppercase;
    }

    .push-review-panel>span {
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(37, 99, 235, 0.08);
      color: var(--ui-blue) !important;
      font-size: 12px !important;
      font-weight: 700 !important;
      white-space: nowrap;
    }

    .manage-toolbar,
    .manage-grid-shell {
      border-radius: var(--ui-radius) !important;
      background: rgba(255, 255, 255, 0.80) !important;
      border-color: var(--ui-line) !important;
      box-shadow: var(--ui-shadow-1) !important;
    }

    .manage-bulk-bar {
      background: rgba(37, 99, 235, 0.055) !important;
      border-color: rgba(37, 99, 235, 0.20) !important;
    }

    .manage-grid-shell {
      padding: 0 !important;
      overflow: hidden;
    }

    .manage-grid-head {
      background: rgba(248, 250, 252, 0.90);
    }

    /* Sortable header cells inside the Live Store Manager grid. Active
       sort gains a blue text color so the user can spot the current key
       without reading the arrow. Hover lifts non-active cells. */
    .manage-grid-head .manage-sort {
      transition: color 0.15s ease, background 0.15s ease;
      padding: 2px 6px;
      border-radius: 4px;
      margin: -2px -6px;
    }

    .manage-grid-head .manage-sort:hover {
      color: var(--ui-text, var(--text));
      background: rgba(37, 99, 235, 0.06);
    }

    .manage-grid-head .manage-sort.active {
      color: var(--blue);
    }

    .manage-grid-row {
      min-height: 66px;
      transition: background 0.12s ease;
    }

    .manage-grid-row:hover {
      background: rgba(37, 99, 235, 0.032);
    }

    @media (max-width: 900px) {
      .content {
        padding: 24px 16px 36px;
      }

      .ui-command-panel,
      .push-review-panel {
        grid-template-columns: 1fr !important;
      }

      .ui-command-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .ist-action-row,
      .ist-status-bar {
        align-items: stretch;
      }

      .ist-action-btn,
      .ist-status-right,
      .ist-status-right .btn {
        width: 100%;
      }

      .ist-status-right {
        flex-wrap: wrap;
      }
    }

    @media (max-width: 768px) {
      .topbar {
        min-height: 108px;
        grid-template-columns: 1fr auto auto;
        padding: 9px 12px 10px;
      }

      .main {
        padding-top: 116px;
      }

      .sidebar {
        height: 68px;
        background: rgba(255, 255, 255, 0.90) !important;
      }

      .sidebar-nav {
        grid-template-columns: repeat(5, minmax(52px, 1fr));
        gap: 5px;
        padding: 8px 9px;
      }

      .nav-item {
        height: 52px;
        font-size: 10px;
        border-radius: var(--ui-radius) !important;
      }

      .nav-item[data-section="manage"] {
        display: none !important;
      }

      .nav-item span:not(.stage-num) {
        max-width: 64px;
        font-size: 9px;
      }

      .stage-num {
        top: 5px;
        left: 7px;
      }
    }

    @media (prefers-reduced-motion: reduce) {

      *,
      *::before,
      *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
      }
    }

    /* ─── DASHBOARD MODERNIZATION (CSS-only, no HTML/JS changes) ──────────
       Lifts the Library command center / stat strip / pipeline chips out
       of the flat white panel look without touching the renderer. Targets
       only the existing classes; if a class disappears in a future refactor,
       this rule set degrades to no-op. */

    /* Subtle entrance — first paint of the dashboard fades in vs jumping. */
    @keyframes ui-dash-rise {
      from {
        opacity: 0;
        transform: translateY(8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    #section-dashboard .ui-command-panel,
    #section-dashboard .ui-stat-strip,
    #section-dashboard .ui-toolbar,
    #section-dashboard .ui-table-shell,
    #section-dashboard #dashboard-analytics>* {
      animation: ui-dash-rise 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    #section-dashboard .ui-stat-strip {
      animation-delay: 60ms;
    }

    #section-dashboard .ui-toolbar {
      animation-delay: 120ms;
    }

    /* Command panel — soft gradient + accent rail on the left edge. */
    #section-dashboard .ui-command-panel {
      position: relative;
      overflow: hidden;
      background:
        radial-gradient(1200px 200px at -10% -50%, rgba(99, 102, 241, 0.08), transparent 60%),
        radial-gradient(800px 200px at 110% 130%, rgba(67, 198, 172, 0.08), transparent 60%),
        rgba(255, 255, 255, 0.86);
      transition: box-shadow 0.25s ease, transform 0.25s ease;
    }

    #section-dashboard .ui-command-panel::before {
      content: '';
      position: absolute;
      inset: 0 auto 0 0;
      width: 4px;
      background: linear-gradient(180deg, var(--ui-blue, #2563eb), var(--ui-green, #43c6ac));
      border-radius: var(--ui-radius) 0 0 var(--ui-radius);
    }

    #section-dashboard .ui-command-panel:hover {
      box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    }

    #section-dashboard .ui-eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 3px 10px;
      border-radius: 999px;
      background: rgba(99, 102, 241, 0.10);
      color: var(--ui-blue, #2563eb);
      letter-spacing: 0.06em;
    }

    #section-dashboard .ui-eyebrow::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--ui-blue, #2563eb);
      box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
      animation: ui-pulse-dot 2.4s ease-in-out infinite;
    }

    @keyframes ui-pulse-dot {

      0%,
      100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
      }

      50% {
        box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
      }
    }

    /* Stage chips — color-coded by stage for visual scanning. */
    #section-dashboard .ui-stage-chip {
      position: relative;
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    }

    #section-dashboard .ui-stage-chip:hover:not(.active) {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
      border-color: rgba(148, 163, 184, 0.45);
    }

    /* Each stage chip's left rail picks up its pipeline color. Order in the
       grid matches the stagePlan: New / Image Studio / Polish / Pre-flight / Push. */
    #section-dashboard .ui-stage-chip {
      border-left: 3px solid transparent;
    }

    #section-dashboard .ui-command-flow .ui-stage-chip:nth-child(1) {
      border-left-color: rgba(99, 102, 241, 0.55);
    }

    #section-dashboard .ui-command-flow .ui-stage-chip:nth-child(2) {
      border-left-color: rgba(67, 198, 172, 0.55);
    }

    #section-dashboard .ui-command-flow .ui-stage-chip:nth-child(3) {
      border-left-color: rgba(245, 158, 11, 0.55);
    }

    #section-dashboard .ui-command-flow .ui-stage-chip:nth-child(4) {
      border-left-color: rgba(168, 85, 247, 0.55);
    }

    #section-dashboard .ui-command-flow .ui-stage-chip:nth-child(5) {
      border-left-color: rgba(34, 197, 94, 0.6);
    }

    /* Active chip glows with its rail color — the count number scales up
       slightly to draw the eye to the pending bucket. */
    #section-dashboard .ui-stage-chip.active {
      background: linear-gradient(180deg, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0.04));
      border-color: rgba(37, 99, 235, 0.30);
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    }

    #section-dashboard .ui-stage-chip.active strong {
      transform: scale(1.05);
      transform-origin: left;
    }

    #section-dashboard .ui-stage-chip strong {
      transition: transform 0.2s ease;
    }

    /* Primary CTA inside the command panel — gentle lift on hover. */
    #section-dashboard .ui-command-action {
      background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
      border: none;
      color: #fff;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
      transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    }

    #section-dashboard .ui-command-action:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(37, 99, 235, 0.36);
    }

    #section-dashboard .ui-command-action:disabled {
      background: rgba(148, 163, 184, 0.25);
      box-shadow: none;
      color: var(--ui-muted);
    }

    /* Stat strip — each card gets a soft gradient background, hover lift,
       and its icon inherits a brand-tinted accent. The strip also gains a
       horizontal "section group" feel via subtle separator-like spacing. */
    #section-dashboard .ui-stat-card {
      position: relative;
      overflow: hidden;
      transition: transform 0.18s ease, box-shadow 0.18s ease;
      background:
        radial-gradient(120% 80% at 0% 0%, rgba(99, 102, 241, 0.04), transparent 60%),
        rgba(255, 255, 255, 0.85);
    }

    #section-dashboard .ui-stat-card::after {
      content: '';
      position: absolute;
      inset: auto 0 0 0;
      height: 2px;
      background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.35), transparent);
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    #section-dashboard .ui-stat-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    }

    #section-dashboard .ui-stat-card:hover::after {
      opacity: 1;
    }

    /* Tint each stat card's accent rail so the row reads as a sequence
       rather than identical tiles. Same hue family as stage chips for
       cross-section consistency. */
    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(1) {
      background-color: rgba(99, 102, 241, 0.04);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(1)::after {
      background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.45), transparent);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(2) {
      background-color: rgba(245, 158, 11, 0.04);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(2)::after {
      background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.45), transparent);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(3) {
      background-color: rgba(67, 198, 172, 0.04);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(3)::after {
      background: linear-gradient(90deg, transparent, rgba(67, 198, 172, 0.45), transparent);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(4) {
      background-color: rgba(34, 197, 94, 0.04);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(4)::after {
      background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.45), transparent);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(5) {
      background-color: rgba(168, 85, 247, 0.04);
    }

    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(5)::after {
      background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.45), transparent);
    }

    /* Stat label icons — paint them with the section's hue. */
    #section-dashboard .ui-stat-strip>.ui-stat-card:nth-child(1) .ui-stat-label img {
      filter: hue-rotate(0deg) brightness(0.9);
    }

    /* Toolbar — slight elevation when focused-within so the user knows
       they're interacting with the filter row. */
    #section-dashboard .ui-toolbar {
      transition: box-shadow 0.2s ease, border-color 0.2s ease;
    }

    #section-dashboard .ui-toolbar:focus-within {
      border-color: rgba(37, 99, 235, 0.28);
      box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    }

    #section-dashboard .ui-toolbar input,
    #section-dashboard .ui-toolbar select {
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    #section-dashboard .ui-toolbar input:focus,
    #section-dashboard .ui-toolbar select:focus {
      border-color: rgba(37, 99, 235, 0.45) !important;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10) !important;
      outline: none;
    }

    /* Bulk-selection bar — pulse subtly when it appears so it draws the eye. */
    #section-dashboard .ui-bulk-bar {
      animation: ui-dash-rise 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    /* Section header — turn the plain "Overview" + button row into a
       stronger anchor for the page. The CTA pill on the right gets a
       gradient when it's the primary action. */
    #section-dashboard>.section-header {
      padding-bottom: 14px;
      border-bottom: 1px solid var(--ui-line, rgba(148, 163, 184, 0.18));
      margin-bottom: 16px;
    }

    #section-dashboard>.section-header .section-title {
      font-size: 22px;
      font-weight: 760;
      letter-spacing: -0.01em;
      background: linear-gradient(135deg, var(--ui-text, #0f172a) 30%, var(--ui-blue, #2563eb) 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    #section-dashboard>.section-header .btn.btn-yellow {
      background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
      border: none;
      color: #fff;
      box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    #section-dashboard>.section-header .btn.btn-yellow:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(99, 102, 241, 0.36);
    }

    /* Library table rows get a smoother hover than the plain "no change". */
    #section-dashboard .ui-table-shell tbody tr {
      transition: background-color 0.15s ease;
    }

    #section-dashboard .ui-table-shell tbody tr:hover {
      background-color: rgba(99, 102, 241, 0.035);
    }

    /* Reduced-motion: kill the entrance animations entirely. The hover
       transitions are fast enough they're not perceived as motion. */
    @media (prefers-reduced-motion: reduce) {

      #section-dashboard .ui-command-panel,
      #section-dashboard .ui-stat-strip,
      #section-dashboard .ui-toolbar,
      #section-dashboard .ui-table-shell,
      #section-dashboard #dashboard-analytics>*,
      #section-dashboard .ui-eyebrow::before,
      #section-dashboard .ui-bulk-bar {
        animation: none;
      }
    }

    /* Dark-mode tweaks — keep the same visual hierarchy but darker base. */
    html.dark #section-dashboard .ui-command-panel {
      background:
        radial-gradient(1200px 200px at -10% -50%, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(800px 200px at 110% 130%, rgba(67, 198, 172, 0.14), transparent 60%),
        rgba(15, 23, 42, 0.55);
    }

    html.dark #section-dashboard .ui-stat-card {
      background-color: rgba(15, 23, 42, 0.55);
    }

    html.dark #section-dashboard .ui-stat-card:hover {
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
    }

    html.dark #section-dashboard>.section-header .section-title {
      background: linear-gradient(135deg, #e2e8f0 30%, #818cf8 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

/* ──────────────────────────────────────────────────────────────────────────
   PUSH QUEUE — final review screen (Stage 4)
   The redesign treats the queue as a confidence-check dashboard, not a
   table dump: stats strip on top → config strip (destination + toggles +
   primary CTA) → filterable table with at-a-glance Qty/Size/Tags columns.
   ────────────────────────────────────────────────────────────────────── */
.pq-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.pq-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.pq-stat-stores {
  grid-column: span 2;
}
.pq-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.pq-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.pq-stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.pq-store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.pq-store-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--text);
}
.pq-store-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.pq-config {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.pq-config-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.pq-config-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pq-config-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pq-config-toggles {
  flex-direction: row;
  gap: 14px;
  margin-top: 14px;
}
.pq-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  min-width: 220px;
  color: var(--text);
  cursor: pointer;
}
.pq-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.pq-toggle:hover {
  border-color: var(--blue);
}
.pq-toggle input[type="checkbox"] {
  accent-color: var(--blue);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.pq-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.pq-toggle-hint {
  font-size: 10px;
  color: var(--muted);
}
.pq-config-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.pq-btn-back,
.pq-btn-push {
  font-size: 12px;
  padding: 8px 16px;
}
.pq-btn-push {
  font-weight: 600;
}
.pq-table-shell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.pq-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.pq-filter {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text);
  max-width: 320px;
}
.pq-filter::placeholder {
  color: var(--muted);
}
.pq-table-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.pq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
.pq-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
}
.pq-th-check { width: 36px; padding-left: 14px !important; }
.pq-th-img { width: 56px; }
.pq-th-store { width: 160px; }
.pq-th-num { text-align: right !important; width: 100px; }
.pq-th-ml { width: 90px; text-align: center !important; }
.pq-row {
  border-top: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.12s;
}
.pq-row:hover {
  background: rgba(67, 134, 255, 0.04);
}
.pq-row-selected {
  background: var(--blue-dim);
}
.pq-row-selected:hover {
  background: rgba(67, 134, 255, 0.18);
}
.pq-row-warn {
  /* Subtle yellow tint when a row is missing data (no final price). */
  background: rgba(234, 179, 8, 0.04);
}
.pq-row-warn.pq-row-selected {
  background: var(--blue-dim);
}
.pq-row td {
  padding: 9px 12px;
  vertical-align: middle;
}
.pq-td-check { padding-left: 14px !important; }
.pq-td-check input[type="checkbox"] {
  pointer-events: none;
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}
.pq-td-img img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.pq-img-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pq-td-title {
  min-width: 0;
}
.pq-title-text {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pq-title-sub {
  font-size: 10px;
  color: var(--blue);
  margin-top: 2px;
}
.pq-td-store {
  color: var(--muted);
  font-size: 12px;
}
.pq-td-num {
  text-align: right;
}
.pq-td-ml {
  text-align: center;
  color: var(--text);
}
.pq-status {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  min-height: 20px;
}

/* ──────────────────────────────────────────────────────────────────────────
   PUSH MODE SEGMENTED CONTROL (Bulk Ops UI)
   ────────────────────────────────────────────────────────────────────── */
.pq-mode-seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  align-items: stretch;
}
.pq-mode-opt {
  background: transparent;
  border: 0;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.pq-mode-opt:hover {
  color: var(--text);
  background: rgba(67, 134, 255, 0.06);
}
.pq-mode-opt.is-active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.pq-mode-opt.is-active:hover {
  background: var(--blue);
}
.pq-mode-tag {
  font-size: 9px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  padding: 2px 5px;
  border-radius: 10px;
  letter-spacing: 0.03em;
  opacity: 0.85;
}
.pq-mode-opt:not(.is-active) .pq-mode-tag {
  background: rgba(148, 163, 184, 0.18);
}


/* ─────────────────────────────────────────────────────────────────────
 *  DARK MODE — GLOSSY POLISH PASS
 *  Comprehensive override that defeats the hardcoded translucent-white
 *  surfaces baked into the UI-refresh layer (lines ~3900-7000) AND adds
 *  a subtle "soft glossy dark" treatment so dark mode reads premium,
 *  not flat. Every surface uses a gentle vertical gradient + inset top
 *  highlight to suggest depth, like Linear / Vercel dashboards.
 *  Loaded last so its !important rules win the cascade.
 * ───────────────────────────────────────────────────────────────────── */

/* ── 1. CHROME HEADER ──────────────────────────────────────────────── */
html:not(.light) .app-header {
  background: linear-gradient(180deg, #1c2236 0%, #0d1220 100%) !important;
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}
html:not(.light) .app-store-badge {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--ui-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}
html:not(.light) .app-store-badge:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04)) !important;
}
html:not(.light) .app-icon-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ── 2. SIDEBAR — gentle vertical gradient ─────────────────────────── */
html:not(.light) .sidebar,
html:not(.light) aside.sidebar {
  background: linear-gradient(180deg, #1a2030 0%, #14192a 100%) !important;
  backdrop-filter: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 1px 0 0 rgba(255, 255, 255, 0.02) !important;
  border-right-color: rgba(255, 255, 255, 0.06) !important;
}

/* Nav items — readable in dark, glossy on hover/active */
html:not(.light) .nav-item {
  color: var(--ui-text-soft) !important;
}
html:not(.light) .nav-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--ui-text) !important;
}
html:not(.light) .nav-item.active {
  background: linear-gradient(180deg, rgba(91, 141, 239, 0.20), rgba(91, 141, 239, 0.08)) !important;
  color: #c7d8ff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 3px 0 0 #5b8def !important;
}
html:not(.light) .nav-section-label {
  color: rgba(124, 134, 148, 0.85) !important;
}

/* Stage number circles (1·2·3·4) — glossy dark instead of light pill */
html:not(.light) .stage-num {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)) !important;
  color: var(--ui-text-soft) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
html:not(.light) .nav-item.active .stage-num,
html:not(.light) .nav-item:hover .stage-num {
  background: linear-gradient(180deg, #6b9aff, #4675d6) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 6px rgba(91, 141, 239, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

/* Footer status pill (Server online / user / AI cost / cache) */
html:not(.light) .footer-status,
html:not(.light) .status-pill,
html:not(.light) .sidebar-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--ui-text-soft) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* ── 3. CHIPS, PILLS, OUTLINE BUTTONS — kill the white !important ──── */
html:not(.light) .pill,
html:not(.light) .ist-variant-pill,
html:not(.light) .btn-outline,
html:not(.light) .ist-settings-pill,
html:not(.light) .ist-mode-tabs,
html:not(.light) .ist-size-opt,
html:not(.light) .ist-scene-actions button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)) !important;
  color: var(--ui-text-soft) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html:not(.light) .pill:hover,
html:not(.light) .ist-variant-pill:hover,
html:not(.light) .btn-outline:hover:not(:disabled),
html:not(.light) .ist-settings-pill:hover,
html:not(.light) .ist-scene-actions button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04)) !important;
  color: var(--ui-text) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
html:not(.light) .ist-variant-pill.active,
html:not(.light) .ist-size-opt.active,
html:not(.light) .ist-mode-tabs.active {
  background: linear-gradient(180deg, #6b9aff, #4675d6) !important;
  color: #fff !important;
  border-color: rgba(91, 141, 239, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 8px rgba(91, 141, 239, 0.28) !important;
}

/* ── 4. EMPTY-STATE CARDS — Polish/Pre-flight/Push/Imaging queues ──── */
html:not(.light) #polish-empty > div,
html:not(.light) #preflight-empty > div,
html:not(.light) #push-empty > div,
html:not(.light) #imaging-empty > div,
html:not(.light) #shopify-empty > div,
html:not(.light) #manage-empty > div {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}
html:not(.light) #polish-empty h3,
html:not(.light) #preflight-empty h3,
html:not(.light) #push-empty h3,
html:not(.light) #imaging-empty h3,
html:not(.light) #shopify-empty h3,
html:not(.light) #manage-empty h3 {
  color: var(--ui-text) !important;
}
html:not(.light) #polish-empty p,
html:not(.light) #preflight-empty p,
html:not(.light) #push-empty p,
html:not(.light) #imaging-empty p,
html:not(.light) #shopify-empty p,
html:not(.light) #manage-empty p {
  color: var(--ui-text-soft) !important;
}

/* ── 5. EMPTY-STATE (top dashboard "Start with a product...") ──────── */
html:not(.light) .empty-title {
  color: var(--ui-text) !important;
}
html:not(.light) .empty-sub {
  color: var(--ui-text-soft) !important;
}
html:not(.light) .ui-empty-command {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html:not(.light) .ui-empty-icon {
  background: rgba(91, 141, 239, 0.10) !important;
}

/* ── 6. PRIMARY BUTTON (Add to cart / Open Image Studio / Push) ────── */
html:not(.light) .btn-primary,
html:not(.light) .btn.btn-primary {
  background: linear-gradient(180deg, #5b8def, #4675d6) !important;
  border-color: rgba(91, 141, 239, 0.55) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 10px rgba(91, 141, 239, 0.30) !important;
}
html:not(.light) .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #7ba4f5, #5b8def) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 14px rgba(91, 141, 239, 0.42) !important;
}

/* ── 7. MISSED TARGETS — dashboard step-pills + JS-rendered push empty ──
   The dashboard's "Start with a product..." panel pills use
   .ui-empty-steps span (line 6889 hardcodes them as rgba(255,255,255,0.74)
   with no theme guard). And the Push empty state is rendered into
   #push-queue-content by JS, not into an id="push-empty". */
html:not(.light) .ui-empty-steps span {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--ui-text-soft) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html:not(.light) #push-queue-content > div {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}
html:not(.light) #push-queue-content > div h3 {
  color: var(--ui-text) !important;
}
html:not(.light) #push-queue-content > div p {
  color: var(--ui-text-soft) !important;
}

/* ── 8. STORE MANAGER — toolbar + grid shell + bulk bar + header row ────
   Lines 7138-7160 in the UI-refresh layer hardcoded these surfaces to
   rgba(255,255,255,0.80) with !important, never gated by theme. */
html:not(.light) .manage-toolbar,
html:not(.light) .manage-grid-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}
html:not(.light) .manage-grid-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--ui-text-soft) !important;
}
html:not(.light) .manage-bulk-bar {
  background: rgba(91, 141, 239, 0.10) !important;
  border-color: rgba(91, 141, 239, 0.20) !important;
}

/* ── 9. SETTINGS — Add store inline form + Shopify stores panel ─────
   The inline-styled #add-store-wrap (background:var(--card)) and its
   parent panel render light in the user's dark-mode screenshot
   despite var(--card) being dark — overriding with explicit values
   to stop chasing the cascade. */
html:not(.light) #add-store-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px dashed rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}
html:not(.light) #add-store-wrap input,
html:not(.light) #add-store-wrap select,
html:not(.light) #add-store-wrap textarea {
  background: rgba(0, 0, 0, 0.30) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--ui-text) !important;
}
html:not(.light) #add-store-wrap input::placeholder {
  color: rgba(184, 194, 207, 0.50) !important;
}

/* ── 10. MODALS — comprehensive dark sweep ─────────────────────────────
   All modal types share the same dark-glossy treatment so opening any
   dialog looks coherent with the rest of dark mode. Covers:
   - .detail-modal (Polish details, Store Manager edit, hero ref,
     snapshots, manage-bulk, scent-notes, pull-from-cull, etc.)
   - .login-card (login overlay)
   - .modal-content (image lightbox)
   - .detail-modal-body / -header / -title text
   - inputs/selects/textareas inside any modal */

/* Outer overlay backdrop — slightly darker scrim in dark mode */
html:not(.light) .detail-modal-overlay,
html:not(.light) .modal-overlay,
html:not(.light) .login-overlay {
  background: rgba(2, 5, 12, 0.62) !important;
  backdrop-filter: blur(4px) !important;
}

/* The modal container itself — glossy dark surface */
html:not(.light) .detail-modal,
html:not(.light) .detail-modal.wide,
html:not(.light) .detail-modal.fullscreen,
html:not(.light) .login-card,
html:not(.light) .modal-content {
  background: linear-gradient(180deg, #1c2236 0%, #161b29 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 20px 60px rgba(0, 0, 0, 0.55) !important;
  color: var(--ui-text) !important;
}

/* Modal headers + titles — readable */
html:not(.light) .detail-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent) !important;
}
html:not(.light) .detail-modal-title {
  color: var(--ui-text) !important;
}
html:not(.light) .detail-modal-body {
  color: var(--ui-text) !important;
}

/* Modal close button hover — subtle white wash */
html:not(.light) .detail-modal-close,
html:not(.light) .modal-close {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html:not(.light) .detail-modal-close:hover,
html:not(.light) .modal-close:hover {
  background: rgba(255, 255, 255, 0.10) !important;
}

/* Form fields inside ANY modal — dark, subtle border, readable */
html:not(.light) .detail-modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html:not(.light) .detail-modal select,
html:not(.light) .detail-modal textarea,
html:not(.light) .login-card input,
html:not(.light) .modal-content input,
html:not(.light) .modal-content select,
html:not(.light) .modal-content textarea {
  background: rgba(0, 0, 0, 0.30) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--ui-text) !important;
}
html:not(.light) .detail-modal input::placeholder,
html:not(.light) .detail-modal textarea::placeholder,
html:not(.light) .login-card input::placeholder,
html:not(.light) .modal-content input::placeholder {
  color: rgba(184, 194, 207, 0.45) !important;
}
html:not(.light) .detail-modal input:focus,
html:not(.light) .detail-modal select:focus,
html:not(.light) .detail-modal textarea:focus,
html:not(.light) .login-card input:focus,
html:not(.light) .modal-content input:focus {
  border-color: rgba(91, 141, 239, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.18) !important;
  outline: none !important;
}

/* Re-assert the Add store form (settings) and other inline panels that
   still slipped through — also covers any element that uses var(--card)
   inline AND has a dashed border (common pattern for collapsible panels). */
html:not(.light) #add-store-wrap,
html:not(.light) #sheet-link-modal > div,
html:not(.light) [id$="-modal"] > div:not(.detail-modal-overlay):not(.modal-overlay) {
  background: linear-gradient(180deg, #1c2236 0%, #161b29 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}

/* ── 11. ACTIVE-STATE FIX + remaining hardcoded light surfaces ──────────
   JS toggles `.selected` on .ist-size-opt (1K/2K/4K buttons), not `.active`.
   My earlier rule used wrong class name. Adding both for safety. */
html:not(.light) .ist-size-opt.selected,
html:not(.light) .ist-size-opt.active,
html:not(.light) .ist-variant-pill.selected,
html:not(.light) .ist-mode-tabs.selected,
html:not(.light) .ist-mode-tabs.active {
  background: linear-gradient(180deg, #6b9aff, #4675d6) !important;
  color: #fff !important;
  border-color: rgba(91, 141, 239, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 8px rgba(91, 141, 239, 0.28) !important;
}

/* Library/products table — header row + striped body */
html:not(.light) .table-wrap table thead,
html:not(.light) .table-wrap table thead tr {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)) !important;
}
html:not(.light) .table-wrap table thead th {
  background: transparent !important;
  color: var(--ui-text-soft) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Analytics donut cards on Dashboard (PRODUCTS BY STORE / PIPELINE STAGE) */
html:not(.light) .ui-analytics-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}
html:not(.light) .ui-analytics-title {
  color: var(--ui-text-soft) !important;
}

/* ── 12. FINAL DARK-MODE SWEEP — surfaces still painted by inline rgba
   tints (0.03–0.06 alpha) that read lighter than the surrounding dark
   body. Targets each by id/class with !important to defeat inline. ──── */

/* (a) Polish modal — Structure-templates row (inline rgba(228,248,160,0.04)) */
html:not(.light) #polish-desc-tpl-row {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)) !important;
  border: 1px dashed rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}
html:not(.light) #polish-desc-tpl-row .polish-desc-tpl-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--ui-text) !important;
}
html:not(.light) #polish-desc-tpl-row .polish-desc-tpl-btn:hover {
  background: rgba(255, 255, 255, 0.10) !important;
}

/* (b) Store Manager edit modal — "+ Add a new size" panel
   (inline rgba(67,198,172,0.03) — reads gray over dark gradient) */
html:not(.light) #m-edit-add-variant-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px dashed rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}

/* (c) Store Manager table — multi-size variant summary pill
   (inline rgba(228,248,160,0.06) on .manage-grid-row child div).
   Selector: any div inside .manage-grid-row whose title attr starts
   with "Multi-variant" — narrow enough not to catch other cells. */
html:not(.light) .manage-grid-row div[title^="Multi-variant"] {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px dashed rgba(255, 255, 255, 0.14) !important;
  color: var(--ui-text-soft) !important;
}

/* (d) Image Studio sticky status bar (0/6 generated · Send to Polish →) */
html:not(.light) .ist-status-bar {
  background: linear-gradient(180deg, #1c2236 0%, #161b29 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 -8px 24px rgba(0, 0, 0, 0.35) !important;
  color: var(--ui-text) !important;
}
html:not(.light) .ist-status-bar .ist-status-sep,
html:not(.light) .ist-status-bar #ist-grid-summary,
html:not(.light) .ist-status-bar #ist-approved-count {
  color: var(--ui-text-soft) !important;
}

/* (e) Polish sticky footer (Promote selected → Pre-flight →) — and any
   other `.ui-sticky-footer` (Pre-flight, Push share the class) */
html:not(.light) .ui-sticky-footer {
  background: linear-gradient(180deg, #1c2236 0%, #161b29 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 -8px 24px rgba(0, 0, 0, 0.35) !important;
  color: var(--ui-text) !important;
}

/* ── 13. DASHBOARD TOOLBAR — search bar + filter dropdowns row ──────────
   .ui-toolbar shares the same hardcoded rgba(255,255,255,0.78) base
   (line ~6999) as .ui-stat-card / .ui-analytics-card. Stat + analytics
   cards already got dark treatment; toolbar was missed. Also force the
   inputs/selects inside to use a true dark surface (their inline
   `background:var(--bg)` was getting visually washed over by parent). */
html:not(.light) .ui-toolbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ui-text) !important;
}
html:not(.light) .ui-toolbar input,
html:not(.light) .ui-toolbar select {
  background: rgba(0, 0, 0, 0.30) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--ui-text) !important;
}
html:not(.light) .ui-toolbar input::placeholder {
  color: rgba(184, 194, 207, 0.50) !important;
}
html:not(.light) .ui-toolbar input:focus,
html:not(.light) .ui-toolbar select:focus {
  border-color: rgba(91, 141, 239, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.18) !important;
  outline: none !important;
}

/* ── 14. STORE MANAGER EDIT MODAL — templates row (twin of Polish) ───────
   Section 12 only caught #polish-desc-tpl-row. The Store Manager edit
   modal has the same UI in #m-edit-tpl-row + .m-edit-tpl-btn buttons. */
html:not(.light) #m-edit-tpl-row {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)) !important;
  border: 1px dashed rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}
html:not(.light) #m-edit-tpl-row .m-edit-tpl-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--ui-text) !important;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease !important;
}
html:not(.light) #m-edit-tpl-row .m-edit-tpl-btn:hover {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(91, 141, 239, 0.40) !important;
}

/* Reinforce hover/transitions on the Polish twin too — consistent feel. */
html:not(.light) #polish-desc-tpl-row .polish-desc-tpl-btn {
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease !important;
}
html:not(.light) #polish-desc-tpl-row .polish-desc-tpl-btn:hover {
  border-color: rgba(91, 141, 239, 0.40) !important;
}

/* ── 15. MODAL GLOSSY FINISH — extra polish on .detail-modal layer ───────
   Tighten the modal feel: subtle inner top highlight, rounded section
   panels (<details>/<summary>) inside the modal, focus-ring on form
   fields not already covered. Keeps everything reading like one piece
   of glass rather than a stack of differently-lit strips. */
html:not(.light) .detail-modal {
  border-radius: 14px !important;
}
html:not(.light) .detail-modal-body details {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 10px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}
html:not(.light) .detail-modal-body details summary {
  color: var(--ui-text) !important;
  padding: 10px 12px !important;
}
html:not(.light) .detail-modal-body details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* ── 16. POLISH ROW INPUTS — dark mode fix ──────────────────────────────
   `.polish-cell-input` (lines ~333 + 4257) has its background forced to
   rgba(255,255,255,0.82) !important by the UI-refresh layer. That reads
   as solid white in dark mode — every input in the Polish row table
   (title, final price, qty, ML, tags, collection) was glowing white
   against the dark surface. Override with a subtle dark glass treatment
   that matches how Image Studio scene inputs and the detail-modal
   sections handle dark mode. */
html:not(.light) .polish-cell-input {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--ui-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html:not(.light) .polish-cell-input:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)) !important;
  border-color: rgba(91, 141, 239, 0.34) !important;
}
html:not(.light) .polish-cell-input:focus {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)) !important;
  border-color: rgba(91, 141, 239, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  outline: none !important;
}
html:not(.light) .polish-cell-input::placeholder {
  color: rgba(148, 163, 184, 0.55) !important;
}
/* `.dirty` indicator (unsaved edit) — keep the warm tint but tuned for dark. */
html:not(.light) .polish-cell-input.dirty {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.18), rgba(234, 179, 8, 0.08)) !important;
  border-color: rgba(234, 179, 8, 0.50) !important;
}

/* ── 16b. POLISH ROW INPUTS — light surface in both themes ──────────────
   The page surface is light across both themes now (the dark theme is
   barely used in practice). Forcing a dark solid fill on these inputs
   made the Polish bulk-edit row read like a black control strip against
   an otherwise white page. Use a clean white surface with grey border
   and dark text — consistent with the Image Studio toolbar selects. */
html:not(.light) .polish-cell-input,
html.dark .polish-cell-input,
body:not(.light) .polish-cell-input {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #e6e8ee !important;
  color: #1f2433 !important;
  box-shadow: none !important;
}
html:not(.light) .polish-cell-input:hover {
  background: #ffffff !important;
  border-color: #c4c9d4 !important;
}
html:not(.light) .polish-cell-input:focus {
  background: #ffffff !important;
  border-color: #4a9fe8 !important;
  box-shadow: 0 0 0 3px rgba(74,159,232,0.15) !important;
  outline: none !important;
}
html:not(.light) .polish-cell-input::placeholder {
  color: #9ca3af !important;
}
html:not(.light) .polish-cell-input.dirty {
  background: rgba(228, 248, 160, 0.30) !important;
  border-color: #d4a017 !important;
  color: #1f2433 !important;
}

/* ── 17. PUSH TAB INPUTS — light surface in both themes ─────────────────
   Same treatment as section 16b. Pure white surface, grey border, dark
   text. Consistent with the rest of the tool's light-first design. */
html:not(.light) .pq-filter,
html:not(.light) .pq-select {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #e6e8ee !important;
  color: #1f2433 !important;
  box-shadow: none !important;
}
html:not(.light) .pq-filter::placeholder {
  color: #9ca3af !important;
}
html:not(.light) .pq-filter:hover,
html:not(.light) .pq-select:hover {
  background: #ffffff !important;
  border-color: #c4c9d4 !important;
}
html:not(.light) .pq-filter:focus,
html:not(.light) .pq-select:focus {
  background: #ffffff !important;
  border-color: #4a9fe8 !important;
  box-shadow: 0 0 0 3px rgba(74,159,232,0.15) !important;
  outline: none !important;
}
html:not(.light) .pq-select {
  color-scheme: light;
}

/* ─── MAQAM STUDIO (Phase 1.A) ────────────────────────────────────────────
   Product-card thumbnails + fallback tile. Brand-accent gradient is set
   inline (via --brand-tint custom property) so it's per-card. The tile
   surface itself reads --card so light + dark both work cleanly. */
.studio-thumb-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--border-subtle);
}
.studio-thumb-fallback {
  width: 100%;
  height: 200px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  background: linear-gradient(135deg, var(--brand-tint, transparent), var(--card));
}
/* Card hover bump — consistent in both themes. */
.studio-product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.studio-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--blue-dim);
}

.studio-product-card-v2 {
  border-radius: 14px;
  box-shadow: var(--shadow-soft, 0 1px 2px rgba(0,0,0,0.05));
}

.studio-product-card-v2:hover {
  border-color: color-mix(in srgb, var(--blue) 46%, var(--border));
  box-shadow: 0 18px 36px rgba(12, 18, 32, 0.12);
}

.studio-card-body-v2 {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 248px;
  padding: 13px 14px 14px;
}

.studio-card-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-card-assets {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.studio-card-title-v2 {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.studio-card-vibe {
  min-height: 34px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.studio-card-map {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.studio-card-map span {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-card-map strong {
  color: var(--text);
}

.studio-card-actions-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  margin-top: auto;
}

.studio-card-open,
.studio-card-drive {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms var(--ease-out-soft, ease-out), border-color 160ms ease, background 160ms ease;
}

.studio-card-open:hover,
.studio-card-drive:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  background: var(--blue-dim);
  color: var(--blue);
}

.studio-card-drive {
  padding: 0;
}

html:not(.light) .studio-product-card-v2:hover {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.studio-modal-header-v2 {
  padding: 16px 58px 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.studio-modal-titleblock {
  flex: 1;
  min-width: 0;
}

.studio-modal-titleblock strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.studio-modal-subtitle {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.studio-workspace-map {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) repeat(5, minmax(142px, 1fr));
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  flex-shrink: 0;
}

.studio-workspace-intro,
.studio-map-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.studio-workspace-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.studio-workspace-eyebrow,
.studio-map-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.studio-workspace-intro strong,
.studio-map-card strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.studio-workspace-intro span:last-child,
.studio-map-card small {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.35;
}

.studio-map-card {
  display: grid;
  gap: 5px;
}

.studio-map-card i {
  color: var(--blue);
  font-size: 16px;
}

.studio-map-card small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.studio-map-card-next {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--border));
  background: var(--blue-dim);
}

.studio-selected-asset-label {
  min-width: 150px;
  display: grid;
  gap: 2px;
  margin-right: auto;
}

.studio-selected-asset-label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.studio-selected-asset-label strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-transform: capitalize;
}

@media (max-width: 1220px) {
  .studio-workspace-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .studio-workspace-intro,
  .studio-map-card-next {
    grid-column: span 3;
  }
}

@media (max-width: 760px) {
  .studio-workspace-map {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .studio-workspace-intro,
  .studio-map-card-next {
    grid-column: auto;
  }

  .studio-modal-header-v2 {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-right: 44px;
  }

  .studio-modal-grid {
    flex-direction: column;
  }

  .studio-modal-rail {
    width: auto;
    max-width: none;
    min-width: 0;
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}
/* Status banner — themed via the --blue/--green/--red dim tokens. */
#studio-status-banner code {
  background: var(--border-subtle);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--text);
}

/* ─── Studio quick-filter chips ─────────────────────────────────────────── */
.studio-chip {
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.studio-chip:hover {
  border-color: var(--blue);
  color: var(--text);
}
.studio-chip.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
}

/* ─── Studio modal tabs (asset-type switcher inside product modal) ──────── */
.studio-tab {
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.studio-tab:hover {
  color: var(--text);
}
.studio-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Studio asset cards inside the modal — adapt to light + dark via tokens. */
.studio-asset-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.studio-asset-card:hover {
  border-color: var(--blue);
}
.studio-asset-card.open {
  grid-column: 1 / -1;  /* expand to full row when editor opens */
  border-color: var(--blue);
  box-shadow: 0 4px 16px var(--blue-dim);
}
.studio-asset-card.open img {
  max-height: 320px;
  object-fit: contain;
  background: var(--border-subtle);
}

/* ─── Studio Generate sub-modal template picker tiles ───────────────────── */
.studio-gen-tpl {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.studio-gen-tpl:hover {
  border-color: var(--blue);
}
.studio-gen-tpl.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
}
.studio-gen-tpl.active div { color: inherit; }

/* ─── Studio modal SPLIT-VIEW (left rail + right pane) ──────────────────── */
.studio-modal-grid {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.studio-modal-rail {
  width: 38%;
  min-width: 280px;
  max-width: 440px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--border-subtle);
}
.studio-modal-detail {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
  min-width: 0;  /* allows flex children to shrink properly */
}

/* Rail items — compact thumbnail + 2 lines + status dots */
.studio-rail-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.studio-rail-item:hover {
  border-color: var(--blue);
}
.studio-rail-item.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  box-shadow: 0 2px 8px var(--blue-dim);
}
.studio-rail-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--border-subtle);
}
.studio-rail-thumb-fallback {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background: var(--border-subtle);
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0.5;
}
.studio-rail-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.studio-rail-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}
.studio-rail-sub {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-rail-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
}

/* Right pane — preview + editor */
.studio-right-pane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.studio-big-preview {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 14px;
  display: block;
}
.studio-big-preview-fallback {
  width: 100%;
  height: 200px;
  align-items: center;
  justify-content: center;
  background: var(--border-subtle);
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 14px;
}
.studio-right-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--muted);
  font-size: 13px;
  padding: 60px 30px;
  text-align: center;
  line-height: 1.5;
}
.studio-asset-editor {
  /* Pane provides bg + padding; editor just lays out fields. */
  padding: 0;
}

/* ─── Studio icon system ─────────────────────────────────────────────────
   Uses CSS mask-image to recolor SVG icons via currentColor — so each icon
   inherits the text color of its parent (button label, link, etc). Means
   one icon definition works in both light and dark mode automatically.
   Pattern: <span class="i i-sparkles"></span>
   Add new icons by appending a `.i-name { mask-image: url(...) }` rule. */
.i {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
.i-sparkles { -webkit-mask-image: url('https://api.iconify.design/lucide/sparkles.svg'); mask-image: url('https://api.iconify.design/lucide/sparkles.svg'); }
.i-folder-open { -webkit-mask-image: url('https://api.iconify.design/lucide/folder-open.svg'); mask-image: url('https://api.iconify.design/lucide/folder-open.svg'); }
.i-download { -webkit-mask-image: url('https://api.iconify.design/lucide/download.svg'); mask-image: url('https://api.iconify.design/lucide/download.svg'); }
.i-check { -webkit-mask-image: url('https://api.iconify.design/lucide/check.svg'); mask-image: url('https://api.iconify.design/lucide/check.svg'); }
.i-copy { -webkit-mask-image: url('https://api.iconify.design/lucide/copy.svg'); mask-image: url('https://api.iconify.design/lucide/copy.svg'); }
.i-refresh { -webkit-mask-image: url('https://api.iconify.design/lucide/refresh-cw.svg'); mask-image: url('https://api.iconify.design/lucide/refresh-cw.svg'); }
.i-inbox { -webkit-mask-image: url('https://api.iconify.design/lucide/inbox.svg'); mask-image: url('https://api.iconify.design/lucide/inbox.svg'); }
.i-chevron-left { -webkit-mask-image: url('https://api.iconify.design/lucide/chevron-left.svg'); mask-image: url('https://api.iconify.design/lucide/chevron-left.svg'); }
.i-chevron-right { -webkit-mask-image: url('https://api.iconify.design/lucide/chevron-right.svg'); mask-image: url('https://api.iconify.design/lucide/chevron-right.svg'); }
.i-alert { -webkit-mask-image: url('https://api.iconify.design/lucide/alert-triangle.svg'); mask-image: url('https://api.iconify.design/lucide/alert-triangle.svg'); }
.i-info { -webkit-mask-image: url('https://api.iconify.design/lucide/info.svg'); mask-image: url('https://api.iconify.design/lucide/info.svg'); }
.i-sheet { -webkit-mask-image: url('https://api.iconify.design/lucide/file-spreadsheet.svg'); mask-image: url('https://api.iconify.design/lucide/file-spreadsheet.svg'); }
.i-map-pin { -webkit-mask-image: url('https://api.iconify.design/lucide/map-pin.svg'); mask-image: url('https://api.iconify.design/lucide/map-pin.svg'); }
.i-hourglass { -webkit-mask-image: url('https://api.iconify.design/lucide/hourglass.svg'); mask-image: url('https://api.iconify.design/lucide/hourglass.svg'); }
.i-rocket { -webkit-mask-image: url('https://api.iconify.design/lucide/rocket.svg'); mask-image: url('https://api.iconify.design/lucide/rocket.svg'); }
.i-arrow-left { -webkit-mask-image: url('https://api.iconify.design/lucide/arrow-left.svg'); mask-image: url('https://api.iconify.design/lucide/arrow-left.svg'); }
.i-image-down { -webkit-mask-image: url('https://api.iconify.design/lucide/image-down.svg'); mask-image: url('https://api.iconify.design/lucide/image-down.svg'); }
.i-circle { -webkit-mask-image: url('https://api.iconify.design/lucide/circle.svg'); mask-image: url('https://api.iconify.design/lucide/circle.svg'); }
.i-link-external { -webkit-mask-image: url('https://api.iconify.design/lucide/external-link.svg'); mask-image: url('https://api.iconify.design/lucide/external-link.svg'); }
.i-camera-off { -webkit-mask-image: url('https://api.iconify.design/lucide/image-off.svg'); mask-image: url('https://api.iconify.design/lucide/image-off.svg'); }
.i-camera { -webkit-mask-image: url('https://api.iconify.design/lucide/image.svg'); mask-image: url('https://api.iconify.design/lucide/image.svg'); }

/* Size helpers — use these alongside .i */
.i-sm { font-size: 12px; }
.i-md { font-size: 14px; }
.i-lg { font-size: 18px; }
.i-xl { font-size: 28px; }

/* ─── LAUNCH MODALS (Phase 3) ──────────────────────────────────────────── */
/* Used by #launches-new-modal and #launches-detail-modal in 10-launches.js. */
/* Real overlay — fixed full-viewport with blur, click outside closes. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 22, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 28px;
  animation: modal-fade-in 0.18s ease-out;
}
.modal-backdrop[style*="display:flex"],
.modal-backdrop[style*="display: flex"] {
  display: flex !important;
}
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: modal-slide-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-header {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.modal-body {
  padding: 18px 22px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: var(--border-subtle);
  color: var(--text);
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Launch detail modal — wider, asset-grid friendly */
#launches-detail-modal .modal {
  max-width: 1180px;
  width: 96%;
}

/* Launch new-launch modal — narrower, sits on the card token so the
   surface is clean white-ish in light mode and proper dark card in
   dark mode. No overrides — each theme provides its own --card. */
#launches-new-modal .modal {
  max-width: 600px;
  width: 92%;
  background: var(--card);
}

/* ─── Image Studio: floating progress widget ──────────────────────────────
   Fixed bottom-right card that shows brief + generation progress. Lives
   outside any .section so it survives tab navigation. Spinner SVG inside
   .ist-progress-icon rotates via @keyframes. */
.ist-progress {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15,20,35,0.12);
  min-width: 280px;
  max-width: 360px;
  z-index: 9000;
  font-family: inherit;
}
.ist-progress.open {
  display: flex;
  animation: istProgressIn 0.25s ease-out;
}
@keyframes istProgressIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.ist-progress-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(74,159,232,0.10), rgba(121,80,212,0.10));
  display: flex;
  align-items: center;
  justify-content: center;
}
.ist-progress-spinner {
  animation: istSpin 0.9s linear infinite;
  transform-origin: center;
}
@keyframes istSpin {
  to { transform: rotate(360deg); }
}
.ist-progress.done .ist-progress-spinner { animation: none; }
.ist-progress.done .ist-progress-icon {
  background: linear-gradient(135deg, rgba(28,140,76,0.12), rgba(67,198,172,0.12));
}
.ist-progress-body {
  flex: 1;
  min-width: 0;
}
.ist-progress-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2433;
  letter-spacing: -0.1px;
  line-height: 1.2;
  margin-bottom: 3px;
}
.ist-progress-step {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.3;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ist-progress-bar {
  height: 4px;
  background: #eef0f5;
  border-radius: 999px;
  overflow: hidden;
}
.ist-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a9fe8, #7950d4);
  border-radius: 999px;
  transition: width 0.3s ease-out;
  width: 0%;
}
.ist-progress.done .ist-progress-bar-fill {
  background: #1c8c4c;
  width: 100% !important;
}
.ist-progress-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ist-progress-close:hover {
  background: #f3f4f7;
  color: #1f2433;
}

/* Hide the inline thinking feed — superseded by the floating widget. The
   DOM stays in place so legacy code paths that mutate its children don't
   crash. */
#section-image-studio .ist-thinking-feed {
  display: none !important;
}

/* Lighter READY badge — reference shows soft-purple background with the
   same purple text, not the heavy dark-on-dark of the previous pass. */
.ist-v2-scene-badge.ready {
  background: rgba(121,80,212,0.14) !important;
  color: #7950d4 !important;
}

/* ─── Polish footer — refresh to match the launches modal aesthetic ───
   Pure-white sticky bar, clean status text on the left, three buttons
   on the right with clear hierarchy (ghost → secondary outline → bold
   blue primary). */
.polish-footer-v2 {
  padding: 14px 22px !important;
  border-top: 1px solid #eef0f5 !important;
  background: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}
.polish-footer-status {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}
.polish-footer-status #polish-selected-count {
  color: #1f2433;
  font-weight: 700;
}
.polish-footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.polish-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  border: 1px solid transparent;
}
.polish-footer-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Ghost — Apply collection to selected. Plain text-link feel. */
.polish-footer-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #6b7280;
}
.polish-footer-btn-ghost:hover:not(:disabled) {
  color: #1f2433;
  background: #f3f4f7;
}
/* Secondary outline — Send back to Cull. White pill with grey border. */
.polish-footer-btn-secondary {
  background: #ffffff;
  border-color: #e6e8ee;
  color: #4a5160;
}
.polish-footer-btn-secondary:hover:not(:disabled) {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
}
/* Primary — Promote selected. Bold solid blue with white text. */
.polish-footer-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  padding: 10px 22px;
}
.polish-footer-btn-primary:hover:not(:disabled) {
  background: #1e54d3;
  border-color: #1e54d3;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.polish-footer-btn-primary:disabled {
  background: #93c0f8;
  border-color: #93c0f8;
  box-shadow: none;
}

/* ─── Dashboard v2 — Step 1: Header / Welcome Area ────────────────────────
   Two-column flex: greeting + operational summary on the left, three
   action buttons aligned right. Matches the premium feel of Image Studio
   + the launches modal header. */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.dash-header-left {
  flex: 1;
  min-width: 280px;
}
.dash-greeting {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #1f2433;
  letter-spacing: -0.6px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dash-summary {
  margin: 6px 0 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.4;
  max-width: 720px;
}
.dash-summary .dash-summary-num {
  color: #1f2433;
  font-weight: 700;
}
.dash-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: stretch;
}
.dash-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #4a5160;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.dash-action-btn i {
  font-size: 14px;
  color: #6b7280;
  transition: color 0.15s;
}
.dash-action-btn:hover {
  border-color: #c4c9d4;
  background: #f8f9fb;
  color: #1f2433;
}
.dash-action-btn:hover i { color: #4a5160; }
/* Primary — Download All Images. Solid indigo with soft shadow.
   Slightly more indigo than the Polish promote button so it reads as
   the dashboard-level CTA (not stage-promote). */
.dash-action-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #5b6cff 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.30);
}
.dash-action-btn-primary i { color: #ffffff; }
.dash-action-btn-primary:hover {
  background: linear-gradient(135deg, #5856e8 0%, #5060f5 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.40);
}
.dash-action-btn-primary:hover i { color: #ffffff; }

/* ─── Dashboard v2.1 — Library Command Center ──────────────────────────────
   Hero column on the left (eyebrow + headline + sub + CTA stacked), the
   5 stage tiles take the rest of the row. Each tile is a tall card: label
   top, big icon-left/count-right middle, colored progress bar at the
   bottom. The progress bar fills proportionally to the BUSIEST stage. */
.dash-command {
  margin-bottom: 22px;
}
.dash-cc-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 26px 22px 32px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  align-items: stretch;
  gap: 32px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.dash-cc-accent {
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-hover, var(--blue)) 100%);
}
.dash-cc-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}
.dash-cc-eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 4px;
}
.dash-cc-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0;
}
.dash-cc-hero-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 12px;
}
.dash-cc-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-hover, var(--blue)) 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  box-shadow: 0 4px 12px var(--blue-glow, rgba(99, 102, 241, 0.30));
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 4px;
}
.dash-cc-cta i { font-size: 14px; }
.dash-cc-cta:hover:not(:disabled) {
  filter: brightness(0.95);
  box-shadow: 0 6px 16px var(--blue-glow, rgba(99, 102, 241, 0.40));
  transform: translateY(-1px);
}
.dash-cc-cta.is-disabled,
.dash-cc-cta:disabled {
  background: var(--blue-dim, #c7c9f3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Pipeline flow — 5 tall tiles separated by ··· dots. */
.dash-cc-flow {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.dash-cc-tile {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: left;
  min-width: 0;
}
.dash-cc-tile:hover {
  border-color: var(--border-subtle, var(--border));
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 20, 35, 0.06);
}
.dash-cc-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dash-cc-tile-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cc-tile-flag i { font-size: 11px; opacity: 0.7; }
.dash-cc-tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-cc-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.dash-cc-tile-count {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.6px;
  line-height: 1;
}
.dash-cc-tile-bar {
  height: 4px;
  background: var(--border-subtle, rgba(15, 20, 35, 0.06));
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}
.dash-cc-tile-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease-out;
}
.dash-cc-dot-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0 2px;
  font-size: 13px;
  user-select: none;
}

/* Stack the hero + flow on narrower viewports. */
@media (max-width: 1100px) {
  .dash-cc-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .dash-cc-flow { flex-wrap: wrap; }
  .dash-cc-tile { min-width: 140px; }
}

/* ─── Dashboard v2 — Step 3: Stat cards row ────────────────────────────────
   5 equal-width cards. Each card is a horizontal flex: icon tile left +
   label/number/sub stacked right. Soft shadow, pure white surface, soft
   pastel icon backgrounds matching the metric type. */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s;
  min-width: 0;
}
.dash-stat-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(58, 114, 212, 0.10);
  transform: translateY(-1px);
}
.dash-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.dash-stat-body {
  flex: 1;
  min-width: 0;
  line-height: 1.1;
}
.dash-stat-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 3px;
  line-height: 1.1;
  white-space: nowrap;
}
.dash-stat-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Dashboard v2 — Step 4: Filter toolbar ────────────────────────────────
   Single-row bar with magnifier search input + 3 selects + clear + refresh.
   All controls share the same 40px height + #ffffff bg + #e6e8ee border
   styling so the bar reads as one cohesive control strip. Matches the
   Image Studio toolbar aesthetic. */
.dash-filters-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.dash-filter-search {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.dash-filter-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
}
.dash-filter-search input {
  width: 100% !important;
  height: 40px !important;
  padding: 0 14px 0 38px !important;
  border-radius: 10px !important;
  border: 1px solid #e6e8ee !important;
  background: #ffffff !important;
  color: #1f2433 !important;
  font-size: 13px !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  box-sizing: border-box !important;
  outline: none !important;
}
.dash-filter-search input::placeholder { color: #9ca3af !important; }
.dash-filter-search input:hover {
  border-color: #c4c9d4 !important;
}
.dash-filter-search input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14) !important;
}
.dash-filter-select {
  height: 40px !important;
  padding: 0 36px 0 14px !important;
  border-radius: 10px !important;
  border: 1px solid #e6e8ee !important;
  background-color: #ffffff !important;
  color: #1f2433 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555c72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 11px 11px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  box-sizing: border-box !important;
  min-width: 160px !important;
  outline: none !important;
  transition: border-color 0.15s !important;
}
.dash-filter-select:hover { border-color: #c4c9d4 !important; }
.dash-filter-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14) !important;
}
.dash-filter-clear {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.dash-filter-clear:hover {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
}
.dash-filter-refresh {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.dash-filter-refresh:hover {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
  transform: rotate(45deg);
}

/* ─── Dashboard v2 — Step 5: Product table ─────────────────────────────────
   Premium product library table. Rounded card wrapper, soft border, no
   internal borders between rows (just 1px subtle separators), generous
   row padding, larger thumbnails, stage-aware Next Best Action button. */
.dash-table-wrap {
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  margin-bottom: 18px;
}
.dash-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.dash-table thead th {
  background: #f8f9fb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eef0f5;
  white-space: nowrap;
  user-select: none;
}
.dash-table .dash-th-sort {
  cursor: pointer;
  transition: color 0.15s;
}
.dash-table .dash-th-sort:hover { color: #1f2433; }
.dash-table .dash-th-right { text-align: right; }
.dash-table .dash-th-check { width: 36px; padding-left: 18px; }
.dash-table .dash-th-img   { width: 56px; }
.dash-table .dash-th-actions { width: 280px; text-align: right; }
.dash-th-arrow {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: #c4c9d4;
  vertical-align: middle;
}
.dash-th-arrow.is-active { color: #6366f1; }

/* Rows */
.dash-row {
  transition: background 0.12s;
}
.dash-row + .dash-row td { border-top: 1px solid #eef0f5; }
.dash-row:hover { background: #fafbfd; }
.dash-row.is-selected { background: rgba(99, 102, 241, 0.05); }
.dash-row.is-selected:hover { background: rgba(99, 102, 241, 0.08); }

.dash-table td {
  padding: 12px 14px;
  color: #1f2433;
  vertical-align: middle;
}
.dash-cell-check { padding-left: 18px; width: 36px; }
.dash-cell-img   { width: 56px; cursor: pointer; }
.dash-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3f4f7;
  display: block;
}
.dash-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c9d4;
  font-size: 16px;
}
.dash-cell-title { cursor: pointer; min-width: 0; max-width: 480px; }
.dash-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2433;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.1px;
}
.dash-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-cell-store {
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}
.dash-cell-price { text-align: right; }
.dash-price-num {
  font-size: 14px;
  font-weight: 700;
  color: #1f2433;
  font-variant-numeric: tabular-nums;
}
.dash-price-cur {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
  font-weight: 500;
}
.dash-cell-images {
  text-align: right;
  color: #6b7280;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dash-cell-scraped { text-align: right; }
.dash-scraped-time {
  font-size: 12px;
  color: #6b7280;
}
.dash-scraped-by {
  font-size: 10px;
  color: #6366f1;
  margin-top: 2px;
  font-weight: 600;
}

/* Stage pill — color-coded per stage. Soft tinted bg + matching darker text. */
.dash-stage-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  white-space: nowrap;
}
.dash-stage-pill.dash-stage-cull        { background: rgba(74,159,232,0.12); color: #2563eb; }
.dash-stage-pill.dash-stage-imaging     { background: rgba(28,140,76,0.12);  color: #1c8c4c; }
.dash-stage-pill.dash-stage-polishing   { background: rgba(245,158,11,0.14); color: #b45309; }
.dash-stage-pill.dash-stage-preflight   { background: rgba(99,102,241,0.14); color: #4f46e5; }
.dash-stage-pill.dash-stage-ready       { background: rgba(28,140,76,0.12);  color: #1c8c4c; }
.dash-stage-pill.dash-stage-pushed      { background: rgba(14,165,233,0.14); color: #0284c7; }
.dash-stage-pill.dash-stage-culled-out  { background: rgba(156,163,175,0.18); color: #6b7280; }

/* Action buttons cell */
.dash-cell-actions {
  text-align: right;
  white-space: nowrap;
}
.dash-cell-actions > * + * { margin-left: 6px; }

/* Next Best Action — primary blue button. Stage-aware label/icon set in JS. */
.dash-nba-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid rgba(99, 102, 241, 0.30);
  background: rgba(99, 102, 241, 0.06);
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.dash-nba-btn i { font-size: 12px; }
.dash-nba-btn:hover:not(:disabled) {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}
.dash-nba-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Secondary action — icon-only ghost button (Skip to Polish, etc.) */
.dash-action-2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  vertical-align: middle;
}
.dash-action-2-btn:hover:not(:disabled) {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
}

/* Kebab — same shape as action-2-btn, lighter color */
.dash-kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  vertical-align: middle;
}
.dash-kebab-btn:hover:not(:disabled) {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
}

/* Empty-state row inside the table */
.dash-empty-row {
  padding: 48px 24px !important;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

/* Per-row kebab dropdown menu (fixed-positioned).
   Heavier shadow so the menu visually pops off the page — without it, in
   dark mode the var(--card) bg is nearly identical to the row colors
   behind it and the eye reads the low contrast as "see-through". */
.dash-row-kebab-menu {
  position: fixed;
  width: 200px;
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  overflow: hidden;
  padding: 4px 0;
  font-family: inherit;
  opacity: 1;
  animation: dashKebabIn 0.12s ease-out;
}
html.light .dash-row-kebab-menu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow:
    0 24px 70px rgba(15, 20, 35, 0.24),
    0 8px 22px rgba(15, 20, 35, 0.12);
}
/* No transform on open — translateY shifts the menu by 4px in the user's
   first few frames and can make a fast click on the first menu item miss. */
@keyframes dashKebabIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.dash-kebab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.dash-kebab-item:hover { background: rgba(255, 255, 255, 0.08); }
html.light .dash-kebab-item:hover { background: #f3f4f7; }
.dash-kebab-item i {
  font-size: 13px;
  color: var(--muted);
  width: 16px;
  text-align: center;
}
.dash-kebab-item-danger { color: #dc2626; }
.dash-kebab-item-danger i { color: #dc2626; }
.dash-kebab-item-danger:hover { background: rgba(220, 38, 38, 0.06); }
.dash-kebab-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Row checkbox styling — clean square with indigo accent */
.dash-row-check {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
}

/* ─── Dashboard v2 — Step 6: Analytics row ─────────────────────────────────
   Three cards in a row. Analytics Overview (4 mini-stats) on the left
   takes 2 columns; Stage Distribution + Stock Status donut cards each
   take 1 column. Wraps to single column under 1100px. */
.dash-analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 1200px) {
  .dash-analytics-grid { grid-template-columns: 1fr 1fr; }
  .dash-analytics-overview { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .dash-analytics-grid { grid-template-columns: 1fr; }
}
.dash-analytics-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.dash-analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dash-analytics-eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.dash-analytics-period {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
}

/* Overview card — 4 mini-stats in a row */
.dash-analytics-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 720px) {
  .dash-analytics-stats { grid-template-columns: repeat(2, 1fr); }
}
.dash-analytics-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.dash-analytics-stat-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-analytics-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
}

/* Donut cards — chart left, legend right */
.dash-analytics-donut-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.dash-donut-wrap {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  height: 160px;
}
.dash-donut-wrap canvas {
  display: block;
  width: 160px !important;
  height: 160px !important;
}
.dash-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dash-donut-center-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.6px;
  line-height: 1;
}
.dash-donut-center-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.dash-donut-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.dash-donut-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  min-width: 0;
}
.dash-donut-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.dash-donut-legend-label {
  flex: 1;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-donut-legend-value {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.dash-donut-legend-pct {
  color: var(--muted);
  font-weight: 500;
}

/* ─── Dashboard v2 — Step 7: empty / loading / error / no-match states ────
   Four variants. All share the same card chrome the rest of the dashboard
   uses (rounded white card, 1px border, soft shadow) so they feel native. */

/* Loading skeleton — placeholder rows with shimmer animation */
.dash-skel-head {
  display: flex;
  gap: 16px;
  padding: 14px 18px;
  background: #f8f9fb;
  border-bottom: 1px solid #eef0f5;
}
.dash-skel-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef0f5;
}
.dash-skel-row:last-child { border-bottom: none; }
.dash-skel-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-skel {
  background: linear-gradient(90deg, #eef0f5 0%, #f5f7fa 50%, #eef0f5 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: dashSkelShimmer 1.4s ease-in-out infinite;
}
@keyframes dashSkelShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dash-skel-thumb { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.dash-skel-line  { height: 12px; }
.dash-skel-pill  { width: 70px; height: 22px; border-radius: 7px; flex-shrink: 0; }
.dash-skel-btn   { width: 110px; height: 32px; border-radius: 9px; flex-shrink: 0; }
.dash-skel-w-60 { width: 60%; }
.dash-skel-w-30 { width: 30%; }
.dash-skel-w-20 { width: 20%; }
.dash-skel-w-15 { width: 100px; }

/* Empty state — never scraped */
.dash-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px 32px;
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  text-align: center;
}
.dash-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(74, 159, 232, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #6366f1;
}
.dash-empty-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #1f2433;
  letter-spacing: -0.3px;
}
.dash-empty-sub {
  margin: 0;
  max-width: 480px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}
.dash-empty-flow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 18px;
  background: #f8f9fb;
  border: 1px solid #eef0f5;
  border-radius: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.dash-empty-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5160;
}
.dash-empty-step i { font-size: 12px; color: #6366f1; }
.dash-empty-arrow { color: #c4c9d4; font-size: 10px; }
.dash-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 11px 22px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #5b6cff 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.30);
}
.dash-empty-cta:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.40);
  transform: translateY(-1px);
}

/* Error variant — orange/red accent on icon + softer message */
.dash-empty-error .dash-empty-icon-error {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.10), rgba(245, 158, 11, 0.12));
  color: #dc2626;
}

/* No-match state — sits inside a table cell, smaller than the page-level empty */
.dash-no-match {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
}
.dash-no-match-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.dash-no-match-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2433;
}
.dash-no-match-sub {
  font-size: 12px;
  color: #6b7280;
  max-width: 380px;
}
.dash-no-match-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #4a5160;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.dash-no-match-cta:hover {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
}

/* ─── Dashboard v2.1 — Stat cards (extended): + Add metric tile + remove × ──
   Each existing .dash-stat-card gets a small × in the top-right that
   removes it from the visible set. The "+ Add metric" tile sits last in
   the row as a dashed call-to-add affordance. */
.dash-stat-card {
  position: relative;
}
.dash-stat-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #c4c9d4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  transition: all 0.15s;
}
.dash-stat-card:hover .dash-stat-remove {
  opacity: 1;
}
.dash-stat-remove:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

/* + Add metric tile — dashed border, plus icon, label below. */
.dash-stat-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  background: transparent;
  border: 1.5px dashed #d6d9e0;
  border-radius: 16px;
  color: #6b7280;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 92px;
}
.dash-stat-add:hover:not(:disabled) {
  background: #f8f9fb;
  border-color: #6366f1;
  color: #6366f1;
}
.dash-stat-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dash-stat-add-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #9ca3af;
  transition: all 0.15s;
}
.dash-stat-add:hover:not(:disabled) .dash-stat-add-icon {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}
.dash-stat-add-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Metric picker overlay — centered modal, ESC closes (wired in JS). */
.dash-metric-picker {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: dashPickIn 0.18s ease-out;
}
@keyframes dashPickIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.dash-metric-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 35, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dash-metric-picker-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  width: min(540px, 100%);
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30);
  padding: 22px 24px 20px;
}
.dash-metric-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.dash-metric-picker-title {
  font-size: 18px;
  font-weight: 800;
  color: #1f2433;
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dash-metric-picker-title i {
  color: #6366f1;
  font-size: 16px;
}
.dash-metric-picker-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 16px;
}
.dash-metric-picker-close:hover {
  background: #f3f4f7;
  color: #1f2433;
}
.dash-metric-picker-sub {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 18px;
}
.dash-metric-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 540px) {
  .dash-metric-picker-grid { grid-template-columns: 1fr; }
}
.dash-metric-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-align: left;
  min-width: 0;
}
.dash-metric-picker-item:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.04);
  transform: translateY(-1px);
}
.dash-metric-picker-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.dash-metric-picker-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.dash-metric-picker-label {
  font-size: 13px;
  font-weight: 700;
  color: #1f2433;
}
.dash-metric-picker-preview {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stat-cards grid — extend to 6 cols by default so "Add metric" fits */
.stat-cards {
  grid-template-columns: repeat(6, 1fr) !important;
}
@media (max-width: 1400px) { .stat-cards { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 1100px) { .stat-cards { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 720px)  { .stat-cards { grid-template-columns: repeat(2, 1fr) !important; } }

/* ─── Dashboard v2.1 — Filter toolbar (extended): Sort dropdown + Filter builder ─ */
.dash-filter-builder {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #6b7280;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.dash-filter-builder:hover {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
}

/* Filter builder popover — centered modal, ESC closes */
.dash-filter-popover {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: dashPickIn 0.18s ease-out;
}
.dash-filter-popover-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 35, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dash-filter-popover-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  width: min(440px, 100%);
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30);
  padding: 22px 24px 18px;
}
.dash-filter-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.dash-filter-popover-title {
  font-size: 16px;
  font-weight: 800;
  color: #1f2433;
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dash-filter-popover-title i {
  color: #6366f1;
  font-size: 14px;
}
.dash-filter-popover-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 16px;
}
.dash-filter-popover-close:hover {
  background: #f3f4f7;
  color: #1f2433;
}
.dash-filter-popover-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.dash-filter-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-filter-popover-label {
  font-size: 13px;
  font-weight: 600;
  color: #4a5160;
  flex-shrink: 0;
}
.dash-filter-popover-input {
  width: 200px !important;
  height: 38px !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  border: 1px solid #e6e8ee !important;
  background: #ffffff !important;
  color: #1f2433 !important;
  font-size: 13px !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  outline: none !important;
  box-sizing: border-box !important;
}
.dash-filter-popover-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14) !important;
}
select.dash-filter-popover-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555c72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 11px 11px !important;
  padding-right: 30px !important;
  cursor: pointer;
}
.dash-filter-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #eef0f5;
}
.dash-filter-popover-clear {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: inherit;
}
.dash-filter-popover-clear:hover {
  color: #1f2433;
  background: #f3f4f7;
}
.dash-filter-popover-apply {
  background: linear-gradient(135deg, #6366f1 0%, #5b6cff 100%);
  color: #ffffff;
  border: none;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.30);
  transition: all 0.15s;
}
.dash-filter-popover-apply:hover {
  background: linear-gradient(135deg, #5856e8 0%, #5060f5 100%);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.40);
  transform: translateY(-1px);
}

/* ─── Dashboard v2.1 — Table: split By + Next Action columns + restyle NBA ── */
.dash-table .dash-th-by    { width: 110px; }
.dash-table .dash-th-next  { width: 180px; }
.dash-table .dash-th-actions { width: 56px; text-align: center; }

.dash-cell-by {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}
.dash-by-link {
  color: #2563eb;
  font-weight: 600;
}
.dash-by-empty { color: #c4c9d4; }

/* Store cell — favicon + domain inline */
.dash-cell-store {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.dash-store-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}
.dash-store-icon-fallback {
  color: #c4c9d4;
  font-size: 12px;
}

/* Scraped cell — just the relative time now (no per-row author; that's
   in the new By column). */
.dash-cell-scraped { text-align: right; }
.dash-scraped-by { display: none; }

/* Next Action column — single tone-coded outline button per row */
.dash-cell-next {
  text-align: left;
  white-space: nowrap;
  padding-right: 12px;
}
.dash-nba-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
  border: 1px solid #e6e8ee;
  color: #6b7280;
}
.dash-nba-btn i { font-size: 12px; }
.dash-nba-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dash-nba-blue {
  border-color: rgba(74, 159, 232, 0.35);
  color: #2563eb;
  background: rgba(74, 159, 232, 0.04);
}
.dash-nba-blue:hover:not(:disabled) {
  background: #2563eb; color: #ffffff; border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.dash-nba-green {
  border-color: rgba(28, 140, 76, 0.35);
  color: #1c8c4c;
  background: rgba(28, 140, 76, 0.05);
}
.dash-nba-green:hover:not(:disabled) {
  background: #1c8c4c; color: #ffffff; border-color: #1c8c4c;
  box-shadow: 0 2px 6px rgba(28, 140, 76, 0.25);
}
.dash-nba-indigo {
  border-color: rgba(99, 102, 241, 0.35);
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.05);
}
.dash-nba-indigo:hover:not(:disabled) {
  background: #4f46e5; color: #ffffff; border-color: #4f46e5;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}
.dash-nba-emerald {
  border-color: rgba(16, 185, 129, 0.40);
  color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}
.dash-nba-emerald:hover:not(:disabled) {
  background: #10b981; color: #ffffff; border-color: #10b981;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.dash-nba-neutral {
  border-color: #e6e8ee;
  color: #6b7280;
  background: #ffffff;
}
.dash-nba-neutral:hover:not(:disabled) {
  background: #f3f4f7; border-color: #c4c9d4; color: #1f2433;
}

/* Actions column is now kebab-only */
.dash-cell-actions { text-align: center; padding: 0 8px; }

/* ─── Dashboard v2.1 — Pagination footer strip ─────────────────────────────
   Sits flush with the table card so the whole thing reads as one bordered
   container. Selected count on the left, rows-per-page + range + minimal
   prev/next icons on the right. */
.dash-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid #eef0f5;
  background: #ffffff;
  flex-wrap: wrap;
}
.dash-table-footer-left,
.dash-table-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-footer-selected {
  font-size: 12px;
  color: #4a5160;
  font-weight: 600;
}
.dash-footer-selected strong { color: #2563eb; font-weight: 800; }
.dash-footer-selected-zero { color: #9ca3af; font-weight: 500; }
.dash-footer-rpp-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.dash-footer-rpp {
  height: 30px;
  padding: 0 28px 0 12px;
  border-radius: 8px;
  border: 1px solid #e6e8ee;
  background-color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  color: #1f2433;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23555c72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 10px;
  outline: none;
}
.dash-footer-rpp:hover { border-color: #c4c9d4; }
.dash-footer-rpp:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
.dash-footer-range {
  font-size: 12px;
  color: #4a5160;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 8px;
}
.dash-footer-nav {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e6e8ee;
  background: #ffffff;
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.dash-footer-nav:hover:not(:disabled) {
  background: #f3f4f7;
  border-color: #c4c9d4;
  color: #1f2433;
}
.dash-footer-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Dashboard v2.1 — Analytics row extended to 4 cards ───────────────────
   Overview (2 cols) + Stage Distribution + Stock Status + Recent Activity.
   Drops to 2-up at 1280px, single-col at 720px. */
.dash-analytics-grid {
  grid-template-columns: 2fr 1fr 1fr 1.4fr !important;
}
@media (max-width: 1480px) {
  .dash-analytics-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .dash-analytics-overview { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .dash-analytics-grid { grid-template-columns: 1fr !important; }
}

/* Period select (Last 7 days / 30 / 90 / All) inside the Overview head */
.dash-analytics-period-select {
  height: 28px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  border: 1px solid #e6e8ee;
  background-color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  color: #4a5160;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23555c72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 10px;
  outline: none;
}
.dash-analytics-period-select:hover { border-color: #c4c9d4; }

/* Trend arrows under each Overview mini-stat */
.dash-analytics-stat-trend {
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dash-analytics-stat-trend i { font-size: 10px; }
.dash-trend-up   { color: #1c8c4c; }
.dash-trend-down { color: #dc2626; }
.dash-trend-flat { color: var(--muted); }
.dash-trend-sub {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  margin-left: 4px;
}

/* Recent Activity card */
.dash-analytics-activity { display: flex; flex-direction: column; }
.dash-activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.dash-activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 12px;
}
.dash-activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}
.dash-activity-body {
  flex: 1;
  min-width: 0;
}
.dash-activity-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.dash-activity-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-activity-time {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.dash-activity-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.dash-activity-empty i { font-size: 14px; }
.dash-activity-view-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  padding: 9px 14px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 10px;
  color: #6366f1;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.dash-activity-view-all:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: #6366f1;
}
.dash-activity-view-all i { font-size: 11px; }

/* ─── PUBLISH CENTER (merged Pre-flight + Push) ────────────────────────── */
/* Every color uses themed CSS vars so the section follows the global
   light/dark switch in :root vs html.light. Studio tab is the reference. */
#section-publish { background: var(--bg); min-height: 100vh; padding-bottom: 120px; }
.pc-wrap { max-width: 1480px; margin: 24px auto; padding: 0 28px; }

/* Header */
.pc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.pc-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); display: flex; align-items: center; gap: 12px; }
.pc-subtitle { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.pc-pill-green { font-size: 11px; padding: 4px 11px; border-radius: 999px; background: var(--green-dim); color: var(--green); font-weight: 700; }
.pc-pill-green.is-empty { background: var(--blue-dim); color: var(--muted); }

/* Step header */
.pc-step { margin-bottom: 24px; }
.pc-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pc-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--blue-dim); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.pc-step-label { font-size: 16px; font-weight: 700; color: var(--text); }

/* Card chrome */
.pc-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }

/* Step 1 — final-checks card */
.pc-checks-card { display: grid; grid-template-columns: 330px minmax(420px, 1fr) 200px; gap: 28px; align-items: center; padding: 24px 28px; }
@media (max-width: 980px) { .pc-checks-card { grid-template-columns: 1fr; } }
.pc-checks-summary { display: flex; align-items: center; gap: 18px; min-width: 0; }
.pc-checks-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--green-dim); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pc-checks-icon.is-warning { background: var(--amber-dim); }
.pc-checks-icon.is-empty { background: var(--blue-dim); }
.pc-checks-h1 { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; margin-bottom: 8px; }
.pc-checks-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.pc-checks-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.pc-checks-card.is-empty .pc-checks-meta-item i { color: var(--blue) !important; }
.pc-checks-card.is-empty .pc-checklist-item { color: var(--muted); }
.pc-checks-card.is-empty .pc-view-checks-btn {
  cursor: default;
}
.pc-checklist-label { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.pc-checklist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; }
@media (max-width: 980px) { .pc-checklist-grid { grid-template-columns: repeat(2, 1fr); } }
.pc-checklist-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-checklist-item.is-fail { color: var(--text); }
.pc-view-checks-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 20px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.pc-view-checks-btn:hover { border-color: var(--blue); color: var(--blue); }
.pc-view-checks-btn:disabled { opacity: 0.7; cursor: default; }
.pc-view-checks-btn:disabled:hover { border-color: var(--border); color: var(--text); }
.pc-view-checks-btn > span:first-of-type { display: inline-flex; align-items: center; gap: 6px; }
.pc-view-checks-sub { font-size: 11px; color: var(--muted); font-weight: 500; }

/* Step 2 — publishing setup card */
.pc-setup-card { padding: 20px 24px; }
.pc-setup-grid { display: grid; grid-template-columns: 220px minmax(280px, 1fr) 220px 180px auto; gap: 18px; align-items: end; }
@media (max-width: 1100px) { .pc-setup-grid { grid-template-columns: 1fr 1fr; } }
.pc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pc-field-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.pc-control { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font-size: 13px; font-family: inherit; box-sizing: border-box; }
.pc-control:focus { outline: none; border-color: var(--blue); }
.pc-mode-group { display: inline-flex; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 4px; gap: 2px; }
.pc-mode-opt { flex: 1; border: none; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; padding: 0 14px; border-radius: 7px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.15s; }
.pc-mode-opt:hover { color: var(--text); }
.pc-mode-opt.is-active { background: var(--blue); color: #fff; }
.pc-mode-opt.is-active:hover { color: #fff; }
.pc-mode-tag { font-size: 10px; opacity: 0.75; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,0.18); }
.pc-mode-opt:not(.is-active) .pc-mode-tag { background: var(--border-subtle); color: var(--muted); }
.pc-dryrun { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.pc-dryrun input { cursor: pointer; }
.pc-dryrun-label { font-weight: 500; }
.pc-field-cta { justify-self: end; }
.pc-dry-test-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.pc-dry-test-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Step 3 — ready product table */
.pc-table-card { padding: 0; overflow: hidden; }
.pc-table-wrap { overflow-x: auto; }
.pc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pc-table thead th { padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); background: var(--bg); }
.pc-table tbody td { padding: 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text); vertical-align: middle; }
.pc-table tbody tr:last-child td { border-bottom: none; }
.pc-table tbody tr.is-selected { background: var(--blue-dim); }
.pc-table tbody tr:hover { background: var(--border-subtle); }
.pc-table tbody tr.is-selected:hover { background: var(--blue-dim); }
.pc-empty-cell { padding: 0 !important; border-bottom: none !important; }
.pc-product-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pc-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: var(--bg); }
.pc-thumb-blank { display: inline-flex; align-items: center; justify-content: center; }
.pc-product-text { min-width: 0; }
.pc-product-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-product-sub { font-size: 11px; color: var(--blue); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-store-cell { color: var(--text-2); font-size: 12px; }
.pc-img-count { display: inline-flex; align-items: center; padding: 2px 8px; background: var(--bg); border-radius: 6px; font-size: 12px; color: var(--text-2); }
.pc-readiness-pass, .pc-readiness-fail { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.pc-readiness-pass { background: var(--green-dim); color: var(--green); }
.pc-readiness-fail { background: var(--amber-dim); color: var(--amber); }
.pc-readiness-pass:hover, .pc-readiness-fail:hover { filter: brightness(1.1); }
.pc-status-pill { display: inline-flex; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.2px; }
.pc-status-ready { background: var(--green-dim); color: var(--green); }
.pc-status-blocked { background: var(--amber-dim); color: var(--amber); }
.pc-row-actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pc-row-action-primary { padding: 6px 14px; background: transparent; border: 1px solid var(--blue); border-radius: 8px; color: var(--blue); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.pc-row-action-primary:hover { background: var(--blue); color: #fff; }
.pc-row-action-secondary { padding: 6px 12px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.pc-row-action-secondary:hover { border-color: var(--amber); color: var(--amber); }
.pc-row-action-kebab { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px; transition: all 0.15s; }
.pc-row-action-kebab:hover { border-color: var(--blue); color: var(--blue); }
.pc-table-footer { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--bg); }

/* Bottom sticky action bar */
.pc-actionbar { position: sticky; bottom: 0; max-width: 1480px; margin: 0 auto; padding: 16px 28px; background: var(--card); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; backdrop-filter: blur(10px); z-index: 10; }
.pc-actionbar-count { font-size: 14px; font-weight: 700; color: var(--text); }
.pc-actionbar-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pc-actionbar-actions { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.pc-btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; background: var(--blue); border: none; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.pc-btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.pc-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.pc-btn-secondary { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.pc-btn-secondary:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pc-btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

/* View Checks modal */
.pc-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pc-modal { background: var(--card); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.pc-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border-subtle); }
.pc-modal-close { background: transparent; border: none; font-size: 18px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.pc-modal-close:hover { color: var(--text); }
.pc-modal-body { overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.pc-check-block { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pc-check-block.is-blocked { border-color: var(--amber-dim); }
.pc-check-block-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.pc-check-block-head:hover { background: var(--border-subtle); }
.pc-check-thumb { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; background: var(--bg); }
.pc-check-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-check-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pc-check-summary-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pc-check-summary-pill.is-ready { background: var(--green-dim); color: var(--green); }
.pc-check-summary-pill.is-blocked { background: var(--amber-dim); color: var(--amber); }
.pc-check-chev { font-size: 11px; color: var(--muted); transition: transform 0.2s; }
.pc-check-block-body { display: none; padding: 4px 14px 14px; border-top: 1px solid var(--border-subtle); }
.pc-check-block-body.is-open { display: block; }
.pc-check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.pc-check-row:last-child { border-bottom: none; }
.pc-check-row-label { font-size: 12px; font-weight: 600; color: var(--text); }
.pc-check-row-fix { font-size: 11px; color: var(--muted); margin-top: 3px; }
.pc-check-row.is-fail .pc-check-row-fix { color: var(--text-2); }
.pc-check-row-fix-btn { padding: 5px 11px; background: var(--blue); border: none; border-radius: 7px; color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; flex-shrink: 0; }
.pc-check-row-fix-btn:hover { background: var(--blue-hover); }

/* Push progress panel (rendered into #pc-push-status) */
.pc-push-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; margin-bottom: 12px; background: var(--card); border: 1px solid var(--border); }
.pc-push-banner.is-success { background: var(--green-dim); border-color: var(--green); }
.pc-push-banner.is-warning { background: var(--amber-dim); border-color: var(--amber); }
.pc-push-banner-h1 { font-size: 14px; font-weight: 700; color: var(--text); }
.pc-push-banner-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pc-push-progress { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); margin-bottom: 12px; }
.pc-push-progress-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.pc-push-progress-track { height: 6px; background: var(--border-subtle); border-radius: 3px; overflow: hidden; }
.pc-push-progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width 0.3s ease; }
.pc-push-list { background: var(--card); border: 1px solid var(--border); border-radius: 10px; max-height: 320px; overflow-y: auto; }
.pc-push-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); font-size: 12px; }
.pc-push-row:last-child { border-bottom: none; }
.pc-push-row-title { flex: 1; min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-push-row-sub { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.pc-push-row-link { font-size: 11px; color: var(--blue); text-decoration: none; }
.pc-push-row-err { font-size: 11px; color: var(--red); }

/* ─── STORE MANAGER v2 ───────────────────────────────────────────────── */
/* Pixel-perfect-ish rebuild matching the approved mockup. Themed via vars
   so light + dark modes both work. The Studio tab is the visual reference
   for dark-mode harmony. */
#section-manage { background: var(--bg); min-height: 100vh; }
.mng-wrap { max-width: 1480px; margin: 24px auto; padding: 0 28px 80px; }

/* Header */
.mng-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.mng-header-titlewrap { display: flex; align-items: flex-start; gap: 16px; }
.mng-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--blue-dim); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mng-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.mng-subtitle { margin: 4px 0 0; font-size: 13px; color: var(--muted); max-width: 580px; }
.mng-header-right { display: inline-flex; gap: 12px; align-items: stretch; }
.mng-loaded-pill, .mng-store-pill { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.mng-loaded-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.mng-loaded-value { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.1; }
.mng-loaded-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.mng-store-name { font-size: 14px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }

/* Toolbar */
.mng-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.mng-toolbar-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; }
.mng-control { position: relative; display: inline-flex; align-items: center; height: 40px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.mng-control-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; z-index: 1; }
.mng-control-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); pointer-events: none; z-index: 1; }
.mng-control-picker { min-width: 220px; }
.mng-control-picker .mng-select { width: 100%; height: 40px; padding: 0 32px 0 34px; background: transparent; border: none; outline: none; font-size: 13px; color: var(--text); font-family: inherit; appearance: none; -webkit-appearance: none; cursor: pointer; }
.mng-control-search { flex: 1; min-width: 280px; }
.mng-control-search .mng-input { width: 100%; height: 40px; padding: 0 12px 0 34px; background: transparent; border: none; outline: none; font-size: 13px; color: var(--text); font-family: inherit; box-sizing: border-box; }
.mng-control-search .mng-input::placeholder { color: var(--muted); }
.mng-btn-primary { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; background: var(--blue); border: none; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.mng-btn-primary:hover { background: var(--blue-hover); }
.mng-last-updated { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.mng-last-updated-value { color: var(--text); font-weight: 600; }
.mng-refresh-btn { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; color: var(--muted); cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; }
.mng-refresh-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Stats grid */
.mng-stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 1280px) { .mng-stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .mng-stats-grid { grid-template-columns: repeat(2, 1fr); } }
.mng-stat-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.mng-stat-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; }
.mng-stat-icon-blue   { background: rgba(58, 143, 217, 0.12); color: #3a8fd9; }
.mng-stat-icon-green  { background: rgba(28, 140, 76, 0.12);  color: #1c8c4c; }
.mng-stat-icon-amber  { background: rgba(209, 138, 26, 0.12); color: #d18a1a; }
.mng-stat-icon-red    { background: rgba(220, 38, 38, 0.10);  color: #dc2626; }
.mng-stat-icon-purple { background: rgba(121, 80, 212, 0.12); color: #7950d4; }
.mng-stat-icon-gray   { background: rgba(107, 114, 128, 0.12); color: #6b7280; }
.mng-stat-body { flex: 1; min-width: 0; }
.mng-stat-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.mng-stat-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.1; margin-top: 2px; }
.mng-stat-value-sm { font-size: 14px; }
.mng-stat-cur { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.mng-stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Selection action bar */
.mng-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.mng-actionbar-info { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; }
.mng-selected-count { font-weight: 700; color: var(--text); }
.mng-action-link { background: transparent; border: 1px solid var(--border); padding: 5px 10px; border-radius: 7px; color: var(--text-2); font-size: 12px; cursor: pointer; font-family: inherit; }
.mng-action-link:hover { color: var(--text); border-color: var(--blue); }
.mng-actionbar-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.mng-action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.mng-action-btn:not(:disabled):hover { border-color: var(--blue); color: var(--blue); }
.mng-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.mng-action-btn.mng-action-danger:not(:disabled):hover { border-color: var(--red); color: var(--red); }

/* Table card */
.mng-table-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mng-table-wrap { overflow-x: auto; }
.mng-empty-state { padding: 60px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; }
.mng-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mng-table thead th { padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); background: var(--bg); user-select: none; }
.mng-table thead th.mng-sort { cursor: pointer; }
.mng-table thead th.mng-sort:hover { color: var(--text); }
.mng-table thead th .mng-sort-arrow { font-size: 9px; margin-left: 4px; opacity: 0.5; }
.mng-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text); vertical-align: middle; }
.mng-table tbody tr:last-child td { border-bottom: none; }
.mng-table tbody tr:hover { background: var(--border-subtle); }
.mng-table tbody tr.mng-row-selected { background: var(--blue-dim); }
.mng-product-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mng-product-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: var(--bg); }
.mng-product-thumb-blank { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.mng-product-text { min-width: 0; }
.mng-product-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.mng-product-sku { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mng-price-cell { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.mng-price-sub { font-size: 10px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.mng-qty-input, .mng-ml-input, .mng-price-input { width: 80px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.mng-qty-input:focus, .mng-ml-input:focus, .mng-price-input:focus { outline: none; border-color: var(--blue); }
.mng-qty-untracked { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 7px; background: var(--bg); color: var(--muted); font-size: 11px; }
.mng-status-pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.mng-status-active { background: rgba(28, 140, 76, 0.12); color: var(--green); }
.mng-status-draft  { background: rgba(209, 138, 26, 0.12); color: var(--amber); }
.mng-status-archived { background: rgba(107, 114, 128, 0.12); color: var(--muted); }
.mng-row-kebab { width: 28px; height: 28px; border: 1px solid var(--border); background: transparent; border-radius: 7px; color: var(--text-2); font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mng-row-kebab:hover { border-color: var(--blue); color: var(--blue); }
.mng-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }

/* Pagination */
.mng-pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg); }
.mng-pagination-info { font-size: 12px; color: var(--muted); }
.mng-pagination-controls { display: inline-flex; align-items: center; gap: 10px; }
.mng-pagination-label { font-size: 12px; color: var(--muted); }
.mng-rpp-select { height: 30px; padding: 0 24px 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--text); font-size: 12px; cursor: pointer; appearance: none; -webkit-appearance: none; font-family: inherit; }
.mng-page-nav { width: 30px; height: 30px; border: 1px solid var(--border); background: var(--card); border-radius: 7px; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mng-page-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.mng-page-nav:not(:disabled):hover { border-color: var(--blue); color: var(--blue); }
.mng-page-current { font-size: 12px; font-weight: 600; color: var(--text); min-width: 30px; text-align: center; padding: 0 8px; background: var(--blue); color: #fff; border-radius: 7px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }

/* ─── NOTIFICATIONS (topbar bell + dropdown) ─────────────────────────── */
.notif-wrap { position: relative; display: inline-flex; align-items: center; }
/* Header bell: same scale as the other global controls, but with a softer
   circular hit-state so it feels intentional inside the dark chrome. */
.notif-wrap-header .notif-bell-header {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #9da7bd;
  background: transparent;
  border-color: transparent;
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.notif-wrap-header .notif-bell-header i {
  font-size: 15px;
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
  line-height: 1;
}
.notif-wrap-header .notif-bell-header:hover,
.notif-wrap-header .notif-bell-header.is-open {
  color: #f3f7ff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.notif-wrap-header .notif-bell-header.has-unread {
  color: #ffffff;
  background: rgba(79, 142, 247, 0.16);
  border-color: rgba(79, 142, 247, 0.34);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.08), inset 0 1px 0 rgba(255,255,255,0.10);
}
.notif-wrap-header .notif-bell-header:active {
  transform: translateY(1px);
}
.notif-wrap-header .notif-badge {
  top: 3px;
  right: 3px;
  min-width: 7px;
  width: 7px;
  height: 7px;
  padding: 0;
  overflow: hidden;
  text-indent: -999px;
  border-radius: 999px;
  background: #4f8ef7;
  border: 1.5px solid #0d1117;
  box-shadow: 0 0 0 3px rgba(79,142,247,.16);
}
html:not(.light) .notif-wrap-header .notif-badge {
  border-color: #101525;
}
.notif-wrap-header .notif-panel {
  top: calc(100% + 12px);
  right: -6px;
}
.notif-bell { position: relative; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s; }
.notif-bell:hover { border-color: var(--blue); color: var(--blue); }
.notif-bell.has-unread { color: var(--text); }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--surface); box-sizing: content-box; }
.notif-panel { position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, calc(100vw - 24px)); max-height: min(480px, calc(100vh - 72px)); background: rgba(255,255,255,0.98); border: 1px solid rgba(214,221,235,0.92); border-radius: 16px; box-shadow: 0 24px 70px rgba(15,20,35,0.22), 0 6px 18px rgba(15,20,35,0.08); z-index: 99999; overflow: hidden; display: flex; flex-direction: column; opacity: 1; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
html.light .notif-panel { background: rgba(255,255,255,0.98); box-shadow: 0 24px 70px rgba(15,20,35,0.20), 0 6px 18px rgba(15,20,35,0.08); }
html:not(.light) .notif-panel { background: rgba(25,31,47,0.98); border-color: rgba(255,255,255,0.08); box-shadow: 0 26px 80px rgba(0,0,0,0.48), 0 8px 24px rgba(0,0,0,0.26); }
.notif-panel-head, .notif-panel-body { background: inherit; }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.notif-panel-title { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.notif-mark-read { background: rgba(79,142,247,0.08); border: 1px solid rgba(79,142,247,0.12); color: var(--blue); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; padding: 6px 10px; border-radius: 999px; }
.notif-mark-read:hover { background: rgba(79,142,247,0.14); border-color: rgba(79,142,247,0.22); }
.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-empty { padding: 38px 28px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.45; }
.notif-empty i { width: 46px; height: 46px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 50%; background: rgba(79,142,247,0.08); color: #8d99ad !important; margin-bottom: 12px !important; }
.notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background 0.14s ease; position: relative; }
.notif-row:hover { background: rgba(79,142,247,0.06); }
.notif-row.is-unread { background: linear-gradient(90deg, rgba(79,142,247,0.12), rgba(79,142,247,0.04)); }
.notif-row.is-unread:hover { filter: none; background: linear-gradient(90deg, rgba(79,142,247,0.16), rgba(79,142,247,0.06)); }
.notif-row:last-child { border-bottom: none; }
.notif-row-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.notif-row-body { flex: 1; min-width: 0; }
.notif-row-text { font-size: 12.5px; color: var(--text); line-height: 1.45; padding-right: 14px; }
.notif-row-text strong { font-weight: 800; }
.notif-row-product { color: var(--blue); font-weight: 600; }
.notif-row-time { font-size: 10.5px; color: var(--muted); margin-top: 4px; font-weight: 650; }
.notif-row-dot { position: absolute; right: 14px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(79,142,247,.14); }

/* ─── DASHBOARD DARK-MODE PATCH ──────────────────────────────────────── */
/* The dashboard's .dash-* components were written light-first with
   hardcoded #ffffff backgrounds + #1f2433 text. Most have no dark-mode
   override, so they render LIGHT inside the dark theme. Until the bigger
   CSS-split refactor lands, these patch rules force the most visible
   dashboard surfaces onto themed vars in dark mode. Scoped to
   html:not(.light) so light mode is unchanged. */
html:not(.light) #section-dashboard .dash-stat-card,
html:not(.light) #section-dashboard .dash-add-metric-tile,
html:not(.light) #section-dashboard .dash-analytics-card,
html:not(.light) #section-dashboard .dash-command-panel,
html:not(.light) #section-dashboard .dash-header-card,
html:not(.light) #section-dashboard .dash-toolbar,
html:not(.light) #section-dashboard .dash-table-shell,
html:not(.light) #section-dashboard .dash-footer-card,
html:not(.light) #section-dashboard .dash-table-head,
html:not(.light) #section-dashboard .dash-action-btn,
html:not(.light) #section-dashboard .dash-by-link,
html:not(.light) #section-dashboard .dash-product-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-stat-label,
html:not(.light) #section-dashboard .dash-stat-sub,
html:not(.light) #section-dashboard .dash-table-head th,
html:not(.light) #section-dashboard .dash-footer-range,
html:not(.light) #section-dashboard .dash-by-empty,
html:not(.light) #section-dashboard .dash-scraped-time {
  color: var(--muted) !important;
}
html:not(.light) #section-dashboard .dash-stat-value,
html:not(.light) #section-dashboard .dash-cell-stage,
html:not(.light) #section-dashboard .dash-by-link {
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-table-row {
  background: transparent !important;
  border-bottom-color: var(--border-subtle) !important;
}
html:not(.light) #section-dashboard .dash-table-row:hover {
  background: var(--border-subtle) !important;
}
html:not(.light) #section-dashboard .dash-action-btn:hover {
  background: var(--blue-dim) !important;
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}

/* ─── DASHBOARD CURRENT-SURFACE HARDENING ───────────────────────────────
   The dashboard v2/v2.1 class names evolved after the first dark-mode patch.
   These rules cover the live class names and keep the dashboard responsive:
   dark mode uses true dark surfaces, controls inherit theme tokens, analytics
   copy cannot spill outside cards, and wide tables scroll instead of crushing. */
#section-dashboard .dash-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
#section-dashboard .dash-table {
  min-width: 1120px;
}
#section-dashboard .dash-analytics-card,
#section-dashboard .dash-cc-card,
#section-dashboard .dash-table-wrap {
  min-width: 0;
}
#section-dashboard .dash-analytics-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.1vw, 18px);
}
#section-dashboard .dash-analytics-stat {
  min-width: 0;
  overflow: hidden;
}
#section-dashboard .dash-analytics-stat-trend {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2px 5px;
  max-width: 100%;
  line-height: 1.15;
}
#section-dashboard .dash-trend-sub {
  flex-basis: 100%;
  margin-left: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 980px) {
  #section-dashboard .dash-analytics-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  #section-dashboard .dash-analytics-head,
  #section-dashboard .dash-table-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  #section-dashboard .dash-analytics-stats,
  #section-dashboard .dash-filters-bar {
    grid-template-columns: 1fr;
  }
  #section-dashboard .dash-filter-search,
  #section-dashboard .dash-filter-select {
    min-width: 100% !important;
    width: 100% !important;
  }
  #section-dashboard .dash-cc-card {
    padding: 18px;
  }
}

html:not(.light) #section-dashboard .dash-cc-card,
html:not(.light) #section-dashboard .dash-cc-tile,
html:not(.light) #section-dashboard .dash-table-wrap,
html:not(.light) #section-dashboard .dash-table-footer,
html:not(.light) #section-dashboard .dash-filter-search input,
html:not(.light) #section-dashboard .dash-filter-select,
html:not(.light) #section-dashboard .dash-filter-clear,
html:not(.light) #section-dashboard .dash-filter-refresh,
html:not(.light) #section-dashboard .dash-filter-builder,
html:not(.light) #section-dashboard .dash-footer-rpp,
html:not(.light) #section-dashboard .dash-footer-nav,
html:not(.light) #section-dashboard .dash-analytics-period-select,
html:not(.light) #section-dashboard .dash-action-2-btn,
html:not(.light) #section-dashboard .dash-kebab-btn,
html:not(.light) #section-dashboard .dash-nba-btn,
html:not(.light) #section-dashboard .dash-nba-neutral,
html:not(.light) #section-dashboard .dash-filter-popover-card,
html:not(.light) #section-dashboard .dash-filter-popover-input {
  background-color: var(--card) !important;
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-table thead th {
  background: var(--surface) !important;
  border-bottom-color: var(--border) !important;
  color: var(--text-2) !important;
}
html:not(.light) #section-dashboard .dash-row + .dash-row td,
html:not(.light) #section-dashboard .dash-table-footer,
html:not(.light) #section-dashboard .dash-filter-popover-footer {
  border-top-color: var(--border-subtle) !important;
}
html:not(.light) #section-dashboard .dash-row:hover {
  background: rgba(255, 255, 255, 0.035) !important;
}
html:not(.light) #section-dashboard .dash-row.is-selected,
html:not(.light) #section-dashboard .dash-row.is-selected:hover {
  background: rgba(124, 134, 255, 0.10) !important;
}
html:not(.light) #section-dashboard .dash-cc-hero-title,
html:not(.light) #section-dashboard .dash-cc-tile-count,
html:not(.light) #section-dashboard .dash-title,
html:not(.light) #section-dashboard .dash-price-num,
html:not(.light) #section-dashboard .dash-table td,
html:not(.light) #section-dashboard .dash-filter-popover-title,
html:not(.light) #section-dashboard .dash-footer-rpp,
html:not(.light) #section-dashboard .dash-footer-range {
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-cc-hero-sub,
html:not(.light) #section-dashboard .dash-cc-tile-label,
html:not(.light) #section-dashboard .dash-cell-store,
html:not(.light) #section-dashboard .dash-cell-by,
html:not(.light) #section-dashboard .dash-sub,
html:not(.light) #section-dashboard .dash-price-cur,
html:not(.light) #section-dashboard .dash-cell-images,
html:not(.light) #section-dashboard .dash-scraped-time,
html:not(.light) #section-dashboard .dash-footer-selected,
html:not(.light) #section-dashboard .dash-footer-rpp-label,
html:not(.light) #section-dashboard .dash-filter-search input::placeholder,
html:not(.light) #section-dashboard .dash-filter-popover-label {
  color: var(--text-2) !important;
}
html:not(.light) #section-dashboard .dash-cc-tile-bar,
html:not(.light) #section-dashboard .dash-thumb {
  background: var(--border-subtle) !important;
}
html:not(.light) #section-dashboard .dash-cc-tile:hover,
html:not(.light) #section-dashboard .dash-filter-clear:hover,
html:not(.light) #section-dashboard .dash-filter-refresh:hover,
html:not(.light) #section-dashboard .dash-filter-builder:hover,
html:not(.light) #section-dashboard .dash-footer-nav:hover:not(:disabled),
html:not(.light) #section-dashboard .dash-action-2-btn:hover:not(:disabled),
html:not(.light) #section-dashboard .dash-kebab-btn:hover:not(:disabled),
html:not(.light) #section-dashboard .dash-nba-neutral:hover:not(:disabled),
html:not(.light) #section-dashboard .dash-filter-popover-close:hover,
html:not(.light) #section-dashboard .dash-filter-popover-clear:hover {
  background: var(--border-subtle) !important;
  border-color: var(--slate) !important;
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-filter-select,
html:not(.light) #section-dashboard .dash-footer-rpp,
html:not(.light) #section-dashboard .dash-analytics-period-select,
html:not(.light) #section-dashboard select.dash-filter-popover-input {
  background-image: none !important;
}

/* Responsive pass: the dashboard lives beside a fixed sidebar, so viewport
   media queries alone overestimate available content width. Use intrinsic
   grids for the dashboard's widest blocks. */
#section-dashboard .stat-cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}
#section-dashboard .dash-stat-card,
#section-dashboard .dash-stat-add {
  min-width: 0;
}
@media (max-width: 1700px) {
  #section-dashboard .dash-cc-card {
    grid-template-columns: 1fr;
  }
  #section-dashboard .dash-cc-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
  }
  #section-dashboard .dash-cc-dot-sep {
    display: none;
  }
}
@media (max-width: 1180px) {
  #section-dashboard .dash-analytics-grid {
    grid-template-columns: 1fr !important;
  }
  #section-dashboard .dash-analytics-donut-row {
    justify-content: flex-start;
  }
}

/* Keep analytics readable immediately after reload; the old dashboard
   animation leaves screenshots and fast visual checks in a dim mid-state. */
#section-dashboard #dashboard-analytics > * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
html:not(.light) #section-dashboard .dash-analytics-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.012)),
    var(--card) !important;
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-analytics-eyebrow {
  color: #7c86ff !important;
}
html:not(.light) #section-dashboard .dash-analytics-stat-label,
html:not(.light) #section-dashboard .dash-donut-legend-label,
html:not(.light) #section-dashboard .dash-trend-sub {
  color: var(--text-2) !important;
}
html:not(.light) #section-dashboard .dash-analytics-stat-value,
html:not(.light) #section-dashboard .dash-donut-center-num,
html:not(.light) #section-dashboard .dash-donut-legend-value {
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-stat-add {
  border-color: var(--border) !important;
  color: var(--text-2) !important;
}
html:not(.light) #section-dashboard .dash-stat-add:hover:not(:disabled) {
  background: var(--border-subtle) !important;
  border-color: var(--indigo) !important;
  color: var(--text) !important;
}
html:not(.light) #section-dashboard .dash-stat-add-icon {
  background: var(--border-subtle) !important;
  color: var(--text-2) !important;
}

/* ─── PIPELINE SURFACE HARDENING ────────────────────────────────────────
   Current pipeline screens still had a few light-first surfaces in dark
   mode. Keep the live screens themed, readable, and responsive without
   touching the backend stage names that existing endpoints still expect. */
.main {
  min-width: 0;
  width: calc(100vw - var(--sidebar-w));
}
.content {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 768px) {
  .main {
    width: calc(100vw - 60px);
  }
}
@media (max-width: 580px) {
  .main {
    width: 100vw;
  }
}
#section-image-studio .ist-v2-settings-wrap,
#section-image-studio .ist-source-empty,
#section-image-studio .ist-source-filled,
#section-image-studio .ist-v2-footer {
  width: min(1480px, calc(100% - 56px));
  max-width: calc(100vw - var(--sidebar-w) - 84px);
}
#section-image-studio .ist-v2-grid {
  width: min(1480px, calc(100% - 56px));
  max-width: calc(100vw - var(--sidebar-w) - 84px) !important;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
#section-image-studio {
  --ist-content-rail: min(1480px, calc(100% - 56px));
}
#section-image-studio > .ist-v2-header,
#section-image-studio > #ist-queue-panel,
#section-image-studio > #ist-source-strip,
#section-image-studio > .ist-v2-settings-wrap,
#section-image-studio > #ist-grid-card,
#section-image-studio > .ist-v2-footer {
  width: var(--ist-content-rail) !important;
  max-width: var(--ist-content-rail) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}
#section-image-studio > #ist-source-strip .ist-source-empty,
#section-image-studio > #ist-source-strip .ist-source-filled,
#section-image-studio > #ist-grid-card .ist-v2-grid {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}
#section-image-studio #ist-grid-card {
  max-width: 100%;
  overflow-x: hidden;
}
#section-image-studio .ist-source-empty {
  flex-wrap: wrap;
}
#section-image-studio .ist-source-empty-actions {
  flex-wrap: wrap;
  min-width: 0;
}
#section-image-studio .ist-v2-settings-row,
#section-image-studio .ist-v2-footer-actions {
  min-width: 0;
}
#section-image-studio .ist-v2-footer-actions {
  justify-content: flex-end;
}
#section-image-studio .ist-v2-footer-btn {
  white-space: nowrap;
}
@media (max-width: 980px) {
  #section-image-studio .ist-v2-settings-wrap {
    flex-direction: column;
  }
  #section-image-studio .ist-v2-settings-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #section-image-studio .ist-v2-setting {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  #section-image-studio .ist-v2-more-btn {
    min-height: 44px;
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
  }
}
@media (max-width: 640px) {
  #section-image-studio .ist-v2-settings-wrap,
  #section-image-studio .ist-source-empty,
  #section-image-studio .ist-source-filled,
  #section-image-studio .ist-v2-footer,
  #section-image-studio .ist-v2-grid {
    width: min(100% - 28px, 1480px);
    max-width: calc(100vw - 28px) !important;
  }
  #section-image-studio {
    --ist-content-rail: min(100% - 28px, 1480px);
  }
  #section-image-studio .ist-v2-settings-row {
    grid-template-columns: 1fr;
  }
  #section-image-studio .ist-v2-footer {
    align-items: stretch;
  }
  #section-image-studio .ist-v2-footer-stats,
  #section-image-studio .ist-v2-footer-actions {
    width: 100%;
    justify-content: space-between;
  }
  #section-image-studio .ist-v2-footer-actions {
    flex-direction: column;
  }
  #section-image-studio .ist-source-empty-actions,
  #section-image-studio .ist-source-empty-actions .btn {
    width: 100%;
  }
  #section-image-studio .ist-v2-footer-btn {
    justify-content: center;
    width: 100%;
  }
}
html:not(.light) #section-image-studio .ist-v2-settings-wrap,
html:not(.light) #section-image-studio .ist-v2-setting,
html:not(.light) #section-image-studio .ist-v2-more-btn,
html:not(.light) #section-image-studio .ist-source-empty,
html:not(.light) #section-image-studio .ist-source-filled,
html:not(.light) #section-image-studio .ist-v2-scene,
html:not(.light) #section-image-studio .ist-v2-footer {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html:not(.light) #section-image-studio .ist-v2-scene {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.012)),
    var(--card) !important;
}
html:not(.light) #section-image-studio .ist-v2-footer {
  background: rgba(31, 38, 54, 0.94) !important;
}
html:not(.light) #section-image-studio .ist-v2-scene-thumb,
html:not(.light) #section-image-studio .ist-v2-setting-toggle,
html:not(.light) #section-image-studio .ist-v2-scene-btn.regen {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html:not(.light) #section-image-studio .ist-v2-setting-input,
html:not(.light) #section-image-studio .ist-v2-setting-input:focus,
html:not(.light) #section-image-studio .ist-v2-setting-input:focus-visible,
html:not(.light) #section-image-studio .ist-v2-setting-input:active {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html:not(.light) #section-image-studio .ist-v2-setting-label,
html:not(.light) #section-image-studio .ist-source-empty-sub,
html:not(.light) #section-image-studio .ist-v2-scene-desc,
html:not(.light) #section-image-studio .ist-v2-stat-label {
  color: var(--text-2) !important;
}
html:not(.light) #section-image-studio .ist-source-empty-title,
html:not(.light) #section-image-studio .ist-source-name,
html:not(.light) #section-image-studio .ist-v2-scene-title,
html:not(.light) #section-image-studio .ist-v2-stat-value {
  color: var(--text) !important;
}
html:not(.light) #section-image-studio .ist-source-desc {
  color: var(--text-2) !important;
}
html:not(.light) #section-image-studio .ist-source-pill {
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-2) !important;
}
html:not(.light) #section-image-studio .ist-source-pill.purple {
  background: rgba(124,134,255,0.16) !important;
  border-color: rgba(124,134,255,0.28) !important;
  color: #a9b0ff !important;
}
html:not(.light) #section-image-studio .ist-source-pill.shopify {
  background: rgba(74,222,128,0.12) !important;
  border-color: rgba(74,222,128,0.24) !important;
  color: #77d99e !important;
}
html:not(.light) #section-image-studio .ist-v2-scene-kebab,
html:not(.light) #section-image-studio .ist-v2-scene-check.is-pending {
  background: rgba(255,255,255,0.10) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
html:not(.light) #section-image-studio .ist-v2-scene-btn:disabled:hover {
  background: rgba(74,159,232,0.07) !important;
}

html:not(.light) #section-polish .polish-table thead th,
html:not(.light) #section-publish .pc-table thead th,
html:not(.light) #section-manage .mng-table thead th {
  background: var(--surface) !important;
  border-bottom-color: var(--border) !important;
  color: var(--text-2) !important;
}
html:not(.light) #section-polish .polish-table tbody td,
html:not(.light) #section-publish .pc-table tbody td,
html:not(.light) #section-manage .mng-table tbody td {
  border-bottom-color: var(--border-subtle) !important;
}
@media (max-width: 640px) {
  #section-image-studio .ist-source-filled {
    align-items: flex-start;
    flex-direction: column;
  }
  #section-image-studio .ist-source-info,
  #section-image-studio .ist-source-actions,
  #section-image-studio .ist-source-actions .btn {
    width: 100%;
  }
  #section-image-studio .ist-source-actions {
    margin-left: 0;
    justify-content: stretch;
  }
  #section-image-studio .ist-source-actions .btn {
    justify-content: center;
  }
  #section-image-studio .ist-source-actions .ist-source-clear-btn {
    width: 100%;
  }
  #section-publish .pc-wrap {
    padding: 0 16px;
  }
  #section-publish .pc-setup-grid {
    grid-template-columns: 1fr !important;
  }
  #section-publish .pc-mode-group {
    width: 100%;
    overflow-x: auto;
  }
  #section-publish .pc-mode-opt {
    min-width: 86px;
    padding: 0 10px;
  }
  #section-publish .pc-field-cta,
  #section-publish .pc-dry-test-btn,
  #section-publish .pc-actionbar-actions,
  #section-publish .pc-btn-primary,
  #section-publish .pc-btn-secondary {
    width: 100%;
  }
  #section-publish .pc-dry-test-btn,
  #section-publish .pc-btn-primary,
  #section-publish .pc-btn-secondary {
    justify-content: center;
  }
}

.cal-view-tabs {
  border: 1px solid var(--border);
  background: var(--card);
}
.cal-view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 64px;
}
.cal-view-tab.active {
  background: var(--blue) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(74, 159, 232, 0.24) !important;
}
.cal-view-tab.active:hover {
  color: #ffffff !important;
}
#calendar-filters > div:first-child .fa-magnifying-glass {
  z-index: 1;
}
#calendar-filters {
  grid-template-columns:
    minmax(260px, 1.4fr)
    minmax(150px, 0.7fr)
    minmax(170px, 0.85fr)
    minmax(150px, 0.7fr)
    minmax(160px, 0.75fr)
    minmax(252px, 1fr)
    minmax(170px, 0.75fr) !important;
  align-items: stretch !important;
}
#calendar-filters > * {
  min-width: 0;
}
#calendar-filters > div:first-child {
  min-width: 240px;
}
#calendar-filters input[type="date"] {
  line-height: 1;
}
.cal-date-range-filter {
  min-width: 252px !important;
  height: 42px;
  box-sizing: border-box;
  align-items: center !important;
  justify-content: flex-start;
  gap: 10px !important;
  position: relative;
  cursor: pointer;
}
.cal-date-range-filter > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex: 0 0 16px;
}
.cal-date-input {
  position: absolute !important;
  left: 10px !important;
  bottom: 4px !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.cal-date-display {
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cal-date-separator {
  width: 16px !important;
  min-width: 16px !important;
  height: 28px !important;
  line-height: 28px !important;
  flex: 0 0 16px;
  transform: translateY(-1px);
}
@media (min-width: 1760px) {
  #calendar-filters {
    grid-template-columns: minmax(320px, 1.6fr) 150px 190px 170px 180px 272px 190px !important;
  }
}
@media (max-width: 1500px) {
  #calendar-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 760px) {
  #calendar-filters {
    grid-template-columns: 1fr !important;
  }
  .cal-view-tabs {
    width: 100%;
    overflow-x: auto;
  }
  .cal-view-tab {
    flex: 1 0 auto;
  }
}

/* ─── APP MOTION PASS ──────────────────────────────────────────────────
   Fast, quiet motion language for page navigation and dense controls. The
   app should feel responsive, not theatrical: short easing, subtle lift,
   and section content that settles into place after every tab switch. */
:root {
  --motion-fast: 120ms;
  --motion-med: 220ms;
  --motion-slow: 340ms;
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring-soft: cubic-bezier(0.34, 1.35, 0.64, 1);
}

.section.active {
  transform-origin: top center;
}
.section.section-enter {
  opacity: 0.001;
  transform: translate3d(0, 10px, 0) scale(0.996);
  filter: saturate(0.96);
}
.section.section-enter-active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: saturate(1);
  transition:
    opacity var(--motion-med) var(--ease-out-soft),
    transform var(--motion-slow) var(--ease-out-soft),
    filter var(--motion-med) ease;
}
body.section-is-changing .content {
  cursor: progress;
}

.nav-item {
  isolation: isolate;
  overflow: hidden;
}
.nav-item::before {
  content: '';
  position: absolute;
  inset: 5px 8px 5px 5px;
  z-index: -1;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(79, 142, 247, 0.18), rgba(67, 198, 172, 0.10));
  opacity: 0;
  transform: scaleX(0.94);
  transform-origin: left center;
  transition:
    opacity var(--motion-fast) ease,
    transform var(--motion-med) var(--ease-out-soft);
}
.nav-item:hover::before,
.nav-item.active::before {
  opacity: 1;
  transform: scaleX(1);
}
.nav-item:active {
  transform: translateX(4px) scale(0.985);
}
.nav-badge.visible {
  animation: navBadgePop 260ms var(--ease-spring-soft);
}
@keyframes navBadgePop {
  from { transform: scale(0.78); opacity: 0.35; }
  to   { transform: scale(1); opacity: 1; }
}

.btn,
button,
.dash-action-2-btn,
.dash-nba-btn,
.polish-footer-btn,
.pc-btn-primary,
.pc-btn-secondary,
.mng-action-btn,
.ist-v2-footer-btn,
.cal-view-tab {
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    color var(--motion-fast) ease,
    opacity var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-out-soft),
    box-shadow var(--motion-med) var(--ease-out-soft);
}
.btn:not(:disabled):active,
button:not(:disabled):active,
.dash-action-2-btn:not(:disabled):active,
.dash-nba-btn:not(:disabled):active,
.polish-footer-btn:not(:disabled):active,
.pc-btn-primary:not(:disabled):active,
.pc-btn-secondary:not(:disabled):active,
.mng-action-btn:not(:disabled):active,
.ist-v2-footer-btn:not(:disabled):active,
.cal-view-tab:not(:disabled):active {
  transform: translateY(1px) scale(0.985);
}

.section.active :is(
  .dash-cc-card,
  .dash-table-wrap,
  .dash-analytics-card,
  .ist-source-empty,
  .ist-source-filled,
  .ist-v2-settings-wrap,
  .ist-v2-scene,
  #polish-pricing-strip,
  #polish-ai-toolbar,
  #polish-table-wrap,
  .pc-card,
  .mng-stat-card,
  .mng-table-card,
  .cal-stat-card,
  .cal-day-group,
  .launch-card,
  .studio-card
) {
  transition:
    border-color var(--motion-med) ease,
    background-color var(--motion-med) ease,
    box-shadow var(--motion-med) var(--ease-out-soft),
    transform var(--motion-med) var(--ease-out-soft);
}
.section.active :is(
  .dash-cc-card,
  .dash-analytics-card,
  .ist-v2-scene,
  .pc-card,
  .mng-stat-card,
  .cal-stat-card,
  .launch-card,
  .studio-card
):hover {
  transform: translateY(-2px);
}

.section.section-enter-active :is(
  .dash-cc-card,
  .dash-table-wrap,
  .dash-analytics-card,
  .ist-source-empty,
  .ist-v2-settings-wrap,
  .ist-v2-scene,
  #polish-pricing-strip,
  #polish-ai-toolbar,
  #polish-table-wrap,
  .pc-step,
  .pc-card,
  .mng-toolbar,
  .mng-stat-card,
  .mng-actionbar,
  .mng-table-card,
  #calendar-stats,
  #calendar-filters,
  .cal-day-group,
  .launch-card,
  .studio-card
) {
  animation: sectionChildRise 360ms var(--ease-out-soft) both;
}
.section.section-enter-active :is(.ist-v2-scene, .mng-stat-card, .cal-stat-card, .dash-analytics-card):nth-child(2) { animation-delay: 30ms; }
.section.section-enter-active :is(.ist-v2-scene, .mng-stat-card, .cal-stat-card, .dash-analytics-card):nth-child(3) { animation-delay: 55ms; }
.section.section-enter-active :is(.ist-v2-scene, .mng-stat-card, .cal-stat-card, .dash-analytics-card):nth-child(4) { animation-delay: 80ms; }
.section.section-enter-active :is(.ist-v2-scene, .mng-stat-card, .cal-stat-card, .dash-analytics-card):nth-child(5) { animation-delay: 105ms; }
.section.section-enter-active :is(.ist-v2-scene, .mng-stat-card, .cal-stat-card, .dash-analytics-card):nth-child(6) { animation-delay: 130ms; }
@keyframes sectionChildRise {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.progress-fill,
#ai-progress-bar,
.dash-cc-tile-bar-fill,
.cal-progress-fill,
.mng-progress-fill {
  transition: width var(--motion-slow) var(--ease-out-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .section.section-enter,
  .section.section-enter-active,
  .section.active :is(
    .dash-cc-card,
    .dash-analytics-card,
    .ist-v2-scene,
    .pc-card,
    .mng-stat-card,
    .cal-stat-card,
    .launch-card,
    .studio-card
  ):hover {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}

/* Image Studio settings modal: strong themed surfaces + scene references */
#ist-drawer.ist-drawer {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 1201;
  width: min(760px, calc(100vw - 32px));
  max-height: min(82vh, 820px);
  display: none;
  flex-direction: column;
  padding: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 94%, var(--card));
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 14px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

#ist-drawer.ist-drawer.open {
  display: flex;
  animation: modalRise 180ms var(--ease-out-soft, ease-out) both;
}

@keyframes modalRise {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 10px)) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.ist-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(14px) saturate(0.9);
}

html.light .ist-drawer-backdrop {
  background: rgba(15, 23, 42, 0.34);
}

#ist-drawer h2 {
  color: var(--text) !important;
}

#ist-drawer p,
#ist-drawer .ist-hint {
  color: var(--text-2) !important;
}

#ist-drawer .ist-drawer-body {
  background: var(--surface);
}

#ist-drawer .ist-drawer-h {
  color: color-mix(in srgb, var(--text) 76%, var(--muted));
}

#ist-drawer .ist-drawer-section {
  border-top-color: var(--border);
  margin-top: 18px;
  padding-top: 18px;
}

#ist-drawer .ist-input,
#ist-drawer select,
#ist-drawer .pq-mode-seg {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html:not(.light) #ist-drawer .ist-input,
html:not(.light) #ist-drawer select,
html:not(.light) #ist-drawer .pq-mode-seg,
html:not(.light) #ist-drawer .pq-mode-opt {
  background: #111722 !important;
  border-color: #2b3243 !important;
  color: #e9edf7 !important;
}

html:not(.light) #ist-drawer .pq-mode-opt.is-active {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

html:not(.light) #ist-drawer .pq-mode-tag {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
}

#ist-drawer .ist-checkbox-row {
  color: var(--text);
}

#ist-drawer .ist-drawer-footer {
  align-items: center;
  padding: 14px 28px;
  margin: 0;
  background: var(--surface) !important;
  border-top: 1px solid var(--border);
}

html:not(.light) #ist-drawer .ist-drawer-footer {
  background: #111722 !important;
  border-top-color: #2b3243 !important;
}

.ist-reference-list {
  display: grid;
  gap: 10px;
}

.ist-reference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ist-reference-main {
  min-width: 0;
}

.ist-reference-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.ist-reference-sub {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ist-reference-thumb,
.ist-reference-empty {
  width: 52px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.ist-reference-thumb {
  padding: 0;
  cursor: zoom-in;
}

.ist-reference-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ist-reference-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.ist-reference-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ist-reference-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms var(--ease-out-soft, ease-out), border-color 160ms ease, background 160ms ease;
}

.ist-reference-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--blue);
  background: var(--blue-dim);
}

.ist-reference-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.ist-reference-btn.ghost {
  width: 34px;
  padding: 0;
}

.ist-style-ref-picker {
  margin-top: 6px;
  padding: 12px;
  background: color-mix(in srgb, var(--card) 88%, var(--blue-dim));
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--border));
  border-radius: 12px;
}

.ist-style-ref-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ist-style-ref-picker-head strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.ist-style-ref-picker-head span {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 11px;
}

.ist-style-ref-picker-head button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

.ist-style-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.ist-style-ref-card {
  display: grid;
  gap: 7px;
  padding: 8px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.ist-style-ref-card:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.ist-style-ref-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}

.ist-style-ref-card span,
.ist-style-ref-card small {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.ist-style-ref-card span {
  -webkit-line-clamp: 2;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.ist-style-ref-card small {
  -webkit-line-clamp: 1;
  color: var(--text-2);
  font-size: 10px;
}

.ist-style-ref-empty {
  padding: 18px 12px;
  color: var(--text-2);
  text-align: center;
  font-size: 12px;
}

.ist-v2-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 8px 0 0;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--blue) 42%, var(--border));
  border-radius: 999px;
  background: var(--blue-dim);
  color: var(--blue);
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  cursor: zoom-in;
}

@media (max-width: 720px) {
  #ist-drawer.ist-drawer {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 28px);
  }

  .ist-reference-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .ist-reference-main {
    grid-column: 2;
    grid-row: 1;
  }

  .ist-reference-thumb,
  .ist-reference-empty {
    grid-column: 1;
    grid-row: 1;
    width: 48px;
    height: 48px;
  }

  .ist-reference-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .ist-reference-btn {
    flex: 1 1 auto;
  }
}

/* Style Library cockpit */
#section-style-library,
#section-style-library button,
#section-style-library input,
#section-style-library select {
  font-family: var(--font-ui);
  letter-spacing: 0;
}

#section-style-library .sl-shell {
  max-width: 1400px;
  margin: 24px auto 60px;
  padding: 0 28px;
}

#section-style-library .sl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

#section-style-library .sl-title-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

#section-style-library .sl-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--border));
  background: color-mix(in srgb, var(--blue-dim) 78%, var(--card));
  color: var(--blue);
  font-size: 22px;
}

#section-style-library .sl-title-block h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

#section-style-library .sl-kicker {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

#section-style-library .sl-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

#section-style-library .sl-btn,
#section-style-library .sl-card-actions button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms var(--ease-out-soft, ease-out), border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

#section-style-library .sl-btn:hover:not(:disabled),
#section-style-library .sl-card-actions button:hover {
  transform: translateY(-1px);
}

#section-style-library .sl-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

#section-style-library .sl-btn-primary {
  border-color: color-mix(in srgb, var(--blue) 70%, #fff);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(74, 159, 232, 0.22);
}

#section-style-library .sl-btn-secondary,
#section-style-library .sl-card-actions button {
  background: var(--card);
  color: var(--text);
}

#section-style-library .sl-btn-secondary:hover,
#section-style-library .sl-card-actions button:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
}

#section-style-library .sl-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(260px, 1.4fr);
  gap: 12px;
  margin-bottom: 14px;
}

#section-style-library .sl-stat-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-soft, 0 1px 2px rgba(0,0,0,0.05));
}

#section-style-library .sl-stat-card > div:last-child {
  min-width: 0;
}

#section-style-library .sl-stat-card span,
#section-style-library .sl-stat-card small {
  display: block;
  color: var(--text-2);
  font-size: 11px;
}

#section-style-library .sl-stat-card span {
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

#section-style-library .sl-stat-card small {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

#section-style-library .sl-stat-card strong {
  display: block;
  margin: 2px 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#section-style-library .sl-stat-card-wide strong {
  font-size: 15px;
  font-weight: 700;
}

#section-style-library .sl-stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 17px;
}

#section-style-library .sl-stat-icon-blue { color: var(--blue); background: var(--blue-dim); }
#section-style-library .sl-stat-icon-green { color: var(--green); background: rgba(67, 198, 172, 0.12); }
#section-style-library .sl-stat-icon-amber { color: var(--amber); background: rgba(245, 158, 11, 0.14); }
#section-style-library .sl-stat-icon-purple { color: #8b5cf6; background: rgba(139, 92, 246, 0.13); }
#section-style-library .sl-stat-card-warn { border-color: color-mix(in srgb, var(--amber) 50%, var(--border)); }

#section-style-library .sl-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) minmax(160px, 220px) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
}

#section-style-library .sl-search {
  position: relative;
  min-width: 0;
}

#section-style-library .sl-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

#section-style-library .sl-search input,
#section-style-library .sl-controls select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  box-sizing: border-box;
}

#section-style-library .sl-search input {
  padding: 0 13px 0 38px;
}

#section-style-library .sl-controls select {
  padding: 0 34px 0 13px;
}

#section-style-library .sl-progress {
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 54%, var(--border));
  border-radius: 14px;
  background: var(--blue-dim);
}

#section-style-library .sl-progress-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

#section-style-library .sl-progress-head strong {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

#section-style-library .sl-progress-head span {
  margin-left: auto;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}

#section-style-library .sl-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1.5s ease-in-out infinite;
}

#section-style-library .sl-progress-log {
  max-height: 120px;
  overflow-y: auto;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.5;
}

#section-style-library .sl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: 16px;
}

#section-style-library .sl-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-soft, 0 1px 2px rgba(0,0,0,0.05));
  transition: transform 180ms var(--ease-out-soft, ease-out), border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

#section-style-library .sl-card:hover,
#section-style-library .sl-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 46%, var(--border));
  box-shadow: 0 18px 38px rgba(12, 18, 32, 0.12);
  outline: none;
}

#section-style-library .sl-card-image-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
}

#section-style-library .sl-card-img {
  width: 100%;
  aspect-ratio: 1.08;
  display: block;
  object-fit: cover;
  background: var(--bg-2);
  transition: transform 220ms var(--ease-out-soft, ease-out), filter 220ms ease;
}

#section-style-library .sl-card:hover .sl-card-img,
#section-style-library .sl-card:focus-visible .sl-card-img {
  transform: scale(1.025);
  filter: saturate(1.05);
}

#section-style-library .sl-preview-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.58);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms var(--ease-out-soft, ease-out);
  backdrop-filter: blur(10px);
}

#section-style-library .sl-card:hover .sl-preview-badge,
#section-style-library .sl-card:focus-visible .sl-preview-badge {
  opacity: 1;
  transform: translateY(0);
}

#section-style-library .sl-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

#section-style-library .sl-card-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
}

#section-style-library .sl-card-brand {
  margin-top: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

#section-style-library .sl-card-summary {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

#section-style-library .sl-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

#section-style-library .sl-chip {
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--border));
  border-radius: 999px;
  background: var(--blue-dim);
  color: var(--blue);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}

#section-style-library .sl-chip-muted {
  cursor: default;
  color: var(--text-2);
  border-color: var(--border);
  background: var(--bg-2);
}

#section-style-library .sl-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 2px;
}

#section-style-library .sl-card-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

#section-style-library .sl-no-results,
#section-style-library .sl-empty {
  grid-column: 1 / -1;
  padding: 42px;
  text-align: center;
  color: var(--muted);
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--bg-2);
}

#section-style-library .sl-no-results i,
#section-style-library .sl-empty i {
  display: block;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 34px;
}

#section-style-library .sl-no-results strong,
#section-style-library .sl-no-results span {
  display: block;
}

#section-style-library .sl-no-results strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

#section-style-library .sl-no-results span {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 12px;
}

html:not(.light) #section-style-library .sl-card:hover {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1120px) {
  #section-style-library .sl-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #section-style-library .sl-stat-card-wide {
    grid-column: 1 / -1;
  }

  #section-style-library .sl-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  #section-style-library .sl-shell {
    padding: 0 16px;
  }

  #section-style-library .sl-header,
  #section-style-library .sl-title-block {
    align-items: flex-start;
  }

  #section-style-library .sl-header {
    flex-direction: column;
  }

  #section-style-library .sl-actions,
  #section-style-library .sl-actions .sl-btn {
    width: 100%;
  }

  #section-style-library .sl-stats-grid,
  #section-style-library .sl-controls {
    grid-template-columns: 1fr;
  }

  #section-style-library .sl-grid {
    grid-template-columns: 1fr;
  }
}

/* Studio workspace final responsive overrides. Kept late so they win over
   the older Studio split-view rules that are still above in the file. */
@media (max-width: 760px) {
  #studio-product-modal .studio-modal-grid {
    flex-direction: column;
  }

  #studio-product-modal .studio-modal-rail {
    width: auto;
    max-width: none;
    min-width: 0;
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  #studio-product-modal .studio-modal-detail {
    min-height: 420px;
  }
}

/* Image Studio reference pass — light-mode parity with the supplied mockup.
   These rules are intentionally late and scoped so the generation state machine
   and dark-mode fixes above stay intact. */
html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-ui) !important;
}

html.light #section-image-studio {
  --ist-blue-ref: #2563eb;
  --ist-blue-soft-ref: #eef4ff;
  --ist-purple-ref: #7c4dff;
  --ist-green-ref: #10b981;
  --ist-ink-ref: #0f172a;
  --ist-muted-ref: #657189;
  --ist-line-ref: #e4e9f2;
  --ist-card-shadow-ref: 0 10px 30px rgba(28, 43, 76, 0.08);
  color: var(--ist-ink-ref);
}

html.light #section-image-studio > .ist-v2-header,
html.light #section-image-studio > #ist-queue-panel,
html.light #section-image-studio > #ist-source-strip,
html.light #section-image-studio > .ist-v2-settings-wrap,
html.light #section-image-studio > #ist-grid-card,
html.light #section-image-studio > .ist-v2-footer {
  width: min(1480px, calc(100% - 56px)) !important;
  max-width: min(1480px, calc(100% - 56px)) !important;
}

html.light #section-image-studio > .ist-v2-header {
  align-items: center;
  margin-top: 34px !important;
  margin-bottom: 28px !important;
}

html.light #section-image-studio .ist-v2-title {
  gap: 18px;
}

html.light #section-image-studio .ist-v2-title-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #edf4ff 0%, #dbe8ff 100%);
  border: 1px solid #d8e5ff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.12);
}

html.light #section-image-studio .ist-v2-title h1 {
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  color: var(--ist-ink-ref) !important;
}

html.light #section-image-studio .ist-v2-title p {
  margin-top: 5px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--ist-muted-ref) !important;
}

html.light #section-image-studio .ist-wizard {
  gap: 0;
  transform: translateY(2px);
}

html.light #section-image-studio .ist-wizard-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid transparent;
  box-shadow: none;
}

html.light #section-image-studio .ist-wizard-step.active .ist-wizard-icon {
  border: 2px solid var(--ist-blue-ref);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
}

html.light #section-image-studio .ist-wizard-step.done .ist-wizard-icon {
  border-color: var(--ist-green-ref);
  background: #ffffff;
}

html.light #section-image-studio .ist-wizard-label {
  font-size: 12px;
  font-weight: 700;
  color: #7a8498;
}

html.light #section-image-studio .ist-wizard-step.active .ist-wizard-label {
  color: var(--ist-blue-ref);
}

html.light #section-image-studio .ist-wizard-bar {
  width: 80px;
  background: #d9deea;
  margin: 0 10px 26px;
}

html.light #section-image-studio .ist-source-filled {
  min-height: 152px;
  padding: 18px 24px;
  gap: 24px;
  border-radius: 18px;
  border: 1px solid var(--ist-line-ref);
  background: #ffffff;
  box-shadow: var(--ist-card-shadow-ref);
}

html.light #section-image-studio .ist-source-filled:hover {
  transform: none;
  box-shadow: 0 16px 38px rgba(28, 43, 76, 0.10);
}

html.light #section-image-studio .ist-source-thumb {
  width: 124px;
  height: 124px;
  padding: 10px;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  border-color: #dce5f0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 10px 24px rgba(28, 43, 76, 0.055);
}

html.light #section-image-studio .ist-source-thumb img {
  border-radius: 12px;
  background: #ffffff;
}

html.light #section-image-studio .ist-source-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ist-ink-ref);
  margin-bottom: 9px;
}

html.light #section-image-studio .ist-source-desc {
  color: var(--ist-muted-ref);
  font-size: 13px;
  font-weight: 600;
  gap: 9px;
}

html.light #section-image-studio .ist-source-pill {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 9px;
  border: 0;
  background: #f1f4f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

html.light #section-image-studio .ist-source-pill.purple {
  background: #f0e9ff;
  color: #7c4dff;
}

html.light #section-image-studio .ist-source-pill.shopify {
  background: rgba(149, 191, 71, 0.16);
  color: #4f7d25;
}

html.light #section-image-studio .ist-source-actions {
  gap: 18px;
}

html.light #section-image-studio .ist-source-actions .btn {
  min-width: 182px;
  min-height: 52px;
  border-radius: 12px !important;
  font-size: 14px !important;
}

html.light #section-image-studio .ist-source-actions .btn-outline {
  background: #ffffff !important;
  border: 1.5px solid var(--ist-blue-ref) !important;
  color: var(--ist-blue-ref) !important;
}

html.light #section-image-studio .ist-source-actions .btn-ghost {
  background: #ffffff !important;
  border: 1px solid var(--ist-line-ref) !important;
  color: #334155 !important;
}

html.light #section-image-studio .ist-source-actions .ist-source-clear-btn {
  min-width: 52px;
  width: 52px;
}

html.light #section-image-studio .ist-source-empty {
  min-height: 108px;
  padding: 22px 24px;
  border-radius: 18px;
  border-color: #d5dbe7;
  background: #ffffff;
  box-shadow: var(--ist-card-shadow-ref);
}

html.light #section-image-studio .ist-source-empty-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ist-ink-ref);
}

html.light #section-image-studio .ist-v2-settings-wrap {
  min-height: 88px;
  margin-top: 20px !important;
  margin-bottom: 22px !important;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--ist-line-ref);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--ist-card-shadow-ref);
}

html.light #section-image-studio .ist-v2-settings-row {
  min-width: 0;
}

html.light #section-image-studio .ist-v2-setting {
  padding: 15px 20px 16px;
  border-right: 1px solid var(--ist-line-ref);
  background: #ffffff;
  gap: 7px;
}

html.light #section-image-studio .ist-v2-setting-label {
  font-size: 11px;
  font-weight: 700;
  color: #66758e;
  line-height: 1;
}

html.light #section-image-studio .ist-v2-setting-input,
html.light #section-image-studio .ist-v2-setting-toggle {
  min-height: 42px !important;
  border-radius: 10px !important;
  border: 1px solid #dfe5ef !important;
  background-color: #ffffff !important;
  color: var(--ist-ink-ref) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

html.light #section-image-studio .ist-v2-setting-toggle {
  padding: 0 12px;
}

html.light #section-image-studio .ist-v2-cost {
  font-size: 18px;
  font-weight: 800;
  color: var(--ist-green-ref);
}

html.light #section-image-studio .ist-v2-more-btn {
  align-self: center;
  height: 44px;
  min-width: 154px;
  margin: 0 18px;
  padding: 0 18px;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ist-ink-ref);
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

html.light #section-image-studio .ist-v2-more-btn:hover {
  border-color: #bfd2f8;
  background: #f8fbff;
  color: var(--ist-blue-ref);
}

html.light #section-image-studio .ist-v2-more-btn i {
  color: var(--ist-ink-ref) !important;
}

html.light #section-image-studio #ist-grid-card .ist-v2-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 16px;
  margin-bottom: 24px;
}

html.light #section-image-studio .ist-v2-scene {
  min-height: 365px;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid var(--ist-line-ref);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(28, 43, 76, 0.08);
}

html.light #section-image-studio .ist-v2-scene:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(28, 43, 76, 0.12);
}

html.light #section-image-studio .ist-v2-scene-thumb {
  border-radius: 12px;
  background: #f4f6fa;
}

html.light #section-image-studio .ist-v2-scene-badge {
  top: 10px;
  left: 10px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 4px 12px rgba(28, 43, 76, 0.10);
}

html.light #section-image-studio .ist-v2-scene-badge.ready {
  background: #ffffff;
  color: var(--ist-purple-ref);
  border: 1.5px solid rgba(124, 77, 255, 0.50);
}

html.light #section-image-studio .ist-v2-scene-badge.waiting {
  background: #ffffff;
  color: #475569;
  border: 1px solid #dfe5ef;
  backdrop-filter: none;
}

html.light #section-image-studio .ist-v2-scene-kebab {
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.78);
}

html.light #section-image-studio .ist-v2-scene-body {
  padding: 13px 6px 2px;
  gap: 7px;
}

html.light #section-image-studio .ist-v2-scene-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ist-ink-ref);
}

html.light #section-image-studio .ist-v2-scene-desc {
  min-height: 42px;
  color: #536179;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

html.light #section-image-studio .ist-v2-scene-btn {
  min-height: 44px;
  margin-top: auto;
  border-radius: 10px;
  border: 1px solid #cfe0ff;
  background: #f7faff;
  color: var(--ist-blue-ref);
  font-size: 13px;
  font-weight: 800;
}

html.light #section-image-studio .ist-v2-scene-btn:hover:not(:disabled) {
  background: var(--ist-blue-ref);
  border-color: var(--ist-blue-ref);
  color: #ffffff;
}

html.light #section-image-studio .ist-v2-footer {
  min-height: 76px;
  margin-top: 24px !important;
  padding: 14px 20px;
  border: 1px solid var(--ist-line-ref);
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -10px 30px rgba(28, 43, 76, 0.07);
}

html.light #section-image-studio .ist-v2-footer-stats {
  gap: 0;
}

html.light #section-image-studio .ist-v2-stat {
  min-width: 110px;
  padding: 0 24px;
  border-right: 1px solid var(--ist-line-ref);
}

html.light #section-image-studio .ist-v2-stat:first-child {
  padding-left: 0;
}

html.light #section-image-studio .ist-v2-stat:last-child {
  border-right: 0;
}

html.light #section-image-studio .ist-v2-stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ist-ink-ref);
}

html.light #section-image-studio .ist-v2-stat-label {
  margin-top: 5px;
  font-size: 11px;
  color: #6b7890;
  letter-spacing: 0;
  text-transform: none;
}

html.light #section-image-studio .ist-v2-footer-actions {
  gap: 16px;
}

html.light #section-image-studio .ist-v2-footer-btn {
  min-width: 156px;
  min-height: 48px;
  border-radius: 10px;
  border-color: #dfe5ef;
  background: #ffffff;
  color: #536179;
  font-size: 14px;
  font-weight: 800;
}

html.light #section-image-studio .ist-v2-footer-btn.primary {
  background: #f7f0ff;
  border: 1px solid rgba(124, 77, 255, 0.42);
  color: var(--ist-purple-ref);
  box-shadow: none;
}

html.light #section-image-studio .ist-v2-footer-btn.primary i {
  color: var(--ist-purple-ref) !important;
}

@media (max-width: 1520px) {
  html.light #section-image-studio #ist-grid-card .ist-v2-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  html.light #section-image-studio .ist-v2-settings-wrap {
    flex-direction: column;
  }

  html.light #section-image-studio .ist-v2-more-btn {
    width: calc(100% - 36px);
    margin: 14px 18px;
  }

  html.light #section-image-studio .ist-source-filled {
    align-items: flex-start;
  }
}

/* Calendar as Social Publishing Command Center */
#section-calendar .cal-shell {
  max-width: 1500px;
  margin: 24px auto 72px;
  padding: 0 28px;
}

#section-calendar .cal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

#section-calendar .cal-hero-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

#section-calendar .cal-hero-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef5ff 0%, #dfeaff 100%);
  border: 1px solid #dbe6fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.12);
  flex-shrink: 0;
}

#section-calendar .cal-kicker {
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

#section-calendar .cal-hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
  color: var(--text);
}

#section-calendar .cal-hero p {
  margin: 8px 0 0;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}

#section-calendar .cal-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

#section-calendar .cal-date-pill,
#section-calendar .cal-action-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

#section-calendar .cal-action-btn {
  color: #2563eb;
  background: #f8fbff;
}

#section-calendar .cal-command-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

#section-calendar .cal-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

#section-calendar .cal-stat-card {
  min-height: 118px;
  padding: 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

#section-calendar .cal-stat-icon {
  width: 40px;
  height: 40px;
}

#section-calendar .cal-stat-value {
  font-size: 28px;
  font-weight: 760;
  letter-spacing: 0;
}

#section-calendar .cal-stat-label,
#section-calendar .cal-stat-sub {
  letter-spacing: 0;
}

#section-calendar .cal-buffer-panel {
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.06)),
    var(--card);
  padding: 18px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

#section-calendar .cal-buffer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

#section-calendar .cal-buffer-label {
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#section-calendar .cal-buffer-title {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
}

#section-calendar .cal-buffer-badge,
#section-calendar .cal-ready-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

#section-calendar .cal-buffer-badge {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.10);
}

#section-calendar .cal-buffer-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 14px;
}

#section-calendar .cal-buffer-flow span {
  color: var(--text);
  font-weight: 700;
}

#section-calendar .cal-buffer-cta,
#section-calendar .cal-post-modal-footer .primary {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-weight: 760;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

#section-calendar .cal-buffer-error {
  margin-top: 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 650;
}

#section-calendar .cal-channel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

#section-calendar .cal-channel-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

#section-calendar .cal-channel-card strong,
#section-calendar .cal-channel-card em {
  display: block;
  font-style: normal;
}

#section-calendar .cal-channel-card strong {
  font-size: 13px;
  font-weight: 760;
}

#section-calendar .cal-channel-card em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

#section-calendar .cal-channel-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #eef5ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-platform-img {
  display: block;
  width: var(--platform-icon-size, 16px);
  height: var(--platform-icon-size, 16px);
  object-fit: contain;
  flex: 0 0 auto;
}

.cal-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.cal-channel-pill .cal-platform-img {
  width: 14px;
  height: 14px;
}

.cal-channel-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.cal-platform-select-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.cal-platform-select-icon .cal-platform-img {
  width: 18px;
  height: 18px;
}

.cal-channel-select-wrap select {
  padding-left: 42px !important;
}

#section-calendar .cal-issues {
  display: none;
  margin-bottom: 14px;
}

#section-calendar .cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 12px;
}

#section-calendar .cal-view-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 4px;
  max-width: 100%;
}

#section-calendar .cal-view-tab {
  min-height: 36px;
  min-width: 86px;
  border-radius: 10px;
  font-weight: 720;
}

#section-calendar .cal-view-tab.cal-view-icon-tab {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 15px;
}

#section-calendar .cal-view-tab.cal-view-icon-tab i {
  line-height: 1;
}

#section-calendar #calendar-filters.cal-filters-grid {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.35fr)
    minmax(132px, .65fr)
    minmax(150px, .75fr)
    minmax(132px, .65fr)
    minmax(156px, .75fr)
    minmax(230px, 1fr)
    minmax(148px, .7fr) !important;
  gap: 9px;
  align-items: stretch;
  margin-bottom: 16px;
}

#section-calendar #calendar-filters.cal-filters-grid > * {
  min-width: 0;
}

#section-calendar #calendar-filters.cal-filters-grid > div:first-child {
  height: 44px;
  min-width: 0;
}

#section-calendar #calendar-filters > div:first-child .fa-magnifying-glass {
  left: 15px !important;
  font-size: 16px !important;
  color: var(--muted) !important;
}

#section-calendar #calendar-filters.cal-filters-grid input:not(.cal-date-input),
#section-calendar #calendar-filters.cal-filters-grid select,
#section-calendar #calendar-filters .cal-date-range-filter {
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  box-sizing: border-box;
  border-radius: 14px !important;
  border-color: var(--border) !important;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  font-size: 14px !important;
}

#section-calendar #calendar-filters.cal-filters-grid input:not(.cal-date-input) {
  padding: 0 14px 0 44px !important;
}

#section-calendar #calendar-filters.cal-filters-grid select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 clamp(34px, 3vw, 42px) 0 14px !important;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right clamp(12px, 1.2vw, 16px) center !important;
  background-size: 16px 16px !important;
}

html:not(.light) #section-calendar #calendar-filters.cal-filters-grid select {
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

#section-calendar #calendar-filters .cal-date-range-filter {
  padding: 0 14px !important;
}

#section-calendar .cal-post-row {
  grid-template-columns: 24px 92px minmax(0, 1fr) 190px 270px 32px;
  gap: 16px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

#section-calendar .cal-shell[data-density="comfortable"] .cal-post-row {
  grid-template-columns: 24px 116px minmax(0, 1fr) 200px 280px 32px;
  padding: 18px;
}

#section-calendar .cal-shell[data-density="comfortable"] .cal-post-thumb {
  width: 108px;
  height: 108px;
}

#section-calendar .cal-shell[data-density="comfortable"] .cal-post-caption {
  -webkit-line-clamp: 3;
  font-size: 12px;
}

#section-calendar .cal-post-row:hover {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

#section-calendar .cal-post-thumb {
  width: 86px;
  height: 86px;
  border-radius: 14px;
}

#section-calendar .cal-post-time {
  color: #2563eb;
}

#section-calendar .cal-post-product {
  font-size: 14px;
  font-weight: 760;
}

#section-calendar .cal-status-pill {
  border-radius: 999px;
  padding: 5px 10px;
  width: fit-content;
}

#section-calendar .cal-status-pill.ready {
  background: #dcfce7;
  color: #15803d;
}

#section-calendar .cal-status-pill.posted {
  background: #ede9fe;
  color: #6d28d9;
}

#section-calendar .cal-ready-pill.ready {
  color: #15803d;
  background: rgba(22, 163, 74, 0.11);
}

#section-calendar .cal-ready-pill.review {
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

#section-calendar .cal-post-action-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

#section-calendar .cal-list-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#section-calendar .cal-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: stretch;
}

#section-calendar .cal-grid-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

#section-calendar .cal-grid-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.30);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.09);
}

#section-calendar .cal-grid-card.selected {
  border-color: #2563eb;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.15);
}

#section-calendar .cal-grid-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
}

#section-calendar .cal-grid-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#section-calendar .cal-grid-media .cal-status-pill {
  position: absolute;
  left: 12px;
  top: 12px;
}

#section-calendar .cal-grid-check {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.26);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.10);
}

#section-calendar .cal-grid-check input {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

#section-calendar .cal-grid-content {
  padding: 14px;
}

#section-calendar .cal-grid-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
  min-height: 36px;
}

#section-calendar .cal-grid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 11px;
}

#section-calendar .cal-grid-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
}

#section-calendar .cal-grid-caption {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  min-height: 54px;
  overflow: hidden;
  margin: 12px 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.48;
}

#section-calendar .cal-grid-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal-post-modal {
  width: min(1120px, 94vw);
  max-width: 1120px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}

.cal-post-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.cal-post-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eef5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-post-modal h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 780;
  letter-spacing: 0;
}

#cal-post-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cal-post-modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
}

#cal-post-body {
  overflow: auto;
  padding: 20px 22px 0;
  flex: 1;
}

.cal-post-editor-grid {
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.cal-post-preview-pane,
.cal-post-controls-pane {
  min-width: 0;
}

.cal-post-preview {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.cal-post-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.cal-post-preview-meta span,
.cal-asset-path {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
}

.cal-readiness-card,
.cal-control-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 14px;
}

.cal-readiness-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 10px;
}

.cal-readiness-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--text-2);
  font-size: 12px;
}

.cal-readiness-row.ok {
  color: var(--text);
  font-weight: 650;
}

.cal-control-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  margin-bottom: 12px;
}

.cal-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cal-control-card {
  margin-bottom: 14px;
}

.cal-control-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.cal-control-card input,
.cal-control-card select,
.cal-control-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 11px;
  outline: 0;
}

.cal-control-card textarea {
  line-height: 1.5;
  resize: vertical;
}

.cal-asset-path {
  display: block;
  border-radius: 10px;
  word-break: break-all;
  margin-bottom: 14px;
}

.cal-post-editor-actions,
.cal-post-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cal-post-editor-actions button,
.cal-post-modal-footer button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}

.cal-post-editor-actions button.danger {
  color: var(--red);
}

.cal-post-modal-footer {
  justify-content: flex-end;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border-subtle);
}

.cal-post-modal-footer .secondary {
  background: var(--bg);
}

.cal-post-modal-footer .primary.blue {
  background: #111827;
  box-shadow: none;
}

.cal-post-modal {
  width: min(1500px, 96vw);
  max-width: 1500px;
  max-height: 92vh;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.24);
  border-radius: 20px;
  overflow: visible;
}

.cal-post-modal-head {
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-radius: 20px 20px 0 0;
}

.cal-post-title-group,
.cal-post-head-actions {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.cal-post-title-group {
  flex: 1;
}

.cal-post-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, #eef5ff 0%, #e7efff 100%);
  border: 1px solid #dbe7ff;
}

.cal-post-modal h2 {
  font-size: 20px;
  font-weight: 760;
  letter-spacing: 0;
  color: #101828;
}

.cal-post-subtitle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
  color: #475569;
  font-size: 13px;
}

.cal-post-subtitle-row span:not(:first-child)::before {
  content: "·";
  margin-right: 7px;
  color: #94a3b8;
}

.cal-post-subtitle-row em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f4f7fb;
  border: 1px solid #e5ebf3;
  color: #475569;
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}

.cal-post-head-actions {
  flex: 0 0 auto;
}

.cal-post-head-btn,
.cal-post-modal-close {
  min-height: 40px;
  border: 1px solid #dbe3ee;
  border-radius: 11px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

.cal-post-modal-close {
  width: 40px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

#cal-post-body {
  padding: 0;
  background: #f5f7fb;
  overflow: auto;
}

.cal-composer-shell {
  display: grid;
  grid-template-columns: minmax(390px, 0.74fr) minmax(720px, 1.26fr);
  min-height: 0;
}

.cal-composer-left {
  padding: 20px 20px 22px;
  background: #ffffff;
  border-right: 1px solid #e5ebf3;
  min-width: 0;
}

.cal-composer-right {
  min-width: 0;
  background: #fbfcff;
  display: flex;
  flex-direction: column;
}

.cal-post-preview.hero {
  border: 0;
  border-radius: 13px;
  background: #eef2f7;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  aspect-ratio: auto !important;
  height: min(430px, 42vh);
  min-height: 300px;
}

.cal-post-preview.hero img,
.cal-post-preview.hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cal-post-empty-preview {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
}

.cal-post-preview-meta {
  gap: 9px;
  margin: 14px 0 14px;
}

.cal-post-preview-meta span {
  min-height: 28px;
  padding: 0 11px;
  border-color: #dbe3ee;
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.cal-readiness-card.premium {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-color: #cfe6d5;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.92), rgba(255, 255, 255, 0.96));
  box-shadow: none;
}

.cal-readiness-card.premium:not(.ready) {
  border-color: #f3d6a4;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(255, 255, 255, 0.96));
}

.cal-readiness-score {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #15803d;
  font-size: 22px;
  font-weight: 820;
  background:
    radial-gradient(circle at center, #fff 56%, transparent 57%),
    conic-gradient(#16a34a 0 288deg, #dcefe2 288deg 360deg);
}

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

.cal-readiness-main strong {
  display: block;
  color: #15803d;
  font-size: 14px;
  margin-bottom: 9px;
}

.cal-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
}

.cal-readiness-row {
  padding: 4px 0;
}

.cal-thumb-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cal-thumb-strip button {
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  padding: 0;
}

.cal-thumb-strip button.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.cal-thumb-strip img,
.cal-thumb-strip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cal-thumb-strip .more {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f2937;
  font-size: 18px;
  font-weight: 800;
}

.cal-composer-tabs {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
  border-bottom: 1px solid #e5ebf3;
  background: #ffffff;
}

.cal-composer-tabs button {
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.cal-composer-tabs button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.cal-composer-panel {
  padding: 30px 34px 34px;
  overflow: auto;
  flex: 1;
}

.cal-template-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #4c1d95;
  font-size: 15px;
  font-weight: 720;
}

.cal-template-label img {
  width: 18px;
  height: 18px;
}

.cal-template-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.cal-template-card {
  min-height: 104px;
  padding: 15px 10px 14px;
  border: 1px solid #d5dfed;
  border-radius: 16px;
  background: #ffffff;
  color: #475569;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font: inherit;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 680;
  cursor: pointer;
  text-align: center;
  white-space: normal;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.025);
}

.cal-template-card img {
  width: 27px;
  height: 27px;
}

.cal-template-card.active {
  border-color: #7c3aed;
  background: linear-gradient(180deg, #fbf9ff 0%, #f4efff 100%);
  color: #6d4aff;
  box-shadow:
    inset 0 0 0 1px rgba(124, 58, 237, 0.30),
    0 0 0 2px rgba(124, 58, 237, 0.10);
}

.cal-caption-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cal-caption-toolbar label,
.cal-caption-grid label,
.cal-control-card label,
.cal-publishing-card label {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.cal-caption-toolbar label {
  flex: 0 1 98px;
  min-width: 92px;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid #dce5f1;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.025);
}

.cal-caption-ai-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex: 0 1 auto;
  justify-content: flex-end;
}

.cal-caption-ai-actions button {
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid #dce5f1;
  border-radius: 13px;
  background: #ffffff;
  color: #7c3aed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.025);
}

.cal-caption-ai-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.cal-caption-ai-actions button.loading img {
  animation: cal-spin 0.9s linear infinite;
}

@keyframes cal-spin {
  to { transform: rotate(360deg); }
}

.cal-caption-ai-actions button img {
  width: 16px;
  height: 16px;
}

.cal-caption-toolbar select,
.cal-caption-grid textarea,
.cal-control-card input,
.cal-control-card select,
.cal-control-card textarea,
.cal-publishing-card input,
.cal-publishing-card select {
  background: #ffffff;
  border-color: #dbe3ee;
  color: #101828;
  border-radius: 11px;
}

.cal-caption-toolbar select {
  min-height: 22px;
  width: 100%;
  padding: 0 18px 0 0;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: #101828 !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.cal-caption-toolbar label:focus-within {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.cal-caption-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 30px;
  align-items: start;
}

.cal-caption-main {
  min-width: 0;
}

.cal-caption-grid {
  display: grid;
  gap: 16px;
}

.cal-caption-grid label {
  display: grid;
  gap: 7px;
  position: relative;
}

.cal-caption-grid label > span {
  position: absolute;
  right: 0;
  top: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.cal-caption-grid textarea {
  min-height: 126px;
  resize: vertical;
  padding: 16px 17px;
  font-size: 13px;
  line-height: 1.58;
}

.cal-asset-path {
  border-radius: 999px;
  margin: 14px 0;
  background: #f8fafc;
}

.cal-caption-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-caption-actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.cal-publishing-card {
  position: sticky;
  top: 0;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid #dbe3ee;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.045);
  overflow: visible;
}

.cal-publishing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 2px;
}

.cal-publishing-head strong {
  font-size: 15px;
  font-weight: 780;
  color: #101828;
}

.cal-publishing-head span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #eef5ff;
}

.cal-publishing-card label {
  display: grid;
  gap: 7px;
  position: relative;
}

.cal-publishing-card select,
.cal-publishing-card input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  outline: none !important;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.cal-publishing-card select:focus,
.cal-publishing-card input:focus,
.cal-publishing-card select:focus-visible,
.cal-publishing-card input:focus-visible,
.cal-publishing-card label:focus-within select,
.cal-publishing-card label:focus-within input {
  border-color: rgba(37, 99, 235, 0.64) !important;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.14),
    0 8px 18px rgba(15, 23, 42, 0.05) !important;
}

.cal-publishing-card input[type="date"],
.cal-publishing-card input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  color-scheme: light;
}

.cal-publishing-card input[type="date"]::-webkit-calendar-picker-indicator,
.cal-publishing-card input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.72;
  cursor: pointer;
  margin-right: 2px;
}

.cal-schedule-trigger,
.cal-schedule-summary {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 16px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #ffffff;
  color: #101828;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 760;
  line-height: 1;
  cursor: pointer;
  outline: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.025);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cal-schedule-trigger:hover,
.cal-schedule-summary:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.cal-schedule-trigger:focus-visible,
.cal-schedule-summary:focus-visible {
  border-color: rgba(37, 99, 235, 0.66);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13), 0 12px 24px rgba(15, 23, 42, 0.05);
}

.cal-schedule-trigger img,
.cal-schedule-summary img {
  flex: 0 0 auto;
}

.cal-schedule-summary {
  grid-column: 1 / -1;
  justify-content: flex-start;
  background: #f8fbff;
}

.cal-schedule-summary span {
  margin-right: auto;
}

.cal-post-date-popover {
  position: fixed;
  z-index: 10040;
  width: min(326px, calc(100vw - 24px));
  padding: 14px 14px 0;
  border: 1px solid #d9e1ed;
  border-radius: 17px;
  background: #ffffff;
  color: #242424;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.20), 0 4px 16px rgba(15, 23, 42, 0.07);
}

.cal-date-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.cal-date-month-head strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.cal-date-month-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cal-date-month-head button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cal-date-month-head button:hover {
  background: #f1f5f9;
}

.cal-date-month-head button img {
  width: 16px;
  height: 16px;
}

.cal-date-weekdays,
.cal-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.cal-date-weekdays {
  margin-bottom: 4px;
  color: #5f5f5f;
  font-size: 13px;
  font-weight: 680;
}

.cal-date-weekdays span,
.cal-date-grid button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-date-grid {
  row-gap: 2px;
}

.cal-date-grid button {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #252525;
  font: inherit;
  font-size: 14px;
  font-weight: 640;
  cursor: pointer;
}

.cal-date-grid button.outside {
  color: #777777;
  font-weight: 520;
}

.cal-date-grid button:hover {
  background: #f2f6ff;
}

.cal-date-grid button.selected {
  background: #aaf095;
  color: #15351d;
  font-weight: 760;
}

.cal-date-divider {
  height: 1px;
  margin: 10px 0 12px;
  background: #d9d9d9;
}

.cal-date-section-title,
.cal-date-time-label > span {
  display: block;
  color: #2c2c2c;
  font-size: 14px;
  font-weight: 680;
  margin-bottom: 8px;
}

.cal-date-slots {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cal-date-slots::-webkit-scrollbar {
  display: none;
}

.cal-date-slots button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 0 7px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: #ffffff;
  color: #2b2b2b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.cal-date-slots button img {
  width: 13px;
  height: 13px;
}

.cal-date-slots button.active {
  border-color: #cef1c1;
  background: #d9f6ce;
  color: #2f6f43;
}

.cal-date-time-row {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #8f8f8f;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.cal-date-time-row img {
  width: 15px;
  height: 15px;
}

.cal-date-time-row select {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: #242424;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  appearance: none;
}

.cal-date-time-row em {
  color: #696969;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.cal-date-actions {
  margin: 13px -14px 0;
  padding: 10px 14px;
  border-top: 1px solid #d9d9d9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cal-date-actions button {
  border: 0;
  background: transparent;
  color: #303030;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cal-date-actions button:hover {
  color: #2563eb;
}

.cal-post-modal [data-tip]::before {
  bottom: calc(100% + 14px);
}

.cal-post-modal [data-tip]::after {
  bottom: calc(100% + 8px);
}

.cal-post-modal .help-dot {
  position: relative;
  top: -1px;
  margin-left: 8px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.cal-publishing-divider {
  height: 1px;
  background: #e5ebf3;
  margin: 2px 0;
}

.cal-publishing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
}

.cal-publishing-row strong {
  color: #101828;
  font-size: 13px;
}

.cal-publishing-row.highlight strong {
  color: #16a34a;
  font-size: 18px;
}

.cal-control-card.flush {
  margin: 0;
  background: #ffffff;
  border-color: #e5ebf3;
}

.cal-post-editor-actions {
  align-content: start;
}

.cal-post-editor-actions button {
  min-height: 42px;
  border-color: #dbe3ee;
  background: #ffffff;
}

.cal-post-modal-footer {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 20px;
  background: #ffffff;
  border-top-color: #e5ebf3;
  position: sticky;
  bottom: 0;
  z-index: 4;
  border-radius: 0 0 20px 20px;
}

.cal-footer-state,
.cal-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-footer-state span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff7ed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-footer-state span.ready {
  background: #dcfce7;
}

.cal-footer-state strong {
  color: #16a34a;
  font-size: 13px;
}

.cal-footer-state em {
  color: #64748b;
  font-style: normal;
  font-size: 12px;
}

.cal-post-modal-footer button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 10px;
  border-color: #dbe3ee;
  background: #ffffff;
  color: #101828;
}

.cal-post-modal-footer .primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
}

@media (max-width: 1180px) {
  .cal-composer-shell {
    grid-template-columns: 1fr;
  }

  .cal-composer-left {
    border-right: 0;
    border-bottom: 1px solid #e5ebf3;
  }

  .cal-post-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .cal-template-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cal-caption-workspace {
    grid-template-columns: 1fr;
  }

  .cal-publishing-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .cal-post-modal {
    width: min(100vw - 20px, 720px);
    max-height: 94vh;
  }

  .cal-post-modal-head,
  .cal-post-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cal-post-head-actions,
  .cal-footer-actions {
    width: 100%;
  }

  .cal-post-head-btn,
  .cal-footer-actions button {
    flex: 1 1 160px;
  }

  .cal-composer-left,
  .cal-composer-panel {
    padding: 14px;
  }

  .cal-template-grid,
  .cal-readiness-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cal-caption-ai-actions {
    justify-content: stretch;
  }

  .cal-caption-ai-actions button {
    flex: 1 1 120px;
  }

  .cal-thumb-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.settings-page {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 6px 4px 30px;
}

.settings-hero {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 8px 18px;
}

.settings-hero .section-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: 0;
}

.settings-hero .section-sub {
  margin-top: 12px;
  color: #667085;
  font-size: 16px;
  line-height: 1.45;
}

.settings-hero-art {
  position: relative;
  flex: 0 0 260px;
  height: 112px;
  margin-top: -2px;
}

.settings-gear-tile {
  position: absolute;
  right: 62px;
  top: 7px;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #eaf0ff;
  font-size: 48px;
  background:
    linear-gradient(142deg, rgba(188, 201, 255, 0.92), rgba(91, 111, 229, 0.95));
  box-shadow:
    0 20px 42px rgba(66, 95, 210, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.settings-cube {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  transform: rotate(38deg);
  box-shadow: 0 8px 16px rgba(31, 41, 55, 0.12);
}

.settings-cube.cube-a { right: 178px; top: 18px; background: #9fb8ff; }
.settings-cube.cube-b { right: 150px; top: 46px; background: #53b878; }
.settings-cube.cube-c { right: 192px; top: 54px; width: 11px; height: 11px; background: #c8d7ff; }

.settings-plant {
  position: absolute;
  bottom: 0;
  width: 52px;
  height: 46px;
  border-radius: 0 0 20px 20px;
}

.settings-plant::before {
  content: "";
  position: absolute;
  left: 13px;
  bottom: 18px;
  width: 28px;
  height: 24px;
  border-radius: 22px 22px 6px 22px;
  background: #4ca36b;
  box-shadow:
    14px -6px 0 -2px #2f8a54,
    -11px -4px 0 -2px #6ab57f;
}

.settings-plant::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 24px;
  border-radius: 9px 9px 14px 14px;
  background: linear-gradient(180deg, #ffffff, #dde4ef);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.10);
}

.settings-plant.plant-left { right: 148px; transform: scale(.78); opacity: .86; }
.settings-plant.plant-right { right: 10px; transform: scale(.92); }

.settings-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.settings-card {
  min-width: 0;
  border: 1px solid #dde4f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 24px;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.settings-card-title {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: 0;
}

.settings-card-sub {
  max-width: 760px;
  margin-top: 7px;
  color: #667085;
  font-size: 14px;
  line-height: 1.45;
}

.settings-divider {
  height: 1px;
  margin: 20px 0 20px;
  background: #e6ebf3;
}

.settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 56px;
}

.settings-card-display .settings-grid-3 {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, .95fr) minmax(330px, 1.35fr);
}

.settings-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #667085;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 740;
}

.settings-field > span:not(.settings-input-wrap):not(.settings-field-hint) {
  color: #8a94a8;
  font-weight: 650;
}

.settings-label-line {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  color: #667085;
  font-weight: 740;
}

.settings-label-line span {
  min-width: 0;
  color: #8a94a8;
  font-weight: 650;
}

.settings-field-title {
  color: #667085;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 740;
}

.settings-input-wrap {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}

.settings-input-wrap > i {
  position: absolute;
  left: 18px;
  z-index: 1;
  color: #76839a;
  font-size: 15px;
  pointer-events: none;
}

.settings-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dce3ee;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 620;
  outline: none;
  padding: 0 16px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.settings-input-wrap > i + .settings-input {
  padding-left: 46px;
}

.settings-input:focus {
  border-color: #94b4ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.settings-input::placeholder {
  color: #98a2b3;
  font-weight: 560;
}

.settings-select-wrap::after {
  content: "";
  position: absolute;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #667085;
  border-bottom: 2px solid #667085;
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}

.settings-select-wrap .settings-input {
  appearance: none;
  padding-right: 42px;
}

.settings-theme-block {
  margin-top: 22px;
}

.settings-theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  max-width: 520px;
  margin-top: 12px;
}

.settings-theme-option {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #dce3ee;
  border-radius: 7px;
  background: #ffffff;
  color: #4b5563;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 730;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.settings-theme-option:hover {
  border-color: #b8c9ee;
  background: #f8fbff;
}

.settings-theme-option.is-active {
  border-color: #8eb1ff;
  background: linear-gradient(180deg, #f7faff, #eff5ff);
  color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22);
}

.settings-buffer-top {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(250px, .92fr) 180px;
  gap: 26px;
  align-items: end;
}

.settings-secret-wrap .settings-input {
  padding-right: 48px;
}

.settings-icon-action {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7b879a;
  cursor: pointer;
}

.settings-icon-action:hover {
  background: #f1f5fb;
  color: #2563eb;
}

.settings-field-hint {
  color: #7b879a;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 560;
}

.settings-token-status {
  min-height: 75px;
  padding-left: 26px;
  border-left: 1px solid #e6ebf3;
}

.settings-token-row {
  margin-top: 10px;
}

.settings-mini-pill,
.settings-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf2f8;
  color: #667085;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.settings-mini-pill.valid,
.settings-state-pill.connected,
.settings-state-pill.recommended {
  background: #dcf8e8;
  color: #179751;
}

.settings-state-pill.connected::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.settings-token-meta {
  margin-top: 6px;
  color: #7b879a;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 580;
}

.settings-reconnect-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

.settings-secondary-btn,
.settings-save-btn,
.settings-primary-btn,
.settings-danger-btn,
.settings-add-channel {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

.settings-secondary-btn,
.settings-save-btn,
.settings-add-channel {
  border: 1px solid #dce3ee;
  background: rgba(255, 255, 255, 0.92);
  color: #3f4a5f;
  padding: 0 18px;
}

.settings-secondary-btn:hover,
.settings-save-btn:hover,
.settings-add-channel:hover {
  border-color: #c3d2ea;
  background: #f8fbff;
}

.settings-primary-btn {
  border: 1px solid #2f67e9;
  background: linear-gradient(180deg, #3f7bf3, #245fe5);
  color: #ffffff;
  padding: 0 22px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.settings-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.30);
}

.settings-danger-btn {
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(254, 242, 242, 0.88);
  color: #dc2626;
  padding: 0 18px;
}

.settings-channel-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 52px;
  margin-top: 22px;
}

.settings-add-channel-field {
  justify-content: end;
}

.settings-add-channel {
  width: fit-content;
  min-width: 150px;
  border-style: solid;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 28px;
}

.settings-actions-split {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr);
  align-items: center;
  gap: 30px;
  width: min(720px, 100%);
  margin-left: auto;
}

.settings-status-line {
  min-height: 18px;
  margin-top: 12px;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 560;
}

.settings-video-layout {
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(280px, 1fr) auto;
  gap: 52px;
  align-items: end;
}

.settings-video-copy {
  color: #667085;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  padding-bottom: 9px;
}

.settings-learn-btn {
  min-width: 132px;
}

.settings-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.settings-feature-row span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dce3ee;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  color: #596579;
  font-size: 13px;
  font-weight: 680;
}

.settings-feature-row i {
  color: #17a259;
}

.settings-video-save {
  min-width: 190px;
}

.settings-add-store-wrap {
  display: none;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed #b9c9e7;
  border-radius: 14px;
  background: #f8fbff;
}

.settings-add-store-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

html:not(.light) #section-settings .settings-hero .section-sub,
html:not(.light) #section-settings .settings-card-sub,
html:not(.light) #section-settings .settings-field,
html:not(.light) #section-settings .settings-field-title,
html:not(.light) #section-settings .settings-token-meta,
html:not(.light) #section-settings .settings-video-copy,
html:not(.light) #section-settings .settings-status-line {
  color: #9ca6ba;
}

html:not(.light) #section-settings .settings-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(28, 32, 42, 0.92);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.18);
}

html:not(.light) #section-settings .settings-card-title,
html:not(.light) #section-settings .settings-hero .section-title {
  color: #f4f7fb;
}

html:not(.light) #section-settings .settings-divider {
  background: rgba(148, 163, 184, 0.16);
}

html:not(.light) #section-settings .settings-input,
html:not(.light) #section-settings .settings-theme-option,
html:not(.light) #section-settings .settings-secondary-btn,
html:not(.light) #section-settings .settings-save-btn,
html:not(.light) #section-settings .settings-add-channel,
html:not(.light) #section-settings .settings-feature-row span {
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(17, 24, 39, 0.70);
  color: #eef2f8;
}

html:not(.light) #section-settings .settings-token-status {
  border-left-color: rgba(148, 163, 184, 0.16);
}

@media (max-width: 1180px) {
  .settings-grid-3,
  .settings-card-display .settings-grid-3,
  .settings-channel-map,
  .settings-video-layout {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .settings-buffer-top {
    grid-template-columns: 1fr 1fr;
  }

  .settings-reconnect-wrap,
  .settings-video-layout .settings-state-pill {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .settings-page {
    padding-inline: 0;
  }

  .settings-hero {
    min-height: 0;
    padding-inline: 0;
  }

  .settings-hero-art {
    display: none;
  }

  .settings-card {
    padding: 18px;
    border-radius: 16px;
  }

  .settings-card-head,
  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-grid-3,
  .settings-card-display .settings-grid-3,
  .settings-channel-map,
  .settings-video-layout,
  .settings-buffer-top,
  .settings-actions-split {
    grid-template-columns: 1fr;
  }

  .settings-theme-options {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .settings-token-status {
    min-height: 0;
    padding-left: 0;
    border-left: 0;
  }
}

html:not(.light) #section-calendar .cal-hero-icon,
html:not(.light) #section-calendar .cal-channel-icon,
html:not(.light) .cal-post-modal-icon {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.22);
}

@media (max-width: 1500px) {
  #section-calendar #calendar-filters.cal-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #section-calendar #calendar-filters.cal-filters-grid > * {
    min-width: 0 !important;
  }

  #section-calendar #calendar-filters .cal-date-range-filter {
    min-width: 0 !important;
  }
}

@media (max-width: 1320px) {
  #section-calendar .cal-command-strip {
    grid-template-columns: 1fr;
  }
  #section-calendar .cal-stats-grid,
  #section-calendar .cal-channel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #section-calendar .cal-post-row {
    grid-template-columns: 24px 80px minmax(0, 1fr);
  }
  #section-calendar .cal-post-status-col,
  #section-calendar .cal-post-actions,
  #section-calendar .launch-card-kebab {
    grid-column: 3;
  }
}

@media (max-width: 1180px) {
  #section-calendar #calendar-filters.cal-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #section-calendar #calendar-filters.cal-filters-grid > * {
    min-width: 0 !important;
  }

  #section-calendar #calendar-filters .cal-date-range-filter {
    min-width: 0 !important;
  }

}

@media (max-width: 860px) {
  #section-calendar .cal-shell {
    padding: 0 14px;
  }
  #section-calendar .cal-hero,
  #section-calendar .cal-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  #section-calendar .cal-stats-grid,
  #section-calendar .cal-channel-grid,
  .cal-post-editor-grid,
  .cal-control-grid {
    grid-template-columns: 1fr;
  }
  #section-calendar .cal-post-row {
    grid-template-columns: 24px 72px minmax(0, 1fr);
    gap: 10px;
  }
  #section-calendar .cal-post-thumb {
    width: 72px;
    height: 72px;
  }

  #section-calendar #calendar-filters.cal-filters-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─── Studio Asset Manager modal ─────────────────────────────────────────
   A focused, light workspace for managing one product's launch assets. Kept
   late so it overrides the generic dark modal sweep above. */
#studio-product-modal.detail-modal-overlay {
  background: rgba(82, 94, 118, 0.48) !important;
  backdrop-filter: blur(14px) saturate(118%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(118%) !important;
  padding: 28px;
}

#studio-product-modal .asset-manager-modal,
html:not(.light) #studio-product-modal .asset-manager-modal {
  width: min(96vw, 1540px) !important;
  max-height: min(92vh, 940px) !important;
  overflow: hidden !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  border: 1px solid rgba(214, 221, 234, 0.96) !important;
  box-shadow:
    0 34px 90px rgba(15, 23, 42, 0.24),
    0 1px 0 rgba(255, 255, 255, 0.92) inset !important;
  color: #0f172a !important;
}

#studio-product-modal #studio-modal-body {
  height: min(92vh, 940px);
  min-height: 620px;
  overflow: hidden;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  flex-direction: column;
}

.asset-manager-header,
.asset-manager-workspace,
.asset-manager-footer {
  flex: 0 0 auto;
}

.asset-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.05), transparent 28%),
    #ffffff;
}

.asset-manager-product {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.asset-manager-product-thumb {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.asset-manager-product-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 15px;
  font-weight: 760;
  text-transform: uppercase;
}

.asset-manager-titleblock {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.asset-manager-kicker {
  color: #1e40af;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.asset-manager-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.asset-manager-title-row h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.16;
}

.asset-manager-titleblock p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
}

.asset-manager-brand,
.asset-manager-count {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
}

.asset-manager-brand {
  background: color-mix(in srgb, var(--brand-color, #2563eb) 12%, #fff);
  color: var(--brand-color, #2563eb);
  border: 1px solid color-mix(in srgb, var(--brand-color, #2563eb) 20%, #e2e8f0);
  text-transform: uppercase;
}

.asset-manager-count {
  background: #f1f5f9;
  color: #64748b;
}

.asset-manager-header-actions,
.asset-preview-actions,
.asset-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.asset-manager-btn,
.asset-preview-actions button,
.asset-preview-actions a {
  min-height: 42px;
  border-radius: 11px;
  padding: 0 16px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}

.asset-manager-btn:hover,
.asset-preview-actions button:hover,
.asset-preview-actions a:hover {
  border-color: #b8c7df;
  background: #f8fbff;
  transform: translateY(-1px);
}

.asset-manager-btn.primary {
  border-color: #2563eb;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.asset-manager-btn.primary:hover {
  background: linear-gradient(180deg, #4f8df8 0%, #2563eb 100%);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.asset-manager-btn.ai {
  border-color: rgba(124, 77, 255, 0.26);
  background: rgba(124, 77, 255, 0.08);
  color: #5b21b6;
}

.asset-manager-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}

.asset-manager-close:hover {
  background: #f8fafc;
  color: #0f172a;
  transform: translateY(-1px);
}

.asset-manager-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(500px, 1fr) 420px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin: 0 18px;
  overflow: hidden;
  background: #ffffff;
}

.asset-manager-list,
.asset-manager-preview,
.asset-manager-details {
  min-width: 0;
  min-height: 0;
}

.asset-manager-list,
.asset-manager-details {
  background: #ffffff;
}

.asset-manager-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e2e8f0;
}

.asset-list-control {
  padding: 14px 14px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.asset-list-search {
  position: relative;
}

.asset-list-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.asset-list-search input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #dbe3ef !important;
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 0 14px 0 38px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.asset-list-search input:focus {
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10) !important;
}

.asset-list-filter {
  width: 44px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #dbe3ef !important;
  background: #ffffff !important;
  color: transparent !important;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(50% - 4px) 50%, calc(50% + 4px) 50%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

.asset-manager-list.source-pulse {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) inset;
}

.asset-list-items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.asset-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 28px;
  gap: 11px;
  align-items: center;
  min-height: 88px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.asset-list-item:hover {
  border-color: #bfdbfe;
}

.asset-list-item.active {
  border-color: #4f80ff;
  background: linear-gradient(180deg, #f9fbff 0%, #f5f8ff 100%);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.16) inset, 0 14px 30px rgba(37, 99, 235, 0.08);
}

.asset-list-thumb {
  width: 70px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.asset-list-thumb-fallback {
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.asset-list-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.asset-list-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a;
  font-size: 13px;
  font-weight: 760;
}

.asset-list-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-style: normal;
  font-size: 11px;
  font-weight: 560;
}

.asset-list-main span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.asset-list-more {
  width: 28px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #64748b;
}

.asset-list-more:hover {
  background: #eef4ff;
  color: #2563eb;
}

.asset-list-empty,
.asset-preview-empty,
.asset-detail-empty {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  color: #64748b;
  padding: 24px;
}

.asset-list-empty i,
.asset-preview-empty i,
.asset-detail-empty i {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 18px;
}

.asset-list-empty strong,
.asset-preview-empty strong,
.asset-detail-empty strong {
  color: #0f172a;
  font-size: 14px;
}

.asset-list-empty span,
.asset-preview-empty span,
.asset-detail-empty span {
  max-width: 230px;
  font-size: 12px;
  line-height: 1.4;
}

.asset-list-footer {
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 12px;
}

.asset-manager-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: #ffffff;
  overflow: hidden;
}

.asset-workspace-tabs {
  height: 54px;
  display: flex;
  align-items: flex-end;
  gap: 26px;
  padding: 0 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.asset-workspace-tabs button {
  height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.asset-workspace-tabs button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.asset-workspace-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px;
}

.asset-preview-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.asset-preview-toolbar span {
  color: #64748b;
  font-size: 11px;
  font-weight: 680;
}

.asset-preview-toolbar h3 {
  margin: 5px 0 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.asset-preview-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.asset-preview-actions button,
.asset-preview-actions a {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #334155;
  padding: 0 6px;
  box-shadow: none;
  font-size: 12px;
}

.asset-preview-actions button:hover,
.asset-preview-actions a:hover {
  color: #2563eb;
  background: #f1f6ff;
  transform: none;
}

.asset-preview-stage {
  flex: 1 1 auto;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(226, 232, 240, 0.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(226, 232, 240, 0.42) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(226, 232, 240, 0.42) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(226, 232, 240, 0.42) 75%),
    #f8fafc;
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.asset-preview-stage img,
.asset-preview-stage video {
  width: 100%;
  height: 100%;
  max-height: min(46vh, 520px);
  object-fit: contain;
  display: block;
}

.asset-auto-resizer {
  display: grid;
  gap: 18px;
}

.resize-section {
  display: grid;
  gap: 12px;
}

.resize-section h4,
.resize-section-title h4 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 820;
}

.resize-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resize-section-title button {
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.resize-source-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 14px;
}

.resize-source-thumb {
  width: 96px;
  height: 76px;
  overflow: hidden;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.resize-source-thumb img,
.resize-source-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.resize-source-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.resize-source-copy strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.resize-source-copy span,
.resize-source-copy em {
  color: #64748b;
  font-style: normal;
  font-size: 12px;
  font-weight: 620;
}

.resize-target-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.resize-target-card {
  position: relative;
  min-height: 126px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, transform .14s ease;
}

.resize-target-card:hover {
  transform: translateY(-1px);
  border-color: #a9c4ff;
}

.resize-target-card.selected {
  border-color: #6f6bff;
  background: linear-gradient(180deg, #ffffff 0%, #f7f6ff 100%);
  box-shadow: 0 0 0 1px rgba(111, 107, 255, 0.14) inset;
}

.resize-target-card > i {
  color: #64748b;
  font-size: 22px;
}

.resize-target-card strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 820;
}

.resize-target-card em,
.resize-target-card small {
  font-style: normal;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.resize-target-card small {
  color: #64748b;
  font-size: 11px;
}

.resize-target-check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #6f4cff;
  color: #ffffff;
  font-size: 11px;
}

.resize-target-card.selected .resize-target-check {
  display: inline-flex;
}

.resize-note {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 77, 255, 0.18);
  background: linear-gradient(180deg, rgba(124, 77, 255, 0.06) 0%, rgba(124, 77, 255, 0.03) 100%);
  color: #334155;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
}

.resize-note i {
  color: #7c3aed;
  font-size: 18px;
}

.resize-generate-btn {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(100deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 820;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.22);
}

.resize-generate-btn:disabled {
  opacity: .72;
  cursor: wait;
}

.resize-estimate {
  display: flex;
  justify-content: center;
  gap: 7px;
  color: #64748b;
  font-size: 12px;
}

.resize-message {
  border-radius: 10px;
  background: #f0fdf4;
  color: #15803d;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 720;
}

.resize-message.error {
  background: #fef2f2;
  color: #dc2626;
}

.asset-preview-stage video {
  background: #0f172a;
}

.asset-preview-missing {
  width: 100%;
  min-height: 340px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.asset-thumb-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
}

.asset-thumb-strip button {
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 9px;
  border: 2px solid transparent;
  background: #f8fafc;
  overflow: hidden;
  cursor: pointer;
}

.asset-thumb-strip button.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.asset-thumb-strip img,
.asset-thumb-strip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-manager-details {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  overflow: hidden;
}

.asset-manager-details.resize-panel-shell {
  background: #fbfdff;
}

.resize-output-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 18px;
  overflow-y: auto;
}

.resize-output-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.resize-output-header h3 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 820;
}

.resize-output-header span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.resize-output-header b {
  border-radius: 999px;
  background: rgba(124, 77, 255, 0.10);
  color: #6d28d9;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.resize-output-list {
  display: grid;
  gap: 10px;
}

.resize-output-row {
  min-height: 76px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 9px;
}

.resize-output-thumb {
  width: 58px;
  height: 58px;
  border-radius: 9px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  overflow: hidden;
}

.resize-output-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resize-output-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.resize-output-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a;
  font-size: 12px;
  font-weight: 790;
}

.resize-output-copy span,
.resize-output-copy em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
}

.resize-output-copy em {
  color: #dc2626;
}

.resize-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 820;
}

.resize-status.pending {
  background: #ffedd5;
  color: #ea580c;
}

.resize-status.generating {
  background: #dbeafe;
  color: #2563eb;
}

.resize-status.ready {
  background: #dcfce7;
  color: #15803d;
}

.resize-status.failed {
  background: #fee2e2;
  color: #dc2626;
}

.resize-icon-btn,
.resize-more-menu summary,
.resize-retry-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.resize-icon-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.resize-retry-btn {
  width: auto;
  padding: 0 10px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 780;
}

.resize-more-menu {
  position: relative;
}

.resize-more-menu summary {
  list-style: none;
}

.resize-more-menu summary::-webkit-details-marker {
  display: none;
}

.resize-more-menu[open] {
  z-index: 4;
}

.resize-more-menu[open]::before {
  content: "";
  position: fixed;
  inset: 0;
}

.resize-more-menu > button {
  position: absolute;
  right: 0;
  width: 122px;
  min-height: 34px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
}

.resize-more-menu > button:nth-of-type(1) {
  top: 40px;
  border-radius: 10px 10px 0 0;
}

.resize-more-menu > button:nth-of-type(2) {
  top: 73px;
  border-radius: 0 0 10px 10px;
  color: #dc2626;
}

.resize-output-actions {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.resize-save-path,
.resize-saved-note {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.resize-save-path strong {
  color: #2563eb;
  font-weight: 760;
}

.resize-saved-note {
  border-radius: 10px;
  background: #f0fdf4;
  color: #15803d;
  padding: 10px 12px;
  font-weight: 760;
}

.asset-history-panel {
  display: grid;
  gap: 12px;
}

.asset-history-panel h3 {
  margin: 0;
  color: #0f172a;
}

.asset-history-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px;
}

.asset-history-row i {
  color: #2563eb;
}

.asset-history-row div {
  display: grid;
  gap: 3px;
}

.asset-history-row span {
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-detail-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 20px 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

.asset-detail-tabs button {
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  font-weight: 660;
  cursor: pointer;
}

.asset-detail-tabs button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.asset-detail-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px 20px;
}

.asset-detail-fields {
  display: grid;
  gap: 12px;
}

.asset-detail-field,
.asset-form-stack label,
.asset-platforms {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 11px;
  font-weight: 680;
}

.asset-detail-field > div,
.asset-form-stack input,
.asset-form-stack textarea,
.asset-form-stack select {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid #dbe3ef !important;
  border-radius: 10px;
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
}

.asset-form-stack textarea {
  min-height: 112px;
  resize: vertical;
  align-items: flex-start;
  padding-top: 11px;
  line-height: 1.45;
}

.asset-form-stack {
  display: grid;
  gap: 14px;
}

.asset-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.asset-platforms > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-platforms label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 680;
  text-transform: capitalize;
}

.asset-platforms input {
  accent-color: #2563eb;
}

.asset-panel-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 2px;
}

.asset-ai-button {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid rgba(124, 77, 255, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
  color: #4f46e5;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.asset-ai-button:hover {
  background: #f7f3ff;
}

.asset-schedule-note {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  padding: 0 12px;
  font-size: 12px;
}

.asset-pill {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.asset-pill.collection {
  background: #eef4ff;
  color: #2563eb;
}

.asset-pill.single {
  background: #f3e8ff;
  color: #7c3aed;
}

.asset-pill.ready {
  background: #dcfce7;
  color: #15803d;
}

.asset-pill.scheduled {
  background: #e0f2fe;
  color: #0369a1;
}

.asset-pill.draft {
  background: #f1f5f9;
  color: #64748b;
}

.asset-manager-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 28px 22px;
  background: #ffffff;
}

.asset-manager-save-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.asset-manager-save-state i {
  color: #16a34a;
  font-size: 18px;
}

.asset-manager-save-state em {
  font-style: normal;
  color: #94a3b8;
}

.asset-manager-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resize-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .68);
  backdrop-filter: blur(10px);
  padding: 26px;
}

.resize-preview-overlay.open {
  display: flex;
}

.resize-preview-dialog {
  position: relative;
  width: min(92vw, 980px);
  max-height: min(92vh, 880px);
  display: grid;
  gap: 16px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, .2);
  background: #0b1220;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .36);
}

.resize-preview-dialog img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 14px;
  background: #111827;
}

.resize-preview-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(15, 23, 42, .58);
  color: #ffffff;
  cursor: pointer;
}

.resize-preview-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e5e7eb;
}

.resize-preview-footer div {
  margin-right: auto;
  display: grid;
  gap: 3px;
}

.resize-preview-footer span {
  color: #94a3b8;
  font-size: 12px;
}

html:not(.light) #studio-product-modal .asset-manager-modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html:not(.light) #studio-product-modal .asset-manager-modal select,
html:not(.light) #studio-product-modal .asset-manager-modal textarea {
  background: #ffffff !important;
  border-color: #dbe3ef !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

html:not(.light) #studio-product-modal .asset-manager-modal input::placeholder,
html:not(.light) #studio-product-modal .asset-manager-modal textarea::placeholder {
  color: #94a3b8 !important;
}

@media (max-width: 1320px) {
  #studio-product-modal .asset-manager-workspace {
    grid-template-columns: 300px minmax(420px, 1fr) 380px;
  }

  #studio-product-modal .resize-target-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  #studio-product-modal #studio-modal-body {
    overflow: auto;
  }

  #studio-product-modal .asset-manager-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #studio-product-modal .asset-manager-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  #studio-product-modal .asset-manager-workspace {
    grid-template-columns: 320px minmax(0, 1fr);
    overflow: visible;
  }

  #studio-product-modal .asset-manager-details {
    grid-column: 1 / -1;
    min-height: 320px;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }

  #studio-product-modal .resize-output-panel {
    max-height: 520px;
  }
}

@media (max-width: 760px) {
  #studio-product-modal.detail-modal-overlay {
    padding: 12px;
  }

  #studio-product-modal .asset-manager-modal {
    width: 100% !important;
    border-radius: 18px !important;
  }

  #studio-product-modal .asset-manager-header {
    padding: 18px;
  }

  #studio-product-modal .asset-manager-product {
    align-items: flex-start;
  }

  #studio-product-modal .asset-manager-product-thumb {
    width: 64px;
    height: 64px;
  }

  #studio-product-modal .asset-manager-title-row h2 {
    font-size: 18px;
  }

  #studio-product-modal .asset-manager-header-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  #studio-product-modal .asset-manager-header-actions .asset-manager-btn {
    flex: 1 1 150px;
  }

  #studio-product-modal .asset-manager-workspace {
    grid-template-columns: 1fr;
    margin: 0 10px;
  }

  #studio-product-modal .asset-manager-list {
    max-height: 330px;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  #studio-product-modal .asset-manager-preview {
    padding: 0;
  }

  #studio-product-modal .asset-workspace-tabs {
    overflow-x: auto;
    padding: 0 14px;
    gap: 18px;
  }

  #studio-product-modal .asset-workspace-content {
    padding: 18px 14px;
  }

  #studio-product-modal .asset-preview-toolbar {
    flex-direction: column;
  }

  #studio-product-modal .asset-preview-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #studio-product-modal .asset-preview-stage {
    min-height: 260px;
  }

  #studio-product-modal .asset-manager-footer {
    position: sticky;
    bottom: 0;
    padding: 14px 18px;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  #studio-product-modal .asset-manager-footer .asset-manager-btn {
    width: 100%;
  }

  #studio-product-modal .asset-manager-footer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #studio-product-modal .resize-source-card,
  #studio-product-modal .resize-output-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  #studio-product-modal .resize-target-grid {
    grid-template-columns: 1fr;
  }
}

/* Scene Reference Settings provider toggle refinement. The modal becomes
   single-column below 1120px, so keep the provider control from stretching
   into a giant pill and force both options to occupy exact equal halves. */
html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child {
  width: min(100%, 360px) !important;
  max-width: 360px !important;
}

html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-seg {
  width: min(100%, 360px) !important;
  max-width: 360px !important;
  min-height: 52px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 4px !important;
  padding: 5px !important;
  border-radius: 15px !important;
  background: #ffffff !important;
  border-color: #d8e1ef !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045) !important;
}

html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-opt {
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 12px !important;
  border-radius: 11px !important;
  justify-content: center !important;
  gap: 8px !important;
  color: #6b7280 !important;
  font-size: 15px !important;
  font-weight: 760 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-opt.is-active,
html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-opt.active {
  background: #2f63ea !important;
  color: #ffffff !important;
  box-shadow: 0 10px 18px rgba(47, 99, 234, 0.20) !important;
}

html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-tag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 22px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
  font-size: 11px !important;
  font-weight: 780 !important;
  line-height: 1 !important;
  background: rgba(124, 77, 255, 0.12) !important;
  color: #6d55f6 !important;
}

html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-opt.is-active .pq-mode-tag,
html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-opt.active .pq-mode-tag {
  background: rgba(255, 255, 255, 0.20) !important;
  color: #ffffff !important;
}

@media (max-width: 560px) {
  html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child,
  html body #section-image-studio #ist-drawer.ist-drawer.open .ist-settings-top-grid > label:first-child .pq-mode-seg {
    max-width: none !important;
    width: 100% !important;
  }
}
