/* eBay Video and Livestream Atomizer — Material Design 3 + eBay Brand */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* eBay brand palette */
    --ebay-blue: #0AA7FF;
    --ebay-blue-dark: #0090e0;
    --ebay-blue-light: rgba(10, 167, 255, 0.10);
    --ebay-green: #4CE160;
    --ebay-green-dark: #2eb84a;
    --ebay-green-light: rgba(76, 225, 96, 0.12);
    --ebay-red: #FF5C5C;
    --ebay-red-dark: #e03c3c;
    --ebay-red-light: rgba(255, 92, 92, 0.12);
    --ebay-yellow: #FFBD14;
    --ebay-orange: #FF8806;
    --ebay-violet: #836BFF;

    /* Surfaces */
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f5f8fc;
    --border: #dde3ed;
    --text: #1a1f36;
    --text-2: #64748b;

    /* Semantic */
    --accent: var(--ebay-blue);
    --accent-hover: var(--ebay-blue-dark);
    --accent-light: var(--ebay-blue-light);
    --green: var(--ebay-green-dark);
    --green-light: var(--ebay-green-light);
    --red: var(--ebay-red-dark);
    --red-light: var(--ebay-red-light);

    --radius: 10px;
    --radius-lg: 16px;
    --shadow-1: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-3: 0 8px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --font: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SF Mono", "Fira Code", monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Header */
.site-header {
    background: #1a1f36;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.site-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ebay-e { color: #FF5C5C; }
.ebay-b { color: #0AA7FF; }
.ebay-a { color: #FFBD14; }
.ebay-y { color: #4CE160; }

/* Main layout */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

.subtitle { color: var(--text-2); font-size: 0.9rem; margin-top: 0.25rem; font-weight: 400; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    letter-spacing: 0.01em;
    text-decoration: none;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
#transcript-search-input:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--ebay-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(10,167,255,0.30);
}
.btn-primary:hover:not(:disabled) {
    background: var(--ebay-blue-dark);
    box-shadow: 0 4px 12px rgba(10,167,255,0.40);
    transform: translateY(-1px);
}
.btn-live {
    background: var(--ebay-red);
    color: white;
    box-shadow: 0 2px 8px rgba(255,92,92,0.30);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.btn-live:hover:not(:disabled) {
    background: var(--ebay-red-dark);
    box-shadow: 0 4px 12px rgba(255,92,92,0.40);
    transform: translateY(-1px);
}
.btn-live:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--accent-light); border-color: var(--accent); }
.btn-sm { padding: 0.3rem 0.85rem; font-size: 0.8rem; }

/* Input section */
.input-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-2);
}
.input-card h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
#url-input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}
#url-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,100,210,0.12);
}
.input-error { color: var(--red); font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.2em; }

/* Processing */
.processing-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-2);
}
.processing-card h2 { font-weight: 500; color: var(--text); margin-bottom: 1rem; }
.steps { margin: 1.5rem 0; display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 400;
}
.step[data-state="active"] { color: var(--accent); font-weight: 500; }
.step[data-state="done"] { color: var(--green); }
.step[data-state="error"] { color: var(--red); }
.step-icon::before { content: "○"; }
.step[data-state="active"] .step-icon::before { content: "◉"; }
.step[data-state="done"] .step-icon::before { content: "✓"; }
.step[data-state="error"] .step-icon::before { content: "✗"; }
.progress-bar-wrapper {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 1rem 0;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.4s ease;
    border-radius: 2px;
}
.status-msg { color: var(--text-2); font-size: 0.85rem; margin-bottom: 1rem; }

/* Results header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.results-header h2 { font-size: 1.3rem; font-weight: 500; }

/* Player */
.player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-3);
}
.player-wrapper iframe,
.player-wrapper > div {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Snippets */
.snippets-section { margin-bottom: 2rem; }
.snippets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.snippets-header h3 { font-size: 1rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    padding: 0.1em 0.4em;
    font-size: 0.75rem;
    background: var(--accent);
    color: white;
    border-radius: 99px;
    font-weight: 600;
}

/* Snippet row */
.snippet-row {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.2s;
    border: 1px solid transparent;
}
.snippet-row:hover { box-shadow: var(--shadow-2); }

.snippet-row-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.snippet-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin: 0;
}
.snippet-timestamps {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.timestamp-btn {
    background: var(--accent-light);
    border: none;
    color: var(--accent);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}
.timestamp-btn:hover { background: var(--accent); color: white; }
.timestamp-sep { color: var(--text-2); font-size: 0.8rem; }

.snippet-description {
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}

.snippet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}
.tag {
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.15rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
}

