:root {
  --ink: #171813;
  --muted: #74746d;
  --paper: #f4f1e9;
  --panel: #fffdf8;
  --line: #d9d5ca;
  --coral: #e95f45;
  --coral-soft: #ffe3da;
  --acid: #d9f35a;
  --green: #11624b;
  --green-soft: #dceee6;
  --blue: #355fb3;
  --blue-soft: #e5ecfb;
  --amber: #a96913;
  --amber-soft: #f7ead0;
  --shadow: 0 10px 30px rgba(38, 36, 29, 0.07);
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { width: 100%; max-width: 100%; overflow-x: hidden; }
body { margin: 0; width: 100%; max-width: 100%; min-width: 320px; overflow-x: hidden; background: var(--paper); }
button, select, input { font: inherit; }
button { color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { display: block; width: 100%; max-width: 100vw; min-height: 100vh; overflow-x: clip; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; height: 100dvh; display: flex; flex-direction: column; padding: 24px 16px; background: var(--ink); color: #f9f6ed; z-index: 20; overflow-y: auto; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 18px; font-size: 14px; line-height: 1.12; font-weight: 700; }
.brand small { color: #9d9d95; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--acid); color: var(--ink); border-radius: 50% 50% 50% 8px; font-family: "DM Mono"; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #aaa99f; padding: 11px 12px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; text-align: left; font-size: 12px; font-weight: 600; }
.nav-item:hover, .nav-item.active { background: #2a2b25; color: white; }
.nav-number { font-family: "DM Mono"; font-size: 9px; color: #686961; }
.nav-item.active .nav-number { color: var(--acid); }
.sidebar-report-context { display: flex; gap: 10px; align-items: center; margin: 0 0 18px; padding: 12px 10px; border: 1px solid #34352f; border-radius: 12px; background: #20211c; }
.sidebar-report-context strong, .sidebar-report-context small { display: block; font-size: 10px; }
.sidebar-report-context small { margin-top: 3px; color: #85867e; line-height: 1.35; }
.sidebar-management { margin-top: auto; padding: 14px 0 0; border-top: 1px solid #383932; }
.management-label { margin: 0 0 8px 12px; color: #686961; font: 800 8px "DM Mono"; letter-spacing: .12em; text-transform: uppercase; }
.management-item { background: #20211c; color: #d9d5ca; }
.management-item:hover, .management-item.active { background: var(--acid); color: var(--ink); }
.management-item.active .nav-number, .management-item:hover .nav-number { color: var(--ink); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 5px rgba(217,243,90,.1); }
.main { min-width: 0; max-width: 100%; margin-left: 230px; overflow-x: clip; }
.topbar { min-height: 104px; display: flex; justify-content: space-between; align-items: center; padding: 24px 34px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 4px; color: var(--coral); font: 500 10px "DM Mono"; text-transform: uppercase; letter-spacing: .14em; }
h1 { margin: 0; font: 600 clamp(28px, 3vw, 40px) "Newsreader"; letter-spacing: -.025em; }
h2 { margin: 0; font: 600 22px "Newsreader"; letter-spacing: -.015em; }
h3 { margin: 0; font-size: 12px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.formula-button, .ghost-button, .upload-button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 9px 12px; cursor: pointer; font-size: 11px; font-weight: 700; }
.formula-button:hover, .ghost-button:hover, .upload-button:hover { background: var(--panel); }
.ghost-button:disabled { cursor: not-allowed; opacity: .45; background: transparent; }
.upload-button { background: var(--ink); border-color: var(--ink); color: white; white-space: nowrap; }
.upload-button:hover { background: #2a2b25; }
.ghost-button.danger, .page-button.danger { color: #9d402e; border-color: #e3b9ad; }
.ghost-button.danger:hover, .page-button.danger:hover { background: var(--coral-soft); }
.avatar { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--coral); color: white; font: 500 11px "DM Mono"; }
.settings-trigger { display: grid; place-items: center; cursor: pointer; font-size: 17px; line-height: 1; }
.settings-trigger:hover { background: var(--ink); color: var(--acid); }
.avatar.active { outline: 2px solid var(--acid); outline-offset: 2px; background: var(--ink); color: var(--acid); }
.role-badge { display: inline-flex; align-items: center; height: 34px; padding: 0 10px; border: 1px solid #d6d2c7; border-radius: 999px; background: var(--panel); color: var(--muted); font: 800 9px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.role-badge.previewing { border-color: #d7ef7a; background: #f5ffd8; color: var(--ink); }
.menu-button { display: none; border: 0; background: none; font-size: 20px; }
.filter-bar { position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); grid-template-areas:
  "view from to scope scope"
  "channel conversion source medium campaign"
  "status spend cards vertical approach"; gap: 8px; align-items: end; padding: 12px 34px; background: rgba(244,241,233,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.filter-group { min-width: 0; }
.filter-bar.reports-mode { display: block; padding: 12px 34px; }
.reports-scope-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reports-scope-strip span { display: inline-flex; gap: 6px; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 10px; }
.reports-scope-strip strong { color: var(--ink); font: 800 9px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.filter-view { grid-area: view; }
.filter-from { grid-area: from; }
.filter-to { grid-area: to; }
.filter-scope { grid-area: scope; }
.filter-channel { grid-area: channel; }
.filter-conversion { grid-area: conversion; }
.filter-source { grid-area: source; }
.filter-medium { grid-area: medium; }
.filter-campaign { grid-area: campaign; }
.filter-status { grid-area: status; }
.filter-spend { grid-area: spend; }
.filter-cards { grid-area: cards; }
.filter-vertical { grid-area: vertical; }
.filter-approach { grid-area: approach; }
.filter-group label { display: block; margin: 0 0 4px 3px; font: 500 8px "DM Mono"; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.filter-group select, .filter-group input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); padding: 0 28px 0 9px; font-size: 10px; color: var(--ink); }
.date-filter-group input { padding-right: 9px; }
.filter-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); overflow: hidden; height: 34px; }
.mode-button { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 0 10px; font-size: 9px; cursor: pointer; }
.mode-button:last-child { border-right: 0; }
.mode-button.active { background: var(--ink); color: white; }
.scope-toggle-group { align-self: end; }
.scope-ticket-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; height: 34px; }
.scope-ticket { width: 100%; max-width: none; height: 34px; min-height: 34px; padding: 0 2px; gap: 7px; align-items: center; border: 0; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; }
.scope-ticket .ticket-mark { width: 18px; height: 18px; border-radius: 5px; font-size: 11px; }
.scope-copy { display: grid; gap: 3px; min-width: 0; }
.scope-title { display: block; font: 800 9px/1 "DM Mono"; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-ticket strong { font: 800 9px/1 "DM Mono"; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-ticket small { margin-top: 3px; color: var(--muted); font: 500 8px/1 "DM Mono"; }
.content { width: 100%; max-width: 1600px; min-width: 0; padding: 24px 34px 54px; margin: 0 auto; overflow-x: clip; }
.content > * { min-width: 0; }
.auth-mode .sidebar, .auth-mode .topbar, .auth-mode .filter-bar { display: none; }
.auth-mode .main { margin-left: 0; min-height: 100vh; display: grid; place-items: center; }
.auth-mode .content { max-width: none; padding: 24px; }
.auth-screen { min-height: calc(100vh - 48px); display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.auth-brand { padding: 0 0 22px; color: var(--ink); }
.auth-brand small { color: var(--muted); }
.auth-card h2 { margin: 0 0 8px; font-size: 34px; }
.auth-copy { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.auth-form input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #fffaf0; color: var(--ink); padding: 0 11px; font: 600 12px "Manrope"; text-transform: none; letter-spacing: 0; }
.auth-form button { width: 100%; height: 42px; justify-content: center; }
.auth-message { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 11px; line-height: 1.45; }
.auth-message.error { background: var(--coral-soft); color: #9d402e; border: 1px solid #e3b9ad; }
.auth-message.success { background: var(--green-soft); color: var(--green); border: 1px solid #b6dac9; }
.loading-state, .empty-state, .error-state { min-height: 400px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.loading-state span { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--coral); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-orbit { display: grid; place-items: center; width: 70px; height: 70px; border: 1px dashed var(--line); border-radius: 50%; margin-bottom: 15px; font: 500 13px "DM Mono"; }
.empty-state h2, .error-state h2 { margin-bottom: 6px; }
.empty-state p, .error-state p { max-width: 380px; font-size: 12px; line-height: 1.6; }
.section-intro { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; align-items: end; }
.section-intro.compact-intro { margin: 6px 0 10px; }
.section-intro p { max-width: 660px; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.data-stamp { flex: 0 0 auto; font: 500 9px "DM Mono"; color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.executive-summary-block { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.executive-health-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.executive-health-grid .kpi-card { min-height: 124px; }
.executive-health-grid .kpi-value { margin-top: 12px; font-size: 31px; }
.executive-panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.executive-list-card, .executive-next-card { min-height: 100%; }
.executive-list { display: grid; gap: 8px; }
.executive-list-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid #ece8dd; }
.executive-list-row:first-child { border-top: 0; padding-top: 0; }
.executive-list-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--blue); }
.executive-list-row.risk .executive-list-dot { background: var(--coral); }
.executive-list-row.watch .executive-list-dot { background: var(--amber); }
.executive-list-row.ok .executive-list-dot { background: var(--green); }
.executive-list-row strong { display: block; font-size: 10px; }
.executive-list-row p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.executive-list-row > span:last-child { padding: 4px 7px; border-radius: 99px; background: #f0ede5; color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.executive-next-list { display: grid; gap: 8px; }
.executive-next-action { display: grid; gap: 4px; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbf8f1; text-align: left; cursor: pointer; }
.executive-next-action:hover { border-color: #c9c2b4; background: #fffdf8; }
.executive-next-action strong { color: var(--ink); font-size: 10px; }
.executive-next-action span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.roi-source-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-stack { display: grid; gap: 15px; margin-bottom: 10px; }
.kpi-row { position: relative; display: grid; gap: 7px; align-items: stretch; }
.kpi-row-title { display: inline-flex; width: fit-content; align-items: center; gap: 7px; padding: 0 2px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font: 800 8px/1 "DM Mono"; text-transform: uppercase; letter-spacing: .14em; }
.kpi-row-title::before { content: ""; width: 16px; height: 1px; background: currentColor; opacity: .45; }
.kpi-row-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-width: 0; overflow: visible; }
.kpi-row.base-row .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-row.existing-accounts-row .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-row.sql-reached-row, .kpi-row.sql-row { position: relative; }
.kpi-row.sql-reached-row .kpi-row-title, .kpi-row.sql-row .kpi-row-title { color: #31558f; }
.kpi-row.sql-reached-row .kpi-row-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-row.sql-row .kpi-row-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-row.client-outcome-row .kpi-row-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-row.budget-row .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-row.sql-reached-row .kpi-row-cards::before, .kpi-row.sql-row .kpi-row-cards::before { content: ""; position: absolute; left: 0; right: 0; top: 19px; bottom: 0; border: 1px dashed rgba(53,95,179,.28); border-radius: 12px; pointer-events: none; }
.kpi-row.sql-reached-row .kpi-card, .kpi-row.sql-row .kpi-card { z-index: 1; }
.kpi-row.sql-reached-row .kpi-card:hover, .kpi-row.sql-reached-row .kpi-card:focus-within,
.kpi-row.sql-row .kpi-card:hover, .kpi-row.sql-row .kpi-card:focus-within { z-index: 90; }
.kpi-stack.compact .kpi-card { min-height: 124px; }
.kpi-card { position: relative; overflow: visible; min-height: 138px; padding: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); animation: rise .45s both; animation-delay: var(--delay); }
.kpi-card:hover, .kpi-card:focus-within { z-index: 90; }
.kpi-card.wide-kpi { grid-column: span 2; }
.kpi-card.wide-kpi .kpi-value { white-space: nowrap; }
.kpi-card.split-kpi .kpi-value { white-space: nowrap; letter-spacing: -.04em; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.kpi-card.accent { background: var(--ink); color: white; border-color: var(--ink); }
.kpi-card.accent::after { content: ""; position: absolute; width: 60px; height: 60px; right: -15px; top: -15px; border-radius: 50%; background: var(--acid); }
.kpi-card.accent.no-orbit::after { display: none; }
.kpi-card.eligible-kpi, .kpi-card.client-kpi { box-shadow: 0 14px 38px rgba(23,24,19,.13); }
.kpi-card.parent-kpi { border-color: #b8c6e5; background: #f6f8fd; box-shadow: none; }
.kpi-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font: 500 9px "DM Mono"; text-transform: uppercase; letter-spacing: .07em; }
.accent .kpi-label { color: #aaa99f; }
.kpi-value { display: block; margin-top: 15px; font: 600 35px "Newsreader"; letter-spacing: -.03em; }
.kpi-note { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.kpi-note-lines { display: block; line-height: 1.45; }
.accent .kpi-note { color: #aaa99f; }
.info-button { position: relative; z-index: 120; width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; cursor: help; font: 800 10px "DM Mono"; padding: 0; text-transform: none; }
.info-button em { position: absolute; right: 0; top: 24px; z-index: 220; display: none; width: min(270px, 70vw); padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; color: var(--ink); box-shadow: 0 16px 40px rgba(38,36,29,.18); font: 500 10px/1.45 "Manrope"; text-align: left; letter-spacing: 0; text-transform: none; font-style: normal; white-space: pre-line; }
.kpi-card.accent .info-button em { color: var(--ink); }
.info-button:hover em, .info-button:focus-visible em { display: block; }
.learn-button { position: absolute; right: 14px; bottom: 11px; left: auto; border: 0; background: transparent; color: var(--blue); padding: 0; cursor: pointer; font: 800 9px "DM Mono"; text-align: right; text-transform: uppercase; letter-spacing: .04em; }
.learn-button:hover { text-decoration: underline; }
.kpi-card.accent .learn-button { color: var(--acid); }
.delta { color: var(--green); }
.lead-source-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.lead-source-card { position: relative; min-height: 150px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); animation: rise .45s both; animation-delay: var(--delay); }
.lead-source-card-head span { display: block; color: var(--muted); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .1em; }
.lead-source-card-head strong { display: block; margin-top: 7px; font: 600 22px/1.05 "Newsreader"; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-source-card-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
.lead-source-card-metrics div { min-width: 0; padding-top: 8px; border-top: 1px solid #ece8dd; }
.lead-source-card-metrics small, .lead-source-card-metrics b { display: block; }
.lead-source-card-metrics small { color: var(--muted); font: 700 7px/1.2 "DM Mono"; text-transform: uppercase; letter-spacing: .04em; }
.lead-source-card-metrics b { margin-top: 4px; font: 600 20px/1 "Newsreader"; }
.source-learn-button { position: absolute; }
.subtab-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,.72); }
.subtab-button { border: 0; border-radius: 9px; background: transparent; padding: 9px 12px; color: var(--muted); cursor: pointer; font: 800 9px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.subtab-button:hover { background: #f1eee6; color: var(--ink); }
.subtab-button.active { background: var(--ink); color: #fffdf8; }
.channel-roi-subtabs { position: sticky; top: 103px; z-index: 10; backdrop-filter: blur(12px); }
.roi-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.roi-hero-card { min-height: 118px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.roi-hero-card:first-child { background: var(--ink); border-color: var(--ink); color: white; }
.roi-hero-card.warning { background: #fff8ea; border-color: #e5d1a8; }
.roi-hero-card span, .roi-hero-card small { display: block; color: var(--muted); }
.roi-hero-card:first-child span, .roi-hero-card:first-child small { color: rgba(255,255,255,.68); }
.roi-hero-card span { font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.roi-hero-card strong { display: block; margin-top: 14px; font: 700 24px/.95 "Newsreader"; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-hero-card small { margin-top: 9px; font-size: 9px; line-height: 1.35; }
.roi-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.roi-source-card { display: grid; gap: 10px; min-height: 174px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); animation: rise .45s both; animation-delay: var(--delay); }
.roi-source-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.roi-source-head > div { min-width: 0; }
.roi-source-head span { display: block; color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .1em; }
.roi-source-head strong { display: block; margin-top: 5px; font: 700 20px/1 "Newsreader"; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-source-head .decision { flex: 0 0 auto; }
.roi-source-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.roi-source-metrics div { min-width: 0; padding-top: 8px; border-top: 1px solid #ece8dd; }
.roi-source-metrics small, .roi-source-metrics b { display: block; }
.roi-source-metrics small { color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.roi-source-metrics b { margin-top: 4px; font: 800 15px "Newsreader"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-metric-source { display: block; margin-top: 3px; color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-main-metrics { display: grid; grid-template-columns: 1.15fr .95fr .7fr .7fr; gap: 6px; }
.roi-main-metrics div, .roi-unit-strip div { min-width: 0; padding: 7px 8px; border-radius: 9px; background: #f6f2e8; }
.roi-main-metrics small, .roi-unit-strip small { display: block; color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-main-metrics b, .roi-unit-strip b { display: block; margin-top: 3px; font: 800 17px/1 "Newsreader"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-unit-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.roi-unit-strip div { background: #fffdf8; border: 1px solid #eeeae1; }
.roi-unit-strip b { font-size: 14px; }
.roi-mini-funnel { display: grid; grid-template-columns: 1fr 14px 1fr 14px 1fr; align-items: center; gap: 4px; padding: 7px 8px; border: 1px dashed #d9d3c6; border-radius: 10px; background: #fbf8f1; }
.roi-mini-funnel.conversion-only { grid-template-columns: 1fr 14px 1fr; }
.roi-mini-funnel div { min-width: 0; }
.roi-mini-funnel span { display: block; color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-mini-funnel strong { display: block; margin-top: 2px; font: 800 16px/1 "Newsreader"; }
.roi-mini-funnel em { color: #aaa398; font: 800 10px "DM Mono"; text-align: center; font-style: normal; }
.roi-rate-line { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; }
.roi-rate-line span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roi-card-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: auto; }
.roi-card-footer.compact { gap: 8px; }
.learn-button.static { position: static; flex: 0 0 auto; }
.roi-outcome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.roi-leader-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.kpi-grid.roi-diagnostic-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.roi-matrix-table { min-width: 3050px; border-collapse: separate; border-spacing: 0; }
.roi-matrix-table th, .roi-matrix-table td,
.roi-campaign-table th, .roi-campaign-table td,
.budget-setup-table th, .budget-setup-table td { border-right: 1px solid #eeeae1; }
.roi-matrix-table thead tr:nth-child(2) th { top: 29px; }
.roi-matrix-table th:first-child, .roi-matrix-table td:first-child { position: sticky; left: 0; z-index: 4; min-width: 210px; background: #fffdf8; box-shadow: 1px 0 0 #e2ded4; }
.roi-matrix-table thead th:first-child { z-index: 6; background: #f6f2e8; }
.roi-matrix-table tfoot td { position: sticky; bottom: 0; background: #f6f2e8; border-top: 1px solid #cfc7b5; font-weight: 900; color: var(--ink); }
.roi-matrix-table tfoot td:first-child { z-index: 4; background: #fffdf8; }
.budget-source-pill { display: inline-flex; max-width: 150px; padding: 4px 7px; border-radius: 99px; background: #ede9df; color: var(--muted); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-source-pill.connected { background: #dff4ec; color: #0c6a50; }
.budget-source-pill.missing { background: #fff0da; color: #9c5b12; }
.budget-detail-cell { min-width: 220px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; line-height: 1.35; }
.roi-campaign-table { min-width: 1320px; table-layout: fixed; }
.roi-campaign-table th:nth-child(1), .roi-campaign-table td:nth-child(1) { width: 270px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.roi-campaign-table th:nth-child(2), .roi-campaign-table td:nth-child(2) { width: 170px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.roi-campaign-table td strong { white-space: normal; overflow-wrap: anywhere; }
.budget-setup-table { min-width: 980px; table-layout: fixed; }
.budget-input, .budget-note-input, .budget-select { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 9px; font-size: 10px; color: var(--ink); }
.budget-input { text-align: right; font-family: "DM Mono"; }
.budget-input:disabled, .budget-note-input:disabled, .budget-select:disabled { background: #f1eee6; color: #aaa49a; cursor: not-allowed; }
.budget-save-strip { display: flex; gap: 10px; align-items: center; margin: 0 17px 12px; padding: 10px 12px; border: 1px solid #cfe0c9; border-radius: 9px; background: #f1f8ed; color: #315b33; font-size: 10px; }
.budget-save-strip.warning { border-color: #e4cf9e; background: #fff7df; color: #755414; }
.budget-save-strip strong { font: 800 9px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.budget-save-strip span { color: inherit; opacity: .82; }
.upload-button.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.budget-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.paid-media-attach-panel { margin-bottom: 12px; background: linear-gradient(135deg, #fffdf8, #f4f8ff); }
.paid-media-attach-panel.google-placeholder { background: linear-gradient(135deg, #fffdf8, #fff7e8); }
.paid-media-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.attached-source-card { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 12px; padding: 12px 13px; border: 1px solid #c9d7f0; border-radius: 10px; background: #eef4ff; }
.attached-source-card strong, .attached-source-card span { display: block; }
.attached-source-card strong { font-size: 11px; }
.attached-source-card span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.paid-media-summary-grid { margin-top: 8px; }
.meta-funnel-panel { margin-top: 8px; border-color: #cfe0c9; background: linear-gradient(135deg, #f7fbf2, #fffdf8); }
.meta-funnel-panel .embedded-source-quality { margin: 12px 0 0; padding: 13px 0 0; border: 0; border-top: 1px solid #dfe7d7; border-radius: 0; background: transparent; box-shadow: none; }
.meta-funnel-panel .embedded-source-quality .panel-head { margin-bottom: 10px; }
.meta-funnel-panel .embedded-source-quality .source-quality-card { background: rgba(255,253,248,.82); }
.meta-funnel-sections { display: grid; grid-template-columns: 1fr; gap: 8px; }
.meta-funnel-section { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: stretch; min-width: 0; padding: 8px; border: 1px solid #dfe7d7; border-radius: 12px; background: rgba(255,255,255,.45); }
.meta-funnel-section h4 { display: flex; align-items: center; margin: 0; padding: 8px 9px; border-right: 1px solid #dfe7d7; color: #58704c; font: 900 8px/1.25 "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.meta-funnel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 7px; }
.meta-funnel-step { position: relative; min-height: 68px; padding: 8px 9px; border: 1px solid #dfe7d7; border-radius: 9px; background: rgba(255,255,255,.76); }
.meta-funnel-step span, .meta-funnel-step small { display: block; color: var(--muted); }
.meta-funnel-step span { font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.meta-funnel-step strong { display: block; margin-top: 6px; font: 700 18px/.92 "Newsreader"; color: var(--ink); letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-funnel-step small { margin-top: 5px; font-size: 7px; line-height: 1.25; }
.meta-funnel-step.priority { border-color: #171813; background: #171813; box-shadow: 0 14px 34px rgba(23,24,19,.16); }
.meta-funnel-step.priority strong { color: #fffdf8; }
.meta-funnel-step.priority small, .meta-funnel-step.priority .meta-metric-label { color: #dfe856; }
.meta-funnel-step.priority .metric-info-button { border-color: rgba(223,232,86,.55); background: rgba(255,255,255,.08); color: #dfe856; }
.meta-funnel-step.diagnostic { border-color: #e0bd6a; background: #fff7df; box-shadow: inset 4px 0 0 #e0bd6a; }
.meta-funnel-step.diagnostic strong { color: #7b4d11; }
.meta-funnel-step.diagnostic .meta-metric-label { color: #7b4d11; }
.meta-funnel-step.quality { min-height: 58px; background: #fbf8f1; border-style: dashed; }
.meta-funnel-step.quality strong { font-size: 16px; }
.meta-metric-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; color: var(--muted); font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.meta-metric-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-info-button { position: relative; flex: 0 0 auto; display: inline-grid; place-items: center; width: 15px; height: 15px; border: 1px solid #b8b5aa; border-radius: 50%; background: rgba(255,253,248,.75); color: #77746b; font: 900 8px "DM Mono"; cursor: help; }
.metric-info-button > span { display: block; color: inherit; font: inherit; letter-spacing: 0; line-height: 1; text-transform: none; }
.metric-info-button em { position: absolute; right: -5px; bottom: calc(100% + 7px); z-index: 30; width: min(280px, 70vw); padding: 9px 10px; border: 1px solid var(--ink); border-radius: 8px; background: #171813; color: #fffdf8; box-shadow: 0 12px 34px rgba(0,0,0,.22); font: 500 9px/1.45 "Manrope"; letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease; }
.metric-info-button em::after { content: ""; position: absolute; right: 10px; top: 100%; border: 6px solid transparent; border-top-color: var(--ink); }
.metric-info-button:hover, .metric-info-button:focus-visible { border-color: var(--ink); color: var(--ink); background: var(--lime); outline: none; }
.metric-info-button:hover em, .metric-info-button:focus-visible em { opacity: 1; transform: translateY(0); }
.meta-efficiency-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.meta-efficiency-strip > div { padding: 10px; border: 1px dashed #cbd8c2; border-radius: 9px; background: rgba(255,255,255,.56); }
.meta-efficiency-strip span, .meta-efficiency-strip small { display: block; color: var(--muted); font-size: 8px; }
.meta-efficiency-strip strong { display: block; margin-top: 4px; font: 700 18px/.95 "Newsreader"; color: var(--ink); }
.meta-allocation-panel { margin-top: 10px; }
.paid-media-table { min-width: 3400px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.paid-media-table th, .paid-media-table td { border-right: 1px solid #eeeae1; }
.paid-media-table th:nth-child(1), .paid-media-table td:nth-child(1) { position: sticky; left: 0; z-index: 4; width: 280px; background: #fffdf8; box-shadow: 1px 0 0 #e2ded4; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.paid-media-table thead th:nth-child(1) { z-index: 6; background: #f6f2e8; }
.paid-media-table th:nth-last-child(-n+3), .paid-media-table td:nth-last-child(-n+3) { width: 160px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.paid-media-table tfoot td { position: sticky; bottom: 0; z-index: 3; background: #f6f2e8; border-top: 1px solid #cfc7b5; font-weight: 900; color: var(--ink); }
.paid-media-table tfoot td:nth-child(1) { z-index: 5; background: #fffdf8; }
.match-pill { display: inline-flex; padding: 4px 7px; border-radius: 99px; background: var(--green-soft); color: var(--green); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.match-pill.unmatched { background: var(--amber-soft); color: var(--amber); }
.ai-insights-panel { margin-top: 12px; }
.ai-insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ai-insight-card { position: relative; overflow: hidden; min-width: 0; }
.ai-insight-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--blue); }
.ai-insight-card.media-buyer::before { background: #e0bd6a; }
.ai-insight-card.cmo::before { background: #171813; }
.ai-insight-card.ceo::before { background: var(--green); }
.ai-insight-card.media-buyer { background: linear-gradient(135deg, #fffdf8, #fff7df); }
.ai-insight-card.cmo { border-color: #171813; background: linear-gradient(135deg, #fffdf8, #f2f1ec); }
.ai-insight-card.ceo { background: linear-gradient(135deg, #fffdf8, #f0f8ed); }
.ai-insight-list { display: grid; gap: 10px; }
.ai-insight-item { padding-top: 10px; border-top: 1px solid #eee7d9; }
.ai-insight-item:first-child { padding-top: 0; border-top: 0; }
.ai-insight-item > span { display: block; margin-bottom: 5px; color: var(--muted); font: 900 7px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.ai-insight-item strong { display: block; font-size: 10px; line-height: 1.45; color: var(--ink); }
.ai-insight-item p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.ai-insight-item.bottleneck { padding: 10px; border: 1px solid #e4d9c8; border-radius: 9px; background: rgba(255,253,248,.72); }
.ai-insight-item.bottleneck span { color: var(--coral); }
.ai-insight-item.actions ul { display: grid; gap: 6px; margin: 6px 0 0 15px; padding: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-insight-item.actions li::marker { color: var(--coral); }
.ai-insight-item.success { padding: 9px 10px; border: 1px dashed #cbd8c2; border-radius: 9px; background: rgba(241,248,237,.58); }
.ai-insight-item.success span { color: var(--green); }
.meta-source-report { display: grid; gap: 10px; margin: 12px 0; }
.meta-source-intro { margin-top: 12px; }
.meta-source-summary-grid { margin-bottom: 0; }
.meta-unit-economics-panel { border-color: #cfe0c9; background: linear-gradient(135deg, #f7fbf2, #fffdf8); }
.meta-unit-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.meta-unit-card { min-height: 84px; padding: 10px; border: 1px solid #dfe7d7; border-radius: 9px; background: rgba(255,255,255,.72); }
.meta-unit-card span, .meta-unit-card small { display: block; color: var(--muted); }
.meta-unit-card span { font: 800 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.meta-unit-card strong { display: block; margin-top: 8px; font: 700 20px/.95 "Newsreader"; color: var(--ink); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-unit-card small { margin-top: 7px; font-size: 8px; line-height: 1.25; }
.meta-source-matrix-panel { border-color: #bfd0ed; background: linear-gradient(135deg, #fffdf8, #f4f8ff); }
.meta-source-campaign-table { min-width: 3300px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.meta-source-campaign-table th, .meta-source-campaign-table td { border-right: 1px solid #eeeae1; }
.meta-source-campaign-table th:nth-child(1), .meta-source-campaign-table td:nth-child(1) { position: sticky; left: 0; z-index: 4; width: 290px; background: #fffdf8; box-shadow: 1px 0 0 #e2ded4; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.meta-source-campaign-table thead th:nth-child(1) { z-index: 6; background: #f6f2e8; }
.meta-source-campaign-table tfoot td:nth-child(1) { z-index: 5; background: #fffdf8; }
.meta-source-campaign-table th:nth-child(2), .meta-source-campaign-table td:nth-child(2) { width: 160px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.meta-source-campaign-table tfoot td { position: sticky; bottom: 0; background: #f6f2e8; border-top: 1px solid #cfc7b5; font-weight: 900; color: var(--ink); }
.campaign-name-line { display: flex; align-items: flex-start; gap: 7px; min-width: 0; line-height: 1.35; }
.campaign-name-line strong { min-width: 0; overflow-wrap: anywhere; }
.campaign-channel-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 3px 6px; border-radius: 999px; background: #eef1ea; color: #5b5d54; font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; }
.campaign-channel-badge.yt { background: #ffe4df; color: #b12418; border: 1px solid #f1b2a8; }
.utm-drilldown-table { min-width: 2380px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.utm-drilldown-table th, .utm-drilldown-table td { border-right: 1px solid #eeeae1; }
.utm-drilldown-table th:nth-child(1), .utm-drilldown-table td:nth-child(1) { position: sticky; left: 0; z-index: 4; width: 300px; background: #fffdf8; box-shadow: 1px 0 0 #e2ded4; }
.utm-drilldown-table th:nth-child(2), .utm-drilldown-table td:nth-child(2) { position: sticky; left: 300px; z-index: 4; width: 185px; background: #fffdf8; box-shadow: 1px 0 0 #e2ded4; white-space: normal; overflow-wrap: anywhere; }
.utm-drilldown-table thead th:nth-child(1), .utm-drilldown-table thead th:nth-child(2) { z-index: 6; background: #f6f2e8; }
.utm-drilldown-table .campaign-row td { background: #f4f0e6; font-weight: 900; color: var(--ink); border-top: 2px solid #d7d0bf; }
.utm-drilldown-table .campaign-row td:nth-child(1), .utm-drilldown-table .campaign-row td:nth-child(2) { background: #f4f0e6; }
.utm-drilldown-table .content-row td { background: #fffdf8; }
.utm-drilldown-table .content-row td:first-child { background: linear-gradient(90deg, #fffdf8 0 28px, #d7deef 28px 30px, #fffdf8 30px); }
.utm-drilldown-table .term-row td { background: #fbfaf5; color: #4d4c46; }
.utm-drilldown-table .term-row td:first-child { background: linear-gradient(90deg, #fbfaf5 0 28px, #d7deef 28px 30px, #fbfaf5 30px 46px, #e8dfcd 46px 48px, #fbfaf5 48px); }
.utm-drilldown-table .single-parent-term-row td:first-child { background: linear-gradient(90deg, #fbfaf5 0 28px, #d7deef 28px 30px, #fbfaf5 30px); }
.utm-level { display: grid; gap: 2px; font: 700 8px "DM Mono"; letter-spacing: .04em; }
.utm-level strong { color: var(--ink); font: 800 10px/1.25 "Manrope"; overflow-wrap: anywhere; }
.utm-level small { color: var(--muted); font: 700 7px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.utm-level.leaf.depth-1 { padding-left: 24px; color: var(--muted); }
.utm-level.leaf.depth-1::before { content: "↳"; color: var(--blue); }
.utm-level.leaf.depth-2 { padding-left: 35px; color: var(--muted); }
.utm-level.leaf.depth-2::before { content: "↳"; color: var(--muted); }
.utm-tree-toggle { width: 100%; min-height: 32px; display: grid; grid-template-columns: 18px minmax(0, 1fr); grid-template-areas: "caret title" "caret count"; column-gap: 6px; align-items: center; border: 0; background: transparent; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.utm-tree-toggle.depth-1 { padding-left: 24px; }
.utm-tree-toggle strong { grid-area: title; font: 800 10px/1.25 "Manrope"; letter-spacing: -.01em; white-space: normal; overflow-wrap: anywhere; }
.utm-tree-toggle small { grid-area: count; margin-top: 2px; color: var(--muted); font: 600 7px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; }
.utm-caret { grid-area: caret; display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #c8c3b6; border-radius: 50%; background: #fffdf8; color: var(--ink); font: 900 14px/1 "Manrope"; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.utm-tree-toggle.open .utm-caret { transform: rotate(90deg); background: var(--acid); border-color: #c1de45; }
.utm-tree-toggle:hover .utm-caret { border-color: var(--blue); }
.spend-basis-pill { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green); font: 700 8px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; white-space: normal; line-height: 1.25; }
.spend-basis-pill.estimated { background: var(--amber-soft); color: var(--amber); }
.meta-diagnostic-grid { margin-top: 0; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr); gap: 10px; min-width: 0; margin-top: 10px; }
.panel-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 17px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; margin-bottom: 16px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.panel-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.export-csv-button { border-color: #c9d99a; color: #1f4d34; background: #f7ffe6; white-space: nowrap; }
.export-csv-button:hover { background: #eaff9a; border-color: #a9c94e; }
.export-contacts-button { border-color: #e3b9ad; color: #9d402e; background: #fff3ee; }
.export-contacts-button:hover { background: var(--coral-soft); border-color: #d9917f; }
.micro-label { font: 500 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.funnel { display: grid; gap: 7px; }
.funnel-row { display: grid; grid-template-columns: 100px minmax(90px, 1fr) 45px 55px; gap: 10px; align-items: center; font-size: 10px; }
.funnel-bar-track { height: 30px; background: #eeece5; border-radius: 5px; overflow: hidden; }
.funnel-bar { height: 100%; width: var(--width); min-width: 3px; background: var(--color); border-radius: 5px; animation: grow .65s both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.funnel-count { text-align: right; font: 500 12px "DM Mono"; }
.funnel-rate { text-align: right; color: var(--muted); font: 400 9px "DM Mono"; }
.qualification-flow-panel { margin: 10px 0; }
.flow-total { align-self: start; padding: 6px 9px; border-radius: 99px; background: var(--ink); color: #fff; font: 500 9px "DM Mono"; white-space: nowrap; }
.flow-table-wrap { overflow: auto; }
.flow-table { min-width: 680px; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.flow-table th { position: static; padding: 9px 10px; border: 1px solid #d5d1c6; border-right: 0; background: #f1eee6; color: var(--ink); font: 800 10px "Manrope"; text-transform: none; letter-spacing: 0; text-align: center; }
.flow-table th:last-child { border-right: 1px solid #d5d1c6; }
.flow-table td { height: 44px; padding: 0; border-top: 0; border-left: 1px solid #ddd8cd; border-bottom: 1px solid #ddd8cd; white-space: normal; }
.flow-table td:last-child { border-right: 1px solid #ddd8cd; }
.flow-cell > div { min-height: 43px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 10px; }
.flow-cell strong { font-size: 12px; }
.flow-cell span { color: var(--muted); font: 500 9px "DM Mono"; white-space: nowrap; }
.flow-cell.new { background: #f2f3ed; }
.flow-cell.sql { background: #dfeeda; }
.flow-cell.client { background: #9bc985; color: #10240f; }
.flow-cell.soft { background: #dfeeda; }
.flow-empty { background: rgba(255,255,255,.36); }
.insight-list { display: grid; gap: 9px; }
.insight { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.insight:first-child { border-top: 0; padding-top: 0; }
.insight-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 3px; background: var(--coral); }
.insight.good .insight-dot { background: var(--green); }
.insight.warn .insight-dot { background: var(--amber); }
.insight strong { display: block; font-size: 10px; }
.insight p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.insight-tag, .decision { padding: 4px 7px; border-radius: 99px; font: 500 8px "DM Mono"; background: var(--coral-soft); color: #a83c28; white-space: nowrap; }
.decision.scale { background: var(--green-soft); color: var(--green); }
.decision.pause { background: var(--coral-soft); color: #a83c28; }
.decision.investigate { background: var(--amber-soft); color: var(--amber); }
.decision.optimize { background: var(--blue-soft); color: var(--blue); }
.decision.working { background: var(--green-soft); color: var(--green); }
.decision.monitor { background: #ebe9e2; color: #55554f; }
.decision.add-budget { background: #171813; color: #f9f6ed; }
.warning-strip { display: flex; gap: 10px; align-items: center; padding: 12px 14px; margin: 10px 0; border: 1px solid #e3c98f; border-radius: 8px; background: #fff6df; color: #725018; font-size: 10px; }
.warning-strip strong { font-size: 10px; }
.warning-strip span { font-size: 9px; opacity: .85; }
.channel-drill-strip { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 13px 15px; margin: 0 0 10px; border: 1px solid var(--blue); border-radius: 10px; background: linear-gradient(135deg, var(--blue-soft), #fffdf8); color: #173875; }
.channel-drill-strip strong, .channel-drill-strip span { display: block; }
.channel-drill-strip strong { font-size: 11px; }
.channel-drill-strip span { margin-top: 3px; color: #405c92; font-size: 9px; }
.channel-drill-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.export-pdf-button { border-color: #b6c7ef; color: #173875; background: #f6f8ff; white-space: nowrap; }
.export-pdf-button:hover { background: #e5ecfb; border-color: #7899e0; }
.report-control-box { margin: 0 0 14px; }
.check-ticket { display: inline-grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; max-width: 560px; padding: 12px 14px; border: 1px dashed #beb8aa; border-radius: 10px; background: rgba(255,253,248,.72); cursor: pointer; }
.check-ticket input { position: absolute; opacity: 0; pointer-events: none; }
.ticket-mark { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: transparent; font: 900 13px "DM Mono"; }
.check-ticket input:checked + .ticket-mark { background: var(--ink); border-color: var(--ink); color: var(--acid); }
.check-ticket strong, .check-ticket small { display: block; }
.check-ticket strong { font-size: 11px; }
.check-ticket small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.filter-group label.check-ticket.scope-ticket,
.check-ticket.scope-ticket { display: grid; grid-template-columns: 18px minmax(0, 1fr); width: 100%; max-width: none; height: 34px; min-height: 34px; margin: 0; padding: 0 2px; gap: 7px; align-items: center; border: 0; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; }
.check-ticket.scope-ticket .ticket-mark { width: 18px; height: 18px; border-radius: 5px; font-size: 11px; }
.check-ticket.scope-ticket .scope-copy { display: grid; grid-template-rows: auto auto; gap: 3px; min-width: 0; align-self: center; }
.check-ticket.scope-ticket .scope-title { display: block; font: 800 9px/1 "DM Mono"; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-ticket.scope-ticket strong { font: 800 9px/1 "DM Mono"; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-ticket.scope-ticket small { margin-top: 0; color: var(--muted); font: 500 8px/1 "DM Mono"; }
.import-strip { display: flex; gap: 10px; align-items: center; padding: 12px 14px; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 10px; }
.import-strip strong { font-size: 10px; white-space: nowrap; }
.import-strip span { font-size: 9px; color: var(--muted); }
.import-strip.success { border-color: #b7d7c8; background: var(--green-soft); color: var(--green); }
.import-strip.error { border-color: #e9b6aa; background: var(--coral-soft); color: #8f2d23; }
.import-strip.loading { border-color: #d9ca93; background: #fff6df; color: #725018; }
.drill-strip { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue-soft); color: #173875; font-size: 10px; }
.drill-strip strong { font-size: 11px; }
.drill-strip span { flex: 1; color: #405c92; }
.chart-list { display: grid; gap: 9px; }
.chart-row { display: grid; grid-template-columns: minmax(80px, 130px) 1fr minmax(42px, max-content); gap: 10px; align-items: center; font-size: 9px; }
.chart-row-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-track { height: 9px; background: #ece9e0; border-radius: 99px; overflow: hidden; }
.chart-fill { width: var(--width); height: 100%; border-radius: 99px; background: var(--coral); }
.chart-value { text-align: right; font-family: "DM Mono"; }
.chart-value-secondary { display: block; margin-top: 2px; color: var(--muted); font: 600 8px/1.1 "DM Mono"; text-transform: uppercase; letter-spacing: .04em; }
.channel-rule-list { gap: 11px; }
.channel-rule-list .chart-row { grid-template-columns: minmax(210px, 1fr) minmax(72px, 28%) 36px; align-items: start; }
.channel-rule-list .chart-row-name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.channel-rule-list .chart-track { margin-top: 3px; }
.table-panel { padding: 0; overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); align-items: center; }
.table-controls { display: flex; gap: 8px; align-items: center; }
.table-toolbar input { width: min(300px, 34vw); height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: #fff; font-size: 10px; }
.table-toolbar select { height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 26px 0 9px; background: #fff; font-size: 10px; }
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: auto; max-height: 620px; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; font-size: 9px; }
th { position: sticky; top: 0; z-index: 2; padding: 10px 12px; background: #f1eee6; color: var(--muted); text-align: left; font: 500 8px "DM Mono"; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.sort-button { width: 100%; display: inline-flex; justify-content: flex-start; align-items: center; gap: 6px; border: 0; background: transparent; color: inherit; padding: 0; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: inherit; }
.sort-button em { color: #a7a299; font-style: normal; font-size: 8px; }
.sort-button.active { color: var(--ink); }
.number .sort-button { justify-content: flex-end; }
td { padding: 10px 12px; border-top: 1px solid #e8e5dc; white-space: nowrap; }
.raw-leads-table { min-width: 3440px; table-layout: fixed; }
.lead-records-table { min-width: 2880px; }
.source-focused-table { min-width: 2920px; }
.raw-leads-table th, .raw-leads-table td { vertical-align: top; }
.raw-leads-table .raw-multiline-col,
.raw-leads-table .raw-multiline-cell,
.raw-leads-table .raw-wrap-cell,
.raw-leads-table .raw-contact-cell { white-space: pre-line; overflow-wrap: anywhere; word-break: normal; line-height: 1.35; }
.raw-leads-table .raw-multiline-cell { max-width: 136px; }
.raw-leads-table .raw-wrap-cell { max-width: 158px; }
.raw-leads-table .raw-contact-cell { max-width: 190px; }
.topup-value { color: var(--green); font-weight: 900; }
.topup-empty { color: #c8c2b3; }
.quality-intro-heading { margin-bottom: 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.quality-intro-heading p { max-width: 980px; }
.data-quality-panel { margin: -2px 0 14px; padding: 12px 14px; border: 1px solid #ead8b5; border-radius: 10px; background: linear-gradient(135deg, #fff8e9, #fffdf8); box-shadow: inset 4px 0 0 var(--amber); }
.data-quality-panel p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.data-quality-panel strong { color: var(--ink); font-weight: 800; }
tbody tr { cursor: default; }
tbody tr:hover { background: #faf7ef; }
.clickable-row { cursor: pointer; }
.channel-row td:first-child strong { display: block; }
.row-action { display: block; margin-top: 3px; color: var(--blue); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; opacity: .78; }
.channel-row:hover .row-action { opacity: 1; text-decoration: underline; }
.number { text-align: right; font-family: "DM Mono"; }
.quality-cell { display: flex; align-items: center; gap: 7px; }
.quality-track { width: 42px; height: 5px; background: #e6e3da; border-radius: 4px; overflow: hidden; }
.quality-fill { height: 100%; background: var(--green); }
.status-pill { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 8px; font-weight: 700; }
.status-new { background: #ebe9e2; color: #55554f; }
.status-mql { background: var(--amber-soft); color: var(--amber); }
.status-sql { background: var(--blue-soft); color: var(--blue); }
.status-client { background: var(--green-soft); color: var(--green); }
.status-existing-client { background: #e9e4d7; color: #665743; }
.status-nonqualified { background: var(--coral-soft); color: #9d402e; }
.status-duplicate { background: #eee8eb; color: #755e68; }
.status-spam { background: #f2dfdd; color: #8f2d23; }
.status-sdql { background: #ece1f0; color: #674377; }
.status-mdql { background: #f1e5d7; color: #80541f; }
.status-leadingads { background: var(--green-soft); color: var(--green); }
.status-service { background: #eee8eb; color: #755e68; }
.status-invalid { background: #eee8eb; color: #755e68; }
.quality-intro-strip { display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; box-shadow: inset 4px 0 0 var(--ink); }
.quality-intro-strip strong { font: 700 18px/1.05 "Newsreader"; letter-spacing: -.02em; color: var(--ink); }
.quality-intro-strip span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.quality-intro-strip em { color: var(--muted); font: 700 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; text-align: right; font-style: normal; }
.quality-segment-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; overflow: visible; }
.quality-segment-grid.secondary-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: -8px; margin-bottom: 18px; }
.quality-segment-card { display: grid; gap: 7px; min-height: 120px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fffdf8; text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.quality-segment-card:hover, .quality-segment-card:focus-within { z-index: 90; }
.quality-segment-card span { color: var(--muted); font: 800 9px "DM Mono"; text-transform: uppercase; letter-spacing: .07em; }
.quality-segment-card .quality-segment-label { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.quality-segment-card .quality-segment-label > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.quality-segment-card .segment-info-button { width: 17px; height: 17px; color: #7f7b70; background: rgba(255,253,248,.7); }
.quality-segment-card .segment-info-button > span { color: inherit; font: 800 9px/1 "DM Mono"; letter-spacing: 0; text-transform: none; }
.quality-segment-card .segment-info-button em { right: -4px; top: 22px; width: min(295px, 72vw); }
.quality-segment-card strong { font: 600 42px/.9 "Newsreader"; letter-spacing: -.04em; color: var(--ink); }
.quality-segment-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.quality-segment-card:hover { transform: translateY(-2px); border-color: #cfc7b5; box-shadow: 0 12px 30px rgba(38,34,24,.08); }
.quality-segment-card.active { background: var(--ink); border-color: var(--ink); color: white; }
.quality-segment-card.active span, .quality-segment-card.active small { color: rgba(255,255,255,.72); }
.quality-segment-card.active .segment-info-button { color: rgba(255,255,255,.72); background: transparent; }
.quality-segment-card.active .segment-info-button em { color: var(--ink); }
.quality-segment-card.active strong { color: white; }
.quality-segment-card.secondary { min-height: 86px; padding: 10px; border-radius: 9px; background: #fbf7ee; }
.quality-segment-card.secondary span { font-size: 7px; letter-spacing: .055em; }
.quality-segment-card.secondary strong { font-size: 27px; }
.quality-segment-card.secondary small { font-size: 8px; line-height: 1.25; }
.quality-segment-card.secondary.active { background: #2f3328; border-color: #2f3328; }
.source-quality-panel { margin: 10px 0; }
.source-quality-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px; }
.source-quality-base-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.source-quality-sql-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; }
.source-quality-grid.secondary-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 8px; }
.source-quality-card { display: grid; align-content: start; gap: 6px; min-height: 118px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; }
.source-quality-card span { color: var(--muted); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .065em; line-height: 1.25; }
.source-quality-card strong { font: 600 36px/.92 "Newsreader"; letter-spacing: -.04em; color: var(--ink); }
.source-quality-card small { color: var(--muted); font-size: 9px; line-height: 1.3; }
.source-quality-card em { margin-top: auto; color: var(--blue); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .04em; font-style: normal; }
.source-quality-card.secondary { min-height: 82px; padding: 9px; background: #fbf7ee; border-radius: 9px; }
.source-quality-card.secondary span { font-size: 7px; letter-spacing: .05em; }
.source-quality-card.secondary strong { font-size: 25px; }
.source-quality-card.secondary small { font-size: 8px; line-height: 1.2; }
.source-quality-card.secondary em { font-size: 7px; }
.clients-analytics { margin-top: 10px; }
.clients-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.clients-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; margin-top: 12px; }
.clients-source-panel { margin-bottom: 12px; }
.clients-topup-panel { margin-top: 12px; }
.clients-topup-priority-panel { border-color: #b7d8bc; background: linear-gradient(135deg, #fffdf8 0%, #f1faef 100%); box-shadow: 0 20px 55px rgba(28,86,52,.12), inset 5px 0 0 var(--green); }
.clients-topup-priority-panel .panel-head h3 { color: var(--green); }
.clients-topup-priority-panel .panel-head .micro-label { color: var(--green); }
.topup-range-panel { margin-top: 10px; border-color: #cfe0c9; background: linear-gradient(135deg, #f7fbf2, #fffdf8); }
.clients-chart-grid .topup-range-panel { margin-top: 0; }
.clients-topup-table { min-width: 1260px; table-layout: fixed; }
.clients-topup-table th:nth-child(2),
.clients-topup-table td:nth-child(2) { text-align: center; }
.clients-topup-table td:nth-child(2) { vertical-align: middle; }
.clients-without-topup-table th:nth-child(2),
.clients-without-topup-table td:nth-child(2) { text-align: left; }
.clients-without-topup-panel { background: #fffaf4; }
.two-line-cell {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.35;
}
.metric-rules-panel { margin-top: 12px; padding: 0; overflow: hidden; }
.metric-rules-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.metric-rules-panel summary::-webkit-details-marker { display: none; }
.metric-rules-panel summary::after {
  content: "Open rules";
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--blue);
  font: 800 8px "DM Mono";
  text-transform: uppercase;
  letter-spacing: .06em;
}
.metric-rules-panel[open] summary { border-bottom: 1px solid var(--line); }
.metric-rules-panel[open] summary::after { content: "Hide rules"; color: var(--muted); }
.metric-rules-panel summary h3 { margin: 0; }
.metric-rules-panel summary p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.rules-wrap { max-height: 430px; }
.metric-rules-table { min-width: 980px; table-layout: fixed; }
.metric-rules-table th:nth-child(1), .metric-rules-table td:nth-child(1) { width: 210px; }
.metric-rules-table th:nth-child(2), .metric-rules-table td:nth-child(2) { width: 145px; }
.metric-rules-table th:nth-child(3), .metric-rules-table td:nth-child(3) { width: 110px; }
.metric-rules-table td { white-space: normal; line-height: 1.45; }
.channel-stage-grid { margin-bottom: 12px; }
.qualification-panel { margin-bottom: 10px; }
.qualification-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qualification-card { min-height: 132px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffaf0; }
.qualification-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.qualification-top strong { font: 600 24px "Newsreader"; letter-spacing: -.02em; }
.qualification-label { display: inline-flex; max-width: 160px; padding: 4px 7px; border-radius: 99px; background: #ebe9e2; color: #55554f; font-size: 8px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.qualification-card p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.matrix-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.matrix-card strong { display: block; margin-bottom: 7px; font-size: 10px; }
.matrix-meta { display: flex; justify-content: space-between; color: var(--muted); font: 500 9px "DM Mono"; }
.dialog { width: min(620px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 30px 80px rgba(0,0,0,.24); padding: 0; }
#lead-dialog.dialog { width: min(900px, calc(100vw - 28px)); }
.dialog::backdrop { background: rgba(23,24,19,.42); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); }
.dialog-close { border: 0; background: none; font-size: 18px; cursor: pointer; }
.dialog-body { padding: 18px; max-height: min(760px, 82vh); overflow: auto; }
.formula-grid { display: grid; gap: 9px; }
.formula-item { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.formula-item code { display: block; margin-top: 5px; font: 500 9px "DM Mono"; color: var(--coral); white-space: normal; }
.saved-reports-dialog { width: min(860px, calc(100vw - 28px)); }
.saved-reports-body { display: grid; gap: 12px; max-height: min(680px, 78vh); overflow: auto; }
.saved-reports-note { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 13px 14px; border: 1px dashed #c8c0b0; border-radius: 10px; background: #f8f4eb; color: var(--muted); font-size: 10px; line-height: 1.5; }
.saved-reports-note strong { color: var(--ink); font-size: 10px; }
.saved-reports-note code { color: var(--blue); font: 500 9px "DM Mono"; }
.saved-report-list { display: grid; gap: 9px; }
.reports-page { display: grid; gap: 16px; }
.report-collection { display: grid; gap: 10px; }
.saved-report-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; }
.saved-report-card.active { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--ink); }
.saved-report-main { min-width: 0; }
.saved-report-card h3 { margin-top: 5px; font: 600 18px "Newsreader"; letter-spacing: -.02em; }
.saved-report-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.report-badge-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.saved-report-type { display: inline-flex; padding: 4px 7px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.saved-report-status { display: inline-flex; padding: 4px 7px; border-radius: 99px; font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.saved-report-status.draft { background: var(--amber-soft); color: var(--amber); }
.saved-report-status.published { background: var(--green-soft); color: var(--green); }
.saved-report-status.archived { background: #ece8dd; color: var(--muted); }
.report-source-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.report-source-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; border: 1px solid transparent; }
.report-source-badge.airtable { background: var(--blue-soft); color: var(--blue); border-color: #c6d4f3; }
.report-source-badge.meta { background: var(--green-soft); color: var(--green); border-color: #b6dac9; }
.report-source-badge.google { background: var(--amber-soft); color: var(--amber); border-color: #e4c891; }
.report-source-badge.budget { background: #ece8dd; color: var(--ink); border-color: #d4cfc3; }
.report-source-badge.source { background: #f8f4eb; color: var(--muted); border-color: var(--line); }
.report-governance-line { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.report-governance-line strong { color: var(--ink); }
.saved-report-meta { display: grid; gap: 4px; min-width: 104px; color: var(--muted); font-size: 9px; text-align: right; }
.saved-report-meta strong { color: var(--ink); font-family: "DM Mono"; }
.saved-report-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; align-items: center; max-width: 260px; }
.publish-action { background: var(--ink); border-color: var(--ink); color: #fff; }
.publish-action:hover { background: #2a2b25; }
.empty-saved-reports { display: grid; place-items: center; padding: 34px; text-align: center; color: var(--muted); }
.empty-saved-reports.mini { min-height: 150px; padding: 24px; border: 1px dashed var(--line); border-radius: 12px; background: #f8f4eb; }
.empty-saved-reports p { max-width: 360px; font-size: 10px; line-height: 1.6; }
.settings-page { display: grid; gap: 18px; }
.settings-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #f4f0e7; }
.settings-tab { display: grid; gap: 4px; min-height: 58px; padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.settings-tab strong { color: inherit; font: 900 10px "DM Mono"; text-transform: uppercase; letter-spacing: .07em; }
.settings-tab span { font-size: 10px; line-height: 1.35; }
.settings-tab:hover { background: #fffaf0; border-color: #e1dacd; color: var(--ink); }
.settings-tab.active { background: var(--ink); border-color: var(--ink); color: #fffdf8; box-shadow: 0 16px 34px rgba(23,24,19,.12); }
.settings-tab.active span { color: rgba(255,253,248,.72); }
.settings-section { display: grid; gap: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.settings-grid.account-grid { grid-template-columns: 1.15fr repeat(2, minmax(0, .9fr)) 1fr; }
.settings-card { min-height: 170px; }
.account-user-card { background: linear-gradient(135deg, #fffdf8 0%, #f8f4eb 100%); }
.settings-card h3 { margin: 8px 0 6px; font: 600 22px "Newsreader"; letter-spacing: -.02em; }
.settings-card p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.access-preview-card { border-color: #d7ef7a; background: linear-gradient(135deg, #fffdf8 0%, #f5ffd8 100%); }
.account-access-panel { padding: 16px; }
.account-access-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.access-flag-card { min-height: 112px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; }
.access-flag-card.allowed { border-color: #cfe0c9; background: #f2f8ef; }
.access-flag-card.locked { border-color: #dfd5c6; background: #f8f4eb; }
.access-flag-card span, .access-flag-card small { display: block; color: var(--muted); }
.access-flag-card span { font: 900 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.access-flag-card strong { display: block; margin: 14px 0 7px; font: 600 30px "Newsreader"; color: var(--ink); letter-spacing: -.03em; }
.access-flag-card small { font-size: 10px; line-height: 1.45; }
.account-logout-panel { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 16px 18px; }
.account-logout-panel h3 { margin: 5px 0; font: 600 24px "Newsreader"; letter-spacing: -.02em; }
.account-logout-panel p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-formula-panel { padding: 0; }
.settings-formula-panel summary { padding: 15px 16px; }
.settings-formula-grid { padding: 0 16px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.source-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.source-status-card { min-height: 130px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fffaf0; }
.source-status-card.airtable { border-color: #c6d4f3; background: #f3f7ff; }
.source-status-card.meta { border-color: #b6dac9; background: #f0f8f3; }
.source-status-card.google { border-color: #e4c891; background: #fff7df; }
.source-status-card strong { display: block; margin: 15px 0 6px; font: 600 24px "Newsreader"; letter-spacing: -.02em; color: var(--ink); }
.source-status-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.settings-select-label { display: grid; gap: 6px; margin-top: 14px; color: var(--muted); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.settings-select-label select { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); padding: 0 10px; font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.password-panel { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(360px, 1fr); gap: 18px; align-items: start; padding: 18px; background: linear-gradient(135deg, #fffdf8 0%, #f8f4eb 100%); }
.password-panel-copy h3 { margin: 5px 0 8px; font: 600 28px "Newsreader"; letter-spacing: -.02em; }
.password-panel-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.password-form { display: grid; gap: 10px; }
.password-field-label { display: grid; gap: 6px; color: var(--muted); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.password-input-wrap { position: relative; display: block; }
.password-input-wrap input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); padding: 0 66px 0 11px; font: 600 12px "Manrope"; text-transform: none; letter-spacing: 0; }
.password-input-wrap input:focus { outline: 2px solid rgba(217, 243, 90, .85); outline-offset: 1px; border-color: var(--ink); }
.password-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); height: 28px; min-width: 48px; border: 1px solid var(--line); border-radius: 8px; background: #f8f4eb; color: var(--ink); cursor: pointer; font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.password-toggle:hover { background: var(--acid); border-color: var(--acid); }
.password-action-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding-top: 4px; }
.password-action-row small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.password-action-row .upload-button { min-height: 38px; }
.team-access-page { display: grid; gap: 16px; }
.team-access-grid { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(300px, 1fr); gap: 10px; }
.member-table-intro { padding: 14px 16px 10px; margin: 0; border-bottom: 1px solid var(--line); }
.member-table-intro h2 { font-size: 24px; }
.member-table-intro p { max-width: 520px; }
.member-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.member-form label { display: grid; gap: 5px; color: var(--muted); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.member-form label:nth-child(2) { grid-column: span 2; }
.member-form .member-local-message { grid-column: span 2; }
.member-form input, .member-form select, .member-role-select { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); padding: 0 10px; font-size: 11px; text-transform: none; letter-spacing: 0; }
.member-form button { min-height: 36px; }
.member-submit-zone { align-self: end; }
.member-local-message { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid #cfe0c9; border-radius: 11px; background: #f1f8ed; color: #315b33; box-shadow: 0 10px 24px rgba(49, 91, 51, .08); }
.member-local-message.error { border-color: #e4b2a8; background: #fff0ec; color: #8f3c2e; }
.member-local-message strong, .member-local-message span, .member-local-message code { display: block; }
.member-local-message strong { font: 900 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.member-local-message span { margin-top: 4px; font-size: 9px; line-height: 1.45; opacity: .86; }
.member-local-message code { margin-top: 8px; padding: 7px 8px; border: 1px dashed currentColor; border-radius: 8px; background: rgba(255,255,255,.68); color: var(--ink); font: 800 10px "DM Mono"; overflow-wrap: anywhere; }
.member-local-message .page-button { white-space: nowrap; border-color: currentColor; color: inherit; }
.role-guide-list { display: grid; gap: 8px; }
.role-guide-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid #ece8dd; }
.role-guide-item:first-child { border-top: 0; }
.role-guide-item strong { font: 800 9px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.role-guide-item span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.role-guide-item.active-role { padding: 11px 12px; border: 1px solid #dfe7c7; border-radius: 10px; background: #f5f8e7; }
.team-access-locked { position: relative; min-height: 238px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #fffdf8 0%, #f5f1e8 100%); }
.locked-member-preview { position: absolute; inset: 16px; display: grid; gap: 10px; filter: blur(4px); opacity: .45; transform: scale(1.01); pointer-events: none; }
.locked-member-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 70px; gap: 10px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; }
.locked-member-row span { width: 34px; height: 34px; border-radius: 50% 50% 50% 8px; background: var(--ink); }
.locked-member-row strong, .locked-member-row small, .locked-member-row em { display: block; height: 9px; border-radius: 999px; background: #d8d2c5; }
.locked-member-row strong { width: 55%; margin-bottom: 7px; }
.locked-member-row small { width: 78%; }
.locked-member-row em { width: 100%; }
.team-lock-message { position: relative; z-index: 1; max-width: 310px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 248, .92); box-shadow: var(--shadow); text-align: center; }
.team-lock-message .lock-icon { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 10px; border-radius: 50%; background: var(--ink); color: var(--acid); }
.team-lock-message h3 { margin: 0 0 7px; font: 600 22px "Newsreader"; letter-spacing: -.02em; }
.team-lock-message p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.member-table .member-identity { display: flex; gap: 10px; align-items: center; min-width: 190px; }
.member-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 8px; background: var(--ink); color: var(--acid); font: 800 10px "DM Mono"; flex: 0 0 auto; }
.member-identity strong, .member-identity small { display: block; }
.member-identity small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.member-role-select { min-width: 112px; font-weight: 700; }
.member-role-select:disabled { opacity: .7; cursor: not-allowed; background: #f1eee6; }
.member-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font: 800 8px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.privacy-value { color: #8c8173; font-style: italic; }
.lead-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lead-detail-grid.raw-first-lead-card { gap: 12px; }
.lead-card-section { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fffaf0; }
.contact-details-section { background: #f8f4eb; }
.detail-item small, .detail-item strong { display: block; }
.detail-item small { color: var(--muted); font: 500 8px "DM Mono"; text-transform: uppercase; margin-bottom: 5px; }
.detail-item strong { font-size: 10px; overflow-wrap: anywhere; }
.raw-audit { grid-column: 1 / -1; padding: 12px; background: #f1eee7; border-radius: 8px; font: 400 9px/1.6 "DM Mono"; overflow: auto; }
.raw-fields-section { grid-column: 1 / -1; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fffaf0; }
.raw-fields-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 13px; border-bottom: 1px solid var(--line); }
.raw-fields-head strong { font-size: 11px; }
.raw-fields-head span { color: var(--muted); font: 500 8px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.raw-fields-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.enriched-fields-section { background: #f8f4eb; }
.enriched-fields-table { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: #eee8dc; }
.enriched-fields-table .detail-item { min-width: 0; padding: 11px 12px; background: #fffdf8; }
.enriched-fields-table .detail-item strong { white-space: pre-wrap; }
.raw-field-row { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-top: 1px solid #eeeae1; min-width: 0; }
.raw-field-row:nth-child(1), .raw-field-row:nth-child(2) { border-top: 0; }
.raw-field-row:nth-child(odd) { border-right: 1px solid #eeeae1; }
.raw-field-row small { color: var(--muted); font: 700 8px/1.35 "DM Mono"; text-transform: uppercase; letter-spacing: .05em; overflow-wrap: anywhere; }
.raw-field-row strong { color: var(--ink); font: 500 10px/1.45 "Manrope"; overflow-wrap: anywhere; white-space: pre-wrap; }
.pagination { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.page-actions { display: flex; gap: 9px; align-items: center; font: 500 9px "DM Mono"; }
.page-button { padding: 6px 9px; font-size: 9px; }
.page-button:disabled { opacity: .45; cursor: not-allowed; background: transparent; }
.stat-pair { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.stat-pair:last-child { border-bottom: 0; }
.stat-pair span:last-child { font-family: "DM Mono"; }
.diagnostic-id-list { margin: -1px 0 7px; padding: 9px 10px; border: 1px dashed #cfc7b5; border-radius: 8px; background: #fffaf0; }
.diagnostic-id-list small { display: block; margin-bottom: 5px; color: var(--muted); font: 500 8px "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.diagnostic-id-list span { display: block; color: var(--ink); font: 500 9px/1.45 "DM Mono"; overflow-wrap: anywhere; }
.pivot-panel { margin-bottom: 10px; }
.pivot-head { padding: 17px 17px 0; margin-bottom: 12px; }
.pivot-table { min-width: 1120px; border-collapse: separate; border-spacing: 0; }
.pivot-table th { position: sticky; top: 0; border-right: 1px solid #e2ded4; background: #f6f2e8; color: #6d6b63; white-space: normal; min-width: 98px; vertical-align: bottom; }
.pivot-table th:first-child, .pivot-table td:first-child, .pivot-table tfoot td:first-child { position: sticky; left: 0; z-index: 3; min-width: 205px; background: #fffdf8; color: var(--ink); box-shadow: 1px 0 0 #e2ded4; }
.pivot-table tbody td { border-right: 1px solid #eeeae1; border-top: 1px solid #eeeae1; font-size: 10px; }
.pivot-table tbody tr:nth-child(even) td:not(:first-child) { background: rgba(244,241,233,.35); }
.pivot-table tbody tr:hover td { background: #fff7e8; }
.pivot-table .has-value { background: #edf6e8; color: var(--ink); font-weight: 800; }
.pivot-table tbody tr:hover .has-value { background: #e4f2dc; }
.pivot-table .grand-total { background: #efe9d9; color: var(--ink); font-weight: 900; }
.pivot-table tfoot td { position: sticky; bottom: 0; background: #f6f2e8; border-top: 1px solid #cfc7b5; font-weight: 900; color: var(--ink); }
.pivot-table tfoot .grand-total { background: #e7dcc4; color: var(--ink); }
.source-matrix-panel { margin-bottom: 10px; }
.source-matrix-table { min-width: 1860px; border-collapse: separate; border-spacing: 0; }
.source-matrix-table th, .source-matrix-table td { border-right: 1px solid #eeeae1; }
.source-matrix-table thead tr:nth-child(2) th { top: 29px; }
.source-matrix-table th:first-child, .source-matrix-table td:first-child { position: sticky; left: 0; z-index: 4; min-width: 190px; background: #fffdf8; box-shadow: 1px 0 0 #e2ded4; }
.source-matrix-table thead th:first-child { z-index: 6; background: #f6f2e8; }
.matrix-group-row th { top: 0; padding: 7px 12px; color: var(--ink); font: 900 8px "DM Mono"; text-transform: uppercase; letter-spacing: .1em; border-top: 0; border-bottom: 1px solid #d8cfbe; text-align: center; }
.matrix-group-row .group-source { background: #f2eee4; }
.matrix-group-row .group-qualification { background: #eef4e8; color: #37533c; }
.matrix-group-row .group-performance { background: var(--blue-soft); color: #264b92; }
.matrix-group-row .group-hygiene { background: var(--amber-soft); color: #7b4d11; }
.matrix-group-row .group-action { background: #f2eee4; }
.source-matrix-table tbody tr:hover td { background: #fff7e8; }
.matrix-source-name { display: block; font: 700 15px/1.1 "Newsreader"; letter-spacing: -.015em; }
.source-matrix-table .strong-metric { color: var(--blue); font-weight: 900; }
.source-matrix-table .status-client-cell { color: var(--green); font-weight: 900; }
.source-matrix-table td:nth-child(14), .source-matrix-table th:nth-child(14) { border-left: 2px solid #d7deef; }
.source-matrix-table td:nth-child(20), .source-matrix-table th:nth-child(20) { border-left: 2px solid #ead8b5; }
.source-matrix-table tfoot td { position: sticky; bottom: 0; background: #f6f2e8; border-top: 1px solid #cfc7b5; font-weight: 900; color: var(--ink); }
.source-matrix-table tfoot td:first-child { z-index: 4; background: #fffdf8; }
.source-raw-panel { margin-top: 10px; }
.raw-source-report { margin-bottom: 10px; }
.raw-source-name { font: 700 13px/1.1 "Newsreader"; letter-spacing: -.01em; }
.empty-mini { display: grid; place-items: center; min-height: 180px; color: var(--muted); font-size: 10px; text-align: center; border: 1px dashed var(--line); border-radius: 9px; background: #faf7ef; }

@media (max-width: 1050px) {
  .app-shell { display: block; }
  .sidebar { width: 72px; padding-inline: 10px; }
  .main { margin-left: 72px; }
  .brand { padding-inline: 7px; }
  .brand > span:last-child, .nav-item > span:last-child, .sidebar-report-context div, .management-label { display: none; }
  .nav-item { justify-content: center; }
  .sidebar-report-context { justify-content: center; padding: 12px 0; }
  .filter-bar { grid-template-columns: repeat(4, minmax(120px, 1fr)); grid-template-areas:
    "view from to scope"
    "channel conversion source medium"
    "campaign status spend cards"
    "vertical approach approach approach"; }
  .lead-source-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roi-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roi-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roi-leader-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid.roi-diagnostic-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .budget-source-grid { grid-template-columns: 1fr; }
  .meta-funnel-sections { grid-template-columns: 1fr; }
  .meta-funnel-grid { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
  .ai-insight-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality-segment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality-segment-grid.secondary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .source-quality-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-quality-base-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-quality-sql-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .source-quality-grid.secondary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .meta-unit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clients-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality-intro-strip { grid-template-columns: 1fr; }
  .quality-intro-strip em { text-align: left; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .executive-health-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .executive-panel-grid { grid-template-columns: 1fr; }
  .settings-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid, .settings-grid.account-grid { grid-template-columns: 1fr; }
  .account-access-grid, .source-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-formula-grid { grid-template-columns: 1fr; }
  .password-panel { grid-template-columns: 1fr; }
  .team-access-grid { grid-template-columns: 1fr; }
  .roi-source-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-stack { gap: 14px; }
  .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-row.base-row .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-row.existing-accounts-row .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-row.hygiene-row .kpi-row-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-row.early-row .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-row.sql-reached-row .kpi-row-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-row.sql-row .kpi-row-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-row.client-outcome-row .kpi-row-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-row.budget-row .kpi-row-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-row.sql-reached-row .kpi-row-cards::before, .kpi-row.sql-row .kpi-row-cards::before { left: 0; top: 19px; }
  .kpi-card { min-height: 128px; }
  .kpi-value { font-size: 32px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -240px; width: 230px; transition: left .25s ease; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  .sidebar.open { left: 0; }
  .main { margin-left: 0; }
  .brand > span:last-child, .nav-item > span:last-child, .sidebar-report-context div, .management-label { display: block; }
  .nav-item { justify-content: flex-start; }
  .sidebar-report-context { justify-content: flex-start; padding: 12px 10px; }
  .menu-button { display: block; }
  .topbar { min-height: 82px; padding: 16px; gap: 10px; }
  .topbar > div:nth-child(2) { flex: 1; }
  .formula-button { display: none; }
  .upload-button { padding: 8px 10px; font-size: 10px; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas:
    "view scope"
    "from to"
    "channel conversion"
    "source medium"
    "campaign status"
    "spend cards"
    "vertical approach"; padding: 10px 16px; }
  .scope-ticket-row { grid-template-columns: 1fr; height: auto; gap: 3px; }
  .filter-group label.check-ticket.scope-ticket,
  .check-ticket.scope-ticket { height: 30px; min-height: 30px; }
  .content { padding: 18px 16px 40px; }
  .panel-grid, .panel-grid.equal { grid-template-columns: 1fr; }
  .lead-source-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roi-summary-grid, .roi-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roi-outcome-grid, .roi-leader-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.roi-diagnostic-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .budget-source-grid { grid-template-columns: 1fr; }
  .meta-funnel-sections { grid-template-columns: 1fr; }
  .meta-funnel-section { grid-template-columns: 104px minmax(0, 1fr); }
  .meta-funnel-grid, .meta-efficiency-strip { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); }
  .meta-funnel-step { min-height: 64px; padding: 7px 8px; }
  .meta-funnel-step strong { font-size: 16px; }
  .ai-insight-grid { grid-template-columns: 1fr; }
  .channel-roi-subtabs { position: static; }
  .executive-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-segment-grid, .clients-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-segment-grid.secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-quality-grid, .source-quality-grid.secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roi-source-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-row-cards, .kpi-row.base-row .kpi-row-cards, .kpi-row.sql-reached-row .kpi-row-cards, .kpi-row.sql-row .kpi-row-cards, .kpi-row.client-outcome-row .kpi-row-cards, .kpi-row.early-row .kpi-row-cards, .kpi-row.hygiene-row .kpi-row-cards, .kpi-row.budget-row .kpi-row-cards, .kpi-row.existing-accounts-row .kpi-row-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qualification-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-intro { display: block; }
  .data-stamp { margin-top: 8px; }
  .funnel-row { grid-template-columns: 74px minmax(80px,1fr) 35px; }
  .funnel-rate { display: none; }
  .table-toolbar, .pagination { display: grid; }
  .table-controls { display: grid; grid-template-columns: 1fr; }
  .table-toolbar input { width: 100%; }
  .saved-report-card, .saved-reports-note { grid-template-columns: 1fr; }
  .saved-report-meta { text-align: left; }
  .saved-report-actions { justify-content: flex-start; }
  .member-form { grid-template-columns: 1fr; }
  .member-form label:nth-child(2) { grid-column: auto; }
  .member-local-message { grid-template-columns: 1fr; }
  .member-local-message .page-button { width: 100%; }
  .password-action-row { display: grid; }
  .password-action-row .upload-button { width: 100%; }
  .raw-fields-table { grid-template-columns: 1fr; }
  .enriched-fields-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raw-field-row, .raw-field-row:nth-child(odd) { border-right: 0; }
  .raw-field-row:nth-child(2) { border-top: 1px solid #eeeae1; }
}

@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .kpi-row-cards, .kpi-row.base-row .kpi-row-cards, .kpi-row.sql-reached-row .kpi-row-cards, .kpi-row.sql-row .kpi-row-cards, .kpi-row.client-outcome-row .kpi-row-cards, .kpi-row.early-row .kpi-row-cards, .kpi-row.hygiene-row .kpi-row-cards, .kpi-row.budget-row .kpi-row-cards, .kpi-row.existing-accounts-row .kpi-row-cards { grid-template-columns: 1fr; gap: 7px; }
  .kpi-card.wide-kpi { grid-column: auto; }
  .kpi-card { min-height: 108px; padding: 12px; }
  .kpi-value { font-size: 28px; }
  .settings-tabs, .account-access-grid, .source-status-grid { grid-template-columns: 1fr; }
  .account-logout-panel { display: grid; }
  .account-logout-panel .ghost-button { width: 100%; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar { grid-template-areas:
    "view"
    "from"
    "to"
    "scope"
    "channel"
    "conversion"
    "source"
    "medium"
    "campaign"
    "status"
    "spend"
    "cards"
    "vertical"
    "approach"; }
  .lead-source-card-grid { grid-template-columns: 1fr; }
  .roi-summary-grid, .roi-card-grid { grid-template-columns: 1fr; }
  .roi-outcome-grid, .roi-leader-grid { grid-template-columns: 1fr; }
  .kpi-grid.roi-diagnostic-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-funnel-sections, .meta-efficiency-strip { grid-template-columns: 1fr; }
  .meta-funnel-section { grid-template-columns: 1fr; }
  .meta-funnel-section h4 { border-right: 0; border-bottom: 1px solid #dfe7d7; }
  .meta-funnel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-insight-grid { grid-template-columns: 1fr; }
  .quality-segment-grid, .clients-kpis { grid-template-columns: 1fr; }
  .quality-segment-grid.secondary-grid { grid-template-columns: 1fr; }
  .meta-unit-grid { grid-template-columns: 1fr; }
  .source-quality-grid, .source-quality-grid.secondary-grid { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: 1fr; }
  .qualification-grid { grid-template-columns: 1fr; }
  .lead-detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { width: auto; max-width: none; overflow: visible; background: #fff; }
  body.printing-source-report { background: #fff; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-source-report .sidebar,
  body.printing-source-report .topbar,
  body.printing-source-report .filter-bar,
  body.printing-source-report .import-strip,
  body.printing-source-report .channel-drill-actions,
  body.printing-source-report .sort-button em,
  body.printing-source-report .export-csv-button,
  body.printing-source-report .export-pdf-button,
  body.printing-source-report dialog { display: none !important; }
  body.printing-source-report .main { margin-left: 0; overflow: visible; max-width: none; }
  body.printing-source-report .content { max-width: none; padding: 0; overflow: visible; }
  body.printing-source-report .panel,
  body.printing-source-report .kpi-card,
  body.printing-source-report .roi-hero-card,
  body.printing-source-report .quality-segment-card { break-inside: avoid; box-shadow: none; }
  body.printing-source-report .section-intro,
  body.printing-source-report .channel-drill-strip { break-after: avoid; }
  body.printing-source-report .table-wrap { max-height: none; overflow: visible; }
  body.printing-source-report table { font-size: 7px; page-break-inside: auto; }
  body.printing-source-report th,
  body.printing-source-report td { padding: 6px 7px; }
  body.printing-source-report thead { display: table-header-group; }
  body.printing-source-report tr { break-inside: avoid; page-break-inside: avoid; }
}
