:root {
    --bg: #0b1120;
    --bg-2: #111827;
    --card: rgba(15, 23, 42, 0.78);
    --card-strong: rgba(17, 24, 39, 0.92);
    --text: #e5eefc;
    --accent: #60a5fa;
    --accent-2: #8b5cf6;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --border: rgba(148, 163, 184, 0.16);
    --muted: #94a3b8;
    --shadow: 0 24px 64px rgba(2, 6, 23, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 22%),
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.12), transparent 18%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    min-height: 100vh;
}

a {
    color: #bfdbfe;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 24px 32px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 12, 24, 0.78);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.16);
}

.topbar h1,
.topbar p {
    margin: 0;
}

.brand-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-eyebrow {
    color: #60a5fa;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.topbar h1 {
    font-size: 2rem;
    line-height: 1.05;
}

.topbar p {
    color: var(--muted);
}

.topbar nav,
.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.topbar a,
.topnav a {
    color: #dbeafe;
    text-decoration: none;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: rgba(30, 41, 59, 0.55);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.topbar a:hover,
.topnav a:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(96, 165, 250, 0.32);
    transform: translateY(-1px);
}

.container {
    padding: 24px 32px 48px;
    max-width: 1600px;
    margin: 0 auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

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

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.stat-card h2,
.stat-card p,
.stat-card span {
    margin: 0;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card h2 {
    font-size: 40px;
    color: #7dd3fc;
}

.mini-stat h2 {
    font-size: 28px;
}

.form-grid,
.form-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    margin-right: 8px;
}

.inline-help-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.help-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: rgba(59, 130, 246, 0.1);
    color: #bfdbfe;
    font-weight: 700;
    cursor: help;
}

.help-tip-panel {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 320px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card-strong);
    color: var(--text);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.28);
    font-size: 13px;
    line-height: 1.6;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 20;
}

.help-tip:hover .help-tip-panel,
.help-tip:focus .help-tip-panel,
.help-tip:focus-within .help-tip-panel {
    opacity: 1;
}

.date-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.7);
}

input,
select,
button {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 14px;
    background: rgba(15, 23, 42, 0.88);
    color: var(--text);
}

button {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.26);
}

input::placeholder {
    color: #7c8aa5;
}

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

thead th {
    position: sticky;
    top: 0;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(8px);
    z-index: 1;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-top: 1px solid var(--border);
    vertical-align: top;
}

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

.video-thumb {
    display: block;
    width: 160px;
    max-width: 100%;
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.22);
}

.video-thumb.compact {
    width: 128px;
}

.filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 14px;
}

.summary-pill,
.chip-link,
.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 13px;
}

.summary-pill {
    background: var(--accent-soft);
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.18);
}

.summary-pill-positive {
    background: rgba(16, 185, 129, 0.14);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.28);
}

.summary-pill-negative {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.28);
}

.chip-link {
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.18);
}

.channel-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.channel-card span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-avatar {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.22);
}

.ghost-button {
    color: #dbeafe;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.suggestion-list,
.progress-video-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.suggestion-pill,
.progress-video-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    text-decoration: none;
    font-size: 13px;
}

.suggestion-pill {
    cursor: pointer;
}

.compact-card {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
}

.status-pill.ready {
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.55);
    border-color: rgba(74, 222, 128, 0.3);
}

.status-pill.pending {
    color: #fdba74;
    background: rgba(124, 45, 18, 0.48);
    border-color: rgba(251, 146, 60, 0.3);
}

.status-pill.syncing {
    color: #bfdbfe;
    background: rgba(30, 64, 175, 0.45);
    border-color: rgba(96, 165, 250, 0.3);
}

.status-pill.empty {
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(148, 163, 184, 0.22);
}

.pager {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.pager a {
    color: #bfdbfe;
    text-decoration: none;
    font-weight: 600;
}

.sort-link {
    color: inherit;
    text-decoration: none;
}

.sort-link:hover {
    color: #93c5fd;
}

.trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 14px;
    align-items: end;
}

.analysis-hero {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 20px;
    align-items: start;
}

.analysis-thumb {
    width: 100%;
}

