:root {
    --surface: #f6f9ff;
    --surface-low: #eef4fc;
    --surface-lowest: #ffffff;
    --surface-high: #e3e9f1;
    --surface-highest: #dde3eb;
    --primary: #0058be;
    --primary-container: #2170e4;
    --secondary: #495e8a;
    --tertiary: #924700;
    --text: #161c22;
    --text-soft: #424754;
    --outline-soft: rgba(194, 198, 214, 0.2);
    --shadow: 0 12px 40px rgba(22, 28, 34, 0.06);
    --radius: 12px;
    --radius-lg: 24px;
    --container: 1200px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); font-family: "Inter", sans-serif; line-height: 1.6; }
h1, h2, h3, .brand { font-family: "Manrope", sans-serif; margin: 0; }
a { color: inherit; text-decoration: none; }
.container { width: min(calc(100% - 48px), var(--container)); margin: 0 auto; }
.page-shell { padding-top: 92px; }
.site-header { position: fixed; top: 0; width: 100%; z-index: 10; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(24px); box-shadow: 0 6px 24px rgba(22, 28, 34, 0.04); }
.nav-row, .footer-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 0; }
.nav-links, .footer-links, .chip-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.04em; }
.nav-link { color: var(--text-soft); font-weight: 700; }
.nav-link.is-active, .nav-link:hover, .link-action { color: var(--primary); }
.hero-section, .section { padding: 48px 0; }
.section-tight { padding-top: 16px; }
.hero-grid, .overview-grid, .dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: stretch; }
.hero-copy { padding: 24px 0; }
.hero-copy h1, .section-heading h1 { font-size: clamp(2.75rem, 6vw, 4.75rem); line-height: 1.05; letter-spacing: -0.05em; margin-bottom: 16px; }
.section-heading h2, .panel-header h2 { font-size: 1.5rem; letter-spacing: -0.03em; }
.lead, .section-heading p { color: var(--text-soft); max-width: 760px; }
.section-heading { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.section-heading.align-center { align-items: center; text-align: center; }
.section-heading.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.eyebrow { display: inline-flex; align-items: center; width: fit-content; padding: 6px 12px; border-radius: 999px; background: rgba(182, 204, 255, 0.35); color: var(--secondary); font-size: 0.875rem; font-weight: 600; }
.panel { background: var(--surface-lowest); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel-accent { background: linear-gradient(135deg, #0058be 0%, #2170e4 100%); color: #ffffff; }
.panel-accent .button-light, .panel-accent .callout { color: var(--text); }
.panel-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.hero-form, .dashboard-form { display: grid; grid-template-columns: 1fr 220px auto; gap: 16px; align-items: end; margin-top: 24px; }
.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-group-grow { min-width: 0; }
.field-group label { font-size: 0.875rem; font-weight: 600; color: var(--text-soft); }
.field-input, .field-select { width: 100%; border: 1px solid var(--outline-soft); border-radius: var(--radius); padding: 14px 16px; background: rgba(255, 255, 255, 0.86); color: var(--text); font: inherit; box-shadow: 0 8px 24px rgba(22, 28, 34, 0.04); }
.field-input:focus, .field-select:focus { outline: 2px solid rgba(0, 88, 190, 0.2); border-color: rgba(0, 88, 190, 0.4); }
.button { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 10px; padding: 14px 20px; font: inherit; font-weight: 700; cursor: pointer; }
.button-primary { color: #ffffff; background: linear-gradient(135deg, #0058be 0%, #2170e4 100%); }
.button-light { background: #ffffff; color: var(--primary); }
.chip { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; background: var(--surface-high); color: var(--text-soft); font-size: 0.8rem; font-weight: 600; }
.ordered-list { margin: 0; padding-left: 20px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.service-card:hover { transform: translateY(-4px); }
.insight-banner { display: flex; justify-content: space-between; align-items: center; gap: 24px; background: linear-gradient(135deg, #0058be 0%, #2170e4 100%); color: #ffffff; padding: 32px; border-radius: var(--radius-lg); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.metric-card { min-height: 150px; }
.metric-label { color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; }
.metric-value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: 8px 0; }
.timeline-stack, .sidebar-stack, .trend-list { display: flex; flex-direction: column; gap: 18px; }
.timeline-label-row, .trend-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.progress-track { width: 100%; height: 10px; background: var(--surface-high); border-radius: 999px; overflow: hidden; }
.progress-track.compact { width: 90px; height: 8px; }
.progress-fill { height: 100%; background: linear-gradient(135deg, #0058be 0%, #2170e4 100%); }
.callout { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.92); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0 14px; }
.data-table th { text-align: left; font-size: 0.8rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.08em; padding-bottom: 8px; }
.data-table td { background: var(--surface-low); padding: 16px; }
.data-table td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; font-weight: 700; }
.data-table td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.progress-inline { display: flex; align-items: center; gap: 10px; }
.accent-text { color: var(--tertiary); font-weight: 700; }
.panel-wide { min-width: 0; }
.chart-bars, .micro-bars { display: flex; align-items: end; gap: 8px; }
.chart-bars { height: 240px; margin-top: 12px; }
.chart-bars-tall { height: 320px; }
.chart-bar, .micro-bars span { flex: 1; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, rgba(33, 112, 228, 0.7), rgba(0, 88, 190, 1)); }
.micro-bars { height: 88px; margin: 16px 0; }
.chart-bars-dense { gap: 2px; }
.chart-bars-dense .chart-bar { border-radius: 3px 3px 0 0; min-width: 4px; }
.chart-axis { display: flex; gap: 8px; margin-top: 8px; font-size: 0.72rem; color: var(--text-soft); }
.chart-axis span { flex: 1; text-align: center; letter-spacing: 0.02em; }
.chart-axis-hide { visibility: hidden; }
.chart-caption { margin-top: 12px; font-size: 0.85rem; color: var(--text-soft); }
.panel-subtitle { margin: 4px 0 0; font-size: 0.9rem; color: var(--text-soft); }
.trend-main-panel { margin-bottom: 24px; }
.sparkline { display: inline-flex; align-items: end; gap: 2px; width: 120px; height: 28px; }
.sparkline span { flex: 1; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, rgba(33, 112, 228, 0.75), rgba(0, 88, 190, 1)); min-width: 3px; }
.sparkline-empty { color: var(--text-soft); font-size: 0.85rem; }
.video-card { padding: 16px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.video-card:hover { transform: translateY(-3px); box-shadow: 0 18px 48px rgba(22, 28, 34, 0.10); }
.video-link { display: block; color: inherit; }
.video-link h3 { margin-top: 8px; font-size: 1.05rem; line-height: 1.35; min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-thumb { position: relative; display: block; height: 180px; padding: 0; border-radius: 12px; background: linear-gradient(135deg, rgba(33, 112, 228, 0.16), rgba(73, 94, 138, 0.32)); background-size: cover; background-position: center; margin-bottom: 16px; overflow: hidden; }
.video-thumb-img { background-color: #000; }
.video-rank { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; }
.video-duration { position: absolute; bottom: 10px; right: 10px; padding: 4px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.source-fill-search_terms { background: linear-gradient(135deg, #0058be, #2170e4); }
.source-fill-trends { background: linear-gradient(135deg, #924700, #c56a1e); }
.source-fill-youtube { background: linear-gradient(135deg, #b00020, #e63253); }
.region-code { font-style: normal; margin-left: 6px; padding: 2px 6px; border-radius: 6px; background: var(--surface-high); color: var(--text-soft); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.site-footer { margin-top: 48px; background: #f4f7fb; }
.footer-copy { color: var(--text-soft); margin: 8px 0 0; }
.narrow-container { max-width: 540px; margin: 0 auto; }
.auth-panel { padding: 32px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.auth-form .field-input { width: 100%; }
.auth-form button { align-self: flex-start; }
.auth-alt { margin-top: 18px; color: var(--text-soft); }
.auth-alt a, .field-help a { color: var(--primary); font-weight: 700; }
.auth-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.field-help { margin: 4px 0 0; font-size: 0.8rem; color: var(--text-soft); }
.field-error { margin: 4px 0 0; font-size: 0.85rem; color: #b00020; font-weight: 600; }
.form-errors { padding: 12px 16px; border-radius: 10px; background: rgba(176, 0, 32, 0.08); color: #b00020; font-weight: 600; }
.nav-user { color: var(--text-soft); font-weight: 600; }
.logout-form { margin: 0; }
.button-compact { padding: 8px 14px; font-size: 0.9rem; }
.pagination { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.alert { margin: 12px 0; padding: 12px 16px; border-radius: 10px; background: rgba(33, 112, 228, 0.08); color: var(--primary); font-weight: 600; }
.alert.alert-warning { background: rgba(255, 165, 0, 0.12); color: var(--tertiary); }
.empty-state { padding: 32px; text-align: center; color: var(--text-soft); }

@media (max-width: 1080px) {
    .hero-grid, .overview-grid, .dashboard-grid, .metric-grid, .card-grid-three, .card-grid-four { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .nav-row, .footer-row, .insight-banner { flex-direction: column; align-items: flex-start; }
    .nav-links { width: 100%; }
    .hero-form, .dashboard-form { grid-template-columns: 1fr; }
}