.snippet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.snippet-transcript {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-2);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-2);
    white-space: pre-wrap;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

/* Transcript section */
.transcript-section { margin-top: 1rem; }
.transcript-section summary {
    cursor: pointer;
    padding: 0.75rem 0;
    color: var(--text-2);
}
.transcript-section summary h3 { display: inline; font-size: 1rem; font-weight: 500; }
.transcript-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: pre-wrap;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text-2);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: #ffffff;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
    box-shadow: var(--shadow-3);
}
.toast-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Source toggle */
.source-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}
.source-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.source-toggle label {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 0.35rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 400;
}
.source-toggle label:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }
.source-toggle input[type="radio"]:checked + label {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 500;
}

/* Persistent nav tab bar — always visible above all sections */
.main-nav-tabs {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 0 0 1.25rem;
    background: var(--surface);
    padding: 5px;
    border-radius: 50px;
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.tab-btn:hover:not(.active) {
    background: var(--accent-light);
    color: var(--accent);
}
.tab-btn.active {
    background: var(--ebay-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(10,167,255,0.35);
    font-weight: 600;
}
.tab-btn[data-tab="tab-ebay-live"].active {
    background: var(--ebay-red);
    box-shadow: 0 2px 8px rgba(255,92,92,0.35);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Upload dropzone */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.15s;
    margin: 1rem 0;
    background: var(--surface-2);
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}
.upload-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.upload-hint { color: var(--text-2); font-size: 0.8rem; margin-top: 0.5rem; }
.upload-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.5rem 0;
    color: var(--text);
    font-size: 0.9rem;
}
#upload-btn { margin-top: 0.5rem; }

/* Channel controls */
.channel-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}
.channel-filter {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: var(--font);
}

/* Channel list */
.channel-list { max-height: 500px; overflow-y: auto; margin-top: 1rem; }
.channel-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.15s;
}
.channel-row:hover { box-shadow: var(--shadow-2); }
.channel-thumb { width: 80px; height: 45px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.channel-info { flex: 1; min-width: 0; }
.channel-title { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-meta { font-size: 0.75rem; color: var(--text-2); }

/* YouTube upload button */
.btn-youtube { background: #cc0000; color: white; }
.btn-youtube:hover { background: #e60000; }

/* Results header actions */
.results-header-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }

/* Upload steps hidden by default */
.upload-step { }

/* AI Thumbnails — on-demand per snippet */
.snippet-thumb-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.btn-generate-thumbs {
    font-size: 0.85rem;
    color: var(--accent);
    border-color: var(--accent);
    padding: 0.4rem 1rem;
}
.btn-generate-thumbs:hover { background: var(--accent-light); }
.thumb-generating {
    padding: 0.75rem 1rem;
    color: var(--text-2);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.thumb-generating::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.snippet-thumbnails-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
.thumbnail-section-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.snippet-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.snippet-thumb-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-1);
}
.snippet-thumb-card:hover { border-color: var(--accent); box-shadow: var(--shadow-2); }
.snippet-thumb-card.selected { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.thumb-style-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}
.snippet-thumb-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
    display: block;
}
.thumb-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}
.thumb-fallback-warning {
    background: #fff8e1;
    border: 1px solid #f9a825;
    color: #5d4037;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    margin-bottom: 8px;
}
/* ---- Video type info bar ---- */
.video-type-bar {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: #1565c0;
    margin-bottom: 12px;
}

