:root{--navy:#1a1f3a;--blue:#283454;--cyan:#95eaef;--white:#fff;--body:#f6f8fb;--ink:#17253d;--muted:#647188;--border:#e4eaf2;--green:#09816a;--red:#b4414e;--shadow:0 12px 45px rgba(25,48,80,.04)}
*{box-sizing:border-box}body{margin:0;background:var(--body);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);-webkit-font-smoothing:antialiased}button,select,input{font:inherit}button{cursor:pointer}.hidden{display:none!important}.muted{color:var(--muted)}.app{min-height:100vh}.topbar{background:var(--navy);display:flex;align-items:center;justify-content:space-between;gap:16px;color:#fff;padding:18px max(22px,calc((100vw - 1230px)/2));min-height:84px}.brand{display:flex;align-items:center;gap:13px}.brand-mark{width:43px;height:43px;border-radius:14px;background:var(--cyan);color:var(--navy);font-size:24px;font-weight:800;display:grid;place-items:center;letter-spacing:-3px}.brand-mark span{font-size:13px;vertical-align:top;margin-left:-6px}.brand b{display:block;font-size:19px;letter-spacing:-.4px}.brand small{display:block;margin-top:3px;font-size:9px;color:#adb9d4;letter-spacing:1.6px;font-weight:650}.top-right{display:flex;align-items:center;gap:18px}.top-sync{font-size:12px;color:#c8d3e8}.refresh{border:1px solid #56617b;color:#fff;background:#313956;padding:11px 16px;border-radius:11px;font-weight:600;font-size:13px;transition:.15s}.refresh:hover{background:#4a5577}.refresh:disabled{opacity:.5;cursor:wait}.refresh span{font-size:19px;margin-right:5px;line-height:0;vertical-align:-2px}.page{max-width:1274px;padding:38px 24px 28px;margin:auto}.heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.eyebrow{display:block;color:#7684a2;font-size:10px;letter-spacing:2px;font-weight:800}.heading h1{font-size:32px;line-height:1.18;letter-spacing:-1.25px;margin:10px 0}.heading p{margin:0;color:var(--muted);font-size:14px}.live-indicator{display:flex;align-items:center;gap:7px;color:var(--green);font-size:12px;font-weight:650;background:#e5f5f1;border:1px solid #c3e9de;border-radius:30px;padding:9px 14px}.live-indicator span{width:7px;height:7px;border-radius:50%;background:#1cb891}.tabs{margin:32px 0 21px;border-bottom:1px solid var(--border);display:flex;gap:28px;overflow:auto;white-space:nowrap}.tab{border:0;border-bottom:2px solid transparent;padding:12px 1px 15px;background:transparent;color:#708098;font-size:13px;font-weight:680}.tab.active{color:var(--navy);border-color:var(--navy)}.pill{margin-left:5px;background:#f6e4cc;color:#9c6326;font-size:10px;border-radius:99px;padding:3px 6px}.filters{background:#fff;border:1px solid var(--border);border-radius:15px;box-shadow:var(--shadow);padding:17px 20px;display:flex;align-items:flex-end;flex-wrap:wrap;gap:14px 18px}.field{display:grid;gap:7px;min-width:177px}.field.narrow{min-width:140px}.field label{font-size:11px;color:var(--muted);font-weight:700}.field select,.field input{height:40px;border:1px solid #dbe3ec;border-radius:9px;background:#fff;padding:0 12px;color:var(--ink);font-size:13px;max-width:100%}.checkbox-field{display:flex;gap:10px;align-items:center;cursor:pointer;margin-left:auto;padding:0 5px 1px 0;min-height:40px}.checkbox-field input{width:18px;height:18px;accent-color:var(--navy)}.checkbox-field b{display:block;font-size:12px}.checkbox-field small{display:block;color:#8a94a7;font-size:10px;margin-top:4px}.alerts{margin-top:15px}.alert{background:#fffaf0;border:1px solid #f2dfbc;color:#805e26;padding:12px 16px;font-size:12px;border-radius:10px;margin-bottom:8px;line-height:1.5}.alert.error{background:#fff4f5;border-color:#f1d6d8;color:#a23845}.alert.info{background:#eff8fa;border-color:#cce9ed;color:#286974}.section-heading{margin:29px 0 16px;display:flex;justify-content:space-between;align-items:end;gap:15px}.section-heading h2{font-size:21px;letter-spacing:-.7px;line-height:1.3;margin:7px 0 0}.section-heading small{color:#8490a0;font-size:12px}.section-heading.second{margin-top:30px}.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.kpi{min-height:136px;border-radius:15px;background:#fff;border:1px solid var(--border);padding:18px 19px;box-shadow:var(--shadow);position:relative;overflow:hidden}.kpi.feature{background:var(--navy);border-color:var(--navy);color:#fff}.kpi.feature .kpi-label,.kpi.feature .kpi-foot{color:#abb9d3}.kpi .kpi-label{display:flex;justify-content:space-between;gap:7px;font-size:12px;color:#77849a;font-weight:640}.kpi .kpi-label span{font-size:15px;color:#9aadc3}.kpi .kpi-value{font-weight:730;font-size:27px;line-height:1.3;letter-spacing:-1px;margin-top:11px;font-variant-numeric:tabular-nums}.kpi .kpi-foot{font-size:11px;color:#8a97a7;margin-top:8px}.kpi.feature:after{content:"";position:absolute;width:120px;height:120px;border-radius:50%;border:25px solid rgba(149,234,239,.1);right:-52px;top:-67px}.dashboard-grid{display:grid;grid-template-columns:1.65fr 1fr;gap:15px;margin-top:16px}.panel{background:#fff;border:1px solid var(--border);border-radius:15px;box-shadow:var(--shadow);padding:21px}.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.panel-heading h3{margin:0;font-size:15px;letter-spacing:-.2px}.panel-heading p{font-size:11px;margin:6px 0 0;color:#8390a1}.legend{display:flex;gap:13px;flex-wrap:wrap;font-size:11px;color:#6f7c91;align-items:center}.legend span{display:flex;align-items:center;gap:6px}.legend i{width:8px;height:8px;display:inline-block;border-radius:50%}.legend i.sales{background:#172b58}.legend i.spend{background:#30c0ca}.chart{height:269px;margin-top:9px}.chart svg{width:100%;height:100%}.chart-empty{height:100%;display:grid;place-items:center;color:#a0a9b7;font-size:13px;text-align:center}.breakdown-row{margin:24px 0 0}.breakdown-row .top{display:flex;justify-content:space-between;font-size:12px}.breakdown-row .top span:first-child{font-weight:650}.breakdown-row .top span:last-child{font-variant-numeric:tabular-nums;font-weight:680}.meter{margin-top:10px;height:8px;border-radius:7px;background:#edf2f5;overflow:hidden}.meter span{display:block;height:100%;border-radius:7px}.meter .meta{background:var(--navy)}.meter .google{background:#4dc9d3}.meter .brand{background:#a2b2ca}.small-note{margin:21px 0 0;color:#8693a7;font-size:11px;line-height:1.5}.platform-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.platform-card{background:#fff;border:1px solid var(--border);border-radius:15px;padding:20px;box-shadow:var(--shadow)}.platform-head{display:flex;align-items:center;justify-content:space-between}.platform-head h3{margin:0;font-size:16px}.platform-tag{font-size:10px;background:#ecf7f9;color:#267984;border-radius:30px;padding:6px 9px;font-weight:700}.platform-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;border-top:1px solid var(--border);margin-top:17px;padding-top:19px}.platform-metrics small{display:block;color:var(--muted);font-size:11px}.platform-metrics b{display:block;font-size:21px;letter-spacing:-.5px;margin-top:8px;font-variant-numeric:tabular-nums}.table-scroll{overflow:auto;max-width:100%}table{border-collapse:collapse;width:100%;text-align:left;min-width:700px}th{background:#f7f9fb;color:#7c889b;text-transform:uppercase;letter-spacing:.7px;font-size:10px;font-weight:750;padding:14px;border-bottom:1px solid var(--border)}td{border-bottom:1px solid #edf1f5;padding:15px 14px;color:#3a4b60;font-size:12px;font-variant-numeric:tabular-nums}td.numeric,th.numeric{text-align:right}tbody tr:last-child td{border-bottom:0}.table-name{font-size:12px;font-weight:650;color:#26374c;max-width:450px}.table-sub{color:#8390a2;font-size:11px;margin-top:5px}.expand{border:0;background:transparent;display:inline-flex;align-items:center;gap:9px;text-align:left;padding:0;font-weight:650;color:var(--ink)}.chev{display:inline-grid;place-items:center;border:1px solid #d8e2ec;color:#8291a5;border-radius:6px;width:20px;height:20px;flex-shrink:0}.sub-row td{background:#f9fbfd;padding:11px 14px}.sub-row td:first-child{padding-left:49px}.table-empty{text-align:center;color:#8e9aab;padding:35px;font-size:13px}.status-tag{display:inline-flex;border-radius:20px;padding:5px 9px;font-size:10px;font-weight:730;white-space:nowrap}.status-tag.brand{color:#9b612f;background:#fff3e6}.status-tag.nonbrand{color:#1f806e;background:#eaf7f3}.status-tag.unreviewed{color:#6e7790;background:#eff1f5}.settings-panel{padding:24px}.settings-intro{color:#69778c;font-size:13px;line-height:1.7;margin:0 0 16px;max-width:820px}.classification-grid{display:grid;grid-template-columns:minmax(0,1fr) 185px;align-items:center;gap:16px;padding:14px 0;border-top:1px solid #edf1f5}.classification-grid select{padding:10px;border:1px solid #dae2eb;border-radius:8px;background:#fff;width:100%;font-size:12px}.classification-grid select:focus,.field input:focus,.field select:focus{outline:2px solid var(--cyan)}.classification-grid .name{font-size:12px;font-weight:660}.classification-grid .details{font-size:10px;color:#95a0ae;margin-top:5px}.connection-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.connections{margin-top:32px}.connections-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.connections-head h3{margin:0;font-size:15px}.connections-head small{color:#8a95a6;font-size:11px}.connection{background:#fff;border:1px solid var(--border);border-radius:12px;padding:15px;min-width:0}.connection-heading{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700}.dot{height:8px;width:8px;border-radius:50%;background:#abb6c6;flex-shrink:0}.dot.ready{background:#16a085}.dot.error{background:#d36a69}.dot.working{background:#dfae51;animation:pulse 1.4s infinite}.connection-caption{font-size:11px;line-height:1.6;color:#8691a4;margin-top:10px;overflow-wrap:anywhere}.connections .alert{margin-top:4px}footer{padding:30px 3px 6px;color:#9ba7b8;font-size:10px;line-height:1.8;text-align:center}footer span{margin:0 8px} @keyframes pulse{50%{opacity:.3}}
@media(max-width:1050px){.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}.chart{height:270px}.checkbox-field{margin-left:0}}@media(max-width:620px){.topbar{padding:15px 17px;min-height:75px}.brand-mark{width:38px;height:38px}.brand b{font-size:18px}.brand small{font-size:8px;letter-spacing:1px}.top-sync{display:none}.refresh{padding:10px 11px;font-size:11px}.refresh span{font-size:15px}.page{padding:27px 14px 22px}.heading h1{font-size:25px}.heading p{font-size:12px;line-height:1.5}.heading-tools{display:none}.tabs{gap:23px;margin-top:25px}.tab{font-size:12px}.filters{padding:14px;gap:12px}.field{min-width:0;flex:1 0 calc(50% - 8px)}.field.narrow{min-width:0}.field select,.field input{width:100%;font-size:12px}.checkbox-field{width:100%;border-top:1px solid var(--border);padding-top:12px}.kpi-grid{gap:10px}.kpi{padding:14px;min-height:121px}.kpi .kpi-value{font-size:23px}.kpi .kpi-label{font-size:11px}.kpi .kpi-foot{font-size:10px}.section-heading{align-items:start}.section-heading h2{font-size:19px}.section-heading small{display:none}.panel{padding:16px}.panel-heading{flex-wrap:wrap}.chart{height:225px}.platform-grid,.connection-grid{grid-template-columns:1fr}.platform-metrics b{font-size:19px}.classification-grid{grid-template-columns:1fr;gap:10px}.settings-panel{padding:17px}.connections-head small{display:none}}