.analysis-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.wide-card {
    grid-column: 1 / -1;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.comment-card {
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.comment-card p {
    margin: 8px 0;
}

.trend-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.trend-bars {
    height: 130px;
    display: flex;
    align-items: end;
    gap: 6px;
}

.bar {
    width: 16px;
    border-radius: 8px 8px 0 0;
    min-height: 4px;
}

.bar.videos,
.swatch.videos {
    background: #b45309;
}

.bar.comments,
.swatch.comments {
    background: #0f766e;
}

.bar.spam,
.swatch.spam {
    background: #b91c1c;
}

.trend-label {
    font-weight: 700;
}

.trend-meta {
    color: var(--muted);
    font-size: 12px;
}

.legend {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    color: var(--muted);
    flex-wrap: wrap;
}

.swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 99px;
    margin-right: 6px;
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .section-head {
        flex-direction: column;
    }

    .analysis-hero {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 16px;
    }
}

.dashboard-shell {
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.16), transparent 30%),
        radial-gradient(circle at top right, rgba(244, 114, 182, 0.12), transparent 24%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%);
    border-radius: 28px;
    padding: 22px;
    color: #e5eefc;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.dashboard-shell .card,
.dashboard-shell .compact-card,
.dashboard-shell .stat-card {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.15);
    color: #e5eefc;
}

.dashboard-shell .muted {
    color: #94a3b8;
}

.dashboard-shell .summary-pill,
.dashboard-shell .ghost-button,
.dashboard-shell .chip-link,
.dashboard-shell .suggestion-pill,
.dashboard-shell .progress-video-item {
    border-color: rgba(96, 165, 250, 0.22);
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
}

.dashboard-shell button {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

.dashboard-shell button.secondary-button {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dashboard-hero h2 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.05;
}

.dashboard-subtitle {
    max-width: 680px;
    margin: 0;
    color: #cbd5e1;
}

.dashboard-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 320px;
    align-items: flex-end;
}

.dashboard-filter-form {
    justify-content: flex-end;
}

.dashboard-filter-form select {
    min-width: 150px;
}

.scope-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-keyword-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.dashboard-actions-row,
.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-actions-row-global {
    grid-template-columns: 1fr;
}

.dashboard-action-card {
    min-height: 210px;
}

.dashboard-action-card-keyword {
    min-height: 0;
    padding: 16px 18px;
}

.dashboard-action-card-global {
    width: 100%;
}

.dashboard-action-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
}

.dashboard-action-layout-keyword {
    grid-template-columns: 1fr;
}

.dashboard-action-layout-global {
    grid-template-columns: minmax(440px, 640px) minmax(360px, 1fr);
    align-items: start;
}

.dashboard-action-column,
.dashboard-status-column {
    min-width: 0;
}

.dashboard-action-column-featured h4 {
    font-size: 28px;
    line-height: 1.05;
    margin-bottom: 12px;
}

.dashboard-action-column-featured h3 {
    font-size: 28px;
    line-height: 1.05;
    margin-bottom: 12px;
}

.dashboard-action-column-featured .muted {
    font-size: 14px;
    line-height: 1.6;
}

.dashboard-action-column-featured input,
.dashboard-action-column-featured select,
.dashboard-action-column-featured button {
    font-size: 16px;
    padding: 14px 16px;
}

.dashboard-action-column-featured .form-inline {
    gap: 14px;
}

.dashboard-action-column-featured input[type="text"] {
    min-width: 280px;
}

.dashboard-action-column-featured .primary-launch-button {
    padding: 14px 22px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.28);
}

.dashboard-subsection {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.dashboard-action-card-keyword .dashboard-subsection {
    margin-top: 10px;
    padding-top: 10px;
}

.dashboard-action-card-keyword .section-head {
    margin-bottom: 8px;
}

.dashboard-action-card-keyword .filter-summary {
    margin-top: 8px;
}

.dashboard-action-card-keyword .form-inline {
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-action-card-keyword .inline-form {
    gap: 6px;
    margin-right: 6px;
}

.dashboard-action-card-keyword button,
.dashboard-action-card-keyword select,
.dashboard-action-card-keyword input {
    padding: 9px 12px;
}

.dashboard-action-card-keyword .refresh-inline-progress {
    margin-top: 10px;
    padding: 12px;
}

.dashboard-action-card-keyword .refresh-inline-head {
    margin-bottom: 8px;
}

.dashboard-action-card-keyword .refresh-inline-stats {
    gap: 10px;
    margin-top: 10px;
}

.dashboard-action-card-keyword .refresh-inline-stats div {
    padding: 8px 10px;
}

.dashboard-subsection h4,
.dashboard-subsection p {
    margin: 0 0 10px;
}

.dashboard-shell .ghost-button.is-active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.35) 0%, rgba(124, 58, 237, 0.35) 100%);
    border-color: rgba(129, 140, 248, 0.45);
    color: #eff6ff;
}