/* ---- AEO question ---- */
.snippet-aeo {
    font-size: 0.82rem;
    color: #666;
    padding: 4px 0 6px 0;
    font-style: normal;
}
.snippet-aeo em { color: #444; }

/* ---- Score badge ---- */
.snippet-score-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}
.score-high { background: #e8f5e9; color: #2e7d32; }
.score-mid  { background: #fff8e1; color: #f57f17; }
.score-low  { background: #fce4ec; color: #c62828; }

/* ---- eBay Live tab ---- */
.live-tab-heading {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: var(--text);
}
.live-form { display: flex; flex-direction: column; gap: 10px; }
.live-label { font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); }
.live-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.92rem;
    width: 100%;
    box-sizing: border-box;
}
.live-hint {
    font-size: 0.78rem;
    color: #888;
    margin: -4px 0 4px 0;
    line-height: 1.4;
}
.live-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.92rem;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.thumb-error {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--red-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    font-size: 0.8rem;
    border-radius: calc(var(--radius) - 2px);
}

/* Review UI */
.review-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.review-count-badge {
    background: var(--border);
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 99px;
}
.review-count-badge.has-approved {
    background: var(--green-light);
    color: var(--green);
}
.review-label {
    font-size: 0.85rem;
    color: var(--text-2);
}

/* Review filter bar */
.review-filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.filter-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-2);
    padding: 0.3rem 0.9rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.filter-btn:hover { border-color: var(--ebay-blue); color: var(--ebay-blue); background: var(--ebay-blue-light); }
.filter-btn.active { background: var(--ebay-blue); border-color: var(--ebay-blue); color: white; box-shadow: 0 2px 6px rgba(10,167,255,0.3); }

/* Review bar on snippet cards */
.review-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.review-actions { display: flex; gap: 0.4rem; }
.review-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-pending { background: #fff8e1; color: #f57f17; }
.status-approved { background: var(--green-light); color: var(--green); }
.status-rejected { background: var(--red-light); color: var(--red); }

/* Approved/rejected card styles */
.snippet-row[data-status="approved"] { border-left: 4px solid var(--green); }
.snippet-row[data-status="rejected"] { border-left: 4px solid var(--red); opacity: 0.6; }

/* Approve/reject buttons */
.btn-approve { background: var(--ebay-green-light); color: var(--ebay-green-dark); border: 1.5px solid var(--ebay-green); border-radius: 50px; }
.btn-approve:hover { background: var(--ebay-green); color: white; box-shadow: 0 2px 8px rgba(76,225,96,0.35); }
.btn-reject { background: var(--ebay-red-light); color: var(--ebay-red-dark); border: 1.5px solid var(--ebay-red); border-radius: 50px; }
.btn-reject:hover { background: var(--ebay-red); color: white; box-shadow: 0 2px 8px rgba(255,92,92,0.35); }

/* Header right (timestamps + rating) */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Inline ratings */
.inline-rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
}
.rating-label {
    font-size: 0.75rem;
    color: var(--text-2);
    font-weight: 500;
}
.star-rating { display: flex; gap: 0.1rem; }
.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--border);
    padding: 0;
    line-height: 1;
    transition: color 0.1s, transform 0.1s;
}
.star-btn:hover { color: #f59e0b; transform: scale(1.2); }
.star-btn.filled { color: #f59e0b; }

/* Editable title/description */
.snippet-title-wrap { flex: 1; }
.snippet-title-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    outline: none;
}
.snippet-desc-wrap { margin: 0.5rem 0; }
.snippet-desc-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    resize: vertical;
    outline: none;
    line-height: 1.5;
}

/* ---- Field Tooltips ---- */

.tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}
.tooltip-icon {
    font-size: 11px;
    color: #bbb;
    cursor: default;
    user-select: none;
    line-height: 1;
}
.tooltip-icon:hover { color: #888; }
.tooltip-bubble {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: #1a1a1a;
    color: #f5f5f5;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.45;
    padding: 7px 10px;
    border-radius: 6px;
    white-space: normal;
    pointer-events: none;
    z-index: 100;
    /* hidden by default */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.12s, visibility 0.12s;
}
/* 300ms delay on enter, instant on leave */
.tooltip-wrap:hover .tooltip-bubble {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.12s 0.3s, visibility 0.12s 0.3s;
}
/* Caret pointing down toward the icon */
.tooltip-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
}
/* Variant: tooltip appears below (for items near the top of the card) */
.tooltip-bubble-below {
    bottom: auto;
    top: calc(100% + 6px);
}
.tooltip-bubble-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1a1a1a;
}
/* chapters button wrapper */
.chapters-btn-wrap {
    display: inline-flex;
    align-items: center;
}

/* Field label (used alongside tooltips) */
.field-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

/* ---- Inline metadata editing ---- */

/* AEO editable */
.snippet-aeo-wrap { margin: 0; }
.snippet-aeo-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    resize: vertical;
    outline: none;
    line-height: 1.5;
    margin: 4px 0 6px;
}

