:root {
    --primary:      #df0517;
    --primary-dark: #df0517;
    --bg:           #222;
    --surface:      #1a1a1a;
    --surface-hi:   #1a1a1a;
    --surface-warm: #221310;
    --border:       #2a2a2a;
    --border-warm:  #2a2a2a;
    --text:         #fff;
    --text-muted:   #fff;
    --live:         #EF4444;
    --success:      #22C55E;
    --radius:       12px;
    --shadow:       0 4px 24px rgba(0,0,0,0.6);
}

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

/* Honor the hidden attribute regardless of class-based display rules. */
[hidden] { display: none !important; }

body {
    font-family: 'Poppins', sans-serif !important;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ─── Shared ─── */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 3px; border: none;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--surface-hi); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-danger    { background: var(--live); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hi); }

.badge-live {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px;
    background: var(--live); color: #fff; font-size: 12px; font-weight: 700;
}
.badge-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ─── Index page ─── */

.page-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
   
    padding: 20px 32px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header p  { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

.page-main { max-width: 960px; margin: 0 auto; padding: 32px 24px; }

.start-section {
    background: #1a1a1a;
    border: 1px solid var(--border-warm);
    border-radius: var(--radius);
    padding: 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    margin-bottom: 36px;
}
.start-section h2 { font-size: 20px; margin-bottom: 6px; }
.start-section p  { color: var(--text-muted); font-size: 14px; }
.btn-start        { padding: 14px 28px; font-size: 16px; }

.section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.session-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 12px;
}
.session-card-title { font-size: 15px; font-weight: 700; }
.session-card-id    { font-size: 12px; color: var(--text-muted); font-family: monospace; }
.session-card-time  { font-size: 12px; color: var(--text-muted); }
.session-card-footer { display: flex; gap: 8px; margin-top: 4px; }

.empty-state {
    grid-column: 1 / -1;
    text-align: center; padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state .emoji { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

.join-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex; align-items: flex-end; gap: 12px;
}
.join-section label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.join-section input {
    padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; width: 180px; font-family: monospace; letter-spacing: 1px;
    text-transform: uppercase; outline: none;
    background: var(--surface-hi); color: var(--text);
}
.join-section input:focus { border-color: var(--primary); }


/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--surface); border-radius: var(--radius);
    padding: 28px; width: 380px; max-width: 90vw;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    border: 1px solid var(--border);
    transform: translateY(8px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 5px; color: var(--text-muted); }
.modal input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; margin-bottom: 20px; outline: none;
    background: var(--surface-hi); color: var(--text);
}
.modal input:focus { border-color: var(--primary); }
.modal input.input-error {
    border-color: var(--live);
    animation: inputShake 0.35s;
}
@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Host & Viewer shared layout ─── */