.refresh-inline-progress {
    margin-top: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.42);
    border: 1px solid rgba(96, 165, 250, 0.16);
}

.dashboard-status-column .refresh-inline-progress {
    margin-top: 0;
}

.dashboard-status-column .section-head {
    margin-bottom: 14px;
}

.refresh-inline-progress.is-idle {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.45);
}

.refresh-inline-progress.is-success {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(6, 78, 59, 0.26);
}

.refresh-inline-progress.is-failed {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.24);
}

.refresh-inline-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.refresh-inline-head strong {
    color: #bfdbfe;
    text-transform: capitalize;
}

.refresh-status-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.refresh-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    background: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

.refresh-status-dot.is-running {
    background: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
    animation: refresh-pulse 1.2s ease-in-out infinite;
}

.refresh-status-dot.is-idle {
    background: #64748b;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
    animation: none;
}

.refresh-status-dot.is-success {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
    animation: none;
}

.refresh-status-dot.is-failed {
    background: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.16);
    animation: none;
}

.refresh-inline-head span {
    color: #94a3b8;
    font-size: 13px;
}

.progress-bar-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.12);
}

.progress-bar-fill {
    position: absolute;
    inset: 0;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8 0%, #6366f1 55%, #a855f7 100%);
    animation: dashboard-progress-slide 1.5s ease-in-out infinite;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
}

.refresh-inline-progress.is-success .progress-bar-fill {
    width: 100%;
    transform: none;
    animation: none;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.refresh-inline-progress.is-failed .progress-bar-fill {
    width: 100%;
    transform: none;
    animation: none;
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
}

.refresh-inline-progress.is-idle .progress-bar-fill {
    width: 22%;
    transform: none;
    animation: none;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.3) 0%, rgba(100, 116, 139, 0.65) 100%);
    box-shadow: none;
}

.refresh-inline-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.refresh-inline-stats div {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.refresh-inline-stats strong,
.refresh-inline-stats span {
    display: block;
}

.refresh-inline-stats strong {
    color: #eff6ff;
    font-size: 20px;
}

.refresh-inline-stats span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 12px;
}

@keyframes dashboard-progress-slide {
    0% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(320%);
    }
}

@keyframes refresh-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.18);
        opacity: 0.72;
    }
}

.dashboard-progress-grid {
    margin-bottom: 0;
}

.dashboard-pipeline-row,
.dashboard-kpi-grid {
    margin-bottom: 16px;
}

.dashboard-pipeline-row .dashboard-panel {
    padding: 16px 18px;
}

.pipeline-stage-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.pipeline-stage {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.pipeline-stage-label {
    font-size: 12px;
    color: #94a3b8;
}

.pipeline-stage strong {
    font-size: 18px;
    color: #e2e8f0;
}

.pipeline-stage small {
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.5;
}

.pipeline-stage-success {
    border-color: rgba(16, 185, 129, 0.22);
}

.pipeline-stage-running,
.pipeline-stage-queued {
    border-color: rgba(96, 165, 250, 0.24);
}

.pipeline-stage-failed {
    border-color: rgba(248, 113, 113, 0.24);
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-kpi-card {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dashboard-kpi-card p,
.dashboard-kpi-card h3 {
    margin: 0;
}

.dashboard-kpi-card p {
    color: #94a3b8;
    font-size: 13px;
}

.kpi-label-with-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.info-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.18);
    cursor: help;
}

.dashboard-kpi-card h3 {
    margin-top: 12px;
    font-size: 34px;
    line-height: 1;
}

.kpi-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    font-size: 12px;
    color: #cbd5e1;
}

.delta {
    font-weight: 700;
}

.delta.up {
    color: #34d399;
}

.delta.down {
    color: #f87171;
}

.tone-blue h3 {
    color: #93c5fd;
}

.tone-cyan h3 {
    color: #67e8f9;
}

.tone-violet h3 {
    color: #c4b5fd;
}

.tone-amber h3 {
    color: #fcd34d;
}

