:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.48;
    color: #17213a;
    background: #f5f7fb;
    --ink: #17213a;
    --muted: #68748a;
    --subtle: #8a95a8;
    --line: #dfe5ee;
    --line-strong: #cbd4e2;
    --canvas: #f5f7fb;
    --surface: #fff;
    --surface-soft: #f8fafd;
    --nav: #101a31;
    --nav-soft: #202d49;
    --primary: #315bd6;
    --primary-dark: #2346ae;
    --success: #147a4c;
    --warning: #8a5a00;
    --danger: #aa2b24;
    --focus: #f4b400;
    --sidebar: 240px;
    --sidebar-collapsed: 68px;
    --radius-sm: 7px;
    --radius: 10px;
    --radius-lg: 13px;
    --shadow: 0 2px 8px rgba(24, 39, 75, .045);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 0; background: var(--canvas); color: var(--ink); }
a { color: #2854c6; }
button, input, select, textarea { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 8px 12px; border-radius: var(--radius-sm); background: #fff; color: #111; }
.skip-link:focus { top: 12px; }
.system-banner { padding: 6px 16px; text-align: center; font-size: 12px; background: #e9f0ff; color: #233e7d; }
.system-banner.warning { background: #fff3d6; color: #704b00; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 16px 12px 12px; display: flex; flex-direction: column; overflow-y: auto; z-index: 20; background: var(--nav); color: #e9eefb; transition: width .18s ease; }
.brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 6px 14px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #5f80ee, #41b6a6); color: #fff; font-weight: 900; }
.brand-copy { min-width: 0; white-space: nowrap; }
.brand-copy strong { display: block; font-size: 15px; }
.brand-copy small { display: block; font-size: 11px; color: #aebbd3; }
.sidebar-toggle { margin-left: auto; width: 32px; height: 32px; padding: 0; border: 1px solid #40506d; background: transparent; color: #dce5f8; }
.sidebar-toggle svg, .mobile-drawer summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.sidebar-toggle:hover { background: var(--nav-soft); }
.workspace-chip { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; margin: 0 2px 12px; border: 1px solid #33425f; border-radius: var(--radius); background: var(--nav-soft); overflow: hidden; }
.workspace-avatar { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 7px; background: #344567; font-size: 11px; font-weight: 800; }
.workspace-copy { min-width: 0; white-space: nowrap; }
.workspace-copy small { display: block; color: #aebbd3; font-size: 10px; }
.workspace-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.primary-nav { display: grid; gap: 2px; }
.primary-nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 9px; border-radius: 8px; color: #cbd5e8; text-decoration: none; font-size: 13px; white-space: nowrap; }
.primary-nav a:hover, .primary-nav a.active { background: var(--nav-soft); color: #fff; }
.nav-icon { display: inline-grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar-bottom { margin-top: auto; padding-top: 12px; }
.user-menu { position: relative; }
.user-menu > summary { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 7px 9px; list-style: none; cursor: pointer; border: 1px solid #34435f; border-radius: var(--radius); color: #e7edf9; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-card { margin-top: 7px; padding: 10px; border: 1px solid #34435f; border-radius: var(--radius); background: #18243d; }
.user-menu-card a, .user-menu-card button { width: 100%; margin-top: 6px; }
.locale-form { margin: 0; }
.locale-form label { color: #c6d0e4; }
.locale-form select { margin: 4px 0 0; background: #1b2843; color: #fff; border-color: #40506d; }

.app-main { min-width: 0; margin-left: var(--sidebar); transition: margin-left .18s ease; }
.app-footer { display: flex; gap: 16px; margin-left: var(--sidebar); padding: 16px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; transition: margin-left .18s ease; }
.app-footer a { color: #53617a; }
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .app-main, .sidebar-collapsed .app-footer { margin-left: var(--sidebar-collapsed); }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .workspace-copy, .sidebar-collapsed .nav-label, .sidebar-collapsed .user-label { display: none; }
.sidebar-collapsed .brand-row { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .sidebar-toggle { position: absolute; top: 58px; margin: 0; }
.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar-collapsed .workspace-chip { justify-content: center; margin-top: 36px; padding-inline: 5px; }
.sidebar-collapsed .primary-nav a { justify-content: center; padding-inline: 5px; }
.sidebar-collapsed .primary-nav a:hover::after, .sidebar-collapsed .primary-nav a:focus-visible::after { content: attr(data-label); position: fixed; left: 62px; z-index: 50; padding: 6px 9px; border-radius: 6px; background: #0d1528; color: #fff; font-size: 12px; box-shadow: 0 5px 18px rgba(0,0,0,.22); }
.sidebar-collapsed .user-menu > summary { justify-content: center; padding-inline: 5px; }
.sidebar-collapsed .user-menu-card { position: fixed; left: 62px; bottom: 12px; width: 210px; z-index: 60; }

.mobile-header { display: none; }
.content-wrap { width: min(100%, 1640px); margin: 0 auto; padding: 28px 28px 44px; }
.analysis-subnav { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-gutter: stable; scroll-snap-type: x proximity; padding: 12px 28px 6px; }
.analysis-subnav a { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #48566d; text-decoration: none; font-size: 12px; }
.analysis-subnav a:hover { border-color: #aebbd0; color: var(--primary); }
.analysis-subnav a.active { border-color: #a8b8d8; background: #eef3ff; color: #244eb8; font-weight: 700; }
.analytics-hub { margin-bottom: 20px; }
.feature-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.feature-card:hover, .feature-card:focus-visible { border-color: #9eb1d3; transform: translateY(-1px); }
.feature-card h3 { margin-top: 0; }
.feature-card p { color: var(--muted); }
.text-link { color: var(--primary); font-weight: 650; text-decoration: none; }
.bounded-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow-wrap: anywhere; }
.comparison-arrow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-header h1, h1 { margin: 0 0 6px; color: var(--ink); font-size: clamp(26px, 2.4vw, 31px); line-height: 1.18; letter-spacing: -.025em; }
.page-header p { max-width: 780px; margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 4px !important; color: #4365be !important; font-size: 11px !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.25; letter-spacing: -.012em; }
h3 { margin: 18px 0 8px; font-size: 16px; line-height: 1.3; }
p { margin: 0 0 12px; }

.panel, .card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: 18px; margin-bottom: 16px; }
.card { padding: 15px; }
.panel.compact { padding: 14px; }
.panel.advanced, details.advanced { background: var(--surface-soft); box-shadow: none; }
.grid, .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.kpi-card { min-height: 94px; padding: 14px; }
.settings-grid, .source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.source-card { display: flex; flex-direction: column; margin-bottom: 0; }
.source-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
.source-actions form.inline { margin: 0; }
.source-account { padding: 9px 0; border-top: 1px solid #edf0f5; }
.source-account small { display: block; margin-top: 2px; }
.value { font-size: clamp(26px, 2.6vw, 34px); font-weight: 760; line-height: 1.15; letter-spacing: -.03em; }
.value.compact { font-size: 22px; }
.metric-label, .muted { color: var(--muted); }
.metric-label { font-size: 12px; font-weight: 650; }
.meta { color: var(--muted); font-size: 12px; }
.ok { color: var(--success); }
.error { color: var(--danger); }
.change { color: var(--muted); font-size: 12px; }

.notice, .alert { padding: 11px 13px; margin: 0 0 14px; border: 1px solid #d6e2ff; border-radius: var(--radius); background: #edf3ff; color: #29447e; }
.alert-success { border-color: #cdebd9; background: #eaf7f0; color: #11633e; }
.alert-warning { border-color: #f0deb3; background: #fff7e5; color: #714c00; }
.alert-error, .notice.error { border-color: #f2cbc7; background: #fff0ef; color: #8e2018; }
.empty-state { padding: 22px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }
.status-pill, .badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 8px; border-radius: 999px; background: #edf1f7; color: #455269; font-size: 11px; font-weight: 750; line-height: 1.45; white-space: nowrap; }
.status-pill.positive, .badge.ok { background: #e7f5ed; color: #11633e; }
.status-pill.warning, .badge.warning { background: #fff3d6; color: #714c00; }
.status-pill.failure, .badge.bad { background: #fdebea; color: #98251d; }
.badge.ai { background: #eceaff; color: #3d3ca7; }

button, .button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border: 0; border-radius: 8px; background: var(--primary); color: #fff !important; text-decoration: none; cursor: pointer; font-size: 13px; font-weight: 680; line-height: 1.2; }
button:hover, .button:hover { background: var(--primary-dark); }
.button.secondary, button.secondary { background: #eef2f8; color: #34425b !important; }
.button.subtle, button.subtle { border: 1px solid var(--line); background: #fff; color: #34425b !important; }
.button.danger, button.danger { background: var(--danger); }
.button.ghost, button.ghost { border: 1px solid #43516d; background: transparent; color: #dce5f8 !important; }
.button.small, button.small { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.icon-button { width: 38px; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .55; }
form.inline { display: inline-flex; align-items: center; gap: 7px; margin: 3px 5px 3px 0; }
form.inline input[type=hidden] { display: none; }
label { color: #354158; font-size: 13px; font-weight: 650; }
input, select, textarea { display: block; width: 100%; min-height: 38px; margin: 4px 0 10px; padding: 7px 10px; border: 1px solid #b8c3d4; border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 88px; }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; min-height: auto; margin: 0 6px 0 0; }

.filter-toolbar { margin-bottom: 16px; padding: 12px 14px; }
.filter-primary { display: grid; grid-template-columns: minmax(210px, 2fr) repeat(2, minmax(130px, 1fr)) auto auto; gap: 10px; align-items: end; }
.filter-primary label, .filter-more label { min-width: 0; }
.filter-primary input, .filter-primary select, .filter-more input, .filter-more select { margin-bottom: 0; }
.filter-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.filter-more > summary { cursor: pointer; color: #405175; font-size: 12px; font-weight: 700; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; align-items: end; margin-top: 10px; }
.active-filter-count { min-width: 20px; justify-content: center; }

.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.panel > .table-scroll { border: 0; border-radius: 0; }
.table-scroll table { min-width: 720px; }
.product-table-scroll table { min-width: 1100px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e8edf4; vertical-align: top; text-align: left; }
th { position: sticky; top: 0; z-index: 1; background: #f8fafd; color: #526078; font-size: 11px; font-weight: 760; letter-spacing: .035em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.action-cell { width: 1%; white-space: nowrap; }
td, code, p, li { overflow-wrap: anywhere; }
code { font-size: .84em; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 12px 0 0; }
.segment-dimension-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.action-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.action-group form { margin: 0; }
.action-group > .button, .action-group > button, .action-group form > button { width: auto; max-width: 100%; white-space: normal; }
.checkbox-row { display: flex; align-items: flex-start; gap: 7px; margin: 10px 0; }
.checkbox-row input { flex: 0 0 auto; margin-top: 2px; }
.campaign-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.campaign-type-card { position: relative; min-width: 0; cursor: pointer; }
.campaign-type-card > input { position: absolute; opacity: 0; }
.campaign-type-card > span { display: flex; min-height: 132px; flex-direction: column; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.campaign-type-card > input:checked + span { border-color: #5277d9; box-shadow: 0 0 0 2px #dce6ff; }
.campaign-type-card > input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.campaign-type-card small { flex: 1; color: var(--muted); line-height: 1.4; }
.campaign-type-card.unavailable { cursor: not-allowed; opacity: .68; }
.target-search { max-width: 440px; }
.disclosure-body > form > fieldset, [data-plan-field="retail"] fieldset { margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.disclosure-body > form > fieldset legend, [data-plan-field="retail"] fieldset legend { padding: 0 7px; color: var(--text); font-size: 14px; font-weight: 760; }
.target-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 7px; max-height: 230px; overflow-y: auto; margin-bottom: 10px; padding: 4px; }
.target-options > label, .facet-options > label { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.target-options > label span { min-width: 0; overflow-wrap: anywhere; }
.target-options > label small { margin-left: auto; color: var(--muted); }
.target-options > label.active { border-color: #5277d9; box-shadow: 0 0 0 2px #dce6ff; }
.selected-targets { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; margin: 5px 0 9px; }
.target-chip { min-height: 30px; padding: 4px 9px; border: 1px solid #b8c7e7; border-radius: 999px; background: #edf3ff; color: #294b9d !important; font-size: 12px; }
.facet-options { display: grid; gap: 5px; max-height: 190px; overflow-y: auto; }
.landing-picker { position: relative; min-width: 0; }
.landing-picker > label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 700; }
.autocomplete-results { position: absolute; inset: auto 0 auto 0; z-index: 35; max-height: 280px; overflow-y: auto; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(35, 49, 79, .18); }
.autocomplete-results > button { display: block; width: 100%; min-height: 0; padding: 9px 11px; border: 0; border-bottom: 1px solid #edf0f5; border-radius: 0; background: #fff; color: var(--text) !important; text-align: left; }
.autocomplete-results > button:last-child { border-bottom: 0; }
.autocomplete-results > button:hover, .autocomplete-results > button.active { background: #edf3ff; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.autocomplete-results strong, .autocomplete-results small { display: block; overflow-wrap: anywhere; }
.autocomplete-results small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.compact-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.compact-metrics > span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.info-tip { position: relative; display: inline-grid; place-items: center; width: 24px; min-height: 24px; padding: 4px; border: 0; background: transparent; color: #62708a !important; vertical-align: middle; }
.info-tip:hover, .info-tip:focus-visible, .info-tip[aria-expanded="true"] { background: #edf2fc; color: #294fae !important; }
.info-tip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.info-tip span[role="tooltip"] { position: absolute; left: 50%; top: 28px; z-index: 80; display: none; width: min(280px, 80vw); padding: 8px 10px; transform: translateX(-50%); border-radius: 7px; background: #16213a; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 12px; font-weight: 500; line-height: 1.4; text-align: left; }
.info-tip:hover span, .info-tip:focus-visible span, .info-tip[aria-expanded="true"] span { display: block; }
.getting-started-list, .checklist { margin: 0; padding: 0; list-style: none; }
.getting-started-list { display: grid; gap: 9px; }
.getting-started-list li { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.step-number { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: #e9efff; color: #244eb8; font-weight: 800; }
.checklist { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.checklist li { color: var(--muted); }
.checklist li.done { color: var(--success); }
.onboarding[data-complete="1"] { padding-block: 12px; }
.onboarding[data-complete="1"] .checklist { font-size: 12px; }

details.disclosure, details.advanced { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); }
details.disclosure > summary, details.advanced > summary { padding: 10px 12px; cursor: pointer; color: #405175; font-size: 13px; font-weight: 700; }
.disclosure-body { padding: 0 12px 12px; }
pre.technical { max-width: 100%; max-height: 360px; overflow: auto; padding: 12px; border-radius: 8px; background: #101827; color: #dce6f8; font-size: 12px; }
.structured-diff { display: grid; gap: 8px; }
.diff-row { display: grid; grid-template-columns: minmax(120px, 1fr) 1.5fr auto 1.5fr; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.diff-arrow { color: var(--muted); }
.definition-list { margin: 0; }
.definition-list div { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid #edf0f5; }
.definition-list div:last-child { border: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; min-width: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #e7ebf2; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, #315bd6, #35a694); }
.quota { display: grid; gap: 7px; }
.quota-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; }
.tabs a { flex: 0 0 auto; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #48566d; text-decoration: none; font-size: 12px; }
.tabs a.active, .tabs a:hover { border-color: #a8b8d8; background: #eef3ff; color: #244eb8; }
.term-help { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%; background: #e6ecf8; color: #2e4f9d !important; font-size: 11px; vertical-align: middle; }
.term-help:hover::after, .term-help:focus::after { content: attr(data-tip); position: absolute; left: 50%; top: 24px; z-index: 40; width: min(260px, 80vw); padding: 8px 10px; transform: translateX(-50%); border-radius: 7px; background: #16213a; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 12px; font-weight: 500; }
.auth-shell { max-width: 520px; margin: 44px auto; padding: 18px; }
.auth-brand { margin-bottom: 18px; text-align: center; }
.auth-footer { display: flex; justify-content: center; gap: 16px; padding: 20px; }
.mobile-drawer { display: none; }
.error-reference code { letter-spacing: .08em; }
.properties label { display: block; margin: 7px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }

@media (max-width: 1100px) {
    .content-wrap { padding: 24px 20px 40px; }
    .source-grid { grid-template-columns: 1fr; }
    .filter-primary { grid-template-columns: minmax(180px, 2fr) minmax(130px, 1fr) auto auto; }
    .filter-primary > :nth-child(3) { display: none; }
}

@media (max-width: 800px) {
    :root { font-size: 14px; }
    .sidebar { display: none; }
    .app-main, .app-footer, .sidebar-collapsed .app-main, .sidebar-collapsed .app-footer { margin-left: 0; }
    .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: var(--nav); color: #fff; }
    .mobile-header .brand-row { padding: 0; }
    .mobile-drawer { display: block; }
    .mobile-drawer summary { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; list-style: none; cursor: pointer; border: 1px solid #4c5b78; border-radius: 8px; }
    .mobile-drawer summary::-webkit-details-marker { display: none; }
    .mobile-drawer[open] .mobile-menu { position: absolute; top: 56px; right: 8px; width: min(330px, calc(100vw - 16px)); max-height: calc(100vh - 68px); overflow-y: auto; padding: 10px; border-radius: 11px; background: #15213a; box-shadow: 0 16px 38px rgba(0,0,0,.3); }
    .mobile-menu a { display: flex; align-items: center; min-height: 40px; padding: 8px 10px; border-radius: 7px; color: #eef3ff; text-decoration: none; }
    .mobile-menu a.active { background: #253554; }
    .mobile-menu form { margin-top: 8px; }
    .content-wrap { padding: 20px 12px 34px; }
    .page-header { display: block; margin-bottom: 16px; }
    .page-header h1, h1 { font-size: 25px; }
    .panel { padding: 14px; margin-bottom: 12px; }
    .card { padding: 13px; }
    .grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .value { font-size: 24px; }
    .analysis-subnav { padding: 10px 12px 0; }
    .filter-primary { grid-template-columns: 1fr; }
    .filter-primary > label:not(:first-child) { display: block; }
    .filter-primary > button, .filter-primary > .button { width: 100%; min-width: auto; }
    .filter-grid { grid-template-columns: 1fr; }
    .filter-more[open] .filter-grid { display: grid; }
    .source-actions { align-items: stretch; }
    .source-actions > *, .source-actions form.inline, .source-actions .button { flex: 1 1 auto; }
    .app-footer { flex-wrap: wrap; padding: 16px 12px; }
    .diff-row { grid-template-columns: 1fr; }
    .diff-arrow { transform: rotate(90deg); }
    .pagination { justify-content: space-between; }
    .campaign-type-grid { grid-template-columns: 1fr; }
    .campaign-type-card > span { min-height: 0; }
    .action-group { align-items: stretch; }
    .action-group > .button, .action-group > button, .action-group > form { flex: 1 1 150px; }
    .action-group > form > button { width: 100%; }
    .target-options { grid-template-columns: 1fr; }
    .term-help:hover::after, .term-help:focus::after { left: 0; transform: none; }
}

@media (max-width: 420px) {
    .grid, .kpi-grid { grid-template-columns: 1fr 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .content-wrap { overflow-x: hidden; }
    .button, button { max-width: 100%; }
    .action-group > .button, .action-group > button, .action-group > form { flex-basis: 100%; width: 100%; }
    .info-tip span[role="tooltip"] { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.analytics-hub-page .analysis-subnav { display: none; }