.export{border:1px solid #dce5ec;background:#fff;color:#34445b;border-radius:9px;padding:10px 12px;font-size:12px;font-weight:700;white-space:nowrap}.export:hover{background:#f1f6f8}

/* v2: Pluto image mark, adaptive chart comparison and dedicated product mix view */
.brand-mark{background:#fff;border-radius:10px;letter-spacing:0;overflow:hidden;flex-shrink:0;padding:7px}
.brand-mark img{display:block;width:100%;height:100%;object-fit:contain}
.chart-toggle{display:inline-flex;align-items:center;gap:7px;cursor:pointer;color:#62738a;font-size:11px;margin-top:14px}
.chart-toggle input{accent-color:var(--navy);height:16px;width:16px}
.legend i.previous{background:transparent;border:2px dashed #a7b3c3}
.chart-note{font-size:11px;line-height:1.5;color:#8794a7;margin:4px 0 0}
.traffic-grid .kpi{min-height:112px}
.traffic-grid .kpi .kpi-value{font-size:24px}
.section-subtitle{color:var(--muted);font-size:12px;margin:8px 0 0;max-width:700px;line-height:1.5}
.product-summary{color:#708199;font-size:12px;padding-bottom:15px}
.product-summary b{color:var(--navy);font-size:15px}

/* v3: compact overview, collapsible dates, Google-only branded toggle */
.date-filter-shell{margin-top:13px;background:#fff;border:1px solid var(--border);border-radius:13px;box-shadow:var(--shadow);overflow:hidden}
.date-filter-summary{display:flex;align-items:center;gap:12px;padding:12px 18px;min-height:48px;cursor:pointer;list-style:none;user-select:none}
.date-filter-summary::-webkit-details-marker{display:none}
.summary-icon{font-size:18px;color:#647188}
.summary-label{font-size:12px;font-weight:710;white-space:nowrap}
.date-filter-summary strong{margin-left:auto;font-size:12px;color:#596980;font-weight:620;text-align:right;line-height:1.4}
.filter-chevron{font-size:19px;color:#66788f;transition:transform .15s}
.date-filter-shell[open] .filter-chevron{transform:rotate(180deg)}
.date-filter-shell .filters{border:0;border-top:1px solid var(--border);border-radius:0;box-shadow:none;margin:0;padding:15px 18px}
.google-brand-toggle{display:flex;align-items:center;gap:9px;cursor:pointer;min-height:38px;margin:14px 0 -4px;color:#394b63;font-weight:650;font-size:12px}
.google-brand-toggle input{width:18px;height:18px;accent-color:var(--navy)}
.google-brand-toggle:focus-within{outline:2px solid var(--cyan);outline-offset:3px;border-radius:5px}
.date-filter-summary:focus-visible,.tab:focus-visible,.refresh:focus-visible{outline:3px solid var(--cyan);outline-offset:-2px}
.chart svg{display:block;max-width:100%;overflow:visible}
.platform-tag{white-space:nowrap}
@media(max-width:620px){
  .topbar{min-height:56px;padding:8px 14px;gap:8px}
  .brand{gap:9px}
  .brand-mark{width:32px;height:32px;padding:5px;border-radius:8px}
  .brand b{font-size:16px}
  .brand small{font-size:8px;letter-spacing:.7px}
  .refresh{padding:8px 9px;font-size:11px;min-height:35px}
  .page{padding:8px 12px 20px}
  .tabs{margin-top:2px;gap:18px;padding:2px 0 0;min-height:45px}
  .tab{font-size:12px;padding:10px 1px}
  .date-filter-shell{margin-top:6px;border-radius:11px}
  .date-filter-summary{padding:10px 12px;min-height:43px;gap:7px}
  .date-filter-summary strong{font-size:11px}
  .date-filter-shell .filters{padding:12px;gap:10px}
  .field{flex:1 0 100%}
  .field.narrow{flex:1 0 calc(50% - 6px)}
  .first-section{display:none}
  .kpi-grid{margin-top:9px;gap:8px}
  .kpi{padding:11px 12px;min-height:105px;border-radius:12px}
  .kpi .kpi-label{font-size:10px}
  .kpi .kpi-label span{font-size:12px}
  .kpi .kpi-value{font-size:22px;margin-top:7px;line-height:1.25;letter-spacing:-.55px}
  .kpi .kpi-foot{font-size:9px;margin-top:7px;line-height:1.35}
  .section-heading{margin:22px 0 12px}
  .dashboard-grid{margin-top:12px}
  .panel{padding:12px}
  .chart{height:244px;margin-top:10px}
  .chart svg{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
  .legend{font-size:10px;gap:9px}
  .platform-card{padding:15px}
  .platform-metrics{gap:10px}
  .platform-metrics b{font-size:18px;overflow-wrap:anywhere}
  .platform-metrics small{font-size:10px}
  .connections{margin-top:22px}
  .settings-panel{padding:13px}
}

/* v4: Products uses its OWN table sizing; do not inherit the 700px ad-table rule. */
#product-table{overflow-x:hidden}
.product-table{min-width:0;width:100%;table-layout:fixed}
.product-table th:first-child{width:57%}
.product-table th.product-units-col{width:18%}
.product-table th.product-orders-col{width:25%}
.product-table td:first-child{overflow-wrap:anywhere}
.product-table .expand{max-width:100%;white-space:normal;line-height:1.4}
.product-table .sub-row td:first-child{padding-left:35px}
.product-heading-short{display:none}
@media(max-width:620px){
  .product-table th:first-child{width:auto}
  .product-table th.product-units-col{width:74px}
  .product-table .product-orders-col{display:none}
  .product-table th,.product-table td{padding:13px 8px}
  .product-table td:first-child,.product-table th:first-child{padding-left:9px;padding-right:4px}
  .product-table .sub-row td:first-child{padding-left:20px}
  .product-table td.numeric,.product-table th.numeric{font-size:13px;font-weight:700}
  .product-table .table-name{font-size:12px;line-height:1.5}
  .product-heading-long{display:none}
  .product-heading-short{display:inline}
}

/* v5: 5x2 KPI grid, GA4 acquisition table, shared contribution settings. */
@media(min-width:1100px){#kpis.kpi-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}#kpis .kpi{padding:14px 13px;min-height:124px}#kpis .kpi .kpi-label{font-size:11px;line-height:1.4}#kpis .kpi .kpi-value{font-size:25px;margin-top:9px;letter-spacing:-.8px}#kpis .kpi .kpi-foot{font-size:10px;line-height:1.3}}
@media(min-width:621px) and (max-width:1099px){#kpis.kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:620px){#kpis.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#kpis .kpi{min-height:110px}}
.business-actions{display:flex;align-items:center;gap:12px}
.icon-button,.header-settings{background:#fff;color:#263755;border:1px solid #dce5ef;border-radius:10px;display:inline-grid;place-items:center;min-width:37px;min-height:37px;font-size:21px;cursor:pointer}.icon-button:hover{background:#edf6f8}
.header-settings{display:none;background:#323b58;color:white;border-color:#56617b}
@media(max-width:620px){.header-settings{display:inline-grid;min-width:34px;min-height:34px;font-size:18px}}
.compare-field{min-width:215px}@media(max-width:620px){.compare-field{flex:1 0 100%}}
.refresh.is-refreshing #refreshIcon{display:inline-block;animation:pluto-spin 1s linear infinite}@keyframes pluto-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.refresh.is-refreshing #refreshIcon{animation:none}}
/* Alerts overlay instead of shifting the page vertically. */
.alerts{position:fixed;right:15px;top:78px;z-index:50;max-width:min(410px,calc(100vw - 30px));margin:0;pointer-events:none}.alerts:empty{display:none}.alerts .alert{box-shadow:0 8px 32px rgba(15,31,50,.15);pointer-events:auto}
.ga4-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}.ga4-toolbar label{font-size:12px;font-weight:700;color:#65758b}.ga4-toolbar input{border:1px solid var(--border);padding:10px 12px;border-radius:9px;background:white;flex:1 1 240px;max-width:400px;font-size:13px}.ga4-toolbar span{font-size:11px}
.ga4-table{min-width:1050px}.ga4-table th{font-size:11px;white-space:normal;min-width:105px;line-height:1.5}.ga4-table th:first-child{min-width:250px}.ga4-table td{font-size:12px}.ga4-total td{font-weight:750;background:#eff5f9;color:#23344e}
.ga4-pagination{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:18px;color:var(--muted);font-size:12px;flex-wrap:wrap}.ga4-pagination>div{display:flex;align-items:center;gap:10px}.ga4-pagination button{border:1px solid var(--border);border-radius:8px;background:white;color:#253955;font-size:12px;padding:8px 10px}.ga4-pagination button:disabled{opacity:.4;cursor:default}
.cost-modal{border:1px solid #dde7f0;border-radius:17px;box-shadow:0 18px 65px rgba(15,22,48,.25);padding:26px;width:min(470px,calc(100vw - 24px));max-height:90vh;overflow-y:auto;color:var(--ink)}.cost-modal::backdrop{background:rgba(16,26,51,.60)}.cost-modal .modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px}.cost-modal h2{font-size:20px;margin:0}.cost-modal p{font-size:12px;color:var(--muted);line-height:1.6;margin:6px 0}
.cost-modal label{display:block;font-weight:700;font-size:13px;margin:17px 0 7px}.cost-modal label small{display:block;font-size:11px;color:var(--muted);font-weight:400;margin-top:3px}.cost-modal input{width:100%;border:1px solid #cbd9e8;border-radius:9px;padding:12px;font-size:15px}.cost-modal .formula-note{background:#f2f6fa;border-radius:9px;padding:12px;margin-top:16px}.cost-modal .modal-close{border:0;background:transparent;font-size:26px;padding:0 3px;color:#6d7f95}.cost-modal .modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}.cost-modal .primary{border:0;border-radius:9px;padding:10px 18px;background:var(--navy);color:#fff;font-weight:700}.cost-modal .primary:disabled{opacity:.6}#costSettingsError{color:#b4414e;font-size:12px}
@media(max-width:620px){.alerts{top:64px}.cost-modal{padding:18px}}

/* v6: one clearly comparable line on every business KPI, including spend. */
#kpis .kpi{display:flex;flex-direction:column;align-items:stretch}
#kpis .kpi-value{flex-shrink:0}
#kpis .kpi-foot{font-size:10px;line-height:1.35}
#kpis .kpi-compare{margin-top:auto;padding-top:7px;font-size:11px;font-weight:760;line-height:1.35;font-variant-numeric:tabular-nums;min-height:21px}
#kpis .kpi-compare span{font-size:10px;font-weight:550;color:#697b93}
#kpis .kpi-compare.good{color:#096d5b}
#kpis .kpi-compare.bad{color:#bd4755}
#kpis .kpi-compare.neutral{color:#315f95}
#kpis .kpi-compare.pending,#kpis .kpi-compare.flat{color:#8694a6;font-weight:600}
#kpis .kpi.feature .kpi-compare{color:#c1f0e8}
#kpis .kpi.feature .kpi-compare.bad{color:#ffb5bc}
#kpis .kpi.feature .kpi-compare.neutral{color:#c8dcff}
#kpis .kpi.feature .kpi-compare.pending,#kpis .kpi.feature .kpi-compare.flat{color:#b1c0d3}
#kpis .kpi.feature .kpi-compare span{color:#c2cfdf}
@media(min-width:1100px){#kpis .kpi{min-height:152px}#kpis .kpi .kpi-foot{font-size:9.5px}#kpis .kpi .kpi-compare{font-size:10.5px}}
@media(max-width:620px){#kpis .kpi{min-height:139px}#kpis .kpi .kpi-compare{font-size:10px}#kpis .kpi .kpi-compare span{font-size:9px}#kpis .kpi .kpi-foot{font-size:9px}}
/* Google classifications are edited inline, within the existing campaign table. */
.google-report-table{min-width:760px}
.google-report-table th:first-child{min-width:240px;width:33%}
.google-campaign-title{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:210px}
.google-campaign-title>.table-name{flex:1;min-width:0;line-height:1.4;overflow-wrap:anywhere}
.google-class-control{flex-shrink:0}
.google-class-control select{width:128px;padding:7px 25px 7px 8px;border:1px solid #cbd9e5;border-radius:8px;background-color:white;color:#273852;font-size:11px;font-weight:670;cursor:pointer}
.google-class-control select:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.google-class-control select:disabled{opacity:.55;cursor:wait}
.google-readonly{display:flex;align-items:center;gap:5px;font-size:10px;color:#7a8a9c;flex-shrink:0}
.google-readonly .status-tag{padding:4px 6px;font-size:9px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:620px){.google-report-table th:first-child{min-width:220px}.google-campaign-title{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px}.google-campaign-title>.table-name{flex-basis:100%}.google-class-control select{width:125px}}

/* v7: Compact KPI comparisons without artificially pinning them to card bottoms. */
#kpis .kpi{min-height:0;gap:0}
#kpis .kpi-compare{margin-top:4px;padding-top:2px;min-height:0;line-height:1.25}
#kpis .kpi-foot{margin-bottom:0}
@media(min-width:1100px){#kpis .kpi{min-height:119px}#kpis .kpi-value{margin-top:7px}}
@media(max-width:620px){#kpis .kpi{min-height:115px}#kpis .kpi-compare{margin-top:4px}}
/* v7: Accessible column sorting; leaves the table stationary while sorting. */
.sort-button{border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;text-align:inherit;cursor:pointer;padding:6px 1px;display:inline-flex;align-items:center;gap:5px;justify-content:flex-start;white-space:normal}
th.numeric .sort-button{justify-content:flex-end;text-align:right}
.sort-button:focus-visible{outline:2px solid #39aeb9;outline-offset:2px;border-radius:3px}
.sort-button:hover{color:#1e6189}
.sort-arrow{font-size:12px;color:#8294ae;flex-shrink:0}
.ga4-table{min-width:1230px}
.ga4-table th{min-width:100px}
.ga4-table th:first-child{min-width:235px}
.ga4-table th:nth-child(4),.ga4-table th:nth-child(5),.ga4-table th:nth-child(9){min-width:128px}

/* v8: denser campaign tables with mouse drag-to-scroll and mobile swipe. */
.table-scroll-hint{margin:0 0 9px;color:#7b8aa0;font-size:11px;line-height:1.4}
.drag-scroll{overflow-x:auto;overflow-y:hidden;max-width:100%;overscroll-behavior-x:contain;scrollbar-width:thin;cursor:grab;-webkit-overflow-scrolling:touch}
.drag-scroll.dragging{cursor:grabbing;user-select:none}
.drag-scroll:focus-visible{outline:2px solid #39aeb9;outline-offset:2px;border-radius:4px}
.meta-report-table,.ga4-table{border-collapse:collapse;table-layout:auto;width:max-content;min-width:100%}
.meta-report-table th,.meta-report-table td,.ga4-table th,.ga4-table td{padding:9px 7px;vertical-align:middle}
.meta-report-table th,.ga4-table th{font-size:9px;line-height:1.3;letter-spacing:.15px;text-transform:none;white-space:normal}
.meta-report-table td,.ga4-table td{font-size:11px;line-height:1.35}
.meta-report-table th:not(:first-child){min-width:78px;width:89px;max-width:106px}
.meta-report-table th:first-child{width:236px;min-width:214px;max-width:300px}
.meta-report-table td:first-child{max-width:300px;overflow-wrap:anywhere}
.meta-report-table td.numeric,.ga4-table td.numeric{white-space:nowrap}
.meta-report-table .sub-row td{padding:8px 7px}
.meta-report-table .sub-row td:first-child{padding-left:18px}
.meta-report-table .sort-button,.ga4-table .sort-button{gap:3px;padding:4px 0;line-height:1.2}
.meta-report-table .sort-arrow,.ga4-table .sort-arrow{font-size:10px}
.meta-report-table .adset-expand{align-items:flex-start;max-width:100%}
.meta-report-table .adset-expand .table-sub{display:block}
.ga4-table{min-width:810px}
.ga4-table th,.ga4-table td{min-width:0!important}
.ga4-table th:first-child{width:185px;max-width:230px;min-width:185px!important}
.ga4-table th:not(:first-child){width:81px;max-width:104px}
.ga4-table th:nth-child(4),.ga4-table th:nth-child(5),.ga4-table th:nth-child(9){min-width:0!important;width:91px}
.ga4-table td:first-child{max-width:230px;overflow-wrap:anywhere}

/* v8: Creative rankings are children of expanded Meta ad-set rows. */
.meta-report-table .creatives-row td{background:#f2f6fb;padding:11px 10px 16px!important;border-bottom:1px solid #dfe7ef}
.creative-panel{padding:9px 3px;min-width:0;max-width:calc(100vw - 110px)}
.creative-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}
.creative-panel-head strong{display:block;font-size:13px;color:#23344e}
.creative-panel-head span{display:block;font-size:11px;color:#72829a;margin-top:4px}
.creative-retry{border:1px solid #d6e0ea;background:#fff;color:#31506a;border-radius:8px;padding:7px 10px;font-size:11px;font-weight:700;white-space:nowrap}
.creative-retry:hover{background:#e9f4f7}
.creative-grid{display:grid;grid-template-columns:repeat(3,minmax(145px,1fr));gap:10px;width:100%}
.creative-card{min-width:0;background:#fff;border:1px solid #dce5ef;border-radius:11px;overflow:hidden;box-shadow:0 4px 11px rgba(26,40,76,.03)}
.creative-open{display:block;padding:0;background:transparent;border:0;width:100%;text-align:left;color:inherit}
.creative-open:focus-visible{outline:3px solid #2c9da7;outline-offset:-3px}
.creative-thumb{height:122px;background:#e8edf3;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}
.creative-thumb img{height:100%;width:100%;object-fit:cover;transition:transform .15s}
.creative-open:hover img{transform:scale(1.04)}
.creative-placeholder{font-size:11px;color:#6d8099;text-align:center;padding:15px}
.creative-kind{position:absolute;bottom:7px;left:7px;background:rgba(22,34,61,.85);color:#fff;padding:4px 7px;border-radius:5px;font-size:10px}
.creative-name{display:block;font-size:11px;font-weight:750;color:#273850;padding:10px 10px 2px;white-space:normal;min-height:39px;line-height:1.35}
.creative-ranks{display:flex;flex-wrap:wrap;gap:4px;padding:6px 9px;min-height:31px}
.creative-rank{background:#eef2fb;color:#31527d;border-radius:5px;padding:4px 6px;font-size:9px;font-weight:720}
.creative-rank.purchase{background:#e5f6f1;color:#177564}
.creative-stats{display:grid;grid-template-columns:1fr 1fr;gap:7px 6px;border-top:1px solid #edf1f6;padding:10px}
.creative-stats>span{font-size:10px;color:#74849a;min-width:0}
.creative-stats b{display:block;font-size:12px;color:#26374c;margin-top:3px;font-variant-numeric:tabular-nums}
.creative-disclaimer{font-size:10px;color:#75849a;margin:11px 2px 0;white-space:normal}
.creative-loading,.creative-error,.creative-empty{border:1px dashed #cbd7e5;border-radius:9px;padding:22px 14px;background:#fff;font-size:12px;color:#687c94;text-align:center;white-space:normal}
.creative-loading .loading-icon{font-size:16px;display:inline-block;animation:pluto-spin 1.1s linear infinite;margin-right:5px}
@keyframes pluto-spin{to{transform:rotate(360deg)}}

/* Meta-hosted interactive preview dialog: media is never copied to our VPS. */
.meta-preview-modal{width:min(800px,calc(100vw - 28px));max-height:92vh;padding:17px;border:1px solid #dce5ed;border-radius:15px;box-shadow:0 20px 60px rgba(20,28,52,.28);color:var(--ink);overflow-y:auto}
.meta-preview-modal::backdrop{background:rgba(10,20,45,.69)}
.meta-preview-head{display:flex;gap:10px;justify-content:space-between;align-items:flex-start;margin-bottom:12px}
.meta-preview-head h2{font-size:17px;line-height:1.35;margin:0;overflow-wrap:anywhere}
.meta-preview-head p{font-size:11px;line-height:1.5;color:#65758c;margin:6px 0 0}
.meta-preview-head .modal-close{border:0;background:#f2f5fa;color:#415069;border-radius:8px;font-size:21px;width:34px;height:34px;flex-shrink:0}
.meta-preview-body{min-height:300px;background:#f4f6fa;border-radius:10px;display:grid;place-items:center;text-align:center;font-size:12px;color:#61728a;padding:10px;white-space:normal}
.meta-preview-body iframe{width:100%;height:min(66vh,650px);min-height:340px;border:0;border-radius:7px;background:white}
.meta-preview-footer{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin-top:12px;font-size:11px;color:#75829a}
.meta-preview-footer a{font-size:12px;font-weight:740;color:#265e91;text-decoration:none}
.meta-preview-footer a:hover{text-decoration:underline}
@media(max-width:760px){
  .creative-panel{max-width:calc(100vw - 73px)}
  .creative-grid{grid-template-columns:repeat(2,minmax(115px,1fr));gap:8px}
  .creative-thumb{height:118px}
  .meta-report-table th:first-child{min-width:175px;width:196px}
  .ga4-table th:first-child{min-width:165px!important;width:165px}
  .ga4-table th:not(:first-child){width:78px}
  .meta-preview-body iframe{height:62vh;min-height:350px}
}
@media(max-width:420px){
  .creative-grid{grid-template-columns:repeat(2,minmax(108px,1fr))}
  .creative-panel{max-width:calc(100vw - 58px)}
  .creative-panel-head{align-items:flex-start}
  .creative-panel-head span{font-size:10px}
  .creative-retry{font-size:10px;padding:6px}
}

/* v9: Ad-level rankings as ordinary table rows; no remote image downloads on expansion. */
.meta-report-table .creative-info-row td{background:#edf4fb;padding-top:9px;padding-bottom:9px;font-size:10px;color:#60758f;white-space:normal}
.meta-report-table .creative-info-row td:first-child{font-weight:750;color:#2b4263}
.meta-report-table .creative-ad-row td{background:#f7faff;border-bottom:1px solid #e0e9f3;padding-top:9px;padding-bottom:9px}
.meta-report-table .creative-ad-row td:first-child{padding-left:30px}
.creative-title-link{background:none;border:0;padding:0;max-width:100%;text-align:left;color:#215e8c;font-weight:730;font-size:11px;line-height:1.45;overflow-wrap:anywhere;text-decoration:underline;text-decoration-color:#c3d8e7;text-underline-offset:2px;cursor:pointer}
.creative-title-link:hover{color:#0b8091;text-decoration-color:currentColor}
.creative-title-link:focus-visible{outline:2px solid #339ea8;border-radius:3px}
.creative-rank-inline{display:flex;flex-wrap:wrap;gap:3px;margin-top:4px}
.creative-rank-inline .creative-rank{font-size:9px;padding:3px 5px}
.meta-report-table .creative-info-row .loading-icon{display:inline-block;animation:pluto-spin 1s linear infinite}
.meta-preview-body{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;min-height:220px;overflow:hidden}
.meta-selfhosted-media{display:block;max-width:100%;max-height:min(68vh,670px);object-fit:contain;border-radius:7px;background:#121724}
.meta-preview-body video.meta-selfhosted-media{width:100%;height:auto;min-height:180px}
.meta-preview-body img.meta-selfhosted-media{width:auto;height:auto}
.meta-preview-body .media-notice{margin:0;color:#6b7991;font-size:11px;line-height:1.4;text-align:center}
.meta-preview-body .media-diagnostic{margin:0;color:#67758b;font-size:10px;line-height:1.4;text-align:center;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.media-retry-button{border:1px solid #a7bdd7;background:#fff;color:#2c5480;border-radius:8px;padding:8px 13px;font-size:12px;font-weight:650;cursor:pointer}
.media-retry-button:hover{background:#eef5ff}
@media(max-width:760px){
  /* On phones: enough width for frozen title AND at least one complete numeric metric. */
  .meta-report-table,.google-report-table,.ga4-table{border-collapse:separate;border-spacing:0}
  .meta-report-table th:first-child,.meta-report-table td:first-child,
  .google-report-table th:first-child,.google-report-table td:first-child,
  .ga4-table th:first-child,.ga4-table td:first-child{
    position:sticky;left:0;z-index:2;
    width:clamp(120px,38vw,148px)!important;
    min-width:clamp(120px,38vw,148px)!important;
    max-width:clamp(120px,38vw,148px)!important;
    padding-left:7px!important;padding-right:7px!important;
    background:#fff;box-shadow:2px 0 0 rgba(204,218,233,.9);
    overflow-wrap:anywhere;white-space:normal;
  }
  .meta-report-table thead th:first-child,.google-report-table thead th:first-child,
  .ga4-table thead th:first-child{background:#f7f9fb;z-index:5}
  .meta-report-table .sub-row td:first-child{background:#f9fbfd}
  .meta-report-table .creative-ad-row td:first-child{background:#f7faff;padding-left:9px!important}
  .meta-report-table .creative-info-row td:first-child{background:#edf4fb}
  .ga4-table .ga4-total td:first-child{background:#eff5f9}
  .meta-report-table th:not(:first-child){min-width:83px;width:86px;max-width:105px}
  .ga4-table th:not(:first-child){width:88px;min-width:82px!important}
  .google-report-table th:not(:first-child){min-width:90px;width:94px}
  .meta-report-table .expand{gap:4px;max-width:100%}
  .meta-report-table .expand .chev{width:17px;height:17px}
  .meta-report-table .expand>span:last-child{min-width:0;overflow-wrap:anywhere}
  .meta-report-table td:first-child .table-name,
  .google-report-table td:first-child .table-name,
  .ga4-table td:first-child{overflow-wrap:anywhere;word-break:normal}
  .meta-report-table td:first-child .table-name{font-size:11px}
  .meta-report-table td:first-child .table-sub{font-size:9px}
  .creative-rank-inline .creative-rank{font-size:8px;padding:2px 4px}
  .google-campaign-title{display:block}
  .google-campaign-title>.table-name{margin-bottom:5px}
  .google-class-control{display:block;width:100%}
  .google-class-control select{width:100%;max-width:100%;padding:6px 14px 6px 5px;font-size:10px}
  .google-readonly{display:block;white-space:normal;line-height:1.5}
  .google-readonly .status-tag{margin-top:3px}
}
/* Keep the mobile frozen width exact: automatic table layout can otherwise
   expand a long Google campaign title and hide the first metric. */
@media(max-width:760px){
  .meta-report-table{table-layout:fixed;width:955px;min-width:955px}
  .google-report-table{table-layout:fixed;width:730px;min-width:730px}
  .ga4-table{table-layout:fixed;width:955px;min-width:955px}
  .google-report-table td:first-child,.meta-report-table td:first-child,.ga4-table td:first-child{overflow-wrap:anywhere}
}
@media(max-width:760px){
  .google-campaign-title{min-width:0!important;width:100%;max-width:100%}
  .google-class-control,.google-class-control select{min-width:0!important;max-width:100%!important}
}
@media(max-width:760px){
  .google-report-table .google-campaign-title{
    width:calc(clamp(120px,38vw,148px) - 14px)!important;
    max-width:calc(clamp(120px,38vw,148px) - 14px)!important;
  }
  .google-report-table .google-class-control select{width:100%!important;max-width:100%!important}
}

/* v10 — Hourly performance is deliberately isolated from global date filters.
   Uses only small cached aggregates and the same horizontal scroll UX. */
.hourly-panel{padding:19px 20px 21px}
.hourly-toolbar{display:flex;align-items:flex-end;gap:12px 18px;flex-wrap:wrap}
.hourly-field{display:grid;gap:6px;font-size:11px;font-weight:700;color:#65758b}
.hourly-field input:focus-visible{outline:2px solid #28aeb7;outline-offset:2px}
.hourly-field input{height:39px;min-width:150px;border:1px solid #dbe3ec;border-radius:8px;padding:0 10px;background:white;color:#17253d;font-size:13px}
.hourly-google-toggle{display:flex;align-items:center;gap:8px;margin-left:auto;padding:7px 0;font-size:12px;font-weight:650;color:#42516a;white-space:nowrap;cursor:pointer}
.hourly-google-toggle input{width:17px;height:17px;accent-color:#273b61}
.hourly-mode-note,.hourly-disclaimer{font-size:11px;color:#75869a;line-height:1.55;margin:12px 0 0}
.hourly-freshness{padding:9px 0 7px;font-size:10.5px;color:#63748e;line-height:1.65;overflow-wrap:anywhere}
.hourly-report-table{width:max-content;min-width:100%;border-collapse:collapse;table-layout:fixed}
.hourly-report-table th,.hourly-report-table td{font-variant-numeric:tabular-nums;padding:11px 11px;white-space:nowrap}
.hourly-report-table thead th{background:#f5f8fb;color:#697891;font-size:10px;text-transform:none;letter-spacing:0}
.hourly-report-table thead th:not(:first-child){width:118px;min-width:118px}
.hourly-report-table th:first-child{width:95px;min-width:95px}
.hourly-report-table tbody th{font-size:12px;font-weight:760;border-bottom:1px solid #edf1f6;background:white;color:#263750}
.hourly-report-table tbody th small{display:block;margin-top:3px;color:#168b7a;font-size:9px;font-weight:700}
.hourly-report-table tbody tr:nth-child(even) td,.hourly-report-table tbody tr:nth-child(even) th{background:#fafbfd}
.hourly-report-table .hourly-future th,.hourly-report-table .hourly-future td{color:#a8b4c2}
.hourly-report-table td{font-size:12px}
.hourly-report-table tfoot th,.hourly-report-table tfoot td{
  background:#e9eff8;color:#17263f;font-size:12px;font-weight:800;
  border-top:2px solid #a6b7d0;border-bottom:1px solid #bfcce0;
}
.hourly-report-table tfoot th{white-space:normal;line-height:1.25}
@media(max-width:620px){
  .hourly-panel{padding:13px 11px}
  .hourly-toolbar{gap:10px}
  .hourly-field{flex:1;min-width:130px}
  .hourly-field input{width:100%;min-width:0}
  .hourly-google-toggle{margin-left:0;width:100%;padding:3px 0}
  .hourly-report-table{min-width:960px;width:960px;table-layout:fixed}
  .hourly-report-table th:first-child,.hourly-report-table tbody th:first-child{
    position:sticky;left:0;z-index:3;width:83px!important;min-width:83px!important;max-width:83px!important;
    padding-left:9px!important;padding-right:5px!important;
    background:#fff;box-shadow:2px 0 0 #cdd8e6;
  }
  .hourly-report-table thead th:first-child{background:#f5f8fb;z-index:5}
  .hourly-report-table tfoot th:first-child{background:#e9eff8;z-index:4}
  .hourly-report-table tbody tr:nth-child(even) th:first-child{background:#fafbfd}
  .hourly-report-table thead th:not(:first-child){min-width:105px;width:105px}
  .hourly-report-table th,.hourly-report-table td{padding:10px 7px}
}