.tone-emerald h3 {
    color: #6ee7b7;
}

.tone-rose h3 {
    color: #f9a8d4;
}

.dashboard-trend-row,
.dashboard-main-grid {
    margin-bottom: 16px;
}

.dashboard-change-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px;
    margin-bottom: 16px;
    align-items: stretch;
}

.compact-panel {
    padding: 14px 16px;
    min-width: 0;
}

.change-watch-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.change-watch-card span {
    font-size: 12px;
    color: #94a3b8;
}

.change-watch-card strong {
    font-size: 24px;
    line-height: 1;
}

.change-watch-card small {
    color: #cbd5e1;
    font-size: 12px;
}

.change-watch-card .muted {
    font-size: 12px;
}

.dashboard-distribution-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-panel {
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 22px;
    padding: 18px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.panel-head h3,
.panel-head p,
.dashboard-panel h4 {
    margin: 0;
}

.panel-head p {
    color: #94a3b8;
    font-size: 13px;
}

.line-chart-card {
    position: relative;
    height: 360px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(2, 6, 23, 0.94) 100%);
    border: 1px solid rgba(148, 163, 184, 0.08);
    overflow: hidden;
}

.line-chart-card svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dashboard-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    color: #94a3b8;
}

.legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.35);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-shell .legend-toggle {
    background: rgba(15, 23, 42, 0.35);
}

.legend-toggle.is-active {
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(59, 130, 246, 0.14);
    color: #e2e8f0;
}

.legend-toggle .swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.trend-tooltip {
    position: absolute;
    z-index: 3;
    min-width: 200px;
    max-width: 260px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.94);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.42);
    pointer-events: none;
}

.trend-tooltip[hidden] {
    display: none;
}

.trend-tooltip-date {
    margin-bottom: 10px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
}

.trend-tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    color: #cbd5e1;
    font-size: 12px;
}

.trend-tooltip-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.trend-tooltip strong {
    color: #eff6ff;
    font-size: 12px;
}

.trend-tooltip.is-pinned {
    pointer-events: auto;
}

.trend-tooltip-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.trend-tooltip-actions .ghost-button {
    padding: 6px 10px;
    font-size: 12px;
}

.trend-hint {
    margin: 12px 0 0;
}

.trend-videos {
    background: #60a5fa;
}

.trend-views {
    background: #34d399;
}

.trend-comments {
    background: #22d3ee;
}

.trend-negative {
    background: #f59e0b;
}

.trend-purchase {
    background: #f472b6;
}

.trend-competitor {
    background: #a78bfa;
}

.distribution-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.distribution-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.4fr auto;
    gap: 10px;
    align-items: center;
}

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

.distribution-meta span,
.distribution-value {
    font-size: 12px;
    color: #94a3b8;
}

.distribution-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}

.distribution-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8 0%, #818cf8 100%);
}

.channel-rank-list,
.video-rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-card,
.video-rank-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.rank-card {
    flex-direction: column;
}

.channel-rank-link {
    color: inherit;
    text-decoration: none;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.channel-rank-link:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.2);
    background: rgba(15, 23, 42, 0.62);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
}

.rank-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.16);
}

.rank-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #cbd5e1;
}

.dashboard-thumb {
    width: 112px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.video-rank-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-rank-body a {
    color: #eff6ff;
    text-decoration: none;
    font-weight: 600;
}

.tag-row,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-enrichment-tags {
    margin-top: 8px;
}

.signal-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.signal-card {
    display: block;
    padding: 14px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.08);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.signal-card:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(15, 23, 42, 0.72);
}

.signal-card span,
.signal-card small {
    display: block;
}

.signal-card span,
.signal-card small {
    color: #94a3b8;
}

.signal-card strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 28px;
    color: #eff6ff;
}

.signal-subgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.signal-subsection h4 {
    margin-bottom: 10px;
}

.phrase-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.18);
    color: #dbeafe;
}

.phrase-chip small {
    color: #93c5fd;
}

.llm-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    min-height: 0;
    padding: 4px 0 2px;
}

.llm-cloud-token {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.78), rgba(30, 41, 59, 0.58));
    box-shadow: 0 6px 16px rgba(2, 6, 23, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.llm-cloud-token:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.24);
}

.llm-cloud-token .llm-cloud-word {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.35;
}

.llm-cloud-token small {
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.9;
}

