:root { --bg:#0b1220; --panel:#131d2d; --panel-soft:#17243a; --line:#26364e; --text:#f3f7fb; --muted:#93a4ba; --blue:#54b6ff; --green:#55d69a; --yellow:#ffcf70; --red:#ff7777; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--text); font:15px/1.45 Inter, ui-sans-serif, system-ui, sans-serif; }
.rail { position:fixed; inset:0 auto 0 0; width:238px; padding:28px 18px; border-right:1px solid var(--line); background:#0d1727; display:flex; flex-direction:column; overflow-y:auto; }
.brand { display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.04em; }
.brand-mark { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; color:#06101b; background:linear-gradient(135deg,#71c7ff,#58e0a4); }
nav { display:grid; gap:6px; margin:36px 0 12px; } nav a { color:var(--muted); text-decoration:none; padding:11px 13px; border-radius:8px; } nav a:hover, nav a.active { color:var(--text); background:#1c2c44; } nav a.active { box-shadow:inset 3px 0 var(--blue); }
.nav-group { display:grid; grid-template-columns:minmax(0,1fr) auto; }
.nav-group > a[data-primary] { grid-column:1 / -1; grid-row:1; padding-right:40px; }
.nav-expand { grid-column:2; grid-row:1; z-index:1; align-self:center; margin-right:5px; padding:3px 9px; border:0; background:transparent; color:var(--muted); font-size:19px; }
.nav-expand[aria-expanded="true"] { transform:rotate(180deg); }
.nav-submenu { grid-column:1 / -1; display:grid; gap:2px; margin:5px 0 4px 14px; padding-left:10px; border-left:1px solid var(--line); }
.nav-submenu a { padding:7px 10px; font-size:13px; }
.rail-note { margin-top:auto; color:var(--muted); font-size:14px; }
main { max-width:none; margin-left:238px; padding:36px 32px 64px; }
.topbar, .panel-heading, .topbar-actions, .formula-grid { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.rail:has(a[href="#overview"].active) ~ main .topbar { justify-content:flex-end; }
.rail:has(a[href="#overview"].active) ~ main .topbar > div:first-child { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
h1,h2,p { margin:0; } h1 { margin-top:2px; font-size:30px; } h2 { font-size:18px; }.eyebrow { color:var(--blue); font-size:11px; letter-spacing:.1em; font-weight:800; }
button,.period { border:1px solid var(--line); background:var(--panel-soft); color:var(--text); border-radius:8px; padding:10px 13px; cursor:pointer; }.period-label { display:grid; gap:4px; color:var(--muted); font-size:11px; }.period { min-width:92px; }.status { color:var(--muted); font-size:13px; }.status i { display:inline-block; width:8px; height:8px; margin-right:7px; border-radius:50%; background:var(--yellow); }.status i.healthy { background:var(--green); }
.notice { display:flex; gap:12px; margin:30px 0 22px; padding:14px 16px; border:1px solid #554622; border-radius:10px; color:#f6d58e; background:#261f12; }.notice span { color:#d1b978; }
.login-panel { display:flex; align-items:center; justify-content:space-between; gap:22px; margin:0 0 22px; padding:18px; border:1px solid #275a76; border-radius:12px; background:#102136; }.login-panel h2 { margin-top:4px; }.login-panel form { display:flex; align-items:end; gap:10px; }.login-panel label { display:grid; gap:5px; color:var(--muted); font-size:12px; }.login-panel input { width:150px; border:1px solid var(--line); border-radius:7px; padding:10px; background:#0b1220; color:var(--text); }.login-panel button { border-color:#2e7eb9; background:#1e5f91; }.login-message { color:var(--yellow); font-size:12px; }
.login-panel:not([hidden]) ~ #financial-content { display:none; }
body:has(.login-panel:not([hidden])) .rail,
body:has(.login-panel:not([hidden])) .topbar,
body:has(.login-panel:not([hidden])) .notice { display:none; }
body:has(#xray-page:not([hidden])) .notice,
body:has(#xray-page:not([hidden])) #overview-monthly-daily-roas,
#overview-outlook #xray-outlook-note { display:none !important; }
body:has(.login-panel:not([hidden])) main { min-height:100vh; min-height:100svh; margin-left:0; padding:24px; display:grid; place-items:center; }
body:has(.login-panel:not([hidden])) .login-panel { width:min(100%,420px); margin:0; display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; gap:18px; }
body:has(.login-panel:not([hidden])) .login-panel form { display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; gap:14px; }
body:has(.login-panel:not([hidden])) .login-panel input { width:100%; }
body:has(.login-panel:not([hidden])) .login-panel button { justify-self:start; }
.session-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-bottom:12px; }.session-actions span { color:var(--muted); font-size:14px; }.session-actions button { border-color:#325575; }
.metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }.metric-card,.panel { border:1px solid var(--line); border-radius:13px; background:var(--panel); }.metric-card { min-height:132px; padding:19px; display:flex; flex-direction:column; gap:6px; }.metric-card span,.metric-card small { color:var(--muted); }.metric-card strong { font-size:31px; letter-spacing:-.04em; }.metric-card small { font-size:12px; }.metric-card.accent { border-color:#24649b; background:linear-gradient(145deg,#162b43,#132136); }.metric-card.accent strong { color:#8ed1ff; }
.overview-breakdown { margin-top:16px; }.breakdown-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:16px; }.breakdown-grid div { display:flex; flex-direction:column; gap:5px; min-width:0; padding:14px; border:1px solid var(--line); border-radius:9px; background:var(--panel-soft); }.breakdown-grid span { color:var(--muted); font-size:12px; }.breakdown-grid strong { font-size:18px; overflow-wrap:anywhere; }
.overview-history { margin-top:16px; }.overview-history .page-intro { margin:14px 0 0; }.overview-history .reference-summary { margin:16px 0 0; }
.overview-history .reference-summary small { display:block; margin-top:8px; color:var(--muted); font-size:12px; }
.overview-compact-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0 0; }
.overview-compact-summary article { min-height:82px; padding:12px; border-radius:10px; }
.overview-compact-summary span { font-size:13px; line-height:1.3; }
.overview-compact-summary strong { margin-top:6px; font-size:clamp(17px,2vw,22px); line-height:1.2; }
.overview-compact-summary article.gam-revenue-card strong { color:var(--green); }
.overview-compact-summary article.media-profit-card strong { color:var(--green); }
.closed-financial-groups { display:grid; gap:18px; margin-top:12px; }
.closed-financial-group h3 { margin:0 0 8px; color:var(--muted); font-size:15px; font-weight:600; }
.closed-financial-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.closed-financial-grid article { min-width:0; min-height:82px; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.closed-financial-grid span { display:block; color:var(--muted); font-size:13px; line-height:1.3; }
.closed-financial-grid strong { display:block; margin-top:6px; color:var(--green); font-size:clamp(17px,1.8vw,22px); line-height:1.2; white-space:nowrap; }
.closed-cost-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.closed-cost-grid strong { color:var(--red); }
.closed-cost-grid .company-total-cost-card { border-color:#713d4b; background:linear-gradient(145deg,#2d202e,#211b29); }
.closed-cost-grid .company-total-cost-card strong { color:#ff7777; }
.overview-compact-summary article.media-profit-card { border-color:#27654f; }
.layout { display:grid; grid-template-columns:1fr; gap:16px; margin:16px 0; }.panel { padding:22px; }.panel-heading button { color:var(--blue); }.chart-placeholder { display:grid; place-items:center; height:260px; margin-top:20px; border-radius:9px; border:1px dashed #38506c; color:var(--muted); background:repeating-linear-gradient(0deg,transparent 0 48px,#1a2940 49px 50px); }.pending { color:var(--yellow); }.pill { border:1px solid #275a76; color:#8dd8f7; border-radius:999px; padding:6px 10px; font-size:12px; }.formula-grid { align-items:stretch; margin-top:20px; }.formula-grid div { flex:1; padding:15px; border-radius:9px; background:var(--panel-soft); }.formula-grid p { color:var(--muted); margin-top:8px; font-size:13px; }
.source-health { margin:16px 0 0; padding:16px 18px; }
body:has(.login-panel:not([hidden])) #overview-sources { display:none; }
.source-health .panel-heading { align-items:baseline; }
.source-refreshed-at,.source-cutoff { color:var(--muted); font-size:14px; line-height:1.45; }
.source-health-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 22px; margin-top:10px; }
.source-health-grid > div { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 10px; min-width:0; padding:8px 2px; border-bottom:1px solid var(--line); }
.source-health-grid span { color:var(--muted); font-size:13px; }
.source-health-grid strong { font-size:14px; white-space:nowrap; }
.source-health-grid .source-ok { color:var(--green); }
.source-health-grid .source-attention { color:var(--yellow); }
.source-health-grid .source-error { color:var(--red); }
.source-health-grid .source-unknown { color:var(--muted); white-space:normal; }
.source-health-grid details { flex-basis:100%; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.source-health-grid details summary { cursor:pointer; color:var(--blue); }
.source-health-grid details p { margin-top:5px; }
.source-cutoff { margin-top:10px; }
.source-cutoff.source-attention { color:var(--yellow); }
.source-cutoff.source-error { color:var(--red); }
.rail .source-health { margin:0; padding:12px 0 8px; border:0; border-top:1px solid var(--line); border-radius:0; background:transparent; }
.rail .source-health h2 { font-size:13px; }
.rail .source-health-grid { grid-template-columns:1fr; margin-top:7px; }
.rail .source-health-grid > div { padding:5px 0; }
.rail .source-health-grid span { font-size:13px; }
.rail .source-health-grid strong { font-size:13px; }
.rail .source-refreshed-at { display:block; margin-top:8px; font-size:14px; }
.metric-card small,.reference-card > p:not([id]) { display:none; }
.overview-kpi { margin-top:18px; }
.overview-kpi h2 { margin:0 0 10px; font-size:18px; }
.overview-kpi .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.overview-kpi .metric-card { min-width:0; min-height:124px; padding:16px; }
.overview-kpi .metric-card span { font-size:14px; }
.overview-kpi .metric-card strong { font-size:clamp(20px,2.4vw,29px); overflow-wrap:anywhere; }
.metric-card .metric-current { display:block; margin-top:auto; padding-top:8px; border-top:1px solid var(--line); color:var(--yellow); font-size:14px; }
.overview-closed-history { margin-top:24px; }
.overview-closed-history .panel-heading { margin-bottom:10px; }
.overview-7d-roas-heading { margin:18px 0 10px; }
.overview-closed-history h2 { font-size:18px; }
.overview-closed-history .metric-card { min-height:150px; }
.overview-closed-history .metric-card strong { font-size:25px; }
.overview-mini-chart { width:100%; height:45px; margin-top:auto; }
.overview-chart { display:grid; place-items:center; min-height:260px; margin-top:20px; border-radius:9px; border:1px solid #38506c; color:var(--muted); background:repeating-linear-gradient(0deg,transparent 0 48px,#1a2940 49px 50px); padding:8px; }.overview-chart svg { display:block; width:100%; max-height:230px; }.trend-caption { color:var(--muted); font-size:12px; text-align:center; }
.reference-page { margin-top:28px; }.reference-page h2 { margin:4px 0 8px; font-size:25px; }.page-intro { color:var(--muted); margin-bottom:22px; overflow-wrap:anywhere; }.reference-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }.reference-summary article { border:1px solid var(--line); background:var(--panel); border-radius:12px; padding:17px; }.reference-summary span { display:block; color:var(--muted); font-size:13px; }.reference-summary strong { display:block; margin-top:6px; font-size:26px; }.reference-filters { display:flex; gap:14px; margin:18px 0; }.reference-filters label { display:grid; gap:6px; min-width:210px; color:var(--muted); font-size:12px; }.reference-filters input,.reference-filters select { width:100%; min-height:40px; border:1px solid var(--line); border-radius:8px; padding:9px 11px; color:var(--text); background:var(--panel-soft); }.reference-list { display:grid; gap:12px; }.reference-card { border:1px solid var(--line); border-radius:12px; background:var(--panel); padding:18px; }.reference-card h3 { margin:0 0 5px; font-size:17px; }.reference-card p { color:var(--muted); margin:4px 0; overflow-wrap:anywhere; }.reference-card details { border-top:1px solid var(--line); margin-top:12px; padding-top:11px; }.reference-card summary { cursor:pointer; color:#9bd5ff; }.reference-row { border-top:1px solid var(--line); padding:11px 0; }.reference-row:first-child { border-top:0; }.reference-row b { color:var(--text); }.reference-row a { color:#8ed1ff; overflow-wrap:anywhere; }.reference-empty { color:var(--muted); border:1px dashed var(--line); border-radius:10px; padding:20px; }
.reference-summary article { min-width:0; overflow-wrap:anywhere; }
#xray-outlook-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
#xray-outlook-summary > article { display:flex; flex-direction:column; }
#xray-outlook-summary > article > span { display:flex; min-height:2.6em; align-items:flex-end; line-height:1.3; }
#xray-outlook-summary > article:nth-child(6) { grid-row:3; grid-column:2; }
#xray-outlook-summary > article:last-child { grid-row:4; grid-column:1 / -1; }
@media (max-width:900px) {
  #xray-outlook-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #xray-outlook-summary > article:nth-child(6) { grid-row:4; grid-column:1; }
  #xray-outlook-summary > article:last-child { grid-row:5; }
}
@media (max-width:600px) {
  #xray-outlook-summary > article:nth-child(6) { grid-row:4; grid-column:1 / -1; }
  #xray-outlook-summary > article:last-child { grid-row:5; grid-column:1 / -1; }
}
.monthly-financial-sheet { margin-top:16px; }
.monthly-financial-sheet .page-intro { margin:8px 0 14px; }
.sheet-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0; }
.sheet-tabs button { min-width:0; width:100%; border:1px solid var(--line); border-radius:8px; padding:9px 8px; background:var(--panel-soft); color:var(--text); cursor:pointer; line-height:1.25; overflow-wrap:anywhere; }
.sheet-tabs button[aria-selected="true"] { border-color:#62b8ff; color:#9bd5ff; background:#132a40; }
.sheet-scroll { max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:10px; }
.financial-sheet-table { width:100%; border-collapse:collapse; min-width:700px; font-size:13px; font-variant-numeric:tabular-nums; }
.financial-sheet-table th,.financial-sheet-table td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; }
.financial-sheet-table th:first-child,.financial-sheet-table td:first-child { text-align:left; position:sticky; left:0; background:var(--panel); }
.financial-sheet-table thead th { color:var(--muted); background:var(--panel-soft); position:sticky; top:0; }
.financial-sheet-table .sheet-revenue { color:var(--green); }
.financial-sheet-table .sheet-expense { color:var(--red); }
.financial-sheet-table .roas-loss { color:var(--red); }
.financial-sheet-table .roas-below-first { color:#ffad72; }
.financial-sheet-table .roas-first { color:var(--yellow); }
.financial-sheet-table .roas-second { color:var(--green); }
.financial-sheet-table .roi-unavailable { color:var(--muted); }
.financial-sheet-table .sheet-profit-positive { color:var(--green); }
.financial-sheet-table .sheet-profit-negative { color:var(--red); }
.financial-sheet-table tfoot td { font-weight:700; border-bottom:0; background:var(--panel-soft); }
@media (max-width:600px) { .sheet-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.reference-filters { flex-wrap:wrap; }
.page-intro:not([id]), #roi-formulas, #meta-site-projection-note { display:none !important; }

/* Campaign account view: the period picker is the only preamble above the
   campaign summary. The summary itself remains the first content block. */
.roi-campaign-view .topbar > div:first-child,
.roi-campaign-view #status,
.roi-campaign-view #logout-status,
.roi-campaign-view #logout-button,
.roi-campaign-view #roi-source-context,
.roi-campaign-view .campaign-preamble { display: none !important; }
.roi-campaign-view .topbar { align-items: center; }
.roi-campaign-view .topbar-actions { align-items: flex-start; justify-content: flex-start; width: 100%; }
.roi-campaign-view #period-label { display: flex; }
.roi-campaign-view .roi-site-label { display:inline-flex; align-items:baseline; gap:10px; margin-right:6px; color:var(--muted); white-space:nowrap; }
.roi-campaign-view .roi-site-label strong { color:var(--blue); font-size:14px; font-weight:700; }
.roi-campaign-view .roi-site-label .roi-site-selector { max-width:140px; min-width:0; border:0; padding:0 20px 0 0; background:transparent; color:var(--blue); font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.roi-campaign-view .roi-site-label span { font-size:13px; }
.roi-campaign-view #meta-campaign-cutoff { display:none !important; }
.roi-campaign-view #meta-campaign-topline { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:12px; margin:10px 0 12px; }
.roi-campaign-view #meta-campaign-topline > article { min-width:0; border:1px solid var(--line); border-radius:12px; background:var(--panel); padding:17px; }
.roi-campaign-view #meta-campaign-topline > article > span { display:block; color:var(--muted); font-size:13px; }
.roi-campaign-view #meta-campaign-topline > article > strong { display:block; margin-top:6px; font-size:26px; }
.roi-campaign-view #google-campaign-topline { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:10px 0 12px; }
.roi-campaign-view #google-campaign-topline > article { min-width:0; border:1px solid var(--line); border-radius:12px; background:var(--panel); padding:17px; }
.roi-campaign-view #google-campaign-topline > article > span { display:block; color:var(--muted); font-size:13px; }
.roi-campaign-view #google-campaign-topline > article > strong { display:block; margin-top:6px; font-size:26px; }
.roi-campaign-view #google-campaign-summary { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:9px; margin:10px 0 12px; }
.roi-campaign-view #google-campaign-summary > article { min-width:0; min-height:82px; padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.roi-campaign-view #google-campaign-summary > article > span { display:block; color:var(--muted); font-size:13px; line-height:1.25; }
.roi-campaign-view #google-campaign-summary > article > strong { display:block; margin-top:6px; font-size:26px; line-height:1.15; }
#meta-campaign-list > .reference-card, #google-campaign-list > .reference-card { display:none !important; }
.roi-worksheets { display:grid; gap:20px; margin-top:14px; }
.roi-worksheet-group { min-width:0; border:1px solid var(--line); border-radius:12px; background:var(--panel); padding:14px; }
.roi-worksheet-group h3 { margin:0 0 8px; font-size:16px; }
.roi-worksheet-count,.roi-worksheet-copy-status { color:var(--muted); font-size:12px; }
.roi-worksheet-scroll { width:100%; max-width:100%; overflow-x:hidden; margin-top:10px; border:1px solid var(--line); border-radius:9px; }
.roi-worksheet-scroll:focus-visible { outline:2px solid var(--blue); }
.roi-worksheet-table { border-collapse:collapse; width:100%; table-layout:fixed; font-size:15px; }
.roi-worksheet-table th,.roi-worksheet-table td { min-width:0; border-bottom:1px solid var(--line); padding:8px 4px; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.roi-worksheet-table th { position:relative; background:#1b2a40; vertical-align:top; font-size:12px; white-space:normal; overflow-wrap:anywhere; }
.roi-worksheet-table th:first-child,.roi-worksheet-table td:first-child { max-width:none; text-align:left; background:var(--panel); }
.roi-worksheet-table th:first-child { background:#1b2a40; }
.roi-worksheet-table tr:hover td { background:#203049; }
.roi-worksheet-sort { display:block; width:100%; padding:2px 5px 2px 0; border:0; color:var(--text); background:transparent; font:inherit; font-weight:600; line-height:1.15; white-space:normal; text-align:inherit; cursor:pointer; }
.roi-worksheet-language-heading .roi-worksheet-sort { display:inline-flex; width:auto; align-items:center; gap:4px; white-space:nowrap; overflow-wrap:normal; }
.roi-worksheet-table th select { display:block; width:100%; min-width:0; margin-top:4px; padding:2px 1px; border:1px solid var(--line); border-radius:5px; color:var(--text); background:var(--panel-soft); font-size:10px; }
.roi-worksheet-table th input[type="search"] { display:block; width:100%; min-width:0; margin-top:4px; padding:3px 4px; border:1px solid var(--line); border-radius:5px; color:var(--text); background:var(--panel-soft); font-size:10px; }
.roi-utm-value { cursor:pointer; color:#9bd5ff; user-select:none; }
.roi-utm-value[aria-pressed="true"] { background:#1c3c56 !important; color:var(--green); box-shadow:inset 0 0 0 1px var(--green); font-weight:700; }
.roi-column-resize { position:absolute; inset:0 0 0 auto; width:7px; cursor:col-resize; touch-action:none; }
.roi-column-resize::after { position:absolute; inset:5px 2px; border-radius:2px; background:#52708e; content:""; opacity:.55; }
.roi-column-resize:hover::after,.roi-column-resize:focus-visible::after { background:var(--blue); opacity:1; }
@media (max-width:1150px) and (min-width:901px) { .roi-worksheet-table td { font-size:12px; padding:6px 2px; } .roi-worksheet-table th { font-size:10px; padding:5px 2px; } .roi-worksheet-table th select { font-size:9px; } }
.roi-campaign-name { cursor:pointer; color:#9bd5ff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.roi-campaign-name[aria-pressed="true"] { box-shadow:inset 3px 0 var(--green); color:var(--green); }
.roi-positive { color:var(--green); }.roi-negative { color:#ff8888; }.roi-neutral { color:var(--yellow); }.roi-unavailable { color:var(--muted); }
.funnel-site-filter { min-width:min(100%,380px); max-width:100%; margin:0; padding:8px 12px 12px; border:1px solid var(--line); border-radius:9px; }
.funnel-site-filter legend { color:var(--muted); font-size:12px; padding:0 5px; }
.funnel-site-options { display:flex; flex-wrap:wrap; gap:8px 14px; max-height:125px; overflow-y:auto; }
.reference-filters .funnel-site-options label { display:flex; align-items:center; gap:6px; min-width:0; color:var(--text); font-size:13px; cursor:pointer; }
.funnel-site-options input { width:16px; height:16px; min-height:16px; margin:0; padding:0; accent-color:var(--blue); }
.funnel-site-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; color:var(--muted); font-size:12px; }
.funnel-site-actions button { padding:6px 9px; font-size:12px; }
@media (min-width:901px) and (max-width:1150px) { .metrics,.reference-summary,.breakdown-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
:where(a, button, input, select, summary):focus-visible { outline:2px solid #8ed1ff; outline-offset:2px; }

/* Funis: compact portfolio view with directly visible page links. */
#funnels-page { margin-top:20px; }
#funnels-summary { grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 18px; }
#funnels-summary article { min-height:104px; padding:16px 18px; border-color:#2a3e58; border-radius:14px; background:linear-gradient(145deg,#17263b,#111c2c); }
#funnels-summary article span { color:#aabbd0; font-size:12px; font-weight:600; letter-spacing:.025em; }
#funnels-summary article strong { margin-top:10px; color:#f1f6fc; font-size:clamp(23px,2vw,30px); line-height:1; }
#funnels-summary article:nth-child(1) strong { color:#8ed1ff; }
#funnels-summary article:nth-child(3) strong { color:#69d5a0; }
#funnels-summary article:nth-child(4) strong { color:#ff9d9d; }
#funnels-page .reference-filters { align-items:stretch; gap:14px; margin:0 0 20px; }
#funnels-page .funnel-site-filter { flex:1 1 58%; min-width:0; max-width:none; padding:12px 14px 13px; border-color:#2a3e58; border-radius:14px; background:#111b2a; }
#funnels-page .funnel-site-filter legend { padding:0 7px; color:#d7e4f3; font-size:13px; font-weight:700; }
#funnels-page .funnel-site-options { display:flex; flex-wrap:wrap; gap:8px; max-height:none; overflow:visible; }
#funnels-page .funnel-site-options label { min-height:36px; padding:7px 11px; border:1px solid #30425b; border-radius:999px; background:#17243a; color:#b9c9dc; transition:background .15s ease,border-color .15s ease,color .15s ease; }
#funnels-page .funnel-site-options label:has(input:checked) { border-color:#347db0; background:#18334c; color:#e9f6ff; }
#funnels-page .funnel-site-options input { width:14px; height:14px; accent-color:#65bcf5; }
#funnels-page .funnel-site-actions { margin-top:11px; color:#93a8c0; font-size:12px; }
#funnels-page .funnel-site-actions button { min-height:30px; padding:5px 10px; border-color:#344a64; border-radius:999px; background:#1a2a40; color:#c9d9eb; }
#funnels-page .reference-filters > label { flex:1 1 280px; min-width:220px; align-content:start; color:#d7e4f3; font-size:13px; font-weight:700; }
#funnels-page .reference-filters > label input { min-height:50px; border-color:#2a3e58; border-radius:13px; background:#111b2a; font-size:14px; }
#funnels-page .reference-list { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:14px; }
#funnels-page .funnel-card { min-width:0; padding:0; overflow:hidden; border-color:#283a52; border-radius:16px; background:linear-gradient(155deg,#162337,#101a29); }
#funnels-page .funnel-card-heading { padding:17px 18px 14px; border-bottom:1px solid #293a50; background:rgba(31,49,72,.46); }
#funnels-page .funnel-card-heading h3 { margin:0; color:#f1f6fc; font-size:17px; line-height:1.35; }
#funnels-page .funnel-card-meta { display:block; margin:6px 0 0; color:#91a7c1; font-size:12px; }
#funnels-page .funnel-entry { min-width:0; padding:14px 18px 15px; border-top:1px solid rgba(48,66,91,.72); }
#funnels-page .funnel-entry:first-of-type { border-top:0; }
#funnels-page .funnel-entry-badges { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
#funnels-page .funnel-badge { display:inline-flex; align-items:center; min-height:23px; padding:3px 8px; border:1px solid #34455e; border-radius:999px; background:#1a293d; color:#b8c8da; font-size:11px; line-height:1.25; }
#funnels-page .funnel-badge-language { border-color:#315d7a; background:#183247; color:#a9dbfb; }
#funnels-page .funnel-badge-success { border-color:#285943; background:#142c25; color:#85dfb0; }
#funnels-page .funnel-badge-failure { border-color:#69424b; background:#322128; color:#ffb0b0; }
#funnels-page .funnel-url { display:block; color:#a9d9fb; font-size:13px; line-height:1.45; overflow-wrap:anywhere; text-decoration:none; }
#funnels-page .funnel-url:hover { color:#e1f3ff; text-decoration:underline; }
#funnels-page .funnel-entry-location { margin:5px 0 0; color:#899db5; font-size:12px; }
#funnels-page .funnel-entry-details { margin-top:9px; padding-top:8px; border-top:1px solid rgba(48,66,91,.55); }
#funnels-page .funnel-entry-details summary { color:#a7bad0; font-size:12px; }
#funnels-page .funnel-entry-details p { margin:7px 0 0; color:#9aacc1; font-size:12px; }
#funnels-page .funnel-audits { margin:0 0 18px; padding:13px 16px; border:1px solid #2a3e58; border-radius:13px; background:#111b2a; }
#funnels-page .funnel-audits > summary { color:#c9d8e8; font-size:13px; font-weight:700; }
#funnels-page .funnel-audits > details { margin-top:12px; padding:11px 0 0; border-top:1px solid #293a50; }
#funnels-page .funnel-audits > details p { margin:7px 0; color:#9aacc1; font-size:13px; overflow-wrap:anywhere; }
@media (max-width:1000px) { #funnels-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } #funnels-page .reference-list { grid-template-columns:1fr; } }
@media (max-width:600px) { #funnels-page { margin-top:12px; } #funnels-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } #funnels-summary article { min-height:88px; padding:12px; } #funnels-summary article strong { margin-top:8px; font-size:24px; } #funnels-page .reference-filters { gap:10px; } #funnels-page .funnel-site-filter { padding:10px; } #funnels-page .funnel-site-options { gap:6px; } #funnels-page .funnel-site-options label { min-height:34px; padding:6px 9px; font-size:12px; } #funnels-page .reference-filters > label { min-width:0; } #funnels-page .reference-filters > label input { min-height:46px; } #funnels-page .funnel-card-heading,#funnels-page .funnel-entry { padding-left:13px; padding-right:13px; } }

/* Keep the site picker and search compact; the choices appear only on demand. */
#funnels-page .funnel-filter-toolbar { display:grid; grid-template-columns:minmax(190px,.7fr) minmax(0,1.3fr); align-items:stretch; gap:10px; margin:0 0 16px; }
#funnels-page .funnel-site-filter { position:relative; z-index:5; display:flex; align-items:stretch; min-width:0; max-width:none; width:100%; height:44px; min-height:44px; margin:0; padding:0; border:0; background:transparent; }
#funnels-page .funnel-site-trigger { display:flex; align-items:center; gap:9px; box-sizing:border-box; width:100%; height:44px; min-height:44px; margin:0; padding:8px 12px; border:1px solid #2a3e58; border-radius:12px; background:#111b2a; text-align:left; line-height:1.2; }
#funnels-page .funnel-site-trigger > span:first-child { color:#91a7c1; font-size:12px; }
#funnels-page .funnel-site-trigger strong { min-width:0; flex:1; overflow:hidden; color:#e1ecf7; font-size:13px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
#funnels-page .funnel-chevron { color:#91a7c1; font-size:17px; line-height:1; transition:transform .15s ease; }
#funnels-page .funnel-site-trigger[aria-expanded="true"] .funnel-chevron { transform:rotate(180deg); }
#funnels-page .funnel-site-menu { position:absolute; top:calc(100% + 7px); left:0; width:min(360px,calc(100vw - 32px)); padding:12px; border:1px solid #30445e; border-radius:13px; background:#121e2e; box-shadow:0 16px 38px rgba(0,0,0,.42); }
#funnels-page .funnel-site-menu[hidden] { display:none; }
#funnels-page .funnel-site-menu-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
#funnels-page .funnel-site-menu-heading strong { color:#dce8f5; font-size:13px; }
#funnels-page .funnel-site-menu-heading button { min-height:30px; padding:5px 9px; border-radius:8px; color:#a9d9fb; font-size:12px; }
#funnels-page .funnel-site-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; max-height:none; overflow:visible; }
#funnels-page .funnel-site-options label { display:flex; align-items:center; gap:7px; min-width:0; min-height:36px; padding:7px 8px; border:1px solid #2d4059; border-radius:9px; background:#17243a; color:#b9c9dc; font-size:12px; line-height:1.25; }
#funnels-page .funnel-site-options label:has(input:checked) { border-color:#347db0; background:#19354e; color:#ecf7ff; }
#funnels-page .funnel-site-options label span { min-width:0; overflow-wrap:anywhere; }
#funnels-page .funnel-site-options input { flex:0 0 14px; width:14px; height:14px; accent-color:#65bcf5; }
#funnels-page .funnel-search { display:flex; align-items:stretch; min-width:0; width:100%; height:44px; min-height:44px; margin:0; padding:0; line-height:normal; }
#funnels-page .funnel-search input { appearance:none; display:block; box-sizing:border-box; width:100%; height:44px; min-height:44px; margin:0; padding:9px 13px; border:1px solid #2a3e58; border-radius:12px; background:#111b2a; font-size:14px; line-height:normal; }
@media (max-width:600px) { #funnels-page .funnel-filter-toolbar { grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); align-items:stretch; gap:8px; margin-bottom:12px; } #funnels-page .funnel-site-filter,#funnels-page .funnel-search,#funnels-page .funnel-site-trigger,#funnels-page .funnel-search input { height:42px; min-height:42px; } #funnels-page .funnel-site-trigger { gap:6px; padding:7px 9px; } #funnels-page .funnel-site-trigger > span:first-child { font-size:11px; } #funnels-page .funnel-site-trigger strong { font-size:12px; } #funnels-page .funnel-search input { padding:8px 10px; font-size:13px; } #funnels-page .funnel-site-menu { width:min(330px,calc(100vw - 32px)); padding:10px; } #funnels-page .funnel-site-options { gap:6px; } #funnels-page .funnel-site-options label { min-height:34px; padding:6px; font-size:11px; } }
.ad-unit-columns { display:grid; grid-template-columns:1fr 1fr; gap:16px; }.ad-unit-alert { padding:13px; border:1px solid #705234; border-radius:8px; background:#271e19; }.ad-unit-alert p { margin:5px 0; color:#ffd38b; }.ad-unit-alert small { color:var(--muted); }.ad-unit-alert a { color:#8ed1ff; }
.ad-unit-notifications { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:0 0 18px; }.ad-unit-notifications span { color:var(--muted); font-size:12px; }
.ad-unit-progress { margin:14px 0 8px; color:var(--muted); font-size:12px; }.ad-unit-progress:empty { display:none; }
.xray-row { display:grid; grid-template-columns:70px 100px 1fr; gap:14px; align-items:center; padding:13px 16px; border:1px solid var(--line); border-radius:9px; background:var(--panel); }.xray-row strong { color:#8ed1ff; }.xray-row span { color:var(--muted); font-size:13px; }
.xray-timeline-chart { min-height:190px; margin:0 0 18px; padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--muted); }.xray-timeline-chart svg { display:block; width:100%; height:auto; max-height:230px; }
.xray-subheading { margin:28px 0 12px; }.reference-page > h3 { font-size:17px; }
.auction-toolbar { display:grid; grid-template-columns:minmax(150px,1fr) minmax(180px,1.5fr) minmax(150px,1fr) minmax(170px,1fr) minmax(140px,1fr) auto auto; align-items:end; gap:12px; margin:18px 0 8px; }
.auction-toolbar label { display:grid; gap:6px; color:var(--muted); font-size:12px; }
.auction-toolbar input,.auction-toolbar select { width:100%; min-height:40px; border:1px solid var(--line); border-radius:8px; padding:9px 11px; color:var(--text); background:var(--panel-soft); }
.auction-local-note { margin:0 0 10px; color:var(--muted); font-size:12px; }
.auction-column-picker { position:relative; align-self:end; min-width:100px; }
.auction-column-picker summary { display:flex; align-items:center; justify-content:center; min-height:40px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; background:var(--panel-soft); color:var(--text); cursor:pointer; list-style:none; }
.auction-slot-picker { position:relative; align-self:end; min-width:150px; }
.auction-slot-picker summary { display:flex; align-items:center; min-height:40px; padding:8px 11px; overflow:hidden; border:1px solid var(--line); border-radius:8px; background:var(--panel-soft); color:var(--text); cursor:pointer; list-style:none; white-space:nowrap; text-overflow:ellipsis; }
.auction-slot-picker summary::-webkit-details-marker { display:none; }
.auction-slot-options { position:absolute; z-index:6; top:calc(100% + 6px); left:0; display:none; width:min(360px,calc(100vw - 40px)); padding:10px; border:1px solid var(--line); border-radius:10px; background:var(--panel); box-shadow:0 12px 28px #0008; }
.auction-slot-picker[open] .auction-slot-options { display:grid; gap:4px; }
.auction-slot-options label { display:flex; align-items:flex-start; gap:8px; min-width:0; padding:6px; color:var(--text); font-size:12px; overflow-wrap:anywhere; }
.auction-slot-options input { width:auto; min-height:auto; accent-color:#52b7ff; }
.auction-column-picker summary::-webkit-details-marker { display:none; }
.auction-column-options { position:absolute; z-index:5; top:calc(100% + 6px); right:0; display:none; grid-template-columns:1fr 1fr; gap:8px 14px; min-width:290px; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--panel); box-shadow:0 12px 28px #0008; }
.auction-column-picker[open] .auction-column-options { display:grid; }
.auction-column-options label { display:flex; align-items:center; gap:7px; color:var(--text); font-size:12px; white-space:nowrap; }
.auction-column-options input { width:auto; min-height:auto; accent-color:#52b7ff; }
.auction-scroll { max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:10px; }
.auction-table { width:100%; min-width:1180px; border-collapse:collapse; font-size:13px; }
.auction-table th,.auction-table td { padding:10px 11px; text-align:left; white-space:nowrap; border-bottom:1px solid var(--line); }
.auction-table th { position:sticky; top:0; z-index:1; color:var(--muted); background:var(--panel-soft); font-weight:600; }
.auction-sort-button { padding:0; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; white-space:nowrap; }
.auction-sort-button:hover { color:#9bd5ff; }
.auction-target-input { width:76px !important; min-height:32px !important; padding:5px 7px !important; font-size:13px; text-align:right; }
.auction-target-input:focus { outline:2px solid #52b7ff; outline-offset:1px; }
.auction-price-draft { display:grid; gap:4px; min-width:0; }
.auction-price-input { width:100% !important; min-width:0; min-height:32px !important; padding:5px 7px !important; border:1px solid var(--line); border-radius:6px; background:var(--panel-soft); color:var(--text); font:inherit; text-align:right; }
.auction-price-input:focus { outline:2px solid #52b7ff; outline-offset:1px; }
.auction-current-price { display:block; overflow:hidden; color:var(--muted); font-size:10px; line-height:1.2; text-overflow:ellipsis; white-space:nowrap; }
.auction-table td:first-child { max-width:300px; overflow:hidden; text-overflow:ellipsis; }
.auction-table tr:last-child td { border-bottom:0; }
.auction-unmatched { color:var(--muted); }
/* Softer, lower-glare palette scoped to the auction workspace. */
#ad-unit-page { --auction-surface:#101a2a; --auction-row:#131f31; --auction-row-alt:#152236; --auction-border:#26354a; --auction-copy:#d5deea; }
#ad-unit-page .auction-toolbar label { color:#a9b6c8; }
#ad-unit-page .auction-toolbar input,
#ad-unit-page .auction-toolbar select,
#ad-unit-page .auction-column-picker summary,
#ad-unit-page .auction-slot-picker summary { background:var(--auction-surface); border-color:var(--auction-border); color:var(--auction-copy); }
#ad-unit-page .auction-local-note { color:#a9b6c8; }
#ad-unit-page .auction-scroll { border-color:var(--auction-border); background:var(--auction-row); }
#ad-unit-page .auction-table th { color:#b3c0d2; background:#19263a; border-color:var(--auction-border); }
#ad-unit-page .auction-table td { color:var(--auction-copy); border-color:var(--auction-border); }
#ad-unit-page .auction-table tbody tr:nth-child(even) { background:var(--auction-row-alt); }
#ad-unit-page .auction-table tbody tr:hover { background:#1a2a40; }
#ad-unit-page .auction-sort-button:hover { color:#a8cbea; }
#ad-unit-page .auction-unmatched { color:#9ba9bc; }
#ad-unit-page .auction-target-input { background:#19263a; border-color:#35465d; color:#e1e8f1; }
#ad-unit-page .auction-price-input { background:#19263a; border-color:#35465d; color:#e1e8f1; }
#ad-unit-page .auction-current-price { color:#9eacc0; }
#ad-unit-page .auction-scroll { overflow-x:hidden; overflow-y:visible; }
#ad-unit-page .auction-table { width:100%; min-width:0; table-layout:fixed; }
#ad-unit-page .auction-table th { padding:13px 10px; color:#d5e5f7; background:#20314a; border-bottom:2px solid #506985; font-size:12px; font-weight:750; letter-spacing:.025em; white-space:normal; line-height:1.25; }
#ad-unit-page .auction-table td { overflow:hidden; text-overflow:ellipsis; }
#ad-unit-page .auction-sort-button { display:inline-block; max-width:100%; color:inherit; font-weight:inherit; white-space:normal; text-align:left; }
#ad-unit-page .auction-column-resize { position:absolute; top:0; right:-5px; z-index:3; width:12px; height:100%; cursor:col-resize; touch-action:none; user-select:none; }
#ad-unit-page .auction-column-resize::after { content:""; position:absolute; top:22%; bottom:22%; left:5px; width:2px; border-radius:2px; background:#6685a9; opacity:.75; }
#ad-unit-page .auction-column-resize:hover::after { background:#9fc3e8; opacity:1; }
#ad-unit-page .auction-table th:first-child { position:relative; }
@media (max-width:1100px) { .auction-toolbar { grid-template-columns:repeat(3,minmax(0,1fr)); }.auction-toolbar label:nth-child(2),.auction-toolbar label:nth-child(5) { grid-column:span 2; } }
@media (max-width:800px) { .auction-toolbar { grid-template-columns:1fr 1fr; }.auction-toolbar label:nth-child(2),.auction-toolbar label:nth-child(5) { grid-column:1 / -1; }.auction-column-options { left:0; right:auto; }.auction-slot-options { width:min(360px,85vw); } }
.sp2-hourly { margin-top:36px; padding-top:25px; border-top:1px solid var(--line); }.sp2-hourly h3 { margin:0 0 8px; font-size:20px; }.sp2-hourly .reference-filters { align-items:end; }.sp2-hourly button { min-height:40px; }.sp2-scroll { overflow-x:auto; }.sp2-table { border-collapse:collapse; width:100%; min-width:730px; font-size:13px; }.sp2-table th,.sp2-table td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; }.sp2-table th:first-child,.sp2-table td:first-child,.sp2-table th:nth-child(2),.sp2-table td:nth-child(2) { text-align:left; }.sp2-table th { color:var(--muted); font-weight:600; }.sp2-table .pending { color:var(--yellow); }
.sp2-chart { min-height:180px; margin-top:12px; border:1px solid var(--line); border-radius:10px; padding:10px; background:var(--panel-soft); }
.sp2-chart svg { display:block; width:100%; height:auto; max-height:240px; }
#sp2-chart-panel label { color:var(--muted); }
.sp2-matrix { min-width:1850px; margin-top:14px; }.sp2-matrix th:first-child,.sp2-matrix td:first-child { position:sticky; left:0; z-index:1; background:var(--panel); min-width:200px; }.sp2-matrix th:not(:first-child),.sp2-matrix td:not(:first-child) { min-width:62px; text-align:right; }
.sp2-matrix td.sp2-peak { background:#b9a0e8; color:#181026; font-weight:700; }
.traffic-month { margin-top:36px; padding-top:25px; border-top:1px solid var(--line); }.traffic-month > h3 { margin:0 0 8px; font-size:20px; }.traffic-month-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }.traffic-month-grid svg { display:block; width:100%; height:auto; }.traffic-month-grid .trend-caption { margin-top:8px; }
.traffic-month-grid svg [role="button"] { cursor:pointer; }.traffic-month-grid svg [role="button"]:focus-visible { outline:2px solid #8ed1ff; outline-offset:3px; }
.traffic-site-picker { display:grid; gap:12px; margin:14px 0 24px; padding:14px; border:1px solid var(--line); border-radius:14px; background:linear-gradient(145deg,#17243a,#111b2c); }.traffic-platform-tabs { display:flex; gap:10px; }.traffic-platform-button { flex:1; min-height:46px; border:1px solid #38516d; border-radius:10px; background:#121d2e; color:#b8c9dc; font-size:15px; font-weight:650; cursor:pointer; }.traffic-platform-button:hover { border-color:#5e9bc7; color:#e7f4ff; }.traffic-platform-button.is-active { border-color:#4ab7f2; background:#1b3854; color:#f5fbff; box-shadow:inset 0 0 0 1px #4ab7f2,0 5px 18px #07111f80; }.traffic-account-options { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-height:36px; }.traffic-account-options > span { flex:0 0 100%; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.06em; }.traffic-account-options a { display:inline-flex; min-height:36px; align-items:center; padding:7px 13px; border:1px solid #334a64; border-radius:999px; background:#18283c; color:#a8d9fb; text-decoration:none; font-size:14px; font-weight:600; transition:background .15s,border-color .15s,transform .15s; }.traffic-account-options a:hover,.traffic-account-options a:focus-visible { border-color:#52bdf4; background:#203d58; transform:translateY(-1px); }.roi-source-context { width:max-content; max-width:100%; margin:0 0 12px; padding:8px 12px; border:1px solid #314c67; border-radius:999px; background:#14263b; color:#9bd5ff; font-size:13px; font-weight:600; }
.traffic-account-options a[hidden] { display:none; }
.traffic-account-month { margin:0 0 28px; }.traffic-account-month > h2 { margin:0 0 20px; font-size:24px; }.traffic-account-platform { margin:0 0 24px; }.traffic-account-platform > h3 { margin:0 0 12px; font-size:19px; }.traffic-account-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:14px; }.traffic-account-card { min-width:0; padding:14px 14px 10px; }.traffic-account-card > h4 { margin:0 0 4px; font-size:17px; }.traffic-account-id { margin:0 0 8px; color:var(--muted); font-size:13px; }.traffic-account-metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; }.traffic-account-metric { min-width:0; padding:11px 12px; border:1px solid var(--line); border-radius:10px; }.traffic-account-metric span { display:block; margin-bottom:5px; color:var(--muted); font-size:13px; }.traffic-account-metric strong { font-size:20px; overflow-wrap:anywhere; }.traffic-account-chart-title { margin:12px 0 4px; color:var(--muted); font-size:14px; }.traffic-account-card svg { display:block; width:100%; height:auto; margin:0; overflow:visible; }.traffic-account-card svg rect { cursor:help; }
@media (min-width:901px) { .traffic-account-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:900px) { .rail { width:185px; padding:22px 10px; }.rail nav { margin:28px 0; }.rail nav a { padding:9px; font-size:13px; } main { margin-left:185px; padding:28px 22px; }.metrics,.reference-summary,.breakdown-grid { grid-template-columns:repeat(2,1fr); }.layout,.ad-unit-columns,.traffic-month-grid { grid-template-columns:1fr; } }
@media (max-width:650px) { .source-health-grid { grid-template-columns:1fr; } }
@media (max-width:600px) { #overview-closed-revenue .gam-revenue-card { grid-column:1 / -1; } }
@media (max-width:900px) { .roi-column-resize { display:none; } .roi-worksheet-table,.roi-worksheet-table thead,.roi-worksheet-table tbody { display:block; width:100%; } .roi-worksheet-table thead tr { display:flex; flex-wrap:wrap; } .roi-worksheet-table thead th { display:block; flex:1 1 130px; width:auto !important; min-width:0; text-align:left; } .roi-worksheet-table tr.roi-summary-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .roi-worksheet-table tr.roi-summary-row td { display:block; min-width:0; width:auto !important; font-size:13px; white-space:normal; text-align:left; border-bottom:0; background:var(--panel); } .roi-worksheet-table tr.roi-summary-row td:first-child { grid-column:1/-1; font-weight:700; white-space:normal; overflow:visible; text-overflow:clip; } .roi-worksheet-table tr.roi-summary-row td::before { content:attr(data-label); display:block; color:var(--muted); font-size:10px; font-weight:400; } }
@media (max-width:600px) { .rail { position:static; width:auto; padding:14px 16px; border-right:0; border-bottom:1px solid var(--line); }.rail nav { display:flex; flex-wrap:wrap; overflow:visible; margin:12px 0 0; }.rail nav a { white-space:nowrap; }.rail .nav-group { flex:0 0 100%; }.rail .nav-submenu { grid-template-columns:repeat(2,minmax(0,1fr)); }.rail .nav-submenu a { white-space:normal; }.rail-note { display:none; } main { margin-left:0; padding:22px 16px; }.topbar,.topbar-actions,.notice,.panel-heading,.formula-grid,.login-panel,.login-panel form,.reference-filters { align-items:flex-start; flex-direction:column; }.metrics,.reference-summary { grid-template-columns:1fr 1fr; }.notice { line-height:1.35; }.login-panel input { width:100%; }.xray-row { grid-template-columns:55px 1fr; }.xray-row span { grid-column:1 / -1; } }
@media (max-width:420px) { .metrics,.reference-summary,.breakdown-grid { grid-template-columns:minmax(0,1fr); } .reference-filters label { min-width:0; width:100%; } }
/* Dense, readable account summary for desktop. Mobile keeps its existing grid. */
@media (min-width:1301px) {
  .roi-campaign-view #meta-campaign-topline { grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:9px; margin:10px 0 12px; }
  .roi-campaign-view #meta-campaign-topline > article { min-height:100px; padding:11px 12px; }
  .roi-campaign-view #meta-campaign-topline > article > span { font-size:13px; line-height:1.25; }
  .roi-campaign-view #meta-campaign-topline > article > strong { margin-top:6px; font-size:26px; line-height:1.15; }
  .roi-campaign-view #meta-campaign-summary { grid-template-columns:repeat(6,minmax(0,1fr)); gap:9px; margin:10px 0 12px; }
  .roi-campaign-view #meta-campaign-summary > article { min-height:82px; padding:11px 12px; }
  .roi-campaign-view #meta-campaign-summary > article > span { font-size:13px; line-height:1.25; }
  .roi-campaign-view #meta-campaign-summary > article > strong { margin-top:6px; font-size:26px; line-height:1.15; }
}
@media (min-width:901px) and (max-width:1300px) {
  .roi-campaign-view #meta-campaign-topline { grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:10px; margin:10px 0 12px; }
  .roi-campaign-view #meta-campaign-topline > article { min-height:100px; padding:11px 12px; }
  .roi-campaign-view #meta-campaign-topline > article > span { font-size:13px; line-height:1.25; }
  .roi-campaign-view #meta-campaign-topline > article > strong { margin-top:6px; font-size:26px; line-height:1.15; }
  .roi-campaign-view #meta-campaign-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:10px 0 12px; }
  .roi-campaign-view #meta-campaign-summary > article { min-height:82px; padding:11px 12px; }
  .roi-campaign-view #meta-campaign-summary > article > span { font-size:13px; line-height:1.25; }
  .roi-campaign-view #meta-campaign-summary > article > strong { margin-top:6px; font-size:26px; line-height:1.15; }
  .roi-campaign-view #google-campaign-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:10px 0 12px; }
}
.roi-campaign-view #meta-campaign-topline > .language-count-card { display:flex; flex-direction:column; justify-content:center; gap:9px; }
.roi-campaign-view .language-count-list { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.roi-campaign-view .language-count-item { display:inline-flex; align-items:center; gap:5px; padding:4px 7px; border:1px solid var(--line); border-radius:7px; background:var(--panel-soft); color:var(--muted); font-size:11px; line-height:1; }
.roi-campaign-view .language-count-item strong { color:var(--text); font-size:13px; }
.roi-campaign-view .language-count-empty { color:var(--muted); font-size:12px; }
@media (min-width:901px) {
  .roi-campaign-view #meta-campaign-topline > article:first-child { display:flex; flex-direction:column; justify-content:center; }
  .roi-campaign-view #meta-campaign-topline > .language-count-card { min-height:100px; }
  .roi-campaign-view .language-count-card > span { font-size:13px !important; }
  .roi-campaign-view .language-count-list { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
  .roi-campaign-view .language-count-item { justify-content:center; gap:7px; min-height:54px; padding:8px 10px; font-size:13px; }
  .roi-campaign-view .language-count-item strong { font-size:26px; line-height:1.15; }
}
@media (max-width:900px) {
  .roi-campaign-view #meta-campaign-topline { grid-template-columns:minmax(0,1fr); gap:8px; }
  .roi-campaign-view #meta-campaign-topline > article { min-height:76px; padding:14px; }
  .roi-campaign-view #meta-campaign-topline > article > strong { font-size:26px; }
  .roi-campaign-view .language-count-list { gap:8px; }
}
#meta-campaign-summary > article.roas-loss > strong { color:var(--red); }
#meta-campaign-summary > article.roas-below-first > strong { color:#ffad72; }
#meta-campaign-summary > article.roas-first > strong { color:var(--yellow); }
#meta-campaign-summary > article.roas-second > strong { color:var(--green); }
#meta-campaign-summary > article.roi-unavailable > strong { color:var(--muted); }
#google-campaign-summary > article.roas-loss > strong { color:var(--red); }
#google-campaign-summary > article.roas-below-first > strong { color:#ffad72; }
#google-campaign-summary > article.roas-first > strong { color:var(--yellow); }
#google-campaign-summary > article.roas-second > strong { color:var(--green); }
#google-campaign-summary > article.roi-unavailable > strong { color:var(--muted); }
@media (max-width:600px) { .overview-compact-summary { grid-template-columns:minmax(0,1fr); gap:8px; }.overview-compact-summary article { min-height:72px; padding:12px; }.overview-compact-summary strong { font-size:clamp(20px,2.4vw,29px); white-space:nowrap; overflow-wrap:normal; } }
@media (max-width:600px) {
  #overview-projections #overview-day-projection-summary,
  #overview-closed #overview-closed-summary { grid-template-columns:minmax(0,1fr) !important; gap:8px; }
  #overview-projections #overview-day-projection-summary strong,
  #overview-closed #overview-closed-summary strong { font-size:clamp(20px,2.4vw,29px); white-space:nowrap; overflow-wrap:normal; word-break:normal; }
}

@media (max-width:900px) {
  #overview-closed-revenue { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #overview-closed-costs { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  #overview-closed #overview-closed-summary { display:grid; grid-template-columns:minmax(0,1fr) !important; gap:16px; }
  #overview-closed-revenue { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  #overview-closed-costs { grid-template-columns:minmax(0,1fr) !important; }
  #overview-closed-revenue strong { font-size:clamp(15px,4.6vw,20px); }
  #overview-closed-costs strong { font-size:clamp(19px,5vw,22px); }
}

/* On phones, keep the pinned campaign column clipped to the resizable width.
   Without an explicit cell width, long campaign names paint over later columns. */
@media (max-width:900px) {
  body.roi-campaign-view .roi-worksheet-table th:first-child,
  body.roi-campaign-view .roi-worksheet-table td:first-child {
    box-sizing:border-box;
    width:var(--roi-campaign-col-width) !important;
    min-width:var(--roi-campaign-col-width) !important;
    max-width:var(--roi-campaign-col-width) !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
}

/* Navegação lateral: texto no modo aberto, ícones no modo recolhido. */
.rail { z-index:20; }
.rail-icon-sprite { position:absolute; width:0; height:0; overflow:hidden; }
.rail-head { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.brand { min-width:0; }
.brand-name { white-space:nowrap; }
.rail-toggle { display:grid; place-items:center; flex:none; width:36px; height:36px; padding:6px; border-color:var(--line); background:transparent; }
.rail-toggle:hover,.rail-toggle:focus-visible { color:var(--blue); border-color:var(--blue); }
.rail-toggle svg,.rail-icon { display:block; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.rail nav a[data-primary] { display:flex; align-items:center; gap:12px; min-width:0; }
.rail nav a[data-primary] .nav-label { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
body.sidebar-collapsed .rail { width:68px; padding:20px 9px; }
body.sidebar-collapsed main { margin-left:68px; }
body.sidebar-collapsed .rail-head { justify-content:center; }
body.sidebar-collapsed .brand,body.sidebar-collapsed .nav-label,body.sidebar-collapsed .rail .source-health,body.sidebar-collapsed .rail-note { display:none; }
body.sidebar-collapsed .rail nav { margin-top:20px; }
body.sidebar-collapsed .rail nav a[data-primary] { justify-content:center; padding:12px; }
@media (max-width:600px) {
  .rail,body.sidebar-collapsed .rail {
    position:fixed; inset:auto 0 0 0; width:100%; height:calc(56px + env(safe-area-inset-bottom));
    padding:0 0 env(safe-area-inset-bottom); border-right:0; border-bottom:0; border-top:1px solid var(--line);
    background:var(--panel); overflow:visible;
  }
  .rail-head { height:0; min-height:0; flex:none; }
  .rail .brand,.rail .nav-label,.rail .source-health,.rail-note { display:none; }
  #sidebar-toggle {
    position:fixed; top:calc(8px + env(safe-area-inset-top)); left:12px; z-index:21;
    width:44px; height:44px; background:var(--panel);
  }
  main::before {
    content:""; position:fixed; top:0; left:0; width:100%; height:calc(60px + env(safe-area-inset-top));
    background:var(--panel); border-bottom:1px solid var(--line); z-index:18;
  }
  .rail nav,body.sidebar-collapsed .rail nav {
    display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:0; height:100%; margin:0; flex:none;
  }
  .rail nav a[data-primary],body.sidebar-collapsed .rail nav a[data-primary] {
    justify-content:center; gap:0; min-width:0; min-height:44px; padding:8px 0;
  }
  main,body.sidebar-collapsed main,body.sidebar-expanded main {
    margin-left:0; padding:calc(72px + env(safe-area-inset-top)) 12px calc(76px + env(safe-area-inset-bottom)); min-width:0;
  }
  main > * { min-width:0; max-width:100%; }
  body.sidebar-expanded .rail {
    inset:0 auto 0 0; width:min(270px,calc(100vw - 48px)); height:100vh; height:100dvh;
    padding:calc(8px + env(safe-area-inset-top)) 12px 14px; border-top:0; border-right:1px solid var(--line);
    overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
    box-shadow:12px 0 32px color-mix(in srgb,var(--bg) 55%,transparent);
  }
  body.sidebar-expanded .rail-head { height:auto; min-height:44px; padding-left:52px; justify-content:space-between; }
  body.sidebar-expanded .rail .brand,body.sidebar-expanded .rail .nav-label { display:flex; }
  body.sidebar-expanded .rail .source-health,body.sidebar-expanded .rail .rail-note { display:block; flex:none; overflow-wrap:anywhere; }
  body.sidebar-expanded .rail .source-health-grid strong { white-space:normal; overflow-wrap:anywhere; }
  body.sidebar-expanded .rail .nav-label { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
  body.sidebar-expanded .rail nav { grid-template-columns:minmax(0,1fr); height:auto; gap:7px; margin:20px 0 12px; }
  body.sidebar-expanded .rail nav a[data-primary] { justify-content:flex-start; gap:12px; padding:11px 13px; }
  body.sidebar-expanded::before { content:""; position:fixed; inset:0; background:color-mix(in srgb,var(--bg) 70%,transparent); z-index:19; }
  body:has(.login-panel:not([hidden])) .rail { display:none; }
  body:has(.login-panel:not([hidden])) main::before { display:none; }
  body:has(.login-panel:not([hidden])) main { margin-left:0; }
}

/* Filtros e meta mensal: área superior compacta em desktop e celular. */
.topbar { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; row-gap:8px; }
.topbar-actions { justify-content:flex-end; align-items:end; gap:10px; flex-wrap:wrap; }
#logout-status:empty { display:none; }
#logout-button { min-height:42px; }
.rail:has(a[href="#overview"].active) ~ main #status { display:none; }
.overview-top-custom { grid-column:2; display:flex; align-items:end; justify-content:flex-end; gap:8px; }
.overview-top-custom label { display:grid; gap:3px; color:var(--muted); font-size:11px; }
.overview-top-custom input { width:145px; min-height:40px; padding:8px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--panel-soft); }
.overview-top-custom button { min-height:40px; }
.monthly-title { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 12px; }
.monthly-title .source-refreshed-at { font-size:14px; }
#overview-monthly-goal .reference-summary { grid-template-columns:repeat(5,minmax(0,1fr)); }
#health-goal-milestones .reference-summary { grid-template-columns:minmax(0,1fr); }
.monthly-roas-chart { margin-top:16px; }
.monthly-roas-chart .panel-heading { align-items:baseline; }
.chart-note,.daily-roas-selected { color:var(--muted); font-size:14px; }
.chart-note:empty,.daily-roas-selected:empty { display:none; }
.daily-roas-plot { display:grid; grid-template-columns:44px minmax(0,1fr) 60px; gap:8px; margin-top:16px; }
.daily-roas-scale { height:178px; display:flex; flex-direction:column; justify-content:space-between; color:var(--muted); font-size:12px; }
.daily-roas-usd-scale { height:178px; min-width:0; display:flex; flex-direction:column; justify-content:space-between; align-items:flex-end; overflow:hidden; color:#fbbf24; font-size:12px; white-space:nowrap; }
.daily-roas-bars { position:relative; height:178px; min-width:0; margin-bottom:44px; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); align-items:end; gap:3px; padding:0 2px; border-bottom:1px solid var(--line); background:linear-gradient(to top, transparent calc(50% - 1px), var(--line) 50%, transparent calc(50% + 1px)); }
.daily-roas-day { width:100%; height:100%; min-width:0; padding:0; display:flex; flex-direction:column; justify-content:end; align-items:center; gap:5px; border:0; border-radius:0; background:transparent; }
.daily-roas-day:hover,.daily-roas-day[aria-pressed="true"] { background:#22344d; }
.daily-roas-column { width:100%; max-width:22px; min-height:0; border-radius:4px 4px 0 0; background:var(--blue); }
.daily-roas-day.is-today .daily-roas-column { background:#fbbf24; }
.daily-roas-day.is-missing .daily-roas-column { background:transparent; }
.daily-roas-day-label { position:absolute; bottom:-40px; left:50%; width:36px; height:12px; overflow:visible; transform:translateX(-50%) rotate(-90deg); transform-origin:center; color:var(--muted); font-size:10px; line-height:12px; white-space:nowrap; }
.daily-roas-usd-line { position:absolute; inset:0; z-index:2; width:100%; height:100%; overflow:visible; pointer-events:none; }
.daily-roas-usd-path { fill:none; stroke:#fbbf24; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.daily-roas-usd-point { fill:#fbbf24; stroke:var(--panel); stroke-width:1.5; vector-effect:non-scaling-stroke; }
.daily-roas-usd-point.is-selected { fill:#fff; stroke:#fbbf24; stroke-width:2.5; r:5; }
.daily-roas-selected { min-height:20px; margin-top:10px; font-size:15px; font-weight:700; color:var(--text); }
#overview-monthly-goal .goal-milestones, #health-goal-milestones .goal-milestones { grid-column:1 / -1; margin-top:4px; padding:16px 18px; border:1px solid #39618c; border-radius:12px; background:linear-gradient(135deg,#1a2c44,#152338 72%); box-shadow:inset 4px 0 #54b6ff; }
.goal-tier { display:grid; grid-template-columns:150px minmax(0,1fr); align-items:center; gap:14px; padding:12px 12px; border-left:4px solid transparent; border-radius:8px; }
.goal-tier + .goal-tier { border-top:1px solid var(--line); }
.goal-tier h3 { margin:0; font-size:16px; }
.goal-tier-1 { border-left-color:var(--blue); background:color-mix(in srgb,var(--blue) 8%,var(--panel)); }
.goal-tier-1 h3 { color:var(--blue); }
.goal-tier-2 { border-left-color:var(--yellow); background:color-mix(in srgb,var(--yellow) 8%,var(--panel)); }
.goal-tier-2 h3 { color:var(--yellow); }
.goal-tier-3 { border-left-color:var(--green); background:color-mix(in srgb,var(--green) 8%,var(--panel)); }
.goal-tier-3 h3 { color:var(--green); }
.goal-tier-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.goal-tier-grid > div { min-width:0; }
.goal-tier-grid span { font-size:14px; }
#overview-monthly-goal .goal-tier-grid strong, #health-goal-milestones .goal-tier-grid strong { margin-top:2px; font-size:clamp(14px,1.6vw,18px); white-space:nowrap; }
#overview-monthly-goal .reference-summary > article.roas-loss > strong { color:var(--red); }
#overview-monthly-goal .reference-summary > article.roas-below-first > strong { color:#ffad72; }
#overview-monthly-goal .reference-summary > article.roas-first > strong { color:var(--yellow); }
#overview-monthly-goal .reference-summary > article.roas-second > strong { color:var(--green); }
#traffic-summary > article.roas-loss > strong,
#traffic-monthly-summary > article.roas-loss > strong { color:var(--red); }
#traffic-summary > article.roas-below-first > strong,
#traffic-monthly-summary > article.roas-below-first > strong { color:#ffad72; }
#traffic-summary > article.roas-first > strong,
#traffic-monthly-summary > article.roas-first > strong { color:var(--yellow); }
#traffic-summary > article.roas-second > strong,
#traffic-monthly-summary > article.roas-second > strong { color:var(--green); }
#traffic-summary > article.roi-unavailable > strong,
#traffic-monthly-summary > article.roi-unavailable > strong { color:var(--muted); }
@media (min-width:1151px) {
  #overview-monthly-goal .reference-summary > article strong, #health-goal-milestones .reference-summary > article strong { font-size:clamp(20px,1.6vw,26px); white-space:nowrap; }
}
@media (max-width:1150px) {
  #overview-monthly-goal .reference-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .monthly-roas-chart { padding:16px 8px; }
  .daily-roas-plot { grid-template-columns:32px minmax(0,1fr) 45px; gap:4px; }
  .daily-roas-bars { gap:1px; }
  .daily-roas-day-label { font-size:10px; }
  .daily-roas-usd-scale { font-size:9px; }
  .topbar { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; min-height:44px; padding-left:0; }
  .topbar .eyebrow { display:none; }
  .topbar > div:first-child { min-width:0; max-width:100%; }
  .topbar h1 { margin:0; font-size:20px; line-height:1.25; overflow-wrap:anywhere; }
  .topbar-actions { display:flex; flex:1 1 auto; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; width:auto; min-width:0; max-width:100%; }
  .topbar-actions .period-label { min-width:0; max-width:100%; }
  .topbar .period { max-width:100%; }
  .topbar #status {
    min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere;
  }
  .topbar #logout-button { flex:none; min-height:44px; }
  .overview-top-custom { grid-column:1; flex:1 0 100%; min-width:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); justify-content:stretch; }
  .overview-top-custom label { min-width:0; }
  .overview-top-custom input { width:100%; min-width:0; }
  .overview-top-custom button { grid-column:1 / -1; }
  #overview-monthly-goal, #health-goal-milestones { padding:16px 8px; }
  #overview-monthly-goal .reference-summary, #health-goal-milestones .reference-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  #overview-monthly-goal .reference-summary > article:not(.goal-milestones) { display:flex; flex-direction:column; padding:12px 7px; }
  #overview-monthly-goal .reference-summary > article:not(.goal-milestones) span { font-size:15px; line-height:1.3; }
  #overview-monthly-goal .reference-summary > article:not(.goal-milestones) strong { margin-top:auto; padding-top:10px; font-size:clamp(18px,4.8vw,21px); line-height:1.18; letter-spacing:-.045em; }
  #overview-monthly-goal .reference-summary > article:nth-child(5) { grid-column:1 / -1; }
  #overview-monthly-goal .reference-summary > article.profit-positive strong { color:var(--green); }
  #overview-monthly-goal .reference-summary > article.profit-negative strong { color:var(--red); }
  #overview-monthly-goal .goal-milestones, #health-goal-milestones .goal-milestones { padding:15px 12px; }
  #overview-monthly-goal .goal-milestones > span, #health-goal-milestones .goal-milestones > span { font-size:15px; }
  .goal-tier { display:block; padding:16px 0; }
  .goal-tier h3 { margin:0 0 12px; font-size:18px; }
  .goal-tier-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 6px; }
  .goal-tier-grid > div { display:flex; flex-direction:column; }
  .goal-tier-grid span { font-size:15px; line-height:1.25; }
  #overview-monthly-goal .goal-tier-grid strong, #health-goal-milestones .goal-tier-grid strong { margin-top:auto; padding-top:4px; font-size:19px; line-height:1.2; letter-spacing:-.04em; }
}

@media (min-width:901px) { #xray-outlook-summary > article:last-child { grid-row:2; grid-column:3; } }

@media (max-width:600px) {
  #xray-outlook-summary > article:nth-child(5) { grid-row:3; grid-column:1; }
  #xray-outlook-summary > article:nth-child(6) { grid-row:3; grid-column:2; }
  #xray-outlook-summary > article:nth-child(5), #xray-outlook-summary > article:nth-child(6) { min-width:0; padding:12px 9px; }
  #xray-outlook-summary > article:nth-child(5) > span, #xray-outlook-summary > article:nth-child(6) > span { min-height:2.6em; font-size:13px; }
  #xray-outlook-summary > article:nth-child(5) > strong, #xray-outlook-summary > article:nth-child(6) > strong { font-size:clamp(17px,4.5vw,21px); line-height:1.2; white-space:nowrap; letter-spacing:-.04em; }
}

@media (max-width:600px) {
  #xray-outlook-summary > article:nth-child(5) { grid-row:3; grid-column:1 / -1; }
  #xray-outlook-summary > article:nth-child(6) { grid-row:4; grid-column:1 / -1; }
  #xray-outlook-summary > article:nth-child(5), #xray-outlook-summary > article:nth-child(6) { padding:17px; }
  #xray-outlook-summary > article:nth-child(5) > strong, #xray-outlook-summary > article:nth-child(6) > strong { font-size:26px; white-space:nowrap; letter-spacing:normal; }
}

#xray-outlook-summary > article.roas-loss > strong { color:var(--red); }
#xray-outlook-summary > article.roas-below-first > strong { color:#ffad72; }
#xray-outlook-summary > article.roas-first > strong { color:var(--yellow); }
#xray-outlook-summary > article.roas-second > strong { color:var(--green); }
#xray-outlook-summary > article.roi-unavailable > strong { color:var(--muted); }
#xray-outlook-chance.xray-chance-high { color:var(--green); }
#xray-outlook-chance.xray-chance-moderate { color:var(--yellow); }
#xray-outlook-chance.xray-chance-low { color:var(--red); }
#overview-projections #overview-day-projection-summary > article.roas-loss > strong { color:var(--red); }
#overview-projections #overview-day-projection-summary > article.roas-below-first > strong { color:#ffad72; }
#overview-projections #overview-day-projection-summary > article.roas-first > strong { color:var(--yellow); }
#overview-projections #overview-day-projection-summary > article.roas-second > strong { color:var(--green); }
#overview-projections #overview-day-projection-summary > article.roi-unavailable > strong { color:var(--muted); }

.traffic-kpi-section { margin-top:22px; }
.traffic-kpi-section > h3 { margin:0 0 12px; font-size:18px; }
.traffic-kpi-grid article { min-height:104px; }
.traffic-kpi-grid .traffic-kpi-detail { display:block; margin-top:7px; color:var(--muted); font-size:12px; }
@media (max-width:600px) { .traffic-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .traffic-kpi-grid article { padding:13px; } .traffic-kpi-grid strong { font-size:20px; } }

/* Keep the six ROI account indicators paired on narrow phones, even below
   the global single-column breakpoint. */
@media (max-width:600px) {
  body.roi-campaign-view #meta-campaign-summary {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  body.roi-campaign-view #google-campaign-summary {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

/* In landscape on phones, show one campaign per table row instead of the
   portrait stacked-card presentation. The user can swipe horizontally for
   the remaining metric columns. */
@media (max-width:900px) and (orientation:landscape) {
  body.roi-campaign-view .roi-worksheet-scroll {
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  body.roi-campaign-view .roi-worksheet-table {
    display:table;
    width:max-content;
    min-width:100%;
    table-layout:auto;
  }
  body.roi-campaign-view .roi-worksheet-table thead { display:table-header-group; width:auto; }
  body.roi-campaign-view .roi-worksheet-table tbody { display:table-row-group; width:auto; }
  body.roi-campaign-view .roi-worksheet-table thead tr { display:table-row; }
  body.roi-campaign-view .roi-worksheet-table thead th {
    display:table-cell;
    width:auto !important;
    min-width:76px;
    text-align:center;
  }
  body.roi-campaign-view .roi-worksheet-table tr.roi-summary-row { display:table-row; }
  body.roi-campaign-view .roi-worksheet-table tr.roi-summary-row td {
    display:table-cell;
    width:auto !important;
    min-width:72px;
    font-size:14px;
    white-space:nowrap;
    text-align:center;
    border-bottom:1px solid var(--line);
  }
  body.roi-campaign-view .roi-worksheet-table tr.roi-summary-row td:first-child {
    min-width:180px;
    text-align:left;
  }
  body.roi-campaign-view .roi-worksheet-table tr.roi-summary-row td::before { display:none; }
}

@media (max-width:600px) {
  body.roi-campaign-view .topbar-actions {
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap;
    align-items:center !important;
    gap:8px;
  }
  body.roi-campaign-view .roi-site-label { max-width:100%; white-space:normal; flex-wrap:wrap; }
  body.roi-campaign-view #meta-campaign-summary > article > strong {
    font-size:clamp(20px,2.4vw,29px) !important;
    letter-spacing:-.04em;
    white-space:nowrap;
  }
  body.roi-campaign-view #google-campaign-summary > article > strong {
    font-size:clamp(20px,2.4vw,29px) !important;
    letter-spacing:-.04em;
    white-space:nowrap;
  }
}

/* On phones, keep the campaign worksheet as a real spreadsheet in both
   orientations. The campaign stays pinned while the remaining columns swipe. */
@media (max-width:900px) {
  body.roi-campaign-view .roi-worksheet-scroll {
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
  }
  body.roi-campaign-view .roi-worksheet-table {
    display:table !important;
    width:1550px !important;
    min-width:1550px !important;
    table-layout:fixed !important;
  }
  body.roi-campaign-view .roi-worksheet-table thead { display:table-header-group !important; width:auto !important; }
  body.roi-campaign-view .roi-worksheet-table tbody { display:table-row-group !important; width:auto !important; }
  body.roi-campaign-view .roi-worksheet-table thead tr { display:table-row !important; }
  body.roi-campaign-view .roi-worksheet-table thead th {
    display:table-cell !important;
    width:auto !important;
    min-width:78px;
    text-align:center;
  }
  body.roi-campaign-view .roi-worksheet-table tr.roi-summary-row { display:table-row !important; }
  body.roi-campaign-view .roi-worksheet-table tr.roi-summary-row td {
    display:table-cell !important;
    width:auto !important;
    min-width:72px;
    font-size:14px;
    white-space:nowrap;
    text-align:center;
    border-bottom:1px solid var(--line);
  }
  body.roi-campaign-view .roi-worksheet-table th:first-child,
  body.roi-campaign-view .roi-worksheet-table td:first-child {
    position:sticky;
    left:0;
    min-width:95px;
    z-index:2;
    text-align:left;
    background:var(--panel);
  }
  body.roi-campaign-view .roi-worksheet-table th:first-child { z-index:3; background:#1b2a40; }
  body.roi-campaign-view .roi-worksheet-table tr.roi-summary-row td::before { display:none !important; }
  body.roi-campaign-view .roi-column-resize {
    display:block !important;
    width:34px;
    z-index:4;
    touch-action:none;
    user-select:none;
    -webkit-user-select:none;
  }
  body.roi-campaign-view .roi-column-resize::after { inset:4px 15px; }
}

.gam-lag-alert { margin:0 0 16px; padding:12px 16px; border-radius:12px; border:1px solid #f59e0b; background:rgba(245,158,11,.12); color:#fbbf24; font-weight:600; }
#overview-closed-result { grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); }
#overview-closed-result article.profit-positive strong { color:var(--green); }
#overview-closed-result article.profit-negative strong { color:var(--red); }
.projection-range { display:block; margin-top:4px; color:var(--muted); font-size:13px; white-space:nowrap; }
#xray-outlook-summary > article > strong, #overview-day-projection-summary strong { white-space:nowrap; font-size:clamp(17px,2.2vw,26px); }

/* Gasto: hoje × ontem */
.spend-compare-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
@media (max-width:700px) { .spend-compare-grid { grid-template-columns:1fr; } }
.spend-compare-card { background:var(--panel-soft); border:1px solid var(--line); border-radius:14px; padding:14px 16px; }
.spend-compare-card h3 { margin:0 0 10px; font-size:15px; color:var(--muted); font-weight:600; }
.spend-compare-line { display:flex; flex-direction:column; gap:2px; margin-top:8px; }
.spend-compare-line span { font-size:13px; color:var(--muted); }
.spend-compare-line strong { font-size:20px; white-space:nowrap; }
.spend-compare-line small { font-size:13px; color:var(--muted); }
.spend-compare-line strong.profit-positive { color:var(--green); }
.spend-compare-line strong.profit-negative { color:var(--red); }
/* Card values never break mid-number; on phones one card per line keeps the big font (Ana, 04/10/2026). */
.metric-card strong { white-space:nowrap; overflow-wrap:normal; }
.overview-kpi .metric-card strong { overflow-wrap:normal; }
@media (max-width:900px) { .metrics { grid-template-columns:minmax(0,1fr) !important; } .metric-card { min-height:0; } .metric-card strong,.overview-kpi .metric-card strong { font-size:31px; } }
#xray-outlook-summary > article.xray-beats-yesterday strong { color:var(--green); }
#xray-outlook-summary > article.xray-below-yesterday strong { color:var(--red); }
/* Tráfego: Meta/Google tabs and account cards stay at the top; the
   diagnostic panels (opportunities, Google insights, coverage) go below
   (Ana, 04/10/2026). Order-based so later insertions keep this layout. */
#traffic-page:not([hidden]) { display:flex; flex-direction:column; }
#traffic-page > #meta-opportunities,#traffic-page > #google-insights,#traffic-page > #meta-coverage { order:1; }
/* Overview ROAS outlook: 4 cards on one row, one per line on phones (Ana, 04/10/2026). */
#xray-outlook-summary { grid-template-columns:repeat(4,minmax(0,1fr)); }
#xray-outlook-summary > article:nth-child(n) { grid-row:auto; grid-column:auto; }
@media (max-width:900px) { #xray-outlook-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { #xray-outlook-summary { grid-template-columns:minmax(0,1fr); } }

/* Audit 05/10: one KPI card per mobile row, with financial numbers intact. */
@media (max-width:600px) {
  .traffic-kpi-grid, .traffic-account-grid, .traffic-month-grid,
  .reference-summary, .reference-list, .breakdown-grid,
  #overview-monthly-goal .reference-summary, #health-goal-milestones .reference-summary, #overview-closed-result,
  body.roi-campaign-view #meta-campaign-summary,
  body.roi-campaign-view #google-campaign-summary {
    grid-template-columns:minmax(0,1fr) !important;
  }
  .reference-summary > article > strong { white-space:nowrap; overflow-wrap:normal; }
  .traffic-account-metric strong { white-space:nowrap; overflow-wrap:normal; font-size:clamp(16px,4.5vw,20px); }
}

/* TRAFEGO-GASTO-LUCRO R1: custo, receita, lucro e ROI no mesmo grupo. */
#traffic-summary, #traffic-monthly-summary { grid-template-columns:repeat(4,minmax(0,1fr)); }
#traffic-page .traffic-financial-card, #traffic-page .traffic-account-card {
  background:var(--traffic-panel,var(--panel)); color:var(--traffic-text,var(--text)); border-color:var(--traffic-line,var(--line));
}
#traffic-page .traffic-financial-card > span, #traffic-page .traffic-financial-card small,
#traffic-page .traffic-account-metric span, #traffic-page .traffic-account-metric small,
#traffic-page .traffic-account-id,
#traffic-page .traffic-account-coverage { color:var(--traffic-muted,var(--muted)); }
#traffic-page .traffic-financial-card > strong { font-size:clamp(22px,2vw,30px); }
#traffic-page .traffic-financial-card small, #traffic-page .traffic-account-metric small { display:block; margin-top:6px; font-size:12px; }
#traffic-page .traffic-account-metric { border-color:var(--traffic-line,var(--line)); }
#traffic-page .traffic-account-metric strong { font-size:22px; }
#traffic-page .traffic-account-roi { order:1; }
#traffic-page .traffic-account-roas { order:2; }
#traffic-page .traffic-account-period { margin:12px 0 8px; font-size:14px; }
#traffic-page .traffic-account-coverage { margin:10px 0; font-size:12px; }
#traffic-page .traffic-financial-card.roi-unavailable > strong,
#traffic-page .traffic-account-metric.roi-unavailable > strong { color:var(--traffic-muted,var(--muted)); }
#traffic-page .traffic-financial-card.roi-positive > strong,
#traffic-page .traffic-account-metric.roi-positive > strong { color:var(--traffic-green,var(--green)); }
#traffic-page .traffic-financial-card.roi-neutral > strong,
#traffic-page .traffic-account-metric.roi-neutral > strong { color:var(--traffic-neutral,var(--yellow)); }
#traffic-page .traffic-financial-card.roi-negative > strong,
#traffic-page .traffic-account-metric.roi-negative > strong { color:var(--traffic-red,var(--red)); }
#traffic-page .traffic-profit-positive > strong { color:var(--traffic-green,var(--green)); }
#traffic-page .traffic-profit-negative > strong { color:var(--traffic-red,var(--red)); }
[data-theme="light"] #traffic-page {
  --traffic-panel:#fff; --traffic-text:#172638; --traffic-muted:#526172; --traffic-line:#cbd5e1;
  --traffic-green:#167342; --traffic-red:#b42318; --traffic-neutral:#855800;
}
@media (max-width:1100px) { #traffic-summary, #traffic-monthly-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) {
  #traffic-summary, #traffic-monthly-summary { grid-template-columns:minmax(0,1fr); }
  #traffic-page .traffic-account-metrics { grid-template-columns:minmax(0,1fr); }
  #traffic-page .traffic-financial-card > strong, #traffic-page .traffic-account-metric strong { font-size:26px; white-space:normal; overflow-wrap:anywhere; }
}

/* Card transferido do Raio X: conserva as regras de reference-card e outlook. */
#overview-outlook { margin-top:16px; min-width:0; }
