/* ============================================================================
 * Products — per-project product-feed catalog.
 * Header + toolbar mirror the Image/Video libraries for cross-page continuity.
 * ========================================================================== */

.pf-page { display: flex; flex-direction: column; min-height: 100%; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.pf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 28px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border-subtle, #e6e6ec);
}
.pf-title-wrap { display: flex; flex-direction: column; gap: 3px; }
.pf-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--text-primary, #1a1a2e); }
.pf-sub { font-size: 12.5px; color: var(--text-muted, #888); }
.pf-add-btn { white-space: nowrap; }

/* ── Feeds strip ──────────────────────────────────────────────────────────── */
.pf-feeds { display: flex; flex-direction: column; gap: 10px; padding: 16px 28px 4px; }
.pf-feeds-empty {
    padding: 18px 16px;
    border: 1px dashed var(--border, #d8dae5);
    border-radius: 12px;
    color: var(--text-muted, #888);
    font-size: 13px;
    background: #fafbff;
}
.pf-db-warn { border-color: #fde68a; background: linear-gradient(135deg, #fffbeb, #fff); color: #92400e; }
.pf-db-warn strong { color: #78350f; }

.pf-feed-card {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 13px 16px;
    background: #fff;
    border: 1px solid var(--border-subtle, #e6e6ec);
    border-radius: 12px;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.pf-feed-card:hover { border-color: #c9ccdb; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05); }
.pf-feed-main { min-width: 0; flex: 1; }
.pf-feed-namerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-feed-name { font-size: 14px; font-weight: 700; color: var(--text-primary, #1a1a2e); }
.pf-feed-fmt {
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
    color: #4f46e5; background: #eef2ff; border-radius: 5px; padding: 2px 6px;
}
.pf-feed-badge { font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 2px 6px; }
.pf-feed-badge-err { color: #b91c1c; background: #fee2e2; }
.pf-feed-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--text-muted, #888); }
.pf-feed-url { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-feed-error { margin-top: 5px; font-size: 11.5px; color: #b91c1c; }
.pf-feed-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pf-feed-del { color: #b91c1c; }
.pf-feed-del:hover { background: #fee2e2; }

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.pf-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid var(--border-subtle, #e6e6ec);
}
.pf-search {
    flex: 1 1 240px; min-width: 180px; max-width: 360px;
    padding: 8px 12px; font-size: 13px; font-family: inherit;
    border: 1px solid var(--border-subtle, #e6e6ec); border-radius: 8px; outline: none;
}
.pf-search:focus { border-color: #5B53E8; box-shadow: var(--focus-ring); }
.pf-feed-filter {
    padding: 8px 10px; font-size: 13px; font-family: inherit; background: #fff;
    border: 1px solid var(--border-subtle, #e6e6ec); border-radius: 8px; min-width: 160px;
}
.pf-count { margin-left: auto; font-size: 12px; color: var(--text-muted, #9ca3af); white-space: nowrap; }

/* ── Products grid ────────────────────────────────────────────────────────── */
.pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px 28px;
}
.pf-grid-loading { grid-column: 1 / -1; display: flex; justify-content: center; padding: 40px; }
.pf-grid-foot { display: flex; justify-content: center; padding: 0 28px 36px; }
.pf-loadmore { min-width: 200px; }

.pf-card {
    position: relative;
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid var(--border-subtle, #e6e6ec);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer; /* whole card deep-links into the catalog browser */
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.pf-card:hover { border-color: #c9ccdb; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); transform: translateY(-2px); }
.pf-card-thumb {
    aspect-ratio: 1 / 1; background: #f4f5fa; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px;
}
/* Square tile, whole product visible (contain = no crop) — letterboxed on the tile bg. */
.pf-card-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pf-card-thumb-empty::after {
    content: ''; width: 36px; height: 36px; border-radius: 8px;
    background: repeating-linear-gradient(45deg, #e5e7f0, #e5e7f0 6px, #eef0f7 6px, #eef0f7 12px);
}
.pf-card-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 3px; }
.pf-card-title {
    font-size: 12.5px; font-weight: 600; color: var(--text-primary, #1a1a2e); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-card-pricerow { display: flex; align-items: baseline; gap: 6px; }
.pf-card-price, .pf-card-sale { font-size: 13px; font-weight: 700; color: #111827; }
.pf-card-sale { color: #dc2626; }
.pf-card-was { font-size: 11px; color: #646B78; text-decoration: line-through; }
.pf-card-brand { font-size: 11px; color: var(--text-muted, #9ca3af); }

.pf-card-actions {
    position: absolute; top: 8px; right: 8px; display: flex; gap: 6px;
    opacity: 0; transform: translateY(-4px); transition: opacity 0.12s, transform 0.12s;
}
.pf-card:hover .pf-card-actions { opacity: 1; transform: translateY(0); }
.pf-card-act {
    font-size: 11px; font-weight: 600; text-decoration: none;
    padding: 4px 9px; border-radius: 999px; cursor: pointer;
    background: rgba(17, 24, 39, 0.82); color: #fff; border: none; backdrop-filter: blur(2px);
}
.pf-card-act:hover { background: rgba(17, 24, 39, 0.95); }
.pf-card-del { background: rgba(185, 28, 28, 0.85); }
.pf-card-del:hover { background: rgba(185, 28, 28, 0.98); }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.pf-empty { grid-column: 1 / -1; padding: 48px 20px; text-align: center; color: var(--text-muted, #888); font-size: 13px; }
.pf-empty-lg { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto; padding: 80px 24px; }
.pf-empty-icon { color: #646B78; }
.pf-empty-title { margin: 4px 0 0; font-size: 18px; font-weight: 700; color: var(--text-primary, #1a1a2e); }
.pf-empty-text { max-width: 420px; font-size: 13.5px; color: var(--text-muted, #888); line-height: 1.5; }

/* ── Import wizard modal ──────────────────────────────────────────────────── */
.pf-modal-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--overlay-bg); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.pf-modal {
    width: 860px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column;
    background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3); overflow: hidden;
}
.pf-modal-head { position: relative; padding: 18px 60px 14px 22px; border-bottom: 1px solid var(--border-subtle, #eef0f4); }
.pf-modal-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; color: var(--text-primary, #1a1a2e); }
.pf-steps { display: flex; gap: 18px; }
.pf-step { font-size: 12px; font-weight: 600; color: #646B78; }
.pf-step.is-active { color: #4f46e5; }
.pf-step.is-done { color: #16a34a; }
.pf-modal-body { padding: 20px 22px; overflow-y: auto; }

.pf-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.pf-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary, #4b5563); }
.pf-input {
    width: 100%; padding: 10px 12px; font-size: 13.5px; font-family: inherit;
    border: 1px solid var(--border, #e2e5ee); border-radius: 9px; background: #fff; color: var(--text-primary);
}
.pf-input:focus { outline: none; border-color: #5B53E8; box-shadow: var(--focus-ring); }
.pf-hint { font-size: 11.5px; color: var(--text-muted, #9ca3af); }

.pf-seg { display: inline-flex; border: 1px solid var(--border, #e2e5ee); border-radius: 9px; overflow: hidden; margin-bottom: 16px; }
.pf-seg-btn { border: none; background: #fff; padding: 9px 16px; font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; font-family: inherit; }
.pf-seg-btn + .pf-seg-btn { border-left: 1px solid var(--border, #e2e5ee); }
.pf-seg-btn.is-active { background: #4f46e5; color: #fff; }

.pf-drop {
    border: 2px dashed var(--border, #d8dae5); border-radius: 12px; padding: 26px; text-align: center;
    cursor: pointer; margin-bottom: 16px; transition: border-color 0.12s, background 0.12s;
}
.pf-drop:hover, .pf-drop.is-over { border-color: #5B53E8; background: #f5f6ff; }
.pf-drop-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted, #888); }
.pf-drop-label { font-size: 13px; }
.pf-file-hidden { display: none; }

.pf-modal-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* Map step (guided) */
.pf-map-lead2 { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary, #4b5563); line-height: 1.55; }
.pf-map-lead2 strong { color: var(--text-primary, #1a1a2e); }
.pf-map-info { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pf-chip { font-size: 12px; color: var(--text-secondary, #4b5563); background: #f3f4f6; border: 1px solid var(--border-subtle, #eef0f4); border-radius: 999px; padding: 3px 10px; }
.pf-chip strong { color: var(--text-primary, #1a1a2e); }

/* Required-mapped progress banner */
.pf-map-progress { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px; padding: 9px 12px; margin-bottom: 16px; }
.pf-map-progress.is-ok { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.pf-map-progress-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.pf-map-progress.is-ok .pf-map-progress-icon { background: #10b981; }
/* Unmapped-columns note under the progress banner — informational, not a warning
   (unmapped columns are KEPT as custom fields, never dropped). */
.pf-map-unmapped { font-size: 12px; color: var(--text-muted, #6b7280); margin: -8px 0 16px; padding: 0 2px; }

/* Per-field guided card */
.pf-fmap-group { display: flex; flex-direction: column; gap: 10px; }
.pf-fmap { border: 1px solid var(--border-subtle, #eef0f4); border-radius: 11px; padding: 11px 13px; background: #fff; }
.pf-fmap.is-required { border-color: #c7d2fe; background: #fbfbff; }
.pf-fmap-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-fmap-label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--text-primary, #1a1a2e); }
.pf-req { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #4f46e5; background: #eef2ff; border-radius: 5px; padding: 2px 6px; margin-left: 0; }
.pf-fmap-status { font-size: 12px; font-weight: 700; }
.pf-fmap-status.is-ok { color: #16a34a; }
.pf-fmap-status.is-warn { color: #d97706; }
.pf-fmap-help { font-size: 11.5px; color: var(--text-muted, #9ca3af); margin: 3px 0 9px; line-height: 1.4; }
.pf-fmap-ctrl { display: flex; align-items: center; gap: 10px; }
.pf-map-select {
    padding: 8px 10px; font-size: 12.5px; font-family: inherit; flex: 0 0 auto; min-width: 170px; max-width: 230px;
    border: 1px solid var(--border, #e2e5ee); border-radius: 8px; background: #fff; color: var(--text-primary);
}
.pf-map-select.pf-map-required { border-color: #c7d2fe; }
.pf-fmap-arrow { color: #646B78; font-size: 14px; flex: 0 0 auto; }
.pf-fmap-preview { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; background: #f8f9fc; border: 1px solid var(--border-subtle, #eef0f4); border-radius: 8px; padding: 6px 10px; min-height: 34px; }
.pf-fmap-preview.is-empty { color: #646B78; font-size: 12px; font-style: italic; background: transparent; border-style: dashed; }
.pf-fmap-val { font-size: 12.5px; color: var(--text-primary, #1a1a2e); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-fmap-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border-subtle, #eef0f4); flex: 0 0 auto; background: #fff; }

/* Optional fields disclosure */
.pf-fmap-optional { margin-top: 14px; }
.pf-fmap-optional > summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: #4f46e5; padding: 8px 2px; list-style: none; }
.pf-fmap-optional > summary::-webkit-details-marker { display: none; }
.pf-fmap-optional > summary::before { content: '▸ '; }
.pf-fmap-optional[open] > summary::before { content: '▾ '; }
.pf-fmap-optional[open] > summary { margin-bottom: 10px; }

/* Importing step */
.pf-importing { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 20px; text-align: center; }
.pf-importing-text { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary, #1a1a2e); }
.pf-importing-sub { margin: 0; font-size: 12.5px; color: var(--text-muted, #888); }

/* Inline button spinner */
.pf-spin {
    display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 6px;
    border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%;
    animation: pf-spin 0.7s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
    .pf-modal { width: 100%; }
    .pf-fmap-ctrl { flex-direction: column; align-items: stretch; gap: 6px; }
    .pf-fmap-arrow { display: none; }
    .pf-map-select { max-width: none; }
}

/* ── Field mapping (feed-column driven): feed column + sample → GMC field ── */
.pf-maprows { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.pf-maprows-head { display: grid; grid-template-columns: 1fr 28px minmax(180px,240px); gap: 12px; padding: 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #646B78; }
.pf-maprows-head span:last-child { grid-column: 3; }
.pf-maprow { display: grid; grid-template-columns: 1fr 28px minmax(180px,240px); gap: 12px; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid #e1e3e5; border-radius: 10px; }
.pf-maprow-src { min-width: 0; }
.pf-maprow-col { font-size: 13px; font-weight: 600; color: #111827; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-maprow-sample { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: #6b7280; min-width: 0; }
.pf-maprow-sample span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-maprow-sample.is-empty { color: #646B78; font-style: italic; }
.pf-maprow-sample.is-cyclable { cursor: pointer; }
.pf-maprow-sample.is-cyclable:hover { color: #2A3343; }
.pf-maprow-cycle { flex: 0 0 auto; font-size: 10px; font-weight: 700; color: #646B78; background: #F0F1F5; border-radius: 5px; padding: 1px 5px; }
.pf-maprow-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 5px; border: 1px solid #e1e3e5; flex-shrink: 0; background: #f6f6f7; }
.pf-maprow-arrow { text-align: center; color: #646B78; font-size: 15px; }
.pf-maprow-dst { width: 100%; }
/* Target cell: a "Custom field" on/off toggle above the field-picker OR the
   custom-name input (one shows at a time, switched by the toggle). */
.pf-maprow-target { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-maprow-toggle { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 0; font-size: 11px; font-weight: 600; color: #6b7280; cursor: pointer; user-select: none; }
.pf-maprow-toggle:hover { color: #4b5563; }
.pf-maprow-switch { position: relative; width: 30px; height: 17px; border-radius: 999px; background: #d1d5db; flex: 0 0 auto; transition: background .15s; }
.pf-maprow-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: left .15s; }
.pf-maprow-switch.is-on { background: #5B53E8; }
.pf-maprow-switch.is-on::after { left: 15px; }
.pf-maprow-custom { width: 100%; box-sizing: border-box; border: 1px solid #d8b4fe; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; color: #111827; outline: none; background: #faf5ff; }
.pf-maprow-custom::placeholder { color: #c4b5fd; }
.pf-maprow-custom:focus { border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); background: #fff; }
.pf-maprow-custom.is-dup { border-color: #dc2626; background: #fef2f2; }       /* duplicate custom name */
.pf-maprow-custom.is-reserved { border-color: #f59e0b; background: #fffbeb; }  /* name collides with a built-in field */
@media (max-width: 640px) {
    .pf-maprows-head { display: none; }
    .pf-maprow { grid-template-columns: 1fr; gap: 8px; }
    .pf-maprow-arrow { display: none; }
}

/* Searchable field picker (replaces the native <select> in the map step). The
   trigger matches .pf-map-select; the popup is body-mounted + position:fixed (set
   inline by JS) so the scrolling modal can't clip it. */
.pf-fsel { position: relative; width: 100%; min-width: 0; }
.pf-fsel-trigger {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 10px; font-size: 12.5px; font-family: inherit; text-align: left;
    border: 1px solid var(--border, #e2e5ee); border-radius: 8px; background: #fff;
    color: var(--text-primary, #1a1a2e); cursor: pointer;
}
.pf-fsel-trigger:hover { border-color: #c7cad8; }
.pf-fsel-trigger[aria-expanded="true"] { border-color: #5B53E8; box-shadow: var(--focus-ring); }
.pf-fsel-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #646B78; }
.pf-fsel.is-set .pf-fsel-value { color: var(--text-primary, #1a1a2e); font-weight: 500; }
.pf-fsel-caret { flex: 0 0 auto; color: #646B78; display: inline-flex; }

.pf-fsel-pop {
    z-index: 10001;   /* above the .pf-modal-overlay (z-index:10000) it's body-mounted beside */
    background: #fff; border: 1px solid var(--border, #e2e5ee); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.16); overflow: hidden; display: flex; flex-direction: column;
    max-height: 340px;
}
.pf-fsel-search {
    margin: 8px; padding: 8px 10px; font-size: 12.5px; font-family: inherit; flex: 0 0 auto;
    border: 1px solid var(--border, #e2e5ee); border-radius: 7px; outline: none; color: var(--text-primary, #1a1a2e);
}
.pf-fsel-search:focus { border-color: #5B53E8; box-shadow: var(--focus-ring); }
.pf-fsel-list { overflow-y: auto; padding: 0 6px 6px; }
.pf-fsel-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #646B78; padding: 8px 8px 3px; }
.pf-fsel-opt {
    display: block; width: 100%; text-align: left; padding: 7px 8px; font-size: 12.5px;
    border: 0; border-radius: 6px; background: transparent; color: var(--text-primary, #1a1a2e); cursor: pointer;
}
.pf-fsel-opt:hover { background: #f3f4f8; }
.pf-fsel-opt.is-active { background: #eef0fe; color: #4f46e5; font-weight: 600; }
.pf-fsel-clear { color: #6b7280; font-style: italic; }
.pf-fsel-empty { padding: 14px 10px; text-align: center; font-size: 12px; color: #646B78; }

/* ── Feed card: status badges + auto-refresh schedule line ── */
.pf-feed-badge-ok  { background: #dcfce7; color: #15803d; }
.pf-feed-badge-run { background: #eef2ff; color: #4f46e5; display: inline-flex; align-items: center; gap: 5px; }
.pf-feed-sched { margin-top: 4px; font-size: 12px; }
.pf-feed-sched-on { display: inline-flex; align-items: center; gap: 6px; color: #15803d; }
.pf-feed-sched-on .pf-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; display: inline-block; }
.pf-feed-sched-off { color: #646B78; }

/* ── Catalog templates page (js/catalog-templates/templates-page.js) ───────── */
.ct-feedrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.ct-feedrow-label { font-size: 12px; font-weight: 600; color: var(--text-muted, #6b7280); }
.ct-feedrow .pf-feed-filter { min-width: 220px; }
/* Templates list — brand-kit-style cards: a big rendered preview, then name + tags. */
.ct-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 18px; }
.ct-tcard {
    display: flex; flex-direction: column; background: #fff;
    border: 1px solid var(--border-color, #e5e7eb); border-radius: 14px; overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.ct-tcard:hover { border-color: #d8d2fb; box-shadow: 0 8px 24px rgba(17, 24, 39, .08); }
.ct-tcard-preview {
    aspect-ratio: 1 / 1; background: #f4f5f8; cursor: pointer;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ct-tcard-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ct-tcard-ph { color: #646B78; font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.ct-tcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.ct-tcard-name { font-size: 14px; font-weight: 600; color: var(--text-strong, #1f2430); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-tcard-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-tcard .pf-feed-badge { background: #eef2f7; color: #6b7280; }
.ct-tcard .pf-feed-badge.pf-feed-badge-ok { background: #e7f6ec; color: #15803d; }
.ct-tcard-meta { font-size: 12px; color: var(--text-muted, #9aa1ad); }
.ct-tcard-actions { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.ct-tcard-actions .btn-primary { flex: 1; }

/* ════════════════════════════════════════════════════════════════════════════
   Sources hub — Shopify-style sectioned settings (left description · right card)
   Used by js/products/products-page.js (the "Sources" page). See SOURCES.md.
   ════════════════════════════════════════════════════════════════════════════ */
.src-page { max-width: 1320px; margin: 0 auto; padding: 8px 4px 80px; }   /* standard non-full-width content column (DESIGN_SYSTEM.md) */
.src-head { padding: 8px 4px 4px; }
.src-head h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; color: var(--text-strong, #111827); }
.src-head .src-sub { font-size: 14px; color: var(--text-muted, #6b7280); margin: 0; }

.src-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 28px;
    padding: 34px 4px;
    border-top: 1px solid var(--border-color, #ececf1);
}
.src-section:first-of-type { border-top: none; }
.src-desc { padding-top: 4px; }
.src-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
    color: var(--text-muted, #8b93a3); margin-bottom: 10px;
}
.src-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #8b7cf6; display: inline-block; }
.src-desc h2 { font-size: 16px; font-weight: 650; margin: 0 0 8px; color: var(--text-strong, #1f2430); }
.src-desc p { font-size: 13px; line-height: 1.55; color: var(--text-muted, #6b7280); margin: 0 0 12px; }
.src-note { font-size: 12px; line-height: 1.5; color: var(--text-faint, #9aa1ad); display: flex; gap: 6px; }
.src-note svg { flex-shrink: 0; margin-top: 1px; opacity: .7; }

.src-card {
    background: #fff;
    border: 1px solid var(--border-color, #e7e8ee);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

/* Info banner inside a card */
.src-banner {
    display: flex; gap: 10px; align-items: flex-start;
    background: #f6f5ff; border: 1px solid #e7e3fb; color: #4b4570;
    border-radius: 10px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px;
}
.src-banner svg { flex-shrink: 0; margin-top: 1px; color: #8b7cf6; }
.src-banner a { color: #6d5dd3; font-weight: 600; text-decoration: none; }
.src-banner a:hover { text-decoration: underline; }
.src-banner-info { background: #eff6ff; border-color: #dbeafe; color: #3a4a63; }
.src-banner-info svg { color: #3b82f6; }

/* Google connect control (Drive card) — OAuth reaches nested subfolders the public key can't. */
.src-gconn { align-items: center; }
.src-gconn__txt { flex: 1 1 auto; }
.src-gconn__ico { flex-shrink: 0; font-weight: 800; color: #15a34a; }
.src-gconn--ok { background: #f0fdf4; border-color: #bbf7d0; color: #2f5540; }
.src-gconn--cta { background: #f6f5ff; border-color: #d8d2fb; }
.src-gconn__btn { flex-shrink: 0; white-space: nowrap; }
.src-gconn__link { flex-shrink: 0; background: none; border: 0; padding: 0 2px; color: #6d5dd3; font-weight: 600; font-size: 12px; cursor: pointer; }
.src-gconn__link:hover { text-decoration: underline; }

/* Media source rows (Drive folders / CSV) */
.src-row {
    display: grid; grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.4fr) 36px;
    gap: 10px; align-items: end;
    padding: 12px; border: 1px solid var(--border-color, #eceef3); border-radius: 11px; margin-bottom: 10px;
}
.src-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.src-field label { font-size: 11px; font-weight: 600; color: var(--text-muted, #6b7280); }
.src-input-wrap { position: relative; display: flex; align-items: center; }
.src-input-wrap > svg { position: absolute; left: 10px; color: var(--text-faint, #9aa1ad); pointer-events: none; }
.src-input {
    width: 100%; font-size: 13px; padding: 9px 11px; border: 1px solid var(--border-color, #dcdfe6);
    border-radius: 9px; background: #fff; color: var(--text-strong, #1f2430); box-sizing: border-box;
}
.src-input.has-icon { padding-left: 30px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.src-input:focus { outline: none; border-color: #8b7cf6; box-shadow: 0 0 0 3px rgba(139,124,246,.14); }
.src-input.src-ok { border-color: #86c79b; }
.src-input.src-bad { border-color: #e2a3a3; }
.src-row-del {
    width: 34px; height: 36px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 9px;
    background: #fff; color: var(--text-muted, #9aa1ad); cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center;
}
.src-row-del:hover { border-color: #e2a3a3; color: #d05a5a; background: #fdf3f3; }
.src-row-msg { grid-column: 1 / -1; font-size: 11.5px; margin-top: -2px; }
.src-row-msg.ok  { color: #2f8a52; }
.src-row-msg.bad { color: #c0504d; }

.src-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.src-card-foot .src-foot-actions { display: flex; align-items: center; gap: 8px; }
.src-count { font-size: 12px; color: var(--text-faint, #9aa1ad); }
.src-empty-line { font-size: 13px; color: var(--text-muted, #6b7280); padding: 10px 2px 14px; }

/* Feed health (Google-Merchant readiness) — project-level card above the feed list */

/* Feed-health drill-down modal — the exact products missing one required field */
.fh-drill-body { max-height: 70vh; }
.fh-drill-note { font-size: 12.5px; line-height: 1.45; padding: 9px 12px; border-radius: 9px; margin-bottom: 12px; }
.fh-drill-note.is-fixable { color: #4338ca; background: #eef0fe; }
.fh-drill-note.is-manual  { color: #b45309; background: #fef3e2; }
.fh-drill-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fh-drill-count { font-size: 12.5px; font-weight: 700; color: var(--text-secondary, #5b6472); }
.fh-drill-list { display: flex; flex-direction: column; gap: 2px; }
.fh-drill-row { display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: 9px; text-decoration: none; color: inherit; }
.fh-drill-row:hover { background: var(--bg-subtle, #f6f7fb); }
.fh-drill-thumb { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 7px; overflow: hidden; background: #f1f2f6; }
.fh-drill-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fh-drill-thumb.is-empty { background: repeating-linear-gradient(45deg, #f1f2f6, #f1f2f6 6px, #e9ebf1 6px, #e9ebf1 12px); }
.fh-drill-txt { min-width: 0; flex: 1; }
.fh-drill-title { font-size: 13px; font-weight: 600; color: #2a3343; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-drill-sku { font-size: 11px; color: var(--text-muted, #9ca3af); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-drill-empty { padding: 24px 8px; text-align: center; font-size: 13px; color: var(--text-muted, #9ca3af); }
.fh-drill-more { padding: 10px 0 2px; text-align: center; font-size: 11.5px; color: var(--text-muted, #9ca3af); }

/* Catalog feed card */
.src-feed { display: flex; align-items: flex-start; gap: 14px; }
.src-feed-ico {
    width: 44px; height: 44px; border-radius: 11px; background: #f3f1fc; color: #7c6ce0;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.src-feed-body { flex: 1; min-width: 0; }
.src-feed-titlerow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.src-feed-name { font-size: 15px; font-weight: 650; color: var(--text-strong, #1f2430); }
.src-feed-fmt {
    font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
    background: #f1ede6; color: #8a7a52; border-radius: 5px; padding: 2px 6px;
}
.src-feed-url { font-size: 12px; color: var(--text-muted, #6b7280); font-family: ui-monospace, Menlo, monospace; margin: 5px 0 8px; word-break: break-all; }
.src-feed-stats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted, #6b7280); }
.src-feed-stat { display: inline-flex; align-items: center; gap: 5px; }
.src-feed-synced { color: #2f8a52; font-weight: 600; }
.src-feed-err    { color: #c0504d; font-weight: 600; }
/* Red alert — feed broken / unavailable / blocked / 0 products. */
.src-feed-alert { display: flex; align-items: flex-start; gap: 9px; margin-top: 11px; padding: 10px 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 9px; }
.src-feed-alert__ico { flex: 0 0 auto; color: #dc2626; display: flex; margin-top: 1px; }
.src-feed-alert__ico svg { width: 16px; height: 16px; }
.src-feed-alert__title { font-size: 12.5px; font-weight: 700; color: #b91c1c; }
.src-feed-alert__detail { margin-top: 2px; font-size: 11.5px; line-height: 1.45; color: #9b1c1c; word-break: break-word; }
.src-feed-alert--note { background: #fffbeb; border-color: #fde68a; }
.src-feed-alert--note .src-feed-alert__ico { color: #b45309; }
.src-feed-alert--note .src-feed-alert__title { color: #92400e; }
.src-feed-alert--note .src-feed-alert__detail { color: #78350f; }
.src-feed-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.src-icon-btn {
    width: 34px; height: 34px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 9px;
    background: #fff; color: var(--text-muted, #6b7280); cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center;
}
.src-icon-btn:hover { background: #f7f7fb; color: var(--text-strong, #1f2430); }
.src-icon-btn.src-icon-del:hover { border-color: #e2a3a3; color: #d05a5a; background: #fdf3f3; }
/* Bordered sub-action buttons under a feed (View products / Templates) — share the
   icon-button's border treatment so the card reads as a row of real buttons. */
.src-feed-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; font-size: 12.5px; font-weight: 600; line-height: 1;
    border: 1px solid var(--border-color, #e5e7eb); border-radius: 9px;
    background: #fff; color: var(--text-strong, #1f2430); cursor: pointer;
}
.src-feed-btn:hover { background: #f7f7fb; border-color: var(--border-strong, #d6d9e0); }
.src-feed-btn svg { width: 15px; height: 15px; }
.src-foot-note { font-size: 12px; color: var(--text-faint, #9aa1ad); display: flex; gap: 6px; align-items: center; margin-top: 14px; }

/* Inline product browser (toggled from the feed card) */
.src-products { margin-top: 16px; border-top: 1px solid var(--border-color, #eceef3); padding-top: 16px; }
.src-products.hidden { display: none; }

/* Platform rows */
.src-platform {
    display: flex; align-items: center; gap: 13px; padding: 13px 4px;
    border-top: 1px solid var(--border-color, #f0f1f5);
}
.src-platform:first-child { border-top: none; }
.src-plat-logo {
    width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: #f6f7f9;
}
.src-plat-logo img, .src-plat-logo svg { width: 100%; height: 100%; object-fit: cover; }
.src-plat-body { flex: 1; min-width: 0; }
.src-plat-namerow { display: flex; align-items: center; gap: 8px; }
.src-plat-name { font-size: 14px; font-weight: 600; color: var(--text-strong, #1f2430); }
.src-plat-badge {
    font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
    color: var(--text-faint, #9aa1ad); border: 1px solid var(--border-color, #e5e7eb); border-radius: 4px; padding: 1px 5px;
}
.src-plat-desc { font-size: 12.5px; color: var(--text-muted, #6b7280); margin-top: 2px; }
.src-plat-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.src-plat-status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.src-pill {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
    color: #2f8a52; background: #eaf7ef; border: 1px solid #c7ebd3; border-radius: 999px; padding: 3px 9px;
}
.src-plat-acct { font-size: 11px; color: var(--text-faint, #9aa1ad); font-family: ui-monospace, Menlo, monospace; }
.src-plat-soon { font-size: 11.5px; color: var(--text-faint, #b3b8c2); font-style: italic; }

/* Save bar (appears when a section is dirty) */
.src-savebar {
    display: none; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px;
    background: #fbfaff; border: 1px solid #e7e3fb; border-radius: 10px;
}
.src-savebar.show { display: flex; }
.src-savebar .src-savebar-msg { font-size: 12.5px; color: #5b5480; flex: 1; }

@media (max-width: 860px) {
    .src-section { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 26px 4px; }   /* minmax(0,…): a bare 1fr grew to its widest child and clipped the card off-screen at 390px */
    .src-row { grid-template-columns: 1fr; }
    .src-row-del { width: 100%; height: 34px; }
}

/* In-card section header (icon + title + subtitle) — sits above dynamic content */
.src-card-header { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; margin-bottom: 15px; border-bottom: 1px solid var(--border-color, #eef0f4); }
.src-card-ico { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #f3f4f7; }
.src-card-ico-plain { background: #fff; border: 1px solid var(--border-color, #eceef3); }
.src-card-htext { min-width: 0; }
.src-card-title { font-size: 14.5px; font-weight: 650; color: var(--text-strong, #1f2430); }
.src-card-subtitle { font-size: 12px; color: var(--text-muted, #8b93a3); margin-top: 1px; }

/* Scoped hide for the batched-save buttons (no global .hidden rule exists) */
.src-media-save.hidden, .src-insp-save.hidden { display: none; }

/* Embedded platforms manager inside the Sources card — strip its page chrome */
.src-card-content .platforms-page { padding: 0; margin: 0; max-width: none; }
.src-card-content .platforms-page > .platform-block:first-of-type { margin-top: 0; }
.src-card-content .platforms-page > .platform-block:last-of-type { margin-bottom: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   Products browser — dedicated #catalog-products page + full-field detail modal
   (js/products/products-browser.js). Reuses .pf-grid / .pf-card for the grid.
   ════════════════════════════════════════════════════════════════════════════ */
.pb-page { max-width: 1160px; margin: 0 auto; }
.pb-page .pf-title-wrap { display: flex; flex-direction: column; gap: 4px; }
.pb-back { align-self: flex-start; margin-bottom: 2px; }
.pb-card { cursor: pointer; }

/* Detail modal */
.pb-modal { width: 760px; max-width: 94vw; }
.pb-detail { display: grid; grid-template-columns: 320px 1fr; gap: 22px; padding: 20px 22px; max-height: 72vh; overflow-y: auto; }
.pb-detail-gallery { display: flex; flex-direction: column; gap: 10px; }
.pb-detail-img {
    width: 100%; aspect-ratio: 1; border-radius: 12px; background: #f4f5f8; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.pb-detail-img img { width: 100%; height: 100%; object-fit: contain; }
.pb-detail-img.pf-card-thumb-empty::after { content: 'No image'; color: var(--text-faint, #b3b8c2); font-size: 13px; }
.pb-detail-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.pb-detail-thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color, #e5e7eb); cursor: pointer; }
.pb-detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pb-detail-thumb:hover { border-color: #8b7cf6; }

.pb-detail-fields { min-width: 0; }
.pb-detail-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-color, #f0f1f5); }
.pb-detail-row:last-child { border-bottom: none; }
.pb-detail-key { font-size: 12px; font-weight: 600; color: var(--text-muted, #8b93a3); }
.pb-detail-val { font-size: 13px; color: var(--text-strong, #1f2430); word-break: break-word; line-height: 1.5; }
.pb-detail-link { color: #6d5dd3; text-decoration: none; }
.pb-detail-link:hover { text-decoration: underline; }
.pb-detail-sectionlabel { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-faint, #9aa1ad); margin: 16px 0 4px; }

.pb-detail-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-color, #eceef3); }
.pb-detail-del { color: #d05a5a; }
.pb-detail-del:hover { background: #fdf3f3; }

@media (max-width: 680px) {
    .pb-detail { grid-template-columns: 1fr; }
    .pb-detail-img { aspect-ratio: 16/10; }
}

/* ── New-template preset chooser (templates page) ─────────────────────────── */
/* Consistent 24px gutter from header → intro → sticky toolbar → grid; the
   format pills + search stay pinned while the grid scrolls under them. */
.ctp-modal { width: 960px; max-width: 94vw; }
.ctp-modal .modal-header { padding: 18px 24px; }
.ctp-modal .modal-header h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.ctp-body { max-height: 78vh; overflow-y: auto; padding: 0; }

/* Intro copy — scrolls away above the sticky toolbar */
.ctp-intro { padding: 18px 24px 0; }
.ctp-hint { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin: 0; max-width: 62ch; }

/* Sticky toolbar — format pills + search, pinned to the top of the scroll area */
.ctp-toolbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
@supports ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .ctp-toolbar {
        background: color-mix(in srgb, var(--bg-secondary) 86%, transparent);
        -webkit-backdrop-filter: saturate(1.4) blur(10px);
        backdrop-filter: saturate(1.4) blur(10px);
    }
}

.ctp-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(192px, 1fr));
    gap: 14px; align-items: start; padding: 18px 24px 26px;
}
.ctp-card {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px 12px 11px; background: #fff; text-align: left; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--card-radius);
    transition: border-color .12s, box-shadow .15s, transform .15s;
}
.ctp-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .10);
    transform: translateY(-2px);
}
.ctp-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.ctp-card:disabled { opacity: .55; cursor: default; transform: none; }
/* EVERY mini lives on the same 200px-tall stage (square layouts, 9:16 video
   clips, blank, saved-template thumbs) so names/descriptions align across a
   row no matter the format mix. Width comes from the aspect ratio. */
.ctp-mini {
    position: relative; height: 200px; width: auto; aspect-ratio: 1 / 1;
    margin: 0 auto; overflow: hidden;
    border-radius: 8px; border: 1px solid var(--border-subtle);
    /* Size container so mini text scales (cqw) with the rendered mini width. */
    container-type: inline-size;
}
/* Real text inside preset minis (actual product title/price, preset copy). */
.ctp-mini-text {
    line-height: 1.12; overflow: hidden; border-radius: 2px;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    font-family: var(--font); pointer-events: none;
}
/* Real product photo substituted into the bound image layer. */
.ctp-mini-photo { object-fit: contain; pointer-events: none; }
.ctp-mini-img {
    background: #e7eaf2 repeating-linear-gradient(45deg, #edf0f6 0 7px, #e2e6ef 7px 14px);
    border-radius: 4px;
}
.ctp-mini-blank {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); background: #fafafd;
}
.ctp-card-name {
    display: flex; align-items: center; gap: 6px; min-width: 0;
    font-size: 13px; font-weight: 700; color: var(--text-primary);
}
.ctp-pop {
    margin-left: auto; flex: 0 0 auto; font-size: 9px; font-weight: 700;
    line-height: 1; color: #b45309; background: #fef3c7;
    padding: 3px 7px; border-radius: 999px;
}
/* "N scenes" — a preset that starts as a multi-scene DECK. Deliberately NOT the amber of
   ★ Popular: that chip is a recommendation, this one is a fact about what you will get, and two
   chips in the same colour read as two grades of the same thing. Indigo is the app's accent. */
.ctp-deck {
    margin-left: auto; flex: 0 0 auto; font-size: 9px; font-weight: 700;
    line-height: 1; color: #4338ca; background: #eef0ff;
    padding: 3px 7px; border-radius: 999px;
}
/* With BOTH chips only the first may push right, or the second is shoved off the row. */
.ctp-pop + .ctp-deck { margin-left: 4px; }

.ctp-card-desc {
    font-size: 11.5px; color: var(--text-secondary); line-height: 1.4;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; min-height: calc(2 * 1.4em);   /* 1-line descs still align */
}

/* Format pick (video) — pill row inside the sticky toolbar */
.ctp-fmt { display: flex; align-items: center; gap: 6px; margin: 0; flex-wrap: wrap; }
.ctp-fmt-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted, #9ca3af); margin-right: 4px;
}
.ctp-fmt-btn {
    padding: 6px 13px; border: 1px solid var(--border-subtle); background: #fff;
    border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1;
    color: var(--text-secondary, #6b7280); cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.ctp-fmt-btn:hover { border-color: #c7d2fe; color: #4338ca; }
.ctp-fmt-btn.is-on { background: #eef2ff; border-color: #5B53E8; color: #4338ca; }

/* Search — leading magnifier icon inside the field */
.ctp-search-wrap { position: relative; display: flex; align-items: center; }
.ctp-search-ico {
    position: absolute; left: 13px; pointer-events: none;
    color: var(--text-muted, #9ca3af);
}
.ctp-search {
    width: 100%; margin: 0; padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-subtle); border-radius: 10px;
    font-size: 13px; background: #fff; color: var(--text-primary);
    transition: border-color .12s, box-shadow .12s;
}
.ctp-search::placeholder { color: var(--text-muted, #9ca3af); }
.ctp-search::-webkit-search-cancel-button { cursor: pointer; }
.ctp-search:focus { outline: none; border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.ctp-empty {
    grid-column: 1 / -1; text-align: center; color: var(--text-muted, #9ca3af);
    font-size: 13px; padding: 40px 0;
}

/* Section labels — hairline-anchored group separators inside the grid */
.ctp-grid-label {
    grid-column: 1 / -1; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted, #9ca3af);
    border-top: 1px solid var(--border-subtle, #eef0f4);
    padding-top: 12px; margin: 4px 0 -2px;
}

/* ── New-template chooser: sidebar (browse · categories · format) + main grid ── */
.ctp-chooser {
    width: 1240px; max-width: 96vw; height: min(880px, 92vh);
    overflow: hidden; margin: auto;
}
.ctp-chooser .ctp-chooser-head { padding: 16px 20px 14px 24px; align-items: flex-start; gap: 16px; }
.ctp-head-text { min-width: 0; }
.ctp-chooser .ctp-chooser-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 3px; }
.ctp-chooser .ctp-hint { max-width: 90ch; font-size: 12.5px; }
.ctp-chooser .ctp-layout {
    flex: 1; min-height: 0; padding: 0;
    display: grid; grid-template-columns: 232px minmax(0, 1fr);
    border-top: 1px solid var(--border-subtle);
}
.ctp-side {
    overflow-y: auto; padding: 14px 10px 18px;
    background: #f7f8fb; border-right: 1px solid var(--border-subtle);
    display: flex; flex-direction: column; gap: 16px;
}
.ctp-side-group { display: flex; flex-direction: column; gap: 2px; }
.ctp-side-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted, #9ca3af); padding: 0 10px 6px;
}
.ctp-nav-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
    font: inherit; font-size: 13px; font-weight: 550; color: var(--text-secondary);
    text-align: left; cursor: pointer; transition: background .12s, color .12s;
}
.ctp-nav-item svg { flex: 0 0 auto; color: var(--text-muted, #9ca3af); transition: color .12s; }
.ctp-nav-item:hover { background: #eceef5; color: var(--text-primary); }
.ctp-nav-item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ctp-nav-item.is-on { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), inset 0 0 0 1px #e3e1fb; }
.ctp-nav-item.is-on svg { color: var(--accent); }
.ctp-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctp-nav-count {
    flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--text-muted, #9ca3af);
    font-variant-numeric: tabular-nums;
}
.ctp-nav-item.is-on .ctp-nav-count { color: var(--accent); }

/* Format list in the sidebar — ratio glyph + ratio + name */
.ctp-side-fmt { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.ctp-chooser .ctp-fmt-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 7px 10px; border: 0; border-radius: 8px; background: transparent;
    font-size: 12.5px; line-height: 1.2; text-align: left; color: var(--text-secondary);
}
.ctp-chooser .ctp-fmt-btn:hover { background: #eceef5; color: var(--text-primary); }
.ctp-chooser .ctp-fmt-btn.is-on { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), inset 0 0 0 1px #e3e1fb; }
.ctp-chooser .ctp-fmt-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ctp-fmt-glyph { width: 16px; height: 16px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.ctp-fmt-glyph > span { display: block; border: 1.6px solid currentColor; border-radius: 2px; opacity: .8; }
.ctp-fmt-ratio { font-weight: 700; min-width: 30px; font-variant-numeric: tabular-nums; }
.ctp-fmt-name { color: var(--text-muted, #9ca3af); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctp-chooser .ctp-fmt-btn.is-on .ctp-fmt-name { color: #7b75ee; }

/* Main column — sticky title + filters, grid scrolls underneath */
.ctp-main { overflow-y: auto; min-width: 0; background: var(--bg-secondary); }
.ctp-chooser .ctp-toolbar { gap: 12px; padding: 16px 24px 14px; }
.ctp-title-line { display: flex; align-items: baseline; gap: 8px; }
.ctp-title { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; color: var(--text-primary); }
.ctp-title-count { font-size: 12.5px; font-weight: 600; color: var(--text-muted, #9ca3af); font-variant-numeric: tabular-nums; }
.ctp-title-hint { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); }
.ctp-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctp-filter-row .ctp-search-wrap { flex: 1 1 260px; min-width: 200px; }
.ctp-tone {
    display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
    background: #f1f2f7; border: 1px solid var(--border-subtle);
}
.ctp-tone[hidden] { display: none; }
.ctp-tone-btn {
    padding: 6px 12px; border: 0; border-radius: 7px; background: transparent;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer;
    transition: background .12s, color .12s;
}
.ctp-tone-btn:hover { color: var(--text-primary); }
.ctp-tone-btn.is-on { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.ctp-tone-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ctp-chooser .ctp-grid { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; padding: 16px 24px 28px; }
.ctp-chooser .ctp-grid-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; letter-spacing: .02em; text-transform: none; color: var(--text-primary);
    border-top: 0; padding-top: 10px; margin: 6px 0 -4px;
}
.ctp-chooser .ctp-grid > .ctp-grid-label:first-child { padding-top: 0; margin-top: 0; }
.ctp-grid-label-text { font-weight: 700; }
.ctp-grid-count {
    font-size: 11px; font-weight: 600; color: var(--text-muted, #9ca3af);
    background: #f1f2f7; border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums;
}
.ctp-see-all {
    margin-left: auto; border: 0; background: transparent; padding: 4px 6px; border-radius: 6px;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer;
}
.ctp-see-all::after { content: ' \2192'; }
.ctp-see-all:hover { background: #eef0ff; }
.ctp-see-all:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ctp-card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctp-card-blank .ctp-mini-blank { border-style: dashed; border-color: #c9cde0; color: var(--accent); }
.ctp-card-blank:hover .ctp-mini-blank { background: #f4f3ff; }

@media (max-width: 760px) {
    .ctp-chooser { height: 94vh; max-width: 100vw; }
    .ctp-chooser .ctp-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .ctp-side {
        flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 4px;
        padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border-subtle);
    }
    .ctp-side-group { flex-direction: row; gap: 4px; }
    .ctp-side-label { display: none; }
    .ctp-side-fmt { margin: 0; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid var(--border-subtle); }
    .ctp-nav-item, .ctp-chooser .ctp-fmt-btn { width: auto; white-space: nowrap; }
    .ctp-fmt-name { display: none; }
    .ctp-chooser .ctp-toolbar, .ctp-chooser .ctp-grid { padding-left: 16px; padding-right: 16px; }
    .ctp-chooser .ctp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Video-preset minis: 9:16 story card on the same 200px stage, ▶ chip */
.ctp-mini-video { aspect-ratio: 9 / 16; }
.ctp-mini-video::after {
    content: '▶'; position: absolute; right: 6px; bottom: 6px; z-index: 2;
    font-size: 9px; line-height: 1; color: #fff; background: rgba(17, 24, 39, .72);
    padding: 4px 6px; border-radius: 999px;
}
/* Hovering a video preset card plays each layer's REAL choreography — the
   inline --ca-anim var carries the mapped enter (+ loop) animation; layers
   without motion fall back to the generic stagger-in. */
.ctp-card:hover .ctp-mini-video > div,
.ctp-card:hover .ctp-mini-video > img { animation: var(--ca-anim, ctpMiniIn .55s cubic-bezier(.2,.8,.3,1) both); }
@media (prefers-reduced-motion: reduce) {
    .ctp-card:hover .ctp-mini-video > div,
    .ctp-card:hover .ctp-mini-video > img { animation: none; }
}
@keyframes ctpAFadein { from { opacity: 0; } }
@keyframes ctpAFadeup { from { opacity: 0; transform: translateY(14%); } }
@keyframes ctpASlideL { from { opacity: 0; transform: translateX(-16%); } }
@keyframes ctpASlideR { from { opacity: 0; transform: translateX(16%); } }
@keyframes ctpAScale  { from { opacity: 0; transform: scale(.7); } }
@keyframes ctpAPop    { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.07); } 100% { opacity: 1; transform: scale(1); } }
@keyframes ctpAKen    { to { transform: scale(1.07); } }
@keyframes ctpALoopPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes ctpALoopFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5%); } }
.ctp-card:hover .ctp-mini-video > div:nth-child(2) { animation-delay: .06s; }
.ctp-card:hover .ctp-mini-video > div:nth-child(3) { animation-delay: .12s; }
.ctp-card:hover .ctp-mini-video > div:nth-child(4) { animation-delay: .18s; }
.ctp-card:hover .ctp-mini-video > div:nth-child(5) { animation-delay: .24s; }
.ctp-card:hover .ctp-mini-video > div:nth-child(6) { animation-delay: .30s; }
.ctp-card:hover .ctp-mini-video > div:nth-child(n+7) { animation-delay: .36s; }
@keyframes ctpMiniIn {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* "Your templates" chooser cards: the saved thumbnail fills the mini */
.ctp-mini-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Admin-only pencil on a preset card: edit the BUILT-IN template (saves for every user). */
.ctp-card { position: relative; }
.ctp-edit {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--text-primary, #111827);
    border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
    opacity: 0; transform: scale(.92); transition: opacity .12s, transform .12s, background .12s, color .12s;
    will-change: opacity, transform;   /* its own layer: WebKit repaints it when the card's hover changes */
}
/* .is-hover is set by pointerenter/leave (templates-page.js) — Safari did not apply `.ctp-card:hover .ctp-edit`. */
.ctp-card:hover .ctp-edit, .ctp-card.is-hover .ctp-edit, .ctp-card:focus-within .ctp-edit, .ctp-edit:focus-visible { opacity: 1; transform: none; }
.ctp-edit:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ctp-edit:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: none) { .ctp-edit { opacity: 1; transform: none; } }
.ctp-mini-cover { background: #fff; }

/* Renders gallery (per-template outputs modal) */
.cto-meta { font-size: 11.5px; color: var(--text-muted, #9ca3af); margin-bottom: 8px; }
/* Client filter bar over the loaded pages (search + rendered/issues lens) */
.cto-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.cto-bar .cto-q { flex: 1; max-width: 280px; }
/* 4 per row (user, 2026-11-01: 6 small tiles per row were too small to judge a creative). */
.cto-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .cto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cto-grp { flex: 0 0 auto; font-size: 11px; font-weight: 600; color: #5B53E8; background: #F4F3FE; border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.cto-tile { border: 1px solid var(--border-subtle, #eef0f3); border-radius: 9px; overflow: hidden; background: var(--bg-primary, #fff); }
.cto-media { position: relative; aspect-ratio: 1 / 1; background: #f4f5f7; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cto-img, .cto-vid { width: 100%; height: 100%; object-fit: contain; display: block; }
.cto-play {
    position: absolute; right: 6px; bottom: 6px; font-size: 9px; line-height: 1;
    color: #fff; background: rgba(17, 24, 39, .72); padding: 4px 6px; border-radius: 999px; pointer-events: none;
}
.cto-media:hover .cto-play { opacity: 0; }
.cto-none { color: var(--text-muted, #9ca3af); font-size: 18px; }
.cto-foot { display: flex; align-items: center; gap: 6px; padding: 5px 8px; }
.cto-eid { flex: 1; font-size: 10.5px; color: var(--text-secondary, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cto-status { font-size: 9.5px; font-weight: 700; color: #b45309; background: #fef3c7; padding: 1px 6px; border-radius: 999px; }
.cto-dl {
    flex: none; font-size: 13px; line-height: 1; text-decoration: none;
    color: var(--text-secondary, #6b7280); padding: 1px 4px; border-radius: 4px;
}
.cto-dl:hover { color: #5B53E8; background: #eef2ff; }
.cto-more { display: flex; justify-content: center; margin-top: 12px; }

/* Template card Active/Paused pill + duplicate-format chooser */
.ct-state-pill {
    margin-left: auto; padding: 2px 9px; font-size: 10px; font-weight: 700;
    border-radius: 999px; border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f3f4f6); color: var(--text-secondary, #6b7280); cursor: pointer;
}
.ct-state-pill.is-on { background: #dcfce7; border-color: #bbf7d0; color: #15803d; }
.ct-state-pill:hover { filter: brightness(.96); }
.ctd-modal { max-width: 360px; }
.ctd-list { display: flex; flex-direction: column; gap: 6px; }
.ctd-opt { text-align: left; }

/* ── Designs (#catalog-designs) — slot → template mapping ─────────────────── */
.cd-modal { width: 640px; max-width: 94vw; }
.cd-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; max-height: 72vh; overflow-y: auto; }
.cd-field { display: flex; flex-direction: column; gap: 6px; }
.cd-field__label, .cd-slots-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted, #9ca3af);
}
.cd-input {
    width: 100%; padding: 9px 12px; font-size: 13px;
    border: 1px solid var(--border-subtle, #d1d5db); border-radius: 9px;
    background: #fff; color: var(--text-primary); box-sizing: border-box;
}
.cd-input:focus { outline: none; border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

.cd-slots { display: flex; flex-direction: column; gap: 8px; }
.cd-slot {
    display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 10px;
    padding: 8px; border: 1px solid var(--border-subtle, #eef0f4); border-radius: 10px; background: #fcfcfd;
}
.cd-slot.is-fixed { background: #eef2ff; border-color: #c7d2fe; }
.cd-slot__label-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cd-slot__fixed { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cd-slot__pin {
    font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    color: #4338ca; background: #e0e7ff; padding: 2px 6px; border-radius: 999px; margin-right: 6px;
}
.cd-field-select, .cd-custom-label, .cd-tmpl-select { padding: 8px 10px; }
.cd-custom-label { margin-top: 0; }
.cd-slot__arrow { color: var(--text-muted, #9ca3af); font-size: 14px; }
.cd-slot__x {
    flex: 0 0 auto; width: 26px; height: 26px; border: none; background: none; cursor: pointer;
    color: var(--text-muted, #9ca3af); font-size: 18px; line-height: 1; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.cd-slot__x:hover { background: #fee2e2; color: #dc2626; }
.cd-slot__x--ghost { pointer-events: none; }
.cd-add { align-self: flex-start; }

/* Design card slot summary */
.cd-card-slots { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; }
.cd-card-slot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 5px 8px; border-radius: 7px; background: #f6f7f9; font-size: 12px;
}
.cd-card-slot.is-unset { background: #fff7ed; }
.cd-card-slot__label { font-weight: 600; color: var(--text-secondary, #4b5563); white-space: nowrap; }
.cd-card-slot__tmpl {
    color: var(--text-muted, #9ca3af); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-card-slot.is-unset .cd-card-slot__tmpl { color: #c2410c; }

/* Shopify source (store address only — converted server-side, api/products/_shopify-feed.php) */
.pf-field label .pf-shop-ico { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
@media (max-width: 640px) {
    .src-page { padding: 8px 14px 60px; }
    /* Phone: the feed's action buttons drop under the body instead of squeezing it to 0px wide. */
    .src-feed { flex-wrap: wrap; }
    .src-feed-body { flex: 1 1 180px; }
}

/* Store-API source: platform picker (Shopify / Gomag / MerchantPro) */
.pf-plats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.pf-plat { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border, #E3E5EA); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #374151; cursor: pointer; }
.pf-plat:hover { border-color: #C7C3F5; }
.pf-plat.is-active { border-color: var(--accent, #5B53E8); background: #F4F3FE; color: var(--accent, #5B53E8); }
.pf-plat:focus-visible { outline: 2px solid var(--accent, #5B53E8); outline-offset: 2px; }
.pf-api-how { margin: 0 0 12px; padding: 10px 12px; background: #F8F8FC; border-radius: 10px; line-height: 1.5; }

/* Protected feed link: optional username / password (products-page.js openFeedWizard). */
.pf-auth { margin: 4px 0 12px; font-size: 12.5px; }
.pf-auth summary { cursor: pointer; color: #5B53E8; font-weight: 600; margin-bottom: 6px; }
.pf-auth .pf-input { margin-top: 6px; }

/* Shopify import: why the public product list could not be read + how to fix (2026-11-07) */
.pf-shop-err { margin: 12px 0 16px; padding: 14px 16px; border: 1px solid #FECDCA; background: #FEF3F2; border-radius: 10px; color: #14171F; }
.pf-shop-err__t { font-size: 13.5px; font-weight: 700; color: #912018; }
.pf-shop-err__why { margin: 6px 0 10px; font-size: 13px; line-height: 1.5; color: #3B414C; }
.pf-shop-err__h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #4B5563; }
.pf-shop-err__list { margin: 6px 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.5; color: #3B414C; }
.pf-shop-err__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-shop-err__acts .bx-ghost { font-size: 12.5px; text-decoration: none; }

/* BUILT PREVIEWS (2026-11-08): the card shows the preset's real render; a video card plays its clip over the still
   while hovered (the clip fades in once it actually plays, so a slow network never flashes black). The old per-layer
   CSS choreography is for the HTML mini only. */
.ctp-mini-prev { background: #f4f5f8; }
.ctp-card:hover .ctp-mini-prev > img, .ctp-card:hover .ctp-mini-prev > video { animation: none; }
.ctp-mini-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.ctp-mini-prev.is-playing .ctp-mini-clip { opacity: 1; }
.ctp-mini-prev.is-playing::after { opacity: 0; }
.ctp-mini-video.ctp-mini-prev::after { transition: opacity .18s ease; }

/* The template open in the editor, in the editor's Templates chooser (2026-11-08). */
.ctp-card.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91, 83, 232, .18); }

/* Sources → Google Drive: "Scan subfolders" switch on each folder row (2026-11-08) */
.src-field--switch { flex: 0 0 auto; }
.src-row--drive { grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.4fr) auto 36px; }
@media (max-width: 860px) { .src-row--drive { grid-template-columns: 1fr; } }
.src-switch { display: inline-flex; align-items: center; gap: 8px; height: 38px; cursor: pointer; user-select: none; font-size: 13px; color: #374151; white-space: nowrap; }
.src-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.src-switch__track { position: relative; width: 32px; height: 18px; border-radius: 9px; background: #D5D8DE; transition: background .15s; flex: 0 0 auto; }
.src-switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.2); transition: transform .15s; }
.src-switch input:checked + .src-switch__track { background: var(--accent, #5B53E8); }
.src-switch input:checked + .src-switch__track::after { transform: translateX(14px); }
.src-switch input:focus-visible + .src-switch__track { outline: 2px solid var(--accent, #5B53E8); outline-offset: 2px; }