/* Score editable */
.score-wrap { display: inline-flex; align-items: center; margin-left: 8px; }
.score-input {
    width: 58px;
    padding: 2px 6px;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    outline: none;
    text-align: center;
}

/* Tags editor */
.tags-editor { margin-top: 0.5rem; }
.tags-edit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}
.tag-editable {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.15rem 0.5rem 0.15rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
}
.tag-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: 0.7rem;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}
.tag-remove-btn:hover { opacity: 1; }
.tag-add-row {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}
.tag-add-input {
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    outline: none;
    width: 130px;
}
.tag-add-input:focus { border-color: var(--accent); }

/* Human-edited field indicator */
.field-edited {
    border-left: 2px solid var(--accent);
    padding-left: 6px;
    margin-left: -8px;
}
.score-edited { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Snippet clip preview */
.snippet-preview {
    margin-top: 0.75rem;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.snippet-preview iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.clip-video-player {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    border: none;
}
.preview-unavailable {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-2);
    font-size: 0.85rem;
}

/* Clip Trimmer */
.clip-trimmer {
    margin: 0.6rem 0 0.25rem;
}

.trimmer-track {
    position: relative;
    height: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: crosshair;
    user-select: none;
}

.trimmer-range {
    position: absolute;
    top: 0; bottom: 0;
    background: rgba(37, 99, 235, 0.15);
    border-left: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    pointer-events: none;
}

.trimmer-handle {
    position: absolute;
    top: -3px; bottom: -3px;
    width: 10px;
    background: var(--accent);
    border-radius: 3px;
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 2;
    transition: background 0.1s;
}
.trimmer-handle:hover { background: var(--accent-hover, #1d4ed8); }

.trimmer-ghost {
    position: absolute;
    top: 3px; bottom: 3px;
    width: 2px;
    background: var(--text-2);
    opacity: 0.35;
    pointer-events: none;
    z-index: 1;
}

.trimmer-edited .trimmer-track {
    border-color: var(--yellow, #f59e0b);
}

.trimmer-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.trimmer-time-group {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.trimmer-label {
    font-size: 0.68rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0.15rem;
}

.trimmer-time {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 3.2em;
    text-align: center;
}

.trimmer-adj-btn {
    padding: 0.1rem 0.3rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.72rem;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    line-height: 1.5;
}
.trimmer-adj-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.trimmer-preview-btn { font-size: 0.78rem; }

.edited-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fef9c3;
    color: #854d0e;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ---- Card Collapse / Expand ---- */

.snippet-header-clickable {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.snippet-header-clickable:hover {
    background: rgba(0, 0, 0, 0.025);
}

.snippet-chevron {
    font-size: 0.85rem;
    color: var(--text-2);
    margin-left: 0.5rem;
    user-select: none;
    flex-shrink: 0;
    transition: color 0.15s;
}
.snippet-header-clickable:hover .snippet-chevron {
    color: var(--text);
}

.snippet-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.snippet-details.expanded {
    max-height: 4000px;
    transition: max-height 0.5s ease-in;
    overflow: visible;
}

/* ---- Collapsible sub-sections within expanded card ---- */
.sub-section {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin: 10px 0;
    overflow: hidden;
}
.sub-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
}
.sub-section-header:hover {
    background: #eef2f7;
}
.sub-section-content.sub-section-collapsed + .sub-section-header,
.sub-section-collapsed ~ .sub-section-header {
    border-bottom: none;
}
/* Remove bottom border when section is collapsed (content hidden) */
.sub-section:has(.sub-section-collapsed) .sub-section-header {
    border-bottom: none;
}
.sub-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #555e6d;
    text-transform: uppercase;
}
.sub-section-chevron {
    font-size: 0.75rem;
    color: #888;
}
.sub-section-content {
    max-height: 3000px;
    overflow: visible;
    transition: max-height 0.35s ease-in, padding 0.2s ease;
    padding: 12px;
}
.sub-section-content.sub-section-collapsed {
    max-height: 0;
    overflow: hidden;
    padding: 0 12px;
    transition: max-height 0.25s ease-out, padding 0.2s ease;
}

/* ---- Content Universe Banner ---- */

.content-universe-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.75rem;
    border-radius: 4px 4px 0 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 0;
}

.universe-label-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.universe-name {
    font-weight: 700;
}

.audience-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255,255,255,0.22);
    border-radius: 20px;
    padding: 0.1rem 0.55rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
}

.universe-edit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.universe-edit-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}