.llm-cloud-bucket {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
}

.llm-cloud-ordered {
    align-items: flex-start;
    gap: 10px 12px;
    min-height: 0;
    padding-top: 4px;
}

.llm-cloud-ordered .llm-cloud-token {
    align-items: center;
    white-space: normal;
    max-width: 100%;
}

.llm-cloud-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(15, 23, 42, 0.88);
    color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    flex: 0 0 auto;
}

.llm-cloud-overall .llm-cloud-token {
    color: #dbeafe;
    border-color: rgba(96, 165, 250, 0.22);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 55%),
        linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.84));
}

.llm-cloud-overall .llm-cloud-token small {
    color: #93c5fd;
}

.llm-cloud-positive .llm-cloud-token {
    color: #dcfce7;
    border-color: rgba(52, 211, 153, 0.24);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 55%),
        linear-gradient(135deg, rgba(20, 83, 45, 0.9), rgba(6, 78, 59, 0.8));
}

.llm-cloud-positive .llm-cloud-token small {
    color: #86efac;
}

.llm-cloud-negative .llm-cloud-token {
    color: #fee2e2;
    border-color: rgba(248, 113, 113, 0.24);
    background:
        radial-gradient(circle at top left, rgba(239, 68, 68, 0.18), transparent 55%),
        linear-gradient(135deg, rgba(127, 29, 29, 0.92), rgba(69, 10, 10, 0.82));
}

.llm-cloud-negative .llm-cloud-token small {
    color: #fca5a5;
}

.wordcloud-status {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.46);
}

.wordcloud-status-head {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 6px;
}

.wordcloud-status-head strong {
    font-size: 0.98rem;
    color: #e2e8f0;
}

.wordcloud-status .muted {
    margin: 0;
}

.wordcloud-status-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.82rem;
    color: #93c5fd;
}

.wordcloud-status-running {
    border-color: rgba(96, 165, 250, 0.28);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 55%),
        rgba(15, 23, 42, 0.52);
}

.wordcloud-status-success {
    border-color: rgba(16, 185, 129, 0.26);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 55%),
        rgba(15, 23, 42, 0.52);
}

.wordcloud-status-failed {
    border-color: rgba(248, 113, 113, 0.28);
    background:
        radial-gradient(circle at top left, rgba(239, 68, 68, 0.12), transparent 55%),
        rgba(15, 23, 42, 0.52);
}

@media (max-width: 720px) {
    .llm-cloud-ordered .llm-cloud-token {
        white-space: normal;
    }

    .wordcloud-status-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.language-cloud-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.language-cloud-card {
    padding: 14px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-signout {
    margin: 0;
}

.ghost-button {
    border: 1px solid rgba(96, 165, 250, 0.24);
    background: rgba(15, 23, 42, 0.5);
    color: #dbeafe;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.auth-page-shell {
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-card {
    width: min(520px, 100%);
    padding: 32px;
    border-radius: 28px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 45%),
        rgba(15, 23, 42, 0.86);
    box-shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

.login-card h1 {
    margin: 6px 0 10px;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: #cbd5e1;
    font-weight: 600;
}

.login-form input {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.55);
    color: #f8fafc;
    padding: 14px 16px;
}

.login-meta {
    margin-top: 18px;
    display: grid;
    gap: 8px;
}

.status-banner-error {
    margin-top: 16px;
    border: 1px solid rgba(248, 113, 113, 0.32);
    background: rgba(127, 29, 29, 0.25);
    color: #fecaca;
    padding: 12px 14px;
    border-radius: 14px;
}

.dashboard-table th,
.dashboard-table td {
    border-top-color: rgba(148, 163, 184, 0.08);
}

.dashboard-table thead th {
    background: rgba(15, 23, 42, 0.98);
}

@media (max-width: 1200px) {
    .pipeline-stage-grid,
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-distribution-grid,
    .dashboard-secondary-grid,
    .dashboard-actions-row,
    .dashboard-action-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-hero {
        flex-direction: column;
    }

    .dashboard-toolbar {
        align-items: stretch;
        min-width: 0;
    }

    .pipeline-stage-grid,
    .dashboard-kpi-grid,
    .dashboard-change-row,
    .dashboard-distribution-grid,
    .signal-card-grid,
    .signal-subgrid {
        grid-template-columns: 1fr;
    }

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

    .video-rank-card {
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
}