.app-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255,107,53,0.08);
    padding: 0 24px;
    height: 56px;
    display: flex; align-items: center; gap: 16px;
}
.app-bar-title { font-size: 16px; font-weight: 700; flex: 1; }
.app-bar-back  { color: var(--text-muted); text-decoration: none; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.app-bar-back:hover { color: var(--text); }

.btn-share {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border-radius: 8px;
    background: rgba(255,107,53,0.14); color: var(--primary);
    border: 1px solid rgba(255,107,53,0.38);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn-share:hover { background: rgba(255,107,53,0.26); border-color: var(--primary); }
.btn-share.copied { background: var(--success); color: #fff; border-color: var(--success); }

.share-toast {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px);
    background: var(--surface-hi); color: var(--text);
    padding: 10px 20px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 200;
}
.share-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    height: calc(100vh - 56px);
    overflow: hidden;
}
/* Studio uses the slim app bar; subtract its actual height */
.app-bar-slim ~ .two-col { height: calc(100vh - 44px); }

.col-main  { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-side  { border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ─── Video ─── */

.video-wrapper {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    width: 100%;
}
.video-wrapper video { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-overlay {
    position: absolute; top: 12px; left: 12px;
    display: flex; gap: 8px; align-items: center;
}
.viewer-count {
    background: rgba(0,0,0,0.55); color: #fff;
    padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}

.live-timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px; font-weight: 700; letter-spacing: 1.5px;
    color: var(--live);
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.28);
    border-radius: 6px;
    padding: 3px 9px;
}

/* Video controls overlay (mute toggle) */
.video-controls {
    position: absolute; bottom: 12px; right: 12px;
    display: none; gap: 8px; z-index: 10;
}
.video-controls.active { display: flex; }
.video-ctrl-btn {
    background: rgba(0,0,0,0.65); color: #fff; border: none;
    border-radius: 50%; width: 36px; height: 36px;
    cursor: pointer; font-size: 16px; backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.video-ctrl-btn:hover { background: rgba(0,0,0,0.9); }

/* ─── Controls bar ─── */

.controls-bar {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ─── Products (host) ─── */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.product-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}
.product-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,53,0.15); }
.product-card.pinned { border-color: var(--primary); background: var(--surface-warm); }
.product-card .emoji { font-size: 28px; margin-bottom: 6px; display: block; color: var(--text); }
.product-card .name  { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.product-card .price { font-size: 13px; color: var(--primary); font-weight: 700; }
.product-card .pin-btn {
    margin-top: 8px; font-size: 11px; padding: 5px 10px;
    border-radius: 6px; border: none; cursor: pointer; font-weight: 600;
    background: var(--primary); color: #fff; width: 100%;
    transition: background 0.15s;
}
.product-card.pinned .pin-btn { background: var(--text-muted); }
.product-card .pin-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.product-card .pin-btn:hover:not(:disabled) { background: var(--primary-dark); }
.product-card.pinned .pin-btn:hover:not(:disabled) { background: #5A6070; }

/* ─── Featured products (viewer) ─── */

#featured-products {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.featured-card {
    flex: 1;
    min-width: 140px;
    background: linear-gradient(135deg, var(--surface-warm), #1E1020);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px;
    animation: slideIn 0.25s ease-out;
    transition: transform 0.15s, box-shadow 0.15s;
}
/* Only the viewer's interactive cards get a lift; the studio's read-only preview doesn't */
#featured-products .featured-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,53,0.2);
}
.featured-label { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.featured-emoji { font-size: 32px; margin-bottom: 6px; display: block; }
.featured-name  { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.featured-desc  { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.featured-price { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.btn-buy        { width: 100%; justify-content: center; font-size: 13px; padding: 10px; transition: background 0.15s, box-shadow 0.15s; }

/* "Already in cart" state on the Add-to-Cart button.
   Keeps the primary CTA color (Add another is still the goal action), but
   visibly tags the button with a count chip so the user can't miss it. */
.btn-buy-label { display: inline-flex; align-items: center; gap: 6px; }
.btn-buy-chip {
    display: inline-flex; align-items: center;
    background: var(--success);
    color: #fff;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0.2px;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}
.btn-buy.just-bumped .btn-buy-chip { animation: chipPop 0.3s ease-out; }
.btn-buy.in-cart {
    /* Slight inset feel — primary still, but no longer the "fresh CTA" hue */
    background: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(34,197,94,0.4);
}
.btn-buy.in-cart:hover:not(:disabled) {
    background: var(--primary);
}
@keyframes chipPop {
    0%   { transform: scale(0.6); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

/* ─── Chat ─── */

.chat-panel {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
    padding: 0;
}
.chat-header {
    padding: 12px 16px;
    font-size: 13px; font-weight: 700;
    border-bottom: 1px solid var(--border);
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 12px 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.chat-msg { font-size: 13px; line-height: 1.5; padding: 4px 8px; border-radius: 6px; }
.chat-msg .sender { font-weight: 700; margin-right: 4px; }
.chat-msg.host {
    background: rgba(255,107,53,0.07);
    border-left: 2px solid rgba(255,107,53,0.55);
    border-radius: 0 6px 6px 0;
    padding-left: 10px;
}
.chat-msg.host .sender   { color: var(--primary); }
.chat-msg.viewer .sender { color: #8B8CF8; }
.chat-msg.system {
    color: var(--text-muted); font-style: italic; font-size: 12px;
    text-align: center; padding: 2px 8px;
}
.chat-msg.pin {
    background: rgba(255,107,53,0.09);
    border: 1px solid rgba(255,107,53,0.22);
    color: var(--primary); font-style: italic; font-size: 12px;
}

.chat-input-area {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px;
}
.chat-input-area input {
    flex: 1; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 13px; outline: none;
    background: var(--surface-hi); color: var(--text);
}
.chat-input-area input:focus { border-color: var(--primary); }

/* ─── Reactions ─── */

.reactions-bar {
    padding: 8px 12px;
    display: flex; gap: 6px; align-items: center;
    border-top: 1px solid var(--border);
}
.reaction-btn {
    background: none; border: 1px solid var(--border);
    border-radius: 20px; padding: 4px 10px; cursor: pointer;
    font-size: 16px; transition: transform 0.1s, background 0.1s;
    /* force color emoji rendering on Linux */
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    font-variant-emoji: emoji;
}
.reaction-btn:hover { background: var(--surface-hi); transform: scale(1.15); }
.reaction-btn:active { transform: scale(0.9); }

/* Floating emoji — position set in JS relative to the video */
.floating-reaction {
    position: fixed;
    font-size: 28px; pointer-events: none;
    animation: floatUp 2.5s ease-out forwards;
    z-index: 50;
}
@keyframes floatUp {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    80%  { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(-180px) scale(1.4); }
}

/* Unmute overlay */
.unmute-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 56px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}
.unmute-overlay.visible { pointer-events: all; opacity: 1; }
.unmute-btn {
    background: rgba(0,0,0,0.65); color: #fff;
    border: none; border-radius: 24px;
    padding: 10px 22px; font-size: 14px; font-weight: 600;
    cursor: pointer; backdrop-filter: blur(4px);
    transition: background 0.15s;
}
.unmute-btn:hover { background: rgba(0,0,0,0.85); }

/* ─── Stream state overlay (waiting / ended) ─── */

.stream-overlay {
    position: absolute; inset: 0;
    background: rgba(8, 8, 18, 0.88);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 20;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
}
.stream-overlay.visible { opacity: 1; }

.stream-overlay-inner { text-align: center; padding: 0 24px; }

.stream-overlay-icon {
    width: 80px; height: 80px; border-radius: 50%;
    margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

/* Waiting — animated orange pulse rings */
.stream-overlay-icon.pulsing {
    background: rgba(255,107,53,0.12);
    border: 1.5px solid rgba(255,107,53,0.25);
}
.stream-overlay-icon.pulsing .soi-dot {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--primary);
    animation: soiDotPulse 1.6s ease-in-out infinite;
}
.stream-overlay-icon.pulsing::before,
.stream-overlay-icon.pulsing::after {
    content: '';
    position: absolute; border-radius: 50%;
    border: 1.5px solid rgba(255,107,53,0.45);
    animation: soiRing 2.2s ease-out infinite;
}
.stream-overlay-icon.pulsing::before { inset: -8px; }
.stream-overlay-icon.pulsing::after  { inset: -20px; animation-delay: 0.55s; }

@keyframes soiDotPulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(0.78); opacity: 0.6; }
}
@keyframes soiRing {
    0%   { transform: scale(0.88); opacity: 0.6; }
    100% { transform: scale(1.28); opacity: 0; }
}

/* Ended — static gray circle with a stop bar */
.stream-overlay-icon.ended {
    background: rgba(128,128,160,0.1);
    border: 1.5px solid rgba(128,128,160,0.2);
}
.stream-overlay-icon.ended .soi-dot {
    width: 22px; height: 5px; border-radius: 3px;
    background: var(--text-muted);
}

.stream-overlay-title {
    font-size: 19px; font-weight: 700; color: #fff;
    margin-bottom: 8px; letter-spacing: -0.2px;
}
.stream-overlay-sub {
    font-size: 13px; color: rgba(255,255,255,0.45); line-height: 1.6;
}

/* Slide-in animation for featured cards */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Session status badges ─── */

.badge-waiting {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px;
    background: rgba(251,191,36,0.12); color: #FCD34D;
    font-size: 12px; font-weight: 700;
    border: 1px solid rgba(251,191,36,0.25);
}
.badge-waiting::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: #FCD34D; animation: pulse 2s infinite;
}

.badge-ended {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 20px;
    background: rgba(128,128,160,0.12); color: var(--text-muted);
    font-size: 12px; font-weight: 700;
}

.session-card.session-ended {
    opacity: 0.55;
}

/* ─── Studio: slim app bar + split controls bar ─── */

.app-bar-slim { height: 44px; padding: 0 20px; }

.controls-bar-split {
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    flex-wrap: nowrap;
    gap: 12px;
}
.controls-bar-split .controls-left,
.controls-bar-split .controls-right {
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
}
.controls-bar-split .controls-right { justify-content: flex-end; flex-wrap: wrap; }

.section-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px;
}
.section-sub { font-size: 12px; color: var(--text-muted); }

.featured-preview {
    display: flex; gap: 10px; flex-wrap: wrap;
    min-height: 1px;
}
.featured-preview:empty { display: none; }
.featured-preview .featured-card { flex: 1 1 200px; max-width: 240px; }
.featured-preview .btn-buy { opacity: 0.55; cursor: default; }

/* ─── Side tabs ─── */

.side-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.side-tab {
    flex: 1;
    background: none; border: none;
    padding: 12px 8px;
    color: var(--text-muted);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.side-tab:hover { color: var(--text); }
.side-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.side-pane {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.side-pane.active { display: flex; }

/* ─── Studio products list (side pane) ─── */

.products-pane {
    display: flex; flex-direction: column;
    flex: 1; overflow: hidden; min-height: 0;
}
.products-pane-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.products-pane-title   { font-size: 13px; font-weight: 700; }
.products-pane-actions { display: flex; align-items: center; gap: 6px; }
.products-list {
    flex: 1; overflow-y: auto;
    padding: 10px;
    display: flex; flex-direction: column; gap: 8px;
}

.product-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.15s, background 0.15s;
}
.product-row:hover { border-color: rgba(255,107,53,0.4); background: var(--surface-hi); }
.product-row.pinned { border-color: var(--primary); background: var(--surface-warm); }
.product-row.pinned:hover { background: #2A1814; }

.product-row-meta { flex: 1; min-width: 0; }
.product-row-name {
    font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-row-sub { font-size: 12px; color: var(--primary); font-weight: 700; }

.product-row-actions { display: flex; gap: 4px; flex-shrink: 0; }

.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }

/* "Pinned" state: clearly on, neutral-toned (not a CTA). */
.pin-btn-on {
    background: rgba(255,107,53,0.16);
    color: var(--primary);
    border: 1px solid rgba(255,107,53,0.4);
}
.pin-btn-on:hover:not(:disabled) {
    background: rgba(255,107,53,0.26);
    border-color: var(--primary);
}
/* "At max" disabled state: looks disabled, not "almost a CTA". */
.pin-btn:disabled {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    opacity: 1;
}

.empty-state-sm {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px 16px;
    line-height: 1.5;
}

/* ─── Unified product icon ─── */

/* The .prod-icon span is the box (sized per context).
   When it contains an <img class="prod-icon-img">, the image fills the box. */
.prod-icon {
    display: inline-flex;
    align-items: center; justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 1;
}
/* Subtle backdrop only for image icons, helps when an image has transparency */
.prod-icon--image { background: var(--surface); }
.prod-icon-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* Per-context sizing only */
.product-row .prod-icon  { width: 36px; height: 36px; font-size: 22px; }
.cart-row    .prod-icon  { width: 40px; height: 40px; font-size: 24px; }
.featured-card .prod-icon {
    display: flex;            /* block-level so it stacks above the name */
    width: 56px; height: 56px;
    font-size: 36px;
    margin-bottom: 8px;
}

/* ─── Tooltips ─── */

.help-tip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: var(--text-muted);
    font-size: 9px; font-weight: 700;
    font-style: italic;
    margin-left: 4px;
    cursor: help;
    position: relative;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    vertical-align: middle;
}
.help-tip:hover, .help-tip:focus-visible { background: var(--primary); color: #fff; outline: none; }

/* Body-level popup — escapes any overflow:hidden ancestor. */
.help-tip-popup {
    position: fixed;
    /* Park off-screen until first positioned to avoid a one-frame flash at 0,0 */
    top: -9999px; left: -9999px;
    background: #1a1a2e;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 280px;
    width: max-content;
    border: 1px solid var(--border);
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
    z-index: 1000;
}
.help-tip-popup.visible {
    opacity: 1;
    transform: translateY(0);
}
.help-tip-popup-text { display: block; }

.help-tip-popup-arrow {
    position: absolute;
    width: 10px; height: 10px;
    background: #1a1a2e;
    border: 1px solid var(--border);
    transform: translateX(-50%) rotate(45deg);
}
/* Arrow points up when the popup is below the target */
.help-tip-popup[data-placement="below"] .help-tip-popup-arrow {
    top: -6px;
    border-right: none;
    border-bottom: none;
}
/* Arrow points down when the popup is above the target */
.help-tip-popup[data-placement="above"] .help-tip-popup-arrow {
    bottom: -6px;
    border-left: none;
    border-top: none;
}

/* ─── Wide modal (product / cart) ─── */

.modal-wide { width: 460px; }

/* Icon input: text + upload button on one row */
.icon-field {
    display: flex; gap: 8px; align-items: stretch;
    margin-bottom: 20px;
}
.icon-field input[type="text"] {
    flex: 1;
    margin-bottom: 0;
}
.icon-field .btn { flex-shrink: 0; }

/* Icon upload preview */
.icon-preview {
    display: flex; align-items: center; gap: 12px;
    padding: 10px;
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
}
.icon-preview img {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--surface);
    flex-shrink: 0;
}
.icon-preview-meta { flex: 1; min-width: 0; }
.icon-preview-label { font-size: 13px; font-weight: 600; }
.icon-preview-size { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── Cart icon (viewer app bar) ─── */

.btn-cart {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface-hi);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 8px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.2s;
}
.btn-cart:hover { background: var(--border); border-color: var(--primary); }
.btn-cart.flash { animation: cartFlash 0.4s ease-out; }
@keyframes cartFlash {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); background: var(--primary); color: #fff; }
    100% { transform: scale(1); }
}
.cart-count {
    background: var(--primary); color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px; font-weight: 700;
    min-width: 20px; text-align: center;
    transition: transform 0.15s, opacity 0.15s;
}
.cart-count.empty {
    transform: scale(0.6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ─── Cart modal ─── */

.cart-items {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.cart-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.cart-row-meta { flex: 1; min-width: 0; }
.cart-row-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row-price { font-size: 12px; color: var(--primary); font-weight: 600; }
.cart-row-url {
    display: inline-flex;
    align-items: center; gap: 4px;
    max-width: 100%;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 3px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(255,255,255,0.04);
    transition: background 0.15s, color 0.15s;
}
.cart-row-url > .url-text {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}
.cart-row-url::after {
    content: '↗';
    font-size: 10px;
    opacity: 0.7;
    flex-shrink: 0;
}
.cart-row-url:hover {
    color: var(--primary);
    background: rgba(255,107,53,0.12);
}
.cart-row-url:hover::after { opacity: 1; }
.cart-row-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

.qty-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 26px; height: 26px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--border); }

.cart-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.cart-total { font-size: 14px; font-weight: 700; color: var(--primary); }
.cart-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Product detail modal ─── */

.modal-product-detail {
    width: 540px;
    max-width: 92vw;
    padding: 0;
    overflow: hidden;             /* hero stays put while body scrolls */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.pd-hero {
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    background: var(--surface-hi);
    display: flex; align-items: center; justify-content: center;
}
.pd-hero.emoji-only {
    background: linear-gradient(135deg, var(--surface-warm) 0%, #1A0E1F 60%, #1E1020 100%);
}
.pd-hero-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.pd-hero-emoji {
    font-size: 128px;
    line-height: 1;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.4));
}

.pd-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 28px;
}
.pd-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}
.pd-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
    letter-spacing: -0.4px;
}
.pd-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 16px;
    white-space: pre-wrap;       /* honor any newlines in the description */
}
.pd-desc:empty { display: none; }

.pd-url {
    font-size: 13px;
    padding: 7px 12px;
    margin-top: 0;
    margin-bottom: 18px;
}
.pd-url::after { font-size: 12px; }

.pd-add-btn {
    width: 100%;
    justify-content: center;
    font-size: 15px;
    padding: 13px;
}

/* Floating close button (top-right of modal hero) */
.modal-close-btn {
    position: absolute;
    top: 12px; right: 12px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    transition: background 0.15s, transform 0.15s;
}
.modal-close-btn:hover {
    background: rgba(0,0,0,0.85);
    transform: scale(1.08);
}

/* Featured card cursor — viewer's interactive cards only (studio's preview is read-only) */
#featured-products .featured-card { cursor: pointer; }

.cart-empty { padding: 36px 16px; }
.cart-empty-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.7;
}
.cart-empty-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* ─── URL platform status (studio) ─── */

/* Pulled up under the URL field so it visually attaches to it. The bottom
   margin (set on .modal input) leaves room for it without extra spacing. */
.url-status {
    display: flex; align-items: center; gap: 8px;
    margin-top: -14px; margin-bottom: 18px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.4;
    border: 1px solid var(--border);
    background: var(--surface-hi);
    animation: urlStatusFade 0.18s ease-out;
}
@keyframes urlStatusFade {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}
.url-status-icon { font-size: 14px; flex-shrink: 0; }
.url-status-text { flex: 1; min-width: 0; }
.url-status .help-tip { flex-shrink: 0; }

.url-status-ok       { border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.10); color: #BBF7D0; }
.url-status-warn     { border-color: rgba(252,211,77,0.45); background: rgba(252,211,77,0.10); color: #FCD34D; }
.url-status-info     { border-color: rgba(255,107,53,0.35); background: rgba(255,107,53,0.08); color: #FFB089; }
.url-status-amazon   { border-color: rgba(255,153,0,0.55);  background: rgba(255,153,0,0.10);  color: #FFCB7A; }
.url-status-shopify  { border-color: rgba(149,191,72,0.55); background: rgba(149,191,72,0.10); color: #C2E27A; }

/* Subtle accent on the URL input itself so the publisher sees confirmation
   without having to read the status line */
.modal input.input-amazon  { border-color: rgba(255,153,0,0.65);  box-shadow: 0 0 0 3px rgba(255,153,0,0.10); }
.modal input.input-shopify { border-color: rgba(149,191,72,0.65); box-shadow: 0 0 0 3px rgba(149,191,72,0.10); }

/* ─── Cart row badge ─── */

.cart-row-badge {
    display: inline-flex; align-items: center; gap: 3px;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.3px;
    vertical-align: 1px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-transform: uppercase;
}
.cart-row-badge.badge-amazon  { color: #FF9900; border-color: rgba(255,153,0,0.45);  background: rgba(255,153,0,0.08); }
.cart-row-badge.badge-shopify { color: #95BF48; border-color: rgba(149,191,72,0.45); background: rgba(149,191,72,0.08); }
.cart-row-badge.badge-warn    { color: #FCD34D; border-color: rgba(252,211,77,0.45); background: rgba(252,211,77,0.08); }
.cart-row-badge.badge-generic { /* default muted style */ }

/* The cart-row-name now hosts an inline badge — let it wrap when names are long */
.cart-row-name { white-space: normal; overflow: visible; text-overflow: clip; }

/* ─── Grouped checkout buttons ─── */

.cart-checkouts {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    margin-bottom: 12px;
}
.btn-checkout {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-hi);
    color: var(--text);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
    text-align: left;
}
.btn-checkout:hover     { transform: translateY(-1px); }
.btn-checkout:active    { transform: scale(0.98); }
.btn-checkout .ck-icon  { font-size: 16px; flex-shrink: 0; }
.btn-checkout .ck-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-checkout .ck-arrow { font-size: 16px; opacity: 0.6; flex-shrink: 0; }
.btn-checkout:hover .ck-arrow { opacity: 1; transform: translateX(2px); transition: transform 0.15s; }

.btn-checkout-shopify { border-color: rgba(149,191,72,0.55); background: linear-gradient(135deg, rgba(149,191,72,0.20) 0%, rgba(149,191,72,0.08) 100%); }
.btn-checkout-shopify:hover { border-color: #95BF48; box-shadow: 0 4px 14px rgba(149,191,72,0.18); }

.checkouts-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 4px;
}

/* ─── Product modal — type picker ─── */

.pm-step-picker { padding: 4px 4px 8px; }
.pm-step-picker h3 { margin-bottom: 4px; }
.pm-step-sub {
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

.pm-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.pm-type {
    flex: 1 1 110px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 18px 10px 14px;
    background: var(--surface-hi);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    color: var(--text);
    transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
    text-align: center;
    font: inherit;
}
.pm-type:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.pm-type:active { transform: translateY(-1px); }

.pm-type-emoji { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.pm-type-label { font-size: 14px; font-weight: 700; letter-spacing: 0.2px; }
.pm-type-hint  { font-size: 11px; color: var(--text-muted); }

/* Per-platform brand accents — subtle in resting state, bold on hover. */
.pm-type-amazon:hover  { border-color: #FF9900; background: linear-gradient(180deg, rgba(255,153,0,0.10), rgba(255,153,0,0.02)); }
.pm-type-shopify:hover { border-color: #95BF48; background: linear-gradient(180deg, rgba(149,191,72,0.12), rgba(149,191,72,0.02)); }
.pm-type-custom:hover  { border-color: var(--primary); background: linear-gradient(180deg, rgba(255,107,53,0.10), rgba(255,107,53,0.02)); }

.pm-type-amazon:hover  .pm-type-label { color: #FFCB7A; }
.pm-type-shopify:hover .pm-type-label { color: #C2E27A; }
.pm-type-custom:hover  .pm-type-label { color: var(--primary); }

/* ─── Product modal — form step ─── */

.pm-form-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px;
}
.pm-form-head h3 { margin: 0; }

.pm-back {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--surface-hi);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.pm-back:hover { background: var(--border); border-color: var(--text-muted); }

.pm-platform-note {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12.5px; line-height: 1.5;
    margin-bottom: 14px;
}
.pm-platform-note-icon { font-size: 14px; flex-shrink: 0; line-height: 1.5; }
.pm-platform-note-amazon {
    background: linear-gradient(135deg, rgba(255,153,0,0.10), rgba(255,153,0,0.04));
    border: 1px solid rgba(255,153,0,0.35);
    color: #FFCB7A;
}
.pm-platform-note-custom {
    background: linear-gradient(135deg, rgba(255,107,53,0.08), rgba(255,107,53,0.02));
    border: 1px solid rgba(255,107,53,0.30);
    color: #FFB089;
}
.pm-platform-note-custom b { color: #FFCEB3; font-weight: 700; }

/* URL row — input + auto-fill button side by side */
.pm-url-row {
    display: flex; align-items: stretch; gap: 8px;
    margin-bottom: 18px;            /* matches .modal input default */
}
.pm-url-row input {
    flex: 1;
    margin-bottom: 0 !important;    /* spacing comes from the row */
}

.btn-fill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(149,191,72,0.55);
    background: linear-gradient(135deg, rgba(149,191,72,0.18), rgba(149,191,72,0.06));
    color: #C2E27A;
    font-weight: 700; font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}
.btn-fill:hover:not(:disabled) {
    border-color: #95BF48;
    box-shadow: 0 4px 14px rgba(149,191,72,0.18);
    transform: translateY(-1px);
}
.btn-fill:disabled { opacity: 0.65; cursor: progress; }

.pm-fill-spinner {
    width: 13px; height: 13px;
    border: 2px solid rgba(194,226,122,0.35);
    border-top-color: #C2E27A;
    border-radius: 50%;
    animation: pmSpin 0.7s linear infinite;
    display: inline-block;
}
@keyframes pmSpin { to { transform: rotate(360deg); } }

/* Auto-fill flash — gentle green pulse on a freshly populated field */
.modal input.input-filled {
    border-color: rgba(149,191,72,0.85);
    animation: inputFilled 1.2s ease-out;
}
@keyframes inputFilled {
    0%   { box-shadow: 0 0 0 0   rgba(149,191,72,0.45); }
    30%  { box-shadow: 0 0 0 6px rgba(149,191,72,0.15); }
    100% { box-shadow: 0 0 0 0   rgba(149,191,72,0); }
}

/* Toast variant: error (red) for failed auto-fill */
.share-toast.toast-error {
    background: rgba(239,68,68,0.18);
    border-color: rgba(239,68,68,0.45);
    color: #FCA5A5;
}

/* ─── Shopify-flow empty state — shown until Scan completes (or skipped) ─── */

.pm-shopify-prompt {
    margin-top: 4px;
    padding: 26px 18px 22px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(149,191,72,0.10) 0%, rgba(149,191,72,0.02) 100%);
    border: 1px dashed rgba(149,191,72,0.45);
    text-align: center;
    animation: urlStatusFade 0.2s ease-out;
}
.pm-shopify-prompt-emoji {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 8px rgba(149,191,72,0.3));
}
.pm-shopify-prompt-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #C2E27A;
}
.pm-shopify-prompt-sub {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.pm-shopify-prompt-sub b { color: var(--text); font-weight: 600; }

.pm-shopify-skip {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.pm-shopify-skip:hover { color: var(--text); background: var(--surface-hi); }

/* ─── 4th picker card: Shopify store importer ─── */
.pm-type-importer:hover {
    border-color: #95BF48;
    background: linear-gradient(180deg, rgba(149,191,72,0.16) 0%, rgba(149,191,72,0.04) 100%);
}
.pm-type-importer:hover .pm-type-label { color: #C2E27A; }

/* ─── Shopify-themed amber/info note used inside the importer ─── */
.pm-platform-note-shopify {
    background: linear-gradient(135deg, rgba(149,191,72,0.10), rgba(149,191,72,0.02));
    border: 1px solid rgba(149,191,72,0.40);
    color: #C2E27A;
}
.pm-platform-note-shopify b { color: #DCEAA8; font-weight: 700; }

/* ─── Modal width modifier — importer needs more horizontal room ─── */
.modal[data-mode="importer"] { width: 720px; }

/* ─── Importer grid + controls ─── */

.pm-imp-toolbar {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 12px;
}
.pm-imp-toolbar input[type="search"] {
    flex: 1;
    margin: 0 !important;
    padding: 8px 12px;
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.pm-imp-toolbar input[type="search"]:focus { border-color: var(--primary); }

.pm-imp-selectall {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text-muted);
    cursor: pointer; user-select: none;
    padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface-hi);
    transition: border-color 0.15s, color 0.15s;
}
.pm-imp-selectall:hover { color: var(--text); border-color: rgba(149,191,72,0.45); }
.pm-imp-selectall input { margin: 0; cursor: pointer; }

.pm-imp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
    margin: 0 -4px 12px;             /* bleed scrollbar to the modal edge */
    border-radius: 10px;
}
.pm-imp-grid::-webkit-scrollbar       { width: 8px; }
.pm-imp-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.pm-imp-grid::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.pm-imp-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 30px 14px;
    font-size: 13px;
    line-height: 1.6;
}
.pm-imp-empty b { color: var(--text); font-weight: 600; }

.pm-imp-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface-hi);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    user-select: none;
}
.pm-imp-card:hover:not(.already) {
    border-color: rgba(149,191,72,0.55);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.pm-imp-card.selected {
    border-color: #95BF48;
    box-shadow: 0 0 0 3px rgba(149,191,72,0.20), 0 4px 14px rgba(149,191,72,0.18);
    background: linear-gradient(180deg, rgba(149,191,72,0.10), rgba(149,191,72,0.02));
}
.pm-imp-card.already { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }

.pm-imp-card-check {
    position: absolute; top: 8px; left: 8px;
    width: 18px; height: 18px;
    cursor: pointer;
    accent-color: #95BF48;
    z-index: 2;
}

.pm-imp-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--surface);
    display: block;
}
.pm-imp-card-img-fallback {
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
    color: var(--text-muted);
}

.pm-imp-card-body {
    padding: 8px 10px 10px;
    display: flex; flex-direction: column; gap: 4px;
    flex: 1;
    min-width: 0;
}
.pm-imp-card-name {
    font-size: 12.5px; font-weight: 600; color: var(--text);
    line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.pm-imp-card-row {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-top: auto;
    gap: 8px;
}
.pm-imp-card-price {
    font-size: 13px; font-weight: 700; color: #C2E27A;
    white-space: nowrap;
}
.pm-imp-card-preview {
    font-size: 11px; color: var(--text-muted);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.pm-imp-card-preview:hover { color: var(--text); background: var(--border); }

.pm-imp-card-already {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,0.55);
    color: #FCD34D;
    font-size: 10.5px; font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    letter-spacing: 0.3px;
    backdrop-filter: blur(2px);
}

.pm-imp-meta {
    display: flex; gap: 8px; align-items: center;
    font-size: 12px; color: var(--text-muted);
    padding: 4px 2px 12px;
}
.pm-imp-meta-sep { opacity: 0.5; }
#pm-imp-selected-count { color: #C2E27A; font-weight: 600; }

.pm-imp-footer { align-items: center; }
.pm-imp-spacer { flex: 1; }
.pm-imp-footer .btn-ghost#pm-imp-load-more {
    display: inline-flex; align-items: center; gap: 6px;
}

/* ─── Open Player button — twin of share but neutral-themed ─── */
.btn-open-player {
    /* Inherits .btn-share box; tone it down so Share remains the primary action. */
    background: rgba(255,255,255,0.04);
    border-color: var(--border);
    color: var(--text-muted);
}
.btn-open-player:hover { color: var(--text); border-color: var(--text-muted); background: var(--surface-hi); }