.universe-select {
    font-size: 0.8rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

/* Universe color variants */
.universe-seller-academy     { background: #1a73e8; }
.universe-auth-lab           { background: #7c3aed; }
.universe-origin-stories     { background: #0d9488; }
.universe-market-pulse       { background: #d97706; }
.universe-fix-restore        { background: #dc2626; }
.universe-biz-fundamentals   { background: #0369a1; }
.universe-category-deep      { background: #0f766e; }
.universe-misc               { background: #64748b; }

/* ---- Platform Icons (collapsed card) ---- */

.platform-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0.4rem;
}

.platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255,255,255,0.22);
    color: #fff;
    flex-shrink: 0;
    cursor: default;
}

/* Colored recommendation dots — replace text badges */
.platform-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
/* On collapsed header icons: absolute bottom-right corner */
.platform-icon .platform-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    border: 1.5px solid #1a1f36;
    border-radius: 50%;
}
.platform-dot-strong { background: var(--ebay-green); }
.platform-dot-maybe  { background: var(--ebay-yellow); }

/* ---- Platform Fit Section (expanded details) ---- */

.platform-fit-section {
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.platform-fit-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.platform-fit-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.platform-fit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--border);
}

.platform-fit-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 80px;
}

.platform-content-type {
    font-size: 0.65rem;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    white-space: nowrap;
}

.platform-fit-rationale {
    width: 100%;
    font-size: 0.78rem;
    color: var(--text-2);
    font-style: italic;
    padding-top: 0.05rem;
}

.platform-fit-times {
    width: 100%;
    font-size: 0.72rem;
    color: var(--text-2);
    font-family: monospace;
}

/* ---- Run History ---- */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.history-empty {
    color: var(--text-2);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem 0;
}

.history-card {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    align-items: center;
}
.history-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(10,167,255,0.12);
}

.history-thumb-wrap {
    flex-shrink: 0;
    width: 120px;
    height: 68px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--surface-2);
}
.history-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.history-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--border);
}

.history-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.history-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-meta {
    font-size: 0.78rem;
    color: var(--text-2);
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}
.history-approved {
    color: var(--ebay-green-dark);
    font-weight: 600;
}
.history-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}
.history-badge {
    font-size: 0.68rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    color: var(--text-2);
    font-family: monospace;
}

/* Responsive */
@media (max-width: 640px) {
    main { padding: 1rem 0.5rem; }
    .input-group { flex-direction: column; }
    .results-header { flex-direction: column; gap: 0.5rem; }
    .results-header-actions { flex-wrap: wrap; }
    .snippet-row-header { flex-direction: column; }
    .tab-bar { flex-wrap: wrap; }
    .channel-row { flex-wrap: wrap; }
    .channel-thumb { width: 60px; height: 34px; }
    .snippet-thumbnails-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- SERP Intelligence ---- */
/* ---- SERP Intelligence (compact layout) ---- */
.serp-section {
    border-top: 1px solid var(--border);
    padding: 0.7rem 1rem 0.5rem;
    background: var(--surface-2);
}
.serp-section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}
.serp-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
/* Compact one-line entry row: keyword | pills | score */
.serp-entry-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    flex-wrap: wrap;
}
.serp-entry-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0 0.25rem 0;
    margin-bottom: 0.1rem;
}
.serp-keyword-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
}
.serp-keyword-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.serp-keyword-link:hover { color: var(--accent-hover); }
/* Score badge + label as a tooltip-wrap group */
.serp-score-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    margin-left: auto;
}
.serp-score {
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 0.1rem 0.45rem;
    min-width: 1.8rem;
    text-align: center;
    line-height: 1.4;
}
/* Priority tiers: 75+ green, 50-74 yellow, 25-49 gray, <25 muted */
.serp-score-high { background: var(--ebay-green-light); color: var(--ebay-green-dark); border: 1px solid var(--ebay-green-dark); }
.serp-score-medium { background: rgba(255, 189, 20, 0.15); color: #9a6e00; border: 1px solid #c9960a; }
.serp-score-low  { background: var(--ebay-red-light); color: var(--ebay-red-dark); border: 1px solid var(--ebay-red-dark); }
.serp-score-label {
    font-size: 0.63rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
/* Pills inline, each pill IS a tooltip-wrap */
.serp-pill-row {
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}
.serp-pill {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    border: 1px solid transparent;
    white-space: nowrap;
    /* Pills also act as tooltip-wrap; override margin-left from .tooltip-wrap */
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;  /* reset anchor default */
}
.serp-pill .tooltip-bubble { width: 210px; }
.serp-pill:hover { opacity: 0.78; }
.serp-pill-green { background: var(--ebay-green-light); color: var(--ebay-green-dark); border-color: var(--ebay-green-dark); }
.serp-pill-red   { background: var(--ebay-red-light);   color: var(--ebay-red-dark);   border-color: var(--ebay-red-dark); }
.serp-pill-gray  { background: #f0f2f5; color: #8a9ab5; border-color: #d0d8e8; }
/* Score breakdown tooltip — wider to fit the breakdown text */
.serp-score-bubble { width: 280px; }
.serp-no-data {
    font-size: 0.8rem;
    color: var(--text-2);
    font-style: italic;
    padding: 4px 0;
}
.serp-occupants {
    font-size: 0.7rem;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40ch;
}
.serp-recommendation {
    font-size: 0.72rem;
    color: var(--text-2);
    line-height: 1.4;
    flex: 1;
}
.serp-cache-age {
    font-size: 0.63rem;
    color: #aab4c4;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- SERP Publish Priority badge (section header) ---- */
.serp-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    flex-shrink: 0;
}
.serp-priority-score {
    font-size: 1rem;
    font-weight: 700;
}
.serp-priority-label {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}
.serp-priority-high   { background: var(--ebay-green-light); color: var(--ebay-green-dark); }
.serp-priority-medium { background: rgba(255, 189, 20, 0.15); color: #9a6e00; }
.serp-priority-low    { background: #f0f2f5; color: #7a8a9e; }
.serp-priority-skip   { background: #f8f8f8; color: #bbb; }

/* ---- SERP Three-dimension bars ---- */
.serp-dimensions {
    display: flex;
    gap: 0.6rem;
    margin: 0.4rem 0 0.5rem;
}
.serp-dim {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.35rem 0.5rem;
}
.serp-dim-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.serp-dim-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-2);
}
.serp-dim-value {
    font-size: 0.85rem;
    font-weight: 700;
}
.serp-dim-demand { color: #42a5f5; }
.serp-dim-gap    { color: #66bb6a; }
.serp-dim-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--border);
}
.serp-dim-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}
.serp-dim-fill-demand { background: #42a5f5; }
.serp-dim-fill-gap    { background: #66bb6a; }
.serp-comp-tag {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 0.6rem;
    font-size: 0.63rem;
    font-weight: 600;
}
.serp-comp-low    { background: var(--ebay-green-light); color: var(--ebay-green-dark); }
.serp-comp-medium { background: rgba(255, 189, 20, 0.15); color: #9a6e00; }
.serp-comp-high   { background: var(--ebay-red-light); color: var(--ebay-red-dark); }

/* Best query row highlight */
.serp-entry-best {
    background: rgba(102, 187, 106, 0.08);
    margin: 0 -1rem;
    padding: 0.3rem 1rem;
    border-radius: 0.3rem;
}

/* Skip tier for score badge */
.serp-score-skip { background: #f8f8f8; color: #bbb; border: 1px solid #ddd; }

/* ---- Transcript toolbar ---- */
.transcript-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0;
    align-items: center;
}

.transcript-editor {
    width: 100%;
    min-height: 240px;
    box-sizing: border-box;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: inherit;
    line-height: inherit;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    background: #fff;
    color: inherit;
}

.transcript-dirty {
    margin-left: 12px;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

.transcript-search {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 0;
}

#transcript-search-input {
    flex: 1 1 240px;
    min-width: 180px;
    padding: 6px 10px;
    border: 1px solid var(--border, #ccc);
    border-radius: 4px;
    font-size: inherit;
}

.transcript-search-count {
    font-size: 0.9em;
    color: #666;
    min-width: 60px;
}

#transcript-content mark.transcript-match {
    background: #fff1a8;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    cursor: pointer;
}

#transcript-content mark.transcript-match.active {
    background: #ffc857;
    outline: 2px solid #e09e1f;
}

/* Edit mode: show both pre and textarea stacked, so search highlights stay visible. */
.transcript-section.editing .transcript-editor {
    margin-top: 8px;
}
