/* Edge is an isolated display surface; ordinary Performance keeps its theme. */
body.edge-mode { background: #000; color: #d5dad7; color-scheme: dark; }
body.edge-mode .site-legal-footer { display: none; }
body.edge-mode main.workspace { padding: 10px 16px 12px; max-width: none; margin: 0; }
.edge-display { --edge-text: #d5dad7; --edge-muted: #9ba79f; --edge-line: #28312c; --edge-surface: #080c09; --edge-warning: #d2b77f; --edge-roas-zero: #9ba79f; --edge-roas-low: #f08080; --edge-roas-caution: #e5cd74; --edge-roas-neutral: #f0f2f1; --edge-roas-good: #86cf9b; color: var(--edge-text); background: #000; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 15px; display: flex; flex-direction: column; gap: 10px; min-height: calc(100dvh - 22px); }
.edge-display * { box-sizing: border-box; }
.edge-display [hidden] { display: none !important; }
.edge-display :is(button, a, select, summary, [tabindex]):focus-visible { outline: 2px solid #bad0c1; outline-offset: 3px; }
.edge-display button { font: inherit; touch-action: manipulation; }
.edge-display .edge-control { min-width: 44px; min-height: 44px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--edge-muted); white-space: nowrap; font-weight: 500; }
.edge-display .edge-control:hover { background: #131b16; color: var(--edge-text); }
.edge-display .edge-control[aria-pressed="true"] { color: var(--edge-text); background: #18221c; border-color: #394a3f; }
.edge-display .edge-control:active { background: #24332a; }
.edge-display .edge-refresh { border-color: #617d6a; background: #263e2e; color: #e1eee5; font-weight: 650; }
.edge-display .edge-refresh:hover { border-color: #8baa94; background: #33513e; color: #fff; }
.edge-display .edge-refresh:disabled { border-color: #405649; background: #18291e; color: #a8b9ae; cursor: wait; }
.edge-display .edge-toolbar { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.edge-display .edge-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.edge-display .edge-shell-controls { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: auto; }
.edge-display .edge-toolbar:has(> .edge-totals:not([hidden])) { flex-wrap: wrap; }
.edge-display .edge-toolbar:has(> .edge-totals:not([hidden])) .edge-shell-controls { margin-right: 0; }
.edge-display .edge-totals { position: relative; flex-shrink: 0; min-width: 0; max-width: 100%; margin-right: auto; border: 1px solid var(--edge-line); border-radius: 7px; }
.edge-display .edge-totals > summary { display: grid; grid-template-columns: auto auto 8px; align-items: center; gap: 2px 12px; min-height: 44px; margin: 0; padding: 4px 10px; color: var(--edge-text); cursor: pointer; list-style: none; touch-action: manipulation; }
.edge-display .edge-totals > summary::-webkit-details-marker { display: none; }
.edge-display .edge-totals > summary::after { content: ""; grid-column: 3; grid-row: 1; width: 6px; height: 6px; border-right: 1px solid var(--edge-muted); border-bottom: 1px solid var(--edge-muted); transform: rotate(45deg); }
.edge-display .edge-totals[open] > summary::after { transform: rotate(225deg); }
.edge-display .edge-totals > summary:hover, .edge-display .edge-totals[open] > summary { background: #131b16; border-radius: 7px; }
.edge-display .edge-total-metric { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.edge-display .edge-total-metric > span { color: var(--edge-muted); font-size: 12px; }
.edge-display .edge-total-metric > strong { font-size: 18px; font-weight: 550; line-height: 1.25; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.edge-display .edge-total-status { grid-column: 1 / -1; justify-self: start; max-width: 100%; padding: 0 5px; border-radius: 3px; background: var(--edge-surface); color: var(--edge-warning); font-size: 12px; line-height: 17px; overflow-wrap: anywhere; }
.edge-display .edge-total-scope { grid-column: 1 / -1; color: var(--edge-muted); font-size: 12px; line-height: 17px; }
.edge-display .edge-total-details { position: absolute; top: calc(100% + 5px); left: 0; z-index: 9; width: 540px; max-width: calc(100vw - 32px); max-height: min(440px, 65dvh); overflow-y: auto; padding: 12px; border: 1px solid #586d5f; border-radius: 7px; background: var(--edge-surface); box-shadow: 0 8px 24px #000b; color: var(--edge-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.edge-display .edge-total-details > p { margin: 0; }
.edge-display .edge-total-details > p + p { margin-top: 8px; }
.edge-display .edge-total-details > p:first-child { color: var(--edge-text); }
.edge-display .edge-total-roas[data-roas-band="zero"] { color: var(--edge-roas-zero); }
.edge-display .edge-total-roas[data-roas-band="low"] { color: var(--edge-roas-low); }
.edge-display .edge-total-roas[data-roas-band="caution"] { color: var(--edge-roas-caution); }
.edge-display .edge-total-roas[data-roas-band="neutral"] { color: var(--edge-roas-neutral); }
.edge-display .edge-total-roas[data-roas-band="good"] { color: var(--edge-roas-good); }
.edge-display .edge-total-roas[data-roas-band="unavailable"] { color: var(--edge-muted); }
.edge-display .edge-brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--edge-muted); font-size: 15px; font-weight: 550; white-space: nowrap; letter-spacing: -.035em; }
.edge-display #company-switch { min-width: 0; width: 160px; max-width: 200px; min-height: 44px; padding: 8px; border: 1px solid var(--edge-line); border-radius: 7px; background: #080c09; color: var(--edge-text); font: inherit; text-overflow: ellipsis; }
.edge-display .edge-account-menu { position: relative; flex-shrink: 0; }
.edge-display .edge-account-menu summary { min-height: 44px; margin-bottom: 0; padding: 12px 10px; border-radius: 7px; color: var(--edge-muted); cursor: pointer; white-space: nowrap; }
.edge-display .edge-account-menu summary:hover, .edge-display .edge-account-menu[open] summary { background: #131b16; color: var(--edge-text); }
.edge-display .edge-account-menu > div { position: absolute; top: calc(100% + 4px); right: 0; z-index: 10; display: grid; width: 200px; max-width: calc(100vw - 20px); padding: 5px; border: 1px solid #586d5f; border-radius: 7px; background: #080c09; box-shadow: 0 8px 24px #000b; }
.edge-display .edge-account-menu > div button { width: 100%; text-align: left; }
.edge-display .edge-user-name { padding: 8px 10px; color: var(--edge-muted); font-size: 12px; overflow-wrap: anywhere; }
.edge-display .edge-count { color: var(--edge-muted); font-size: 12px; }
.edge-display .edge-periods, .edge-display .edge-navigation, .edge-display .edge-view-controls, .edge-display .edge-refresh-controls { display: flex; align-items: center; gap: 3px; }
.edge-display .edge-navigation { border-left: 1px solid var(--edge-line); padding-left: 10px; }
.edge-display .edge-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; flex: 1; align-content: start; }
.edge-display .edge-tile { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; min-width: 0; min-height: 44px; padding: clamp(12px, .65vw, 17px); border: 1px solid var(--edge-line); border-radius: 9px; background: var(--edge-surface); color: var(--edge-text); text-align: left; white-space: normal; font-weight: 400; line-height: 1.25; box-shadow: none; }
.edge-display .edge-tile:hover { border-color: #586d5f; background: #0d140f; }
.edge-display .edge-account { flex-shrink: 0; min-width: 0; display: flex; align-items: baseline; gap: .3em; font-size: clamp(15px, .85vw, 22px); font-weight: 550; line-height: 1.2; }
.edge-display .edge-account-name, .edge-display .edge-account-products { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.edge-display .edge-account-name { flex: 0 1 auto; }
.edge-display .edge-account:has(.edge-account-products:not([hidden])) .edge-account-name { max-width: 50%; }
.edge-display .edge-account-products { flex: 1; font-weight: 400; }
.edge-display .edge-account-products::before { content: "· "; }
.edge-display .edge-context { color: var(--edge-muted); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; margin-top: 3px; }
.edge-display .edge-metrics { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; margin: 0; padding: 10px 0 8px; font-variant-numeric: tabular-nums; }
.edge-display .edge-label { display: block; color: var(--edge-muted); font-size: clamp(12px, .6vw, 15px); margin-bottom: 4px; }
.edge-display .edge-metrics > span { container-type: inline-size; min-width: 0; }
.edge-display .edge-metrics strong { --edge-metric-size: clamp(19px, 1.55vw, 39px); display: block; font-size: min(var(--edge-metric-size), calc(100cqi / var(--edge-number-width, 1))); font-weight: 450; line-height: 1.1; letter-spacing: -.045em; white-space: nowrap; }
.edge-display .edge-comparison { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); column-gap: 10px; margin-top: 0; color: var(--edge-muted); line-height: 1.25; }
.edge-display .edge-comparison > .edge-reference-label { grid-column: 1 / -1; }
.edge-display .edge-reference { display: block; min-width: 0; container-type: inline-size; color: var(--edge-muted); line-height: 1.25; }
.edge-display .edge-reference-label { display: block; font-size: 12px; margin-bottom: 2px; }
.edge-display .edge-yesterday-spend, .edge-display .edge-yesterday-roas { display: block; font-size: min(clamp(14px, .8vw, 20px), calc(70cqi / var(--edge-primary-width, 1)), calc(100cqi / var(--edge-number-width, 1))); white-space: nowrap; font-variant-numeric: tabular-nums; }
.edge-display .edge-tile .edge-roas[data-roas-band="zero"] { color: var(--edge-roas-zero); }
.edge-display .edge-tile .edge-roas[data-roas-band="low"] { color: var(--edge-roas-low); }
.edge-display .edge-tile .edge-roas[data-roas-band="caution"] { color: var(--edge-roas-caution); }
.edge-display .edge-tile .edge-roas[data-roas-band="neutral"] { color: var(--edge-roas-neutral); }
.edge-display .edge-tile .edge-roas[data-roas-band="good"] { color: var(--edge-roas-good); }
.edge-display .edge-tile .edge-roas[data-roas-band="unavailable"] { color: var(--edge-muted); }
.edge-display .edge-sales { color: var(--edge-muted); font-size: clamp(12px, .65vw, 16px); font-variant-numeric: tabular-nums; }
.edge-display .edge-tile-footer { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 8px; margin-top: auto; padding-top: 10px; color: var(--edge-muted); font-size: 12px; line-height: 1.3; }
.edge-display .edge-state { min-width: 0; overflow-wrap: anywhere; }
.edge-display .edge-footer-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 6px; max-width: 100%; margin-left: auto; }
.edge-display .edge-freshness { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.edge-display .edge-manager { flex-shrink: 0; padding: 1px 7px; border: 1px solid color-mix(in srgb, var(--edge-muted) 45%, transparent); border-radius: 999px; color: var(--edge-text); font-size: 11.5px; font-weight: 400; line-height: 1.35; white-space: nowrap; }
.edge-display .edge-warning { color: var(--edge-warning); }
.edge-display .edge-footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 18px; color: var(--edge-muted); font-size: 12px; flex-shrink: 0; }
.edge-display .edge-status { margin: 0; line-height: 1.35; }
.edge-display .edge-next-update { white-space: nowrap; font-variant-numeric: tabular-nums; }
.edge-display .edge-empty { padding: 30px 16px; color: var(--edge-muted); flex: 1; }
.edge-display .edge-detail { flex: 1; min-width: 0; }
.edge-display .edge-detail-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.edge-display .edge-detail-heading .edge-control { border-color: var(--edge-line); }
.edge-display h2 { margin: 0; font-weight: 500; font-size: clamp(21px, 1.3vw, 30px); line-height: 1.25; overflow-wrap: anywhere; }
.edge-display .edge-note { color: var(--edge-muted); font-size: 14px; line-height: 1.6; margin: 10px 0 16px; }
.edge-display .edge-table-scroll { overflow-x: auto; border: 1px solid var(--edge-line); border-radius: 7px; margin: 14px 0; }
.edge-display table { border-collapse: collapse; width: 100%; font-size: 14px; color: var(--edge-text); font-variant-numeric: tabular-nums; }
.edge-display caption { text-align: left; padding: 12px; font-size: 16px; font-weight: 500; color: var(--edge-text); }
.edge-display th, .edge-display td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--edge-line); vertical-align: top; }
.edge-display thead th { color: var(--edge-muted); font-weight: 450; background: #0c130e; }
.edge-display tbody th { font-weight: 500; }
.edge-display td:nth-child(2), .edge-display td:nth-child(3), .edge-display td:nth-child(4) { white-space: nowrap; }
.edge-display table small { display: block; font-weight: 400; font-size: 12px; color: var(--edge-muted); line-height: 1.5; margin-top: 4px; }
.edge-display .edge-detail-heading h2 { font-size: clamp(28px, 1.25vw, 32px); }
.edge-display .edge-detail-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; flex: 1; min-width: 0; }
.edge-display .edge-detail-identity h2 { flex: 0 1 auto; max-width: 100%; }
.edge-display .edge-detail-body { min-width: 0; }
.edge-display .edge-detail-products { flex: 1 1 360px; min-width: 0; margin: 0; font-size: 20px; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.edge-display .edge-detail-status { margin: 0 0 8px; color: var(--edge-muted); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.edge-display .edge-campaign-context { color: var(--edge-muted); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.edge-display .edge-detail-status[data-state="retained"], .edge-display .edge-detail-status[data-state="error"] { color: var(--edge-warning); }
.edge-display .edge-campaign-scroll { width: 100%; max-width: 100%; max-height: max(180px, calc(100dvh - 285px)); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; margin: 8px 0; touch-action: pan-x pan-y; }
.edge-display .edge-campaign-scroll, .edge-display .edge-campaign-scroll * { -webkit-user-select: none; user-select: none; cursor: grab; }
.edge-display .edge-campaign-scroll.edge-campaign-grabbing, .edge-display .edge-campaign-scroll.edge-campaign-grabbing * { cursor: grabbing; }
.edge-display .edge-campaign-scroll::-webkit-scrollbar { width: 20px; height: 20px; background: #142019; cursor: default; }
.edge-display .edge-campaign-scroll::-webkit-scrollbar-thumb { min-width: 44px; min-height: 44px; border: 3px solid #142019; border-radius: 10px; background: #a8b9ae; }
.edge-display .edge-campaign-scroll::-webkit-scrollbar-thumb:hover { background: #d5dad7; }
.edge-display .edge-campaign-scroll::-webkit-scrollbar-corner { background: #142019; }
@supports not selector(::-webkit-scrollbar) {
  .edge-display .edge-campaign-scroll { scrollbar-color: #a8b9ae #142019; }
}
.edge-display .edge-campaign-table { min-width: 1180px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.edge-display .edge-campaign-table thead { position: sticky; top: 0; z-index: 1; }
.edge-display .edge-campaign-table thead th { font-size: 17px; line-height: 1.3; padding: 12px 16px; border-top: 0; border-bottom: 1px solid var(--edge-line); background: var(--edge-surface); }
.edge-display .edge-campaign-table thead th:first-child { width: 29%; }
.edge-display .edge-campaign-table thead th:nth-child(2), .edge-display .edge-campaign-table thead th:nth-child(4) { width: 19%; }
.edge-display .edge-campaign-table thead th:nth-child(3) { width: 17%; }
.edge-display .edge-campaign-table thead th:last-child { width: 16%; }
.edge-display .edge-campaign-table tbody tr:first-child :is(th, td) { border-top: 0; }
.edge-display .edge-campaign-table tbody :is(th, td) { padding: 10px 16px; vertical-align: middle; white-space: normal; }
.edge-display .edge-campaign-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 21px; font-weight: 500; line-height: 1.3; }
.edge-display .edge-campaign-table .edge-control { min-height: 44px; margin-top: 4px; padding: 6px 12px; font-size: 16px; border: 1px solid var(--edge-line); }
.edge-display .edge-campaign-table .edge-campaign-name-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 2px 0; border: 0; background: transparent; color: var(--edge-text); text-align: left; white-space: normal; }
.edge-display .edge-campaign-name-button .edge-campaign-name { min-width: 0; }
.edge-display .edge-campaign-chevron { flex: 0 0 auto; color: var(--edge-muted); font-size: 24px; }
.edge-display .edge-campaign-metric { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.edge-display :is(.edge-campaign-spend, .edge-campaign-roas, .edge-campaign-budget) { font-size: clamp(24px, 1.1vw, 28px); font-weight: 500; line-height: 1.25; letter-spacing: -.03em; white-space: nowrap; }
.edge-display .edge-at { color: var(--edge-muted); font-size: 17px; }
.edge-display .edge-campaign-percent { display: block; margin-top: 2px; font-size: 20px; line-height: 1.3; }
.edge-display .edge-campaign-change { display: block; font-size: 21px; line-height: 1.3; overflow-wrap: anywhere; }
.edge-display .edge-campaign-table small { font-size: 16px; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }
.edge-display .edge-campaign-roas[data-roas-band="zero"] { color: var(--edge-roas-zero); }
.edge-display .edge-campaign-roas[data-roas-band="low"] { color: var(--edge-roas-low); }
.edge-display .edge-campaign-roas[data-roas-band="caution"] { color: var(--edge-roas-caution); }
.edge-display .edge-campaign-roas[data-roas-band="neutral"] { color: var(--edge-roas-neutral); }
.edge-display .edge-campaign-roas[data-roas-band="good"] { color: var(--edge-roas-good); }
.edge-display .edge-campaign-roas[data-roas-band="unavailable"], .edge-display .edge-campaign-roas[data-roas-band="reference"] { color: var(--edge-muted); }
.edge-display :is(.edge-history, .edge-delivery-status) { min-width: 0; margin-top: 6px; border-top: 1px solid var(--edge-line); }
.edge-display :is(.edge-history, .edge-delivery-status) summary { min-height: 44px; margin: 0; padding: 10px 4px; font-size: 16px; line-height: 24px; cursor: pointer; touch-action: manipulation; color: var(--edge-muted); }
.edge-display .edge-delivery-status ul { max-height: 220px; overflow: auto; padding: 0 8px; list-style: none; overscroll-behavior: contain; }
.edge-display .edge-delivery-status li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--edge-line); }
.edge-display .edge-delivery-status li span { min-width: 0; overflow-wrap: anywhere; }
.edge-display .edge-history pre { max-width: 100%; padding: 12px; border: 1px solid var(--edge-line); background: var(--edge-surface); color: var(--edge-muted); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.edge-display .edge-campaign-dialog { width: min(1480px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 24px); margin: auto; padding: 12px 24px 24px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--edge-muted); border-radius: 9px; background: #000; color: var(--edge-text); font-size: 17px; line-height: 1.4; }
.edge-display .edge-campaign-dialog::backdrop { background: #000d; }
.edge-display .edge-campaign-dialog > .edge-control { position: sticky; top: 0; z-index: 2; display: block; margin-left: auto; background: #000; border: 1px solid var(--edge-muted); color: var(--edge-text); font-size: 16px; white-space: normal; }
.edge-display .edge-campaign-dialog h3 { margin: 6px 0 18px; font-size: clamp(24px, 1.25vw, 32px); font-weight: 550; line-height: 1.25; overflow-wrap: anywhere; }
.edge-display .edge-campaign-dialog h4 { margin: 0; font-size: 22px; font-weight: 550; line-height: 1.3; }
.edge-display .edge-campaign-dialog p { overflow-wrap: anywhere; }
.edge-display .edge-history-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.edge-display .edge-history-daily, .edge-display .edge-history-totals { min-width: 0; }
.edge-display .edge-history-subtitle { margin: 5px 0 12px; color: var(--edge-muted); font-size: 15px; }
.edge-display .edge-history-scroll-hint { display: none; }
.edge-display .edge-history-chart-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior: contain; scrollbar-color: var(--edge-muted) #111; padding: 3px 2px 8px; }
.edge-display .edge-history-chart { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-width: 620px; gap: 12px; }
.edge-display .edge-history-day { min-width: 0; text-align: center; }
.edge-display .edge-history-date { min-height: 44px; font-size: 18px; font-weight: 550; line-height: 1.25; }
.edge-display .edge-history-date > span { display: block; color: var(--edge-muted); font-size: 14px; font-weight: 400; margin-top: 3px; }
.edge-display .edge-history-plot { position: relative; height: 105px; margin: 10px 0 5px; border-bottom: 1px solid var(--edge-muted); background: linear-gradient(to top, transparent calc(50% - 1px), var(--edge-line) 50%, transparent calc(50% + 1px)); }
.edge-display .edge-history-bar { position: absolute; bottom: 0; left: 25%; width: 50%; height: var(--history-height); min-height: 2px; background: #91b7cf; border-radius: 3px 3px 0 0; }
.edge-display .edge-history-bar[data-missing="true"] { height: 100%; min-height: 0; border: 1px dashed var(--edge-muted); background: transparent; }
.edge-display .edge-history-roas-plot { height: 55px; margin-top: 14px; border-bottom-style: dotted; }
.edge-display .edge-history-point { position: absolute; left: 50%; bottom: clamp(6px, var(--history-height), calc(100% - 6px)); width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, 50%); background: #b5d2a1; }
.edge-display .edge-history-point[data-missing="true"] { display: none; }
.edge-display .edge-history-value { min-height: 48px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.edge-display .edge-history-value > span { display: block; color: var(--edge-muted); font-size: 14px; }
.edge-display .edge-history-value > strong { font-size: 20px; font-weight: 550; line-height: 1.25; }
.edge-display .edge-history-value > small { display: block; color: var(--edge-muted); font-size: 13px; }
.edge-display .edge-history-totals { display: grid; gap: 18px; padding-left: 24px; border-left: 1px solid var(--edge-line); }
.edge-display .edge-history-total + .edge-history-total { border-top: 1px solid var(--edge-line); padding-top: 16px; }
.edge-display .edge-history-total dl { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.edge-display .edge-history-total dl > div { min-width: 0; }
.edge-display .edge-history-total dt { color: var(--edge-muted); font-size: 15px; }
.edge-display .edge-history-total dd { margin: 3px 0 0; font-size: clamp(26px, 1.3vw, 34px); font-weight: 500; line-height: 1.2; letter-spacing: -.03em; overflow-wrap: anywhere; }
.edge-display .edge-history-state { margin: 10px 0 0; color: var(--edge-warning); font-size: 14px; line-height: 1.4; }
.edge-display.edge-dim .edge-history-bar { background: #8aa5b6; }
.edge-display.edge-dim .edge-history-bar[data-missing="true"] { background: transparent; }
.edge-display.edge-dim .edge-history-point { background: #9fb58f; }
@media (max-width: 1000px) {
  .edge-display .edge-history-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .edge-display .edge-history-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; padding-left: 0; border-top: 1px solid var(--edge-line); padding-top: 16px; }
  .edge-display .edge-history-total + .edge-history-total { border-top: 0; padding-top: 0; }
}
@media (max-width: 760px) {
  .edge-display .edge-campaign-scroll { max-height: 60dvh; }
  .edge-display .edge-campaign-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 10px 12px 18px; }
  .edge-display .edge-history-totals { grid-template-columns: minmax(0, 1fr); }
  .edge-display .edge-history-total + .edge-history-total { border-top: 1px solid var(--edge-line); padding-top: 16px; }
}
@media (max-width: 680px) {
  .edge-display .edge-history-scroll-hint { display: block; margin-top: 3px; }
}
.edge-display .edge-ai { --ai-safe: #91d4a5; --ai-warn: #ecd087; --ai-danger: #f39a9a; --ai-neutral: #aab5ae; width: 100%; min-height: 0; min-width: 0; flex: 1; overflow-y: auto; padding: 2px; }
.edge-display .edge-ai-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.edge-display .edge-eyebrow { text-transform: uppercase; font-size: 12px; letter-spacing: .12em; color: var(--edge-muted); margin-top: 0; }
.edge-display .edge-enrollment { margin: 24px 0; }
.edge-display .edge-enrollment > div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; border-top: 1px solid var(--edge-line); padding: 12px 0; }
.edge-display .edge-enrollment dt { font-weight: 500; }
.edge-display .edge-enrollment dd { margin: 0; color: var(--edge-muted); }
.edge-display .edge-ai h2 { font-size: clamp(19px, 1.05vw, 26px); }
.edge-display .edge-ai-refresh { flex-shrink: 0; min-height: 44px; border-color: #617d6a; background: #263e2e; color: #e1eee5; font-weight: 650; }
.edge-display .edge-ai-refresh:hover { border-color: #8baa94; background: #33513e; color: #fff; }
.edge-display .edge-ai-refresh:disabled { border-color: #405649; background: #18291e; color: #a8b9ae; cursor: wait; }
.edge-display .edge-ai-status { color: var(--edge-muted); font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.edge-display .edge-ai-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.edge-display .edge-ai-tile { --ai-accent: var(--ai-neutral); min-width: 0; border: 1px solid var(--edge-line); border-top: 3px solid var(--ai-accent); border-radius: 10px; background: var(--edge-surface); padding: 18px; overflow-wrap: anywhere; }
.edge-display .edge-ai [data-severity="safe"] { --ai-accent: var(--ai-safe); }
.edge-display .edge-ai [data-severity="warn"] { --ai-accent: var(--ai-warn); }
.edge-display .edge-ai [data-severity="danger"] { --ai-accent: var(--ai-danger); }
.edge-display .edge-ai [data-severity="neutral"] { --ai-accent: var(--ai-neutral); }
.edge-display .edge-ai h3 { font-weight: 600; font-size: clamp(20px, 1vw, 26px); line-height: 1.25; margin: 0; }
.edge-display .edge-ai-account-status { color: var(--edge-muted); font-size: 13px; line-height: 1.4; margin: 8px 0 0; }
.edge-display .edge-ai-window-label { margin: 18px 0 6px; color: var(--edge-muted); font-size: 14px; line-height: 1.3; }
.edge-display .edge-ai-used { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; font-size: 14px; line-height: 1.2; color: var(--edge-muted); font-variant-numeric: tabular-nums; }
.edge-display .edge-ai-used strong { color: var(--edge-text); font-size: clamp(40px, 2.2vw, 56px); font-weight: 500; letter-spacing: -.04em; }
.edge-display .edge-ai-used.edge-ai-unavailable strong { font-size: 30px; letter-spacing: -.025em; color: var(--ai-neutral); }
.edge-display .edge-ai-bar { height: 10px; border-radius: 5px; overflow: hidden; background: #222b25; }
.edge-display .edge-ai-bar-fill { display: block; height: 100%; background: var(--ai-accent); border-radius: inherit; }
.edge-display .edge-ai-bar-unknown { border: 1px dashed var(--edge-muted); background: transparent; }
.edge-display .edge-ai-bar-unknown .edge-ai-bar-fill { display: none; }
.edge-display .edge-ai-reset { margin: 10px 0 0; color: var(--edge-muted); font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.edge-display .edge-ai-pace { margin: 16px 0 0; color: var(--ai-accent); font-size: 20px; font-weight: 600; line-height: 1.3; }
.edge-display .edge-ai-estimate { margin: 4px 0 0; color: var(--edge-text); font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.edge-display .edge-ai-alerts { padding: 10px 0 0; margin: 12px 0 0; border-top: 1px solid var(--edge-line); list-style: none; font-size: 13px; line-height: 1.5; }
.edge-display .edge-ai-alerts li { color: var(--ai-accent); }
.edge-display .edge-ai-alerts li + li { margin-top: 5px; }
.edge-display .edge-ai-details { margin-top: 14px; border-top: 1px solid var(--edge-line); }
.edge-display .edge-ai-details > summary { display: list-item; min-height: 44px; padding: 12px 0 8px; color: var(--edge-muted); cursor: pointer; font-size: 14px; line-height: 24px; touch-action: manipulation; }
.edge-display .edge-ai-details > summary:hover, .edge-display .edge-ai-details[open] > summary { color: var(--edge-text); }
.edge-display .edge-ai-provenance, .edge-display .edge-ai-observed, .edge-display .edge-ai-last-attempt, .edge-display .edge-ai-pool-note { margin: 5px 0 10px; color: var(--edge-muted); font-size: 13px; line-height: 1.5; }
.edge-display .edge-ai .edge-ai-pool-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 13px; }
.edge-display .edge-ai-pool-table caption { padding: 10px 0; font-size: 14px; }
.edge-display .edge-ai-pool-table :is(th, td) { padding: 10px 4px; white-space: normal; overflow-wrap: anywhere; }
.edge-display .edge-ai-pool-table th:first-child { width: 42%; }
.edge-display .edge-ai-pool-table small { font-size: 12px; }
.edge-display .edge-ai .edge-warning { color: var(--edge-warning); }
.edge-display.edge-dim .edge-ai { --ai-safe: #99bfa4; --ai-warn: #caba91; --ai-danger: #d2a0a0; --ai-neutral: #a0aba4; }
.edge-display.edge-dim { --edge-text: #aeb9b2; --edge-muted: #89998e; --edge-line: #202a23; --edge-surface: #030604; --edge-warning: #b8a375; --edge-roas-zero: #89998e; --edge-roas-low: #cf8585; --edge-roas-caution: #bdae77; --edge-roas-neutral: #cbd1cd; --edge-roas-good: #83b58f; }
.edge-display.edge-dim .edge-control[aria-pressed="true"] { background: #0c150f; border-color: #2c3c31; }
@media (min-width: 1200px) {
  .edge-display:not(.edge-show-detail) { height: calc(100dvh - 22px); }
  .edge-display .edge-grid { grid-auto-rows: minmax(0, 1fr); align-content: stretch; min-height: 0; }
  /* Extra enrolled accounts remain reachable rather than being silently clipped. */
  .edge-display .edge-grid:has(.edge-tile:nth-child(15)) { grid-auto-rows: minmax(235px, 1fr); overflow-y: auto; padding: 3px; }
}
@media (min-width: 1200px) and (max-height: 580px) {
  body.edge-mode main.workspace { padding: 6px 10px; }
  .edge-display { min-height: calc(100dvh - 12px); gap: 6px; }
  .edge-display:not(.edge-show-detail) { height: calc(100dvh - 12px); }
  .edge-display .edge-toolbar { gap: 8px; }
  .edge-display .edge-control { padding-inline: 10px; font-size: 13px; }
  .edge-display .edge-navigation { padding-left: 8px; }
  .edge-display .edge-grid { gap: 7px; }
  .edge-display .edge-tile { padding: 8px 10px; }
  .edge-display .edge-account { font-size: 15px; }
  .edge-display .edge-context { font-size: 12px; margin-top: 2px; line-height: 1.2; }
  .edge-display .edge-metrics { padding: 6px 0 4px; gap: 6px; }
  .edge-display .edge-label { font-size: 12px; margin-bottom: 2px; }
  .edge-display .edge-metrics strong { --edge-metric-size: clamp(19px, 1.45vw, 28px); }
  .edge-display .edge-sales { font-size: 12px; }
  .edge-display .edge-comparison { column-gap: 6px; }
  .edge-display .edge-reference-label { margin-bottom: 1px; }
  .edge-display .edge-tile-footer { padding-top: 5px; }
  .edge-display .edge-ai-status { margin-bottom: 10px; }
  .edge-display .edge-ai-tile { padding: 12px; }
  .edge-display .edge-ai-window-label { margin-top: 12px; margin-bottom: 4px; }
  .edge-display .edge-ai-used { margin-bottom: 8px; }
  .edge-display .edge-ai-reset { margin-top: 8px; }
  .edge-display .edge-ai-pace { margin-top: 10px; }
  .edge-display .edge-ai-details { margin-top: 8px; }
  .edge-display .edge-footer { font-size: 12px; }
  .edge-display .edge-campaign-dialog { padding-bottom: 16px; }
  .edge-display .edge-campaign-dialog h3 { margin-bottom: 12px; }
  .edge-display .edge-history-subtitle { margin-bottom: 8px; }
  .edge-display .edge-history-plot { height: 60px; margin-top: 6px; }
  .edge-display .edge-history-roas-plot { height: 32px; margin-top: 8px; }
  .edge-display .edge-history-state { margin-top: 6px; }
}
@media (min-width: 1200px) and (max-height: 400px) {
  /* At 1280×360, fitting fourteen slots would sacrifice readable source states.
     Reflow instead: every account remains reachable by vertical scrolling. */
  .edge-display:not(.edge-show-detail) { height: auto; }
  .edge-display .edge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(200px, auto); }
  .edge-display .edge-tile { padding: 12px; }
  .edge-display .edge-account-name, .edge-display .edge-account-products { -webkit-line-clamp: 2; }
  .edge-display .edge-metrics { padding: 10px 0 6px; }
  .edge-display .edge-tile-footer { padding-top: 8px; }
  .edge-display .edge-metrics strong { --edge-metric-size: 28px; }
}
@media (max-width: 1499px) {
  .edge-display .edge-toolbar { flex-wrap: wrap; gap: 8px; }
  .edge-display .edge-periods { order: 3; width: 100%; flex-wrap: wrap; }
}
@media (max-width: 1199px) {
  .edge-display .edge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .edge-display .edge-ai-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edge-display .edge-tile { min-height: 235px; }
  .edge-display .edge-metrics strong { --edge-metric-size: 26px; }
}
@media (max-width: 760px) {
  body.edge-mode main.workspace { padding: 10px; }
  .edge-display { min-height: calc(100dvh - 20px); }
  .edge-display .edge-shell-controls { width: 100%; }
  .edge-display .edge-totals { width: 100%; }
  .edge-display .edge-totals > summary { display: flex; flex-wrap: wrap; padding-right: 26px; }
  .edge-display .edge-totals > summary::after { position: absolute; top: 17px; right: 12px; }
  .edge-display .edge-total-status, .edge-display .edge-total-scope { flex-basis: 100%; }
  .edge-display .edge-total-details { max-width: calc(100vw - 22px); }
  .edge-display #company-switch { flex: 1; width: 0; max-width: none; }
  .edge-display .edge-brand { font-size: 14px; }
  .edge-display .edge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .edge-display .edge-navigation { padding-left: 0; border: 0; }
  .edge-display .edge-control { padding-inline: 10px; }
  .edge-display .edge-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edge-display .edge-period { white-space: normal; padding: 8px; font-size: 13px; }
  .edge-display .edge-account { font-size: 17px; }
  .edge-display .edge-metrics strong { --edge-metric-size: 23px; }
  .edge-display .edge-ai { padding: 0; overflow: visible; }
  .edge-display .edge-ai-grid { grid-template-columns: 1fr; }
  .edge-display .edge-ai-heading { align-items: flex-start; }
  .edge-display .edge-enrollment > div { grid-template-columns: 1fr; gap: 5px; }
  .edge-display .edge-detail-heading { align-items: flex-start; }
  .edge-display .edge-detail-heading h2 { padding-top: 8px; }
  .edge-display table { min-width: 720px; }
}
@media (max-width: 440px) {
  .edge-display .edge-refresh-controls { margin-left: auto; }
  .edge-display .edge-view-controls { width: 100%; }
  .edge-display .edge-view-controls .edge-control { flex: 1; }
  .edge-display .edge-grid { grid-template-columns: 1fr; }
  .edge-display .edge-tile { min-height: 235px; }
  .edge-display .edge-account-name { min-height: 0; -webkit-line-clamp: unset; }
  .edge-display .edge-metrics strong { --edge-metric-size: 34px; }
}
@media (min-width: 1200px) {
  .edge-display.edge-show-detail { height: calc(100dvh - 22px); min-height: 0; }
  .edge-display.edge-show-detail .edge-detail { display: flex; flex-direction: column; min-height: 0; }
  .edge-display.edge-show-detail .edge-detail-heading { flex: 0 0 auto; margin-bottom: 6px; }
  .edge-display.edge-show-detail .edge-detail-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
  .edge-display.edge-show-detail .edge-detail-body > :not(.edge-campaign-scroll) { flex: 0 0 auto; }
  .edge-display.edge-show-detail .edge-campaign-scroll { flex: 1 1 auto; min-height: 80px; max-height: none; margin: 4px 0; }
  .edge-display.edge-show-detail .edge-detail-body > details[open] { flex: 0 1 auto; max-height: 45%; overflow: auto; overscroll-behavior: contain; }
  .edge-display.edge-show-detail .edge-detail-products { font-size: 20px; }
}
@media (min-width: 1200px) and (max-height: 580px) {
  .edge-display.edge-show-detail { height: calc(100dvh - 12px); }
}
@media (max-width: 760px) {
  .edge-display .edge-detail-heading { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
  .edge-display .edge-detail-heading > .edge-control { align-self: flex-start; }
  .edge-display .edge-detail-identity { display: block; width: 100%; }
  .edge-display .edge-detail-heading h2 { padding-top: 0; font-size: 26px; }
  .edge-display .edge-detail-products { margin-top: 6px; -webkit-line-clamp: 3; }
  .edge-display .edge-campaign-table { width: 1060px; min-width: 1060px; }
  .edge-display .edge-campaign-table thead { z-index: 3; }
  .edge-display .edge-campaign-table thead th:first-child { width: 190px; }
  .edge-display .edge-campaign-table thead th:nth-child(2), .edge-display .edge-campaign-table thead th:nth-child(4) { width: 235px; }
  .edge-display .edge-campaign-table thead th:nth-child(3) { width: 185px; }
  .edge-display .edge-campaign-table thead th:last-child { width: 215px; }
}

/* Products consumes canonical product reporting; account hints never set metrics. */
.edge-display .edge-products { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; flex: 1; }
.edge-display .edge-products-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; flex: 0 0 auto; }
.edge-display .edge-products-heading h2 { margin-right: auto; font-size: clamp(20px, 1.2vw, 28px); }
.edge-display .edge-products-heading .edge-control { border-color: var(--edge-line); }
.edge-display .edge-product-sort-label { display: flex; align-items: center; gap: 8px; color: var(--edge-muted); font-size: 13px; }
.edge-display .edge-product-sort { max-width: 100%; min-height: 44px; padding: 8px; color: var(--edge-text); background: var(--edge-surface); border: 1px solid var(--edge-line); border-radius: 7px; font: inherit; }
.edge-display .edge-products-status { flex: 0 0 auto; margin: 0; color: var(--edge-muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.edge-display .edge-products[data-state="error"] .edge-products-status, .edge-display .edge-products[data-state="cached"] .edge-products-status { color: var(--edge-warning); }
.edge-display .edge-products-total { position: relative; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; overflow: visible; border: 1px solid var(--edge-line); border-radius: 7px; padding: 5px 12px; flex: 0 0 auto; }
.edge-display .edge-product-total-label { max-width: 220px; color: var(--edge-muted); font-size: 12px; line-height: 1.35; }
.edge-display .edge-products-total > .edge-product-metric { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 12px; flex: 1 1 320px; max-width: 700px; }
.edge-display .edge-products-total .edge-metrics { grid-row: 1 / 4; padding: 0; min-width: 170px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.edge-display .edge-products-total .edge-metrics strong { --edge-metric-size: 23px; }
.edge-display .edge-products-total .edge-label { font-size: 12px; margin-bottom: 1px; }
.edge-display .edge-products-total .edge-context, .edge-display .edge-products-total .edge-sales { font-size: 11px; line-height: 1.2; margin: 0; }
.edge-display .edge-products-total .edge-product-observed { grid-column: 2; }
.edge-display .edge-product-provenance { margin-left: auto; flex: 0 0 auto; }
.edge-display .edge-product-provenance > summary { min-height: 44px; padding: 12px 8px; margin: 0; font-size: 13px; color: var(--edge-muted); cursor: pointer; }
.edge-display .edge-product-provenance-body { position: absolute; top: calc(100% + 5px); right: 0; z-index: 10; width: min(640px, calc(100vw - 32px)); max-height: min(440px, 55dvh); overflow: auto; padding: 12px; border: 1px solid var(--edge-muted); border-radius: 7px; background: var(--edge-surface); box-shadow: 0 8px 24px #000b; font-size: 13px; line-height: 1.4; }
.edge-display .edge-product-provenance-body > p { margin: 0 0 10px; color: var(--edge-muted); }
.edge-display .edge-product-context-detail { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 0; border-top: 1px solid var(--edge-line); }
.edge-display .edge-products-content { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; flex: 1; }
.edge-display .edge-products-content > .edge-product-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: min-content; align-content: start; min-height: 80px; }
.edge-display .edge-product-tile { min-height: 0; padding: 10px 12px; }
.edge-display .edge-product-tile .edge-account-name { max-width: none; }
.edge-display .edge-product-tile .edge-metrics { padding-block: 5px 4px; }
.edge-display .edge-product-tile .edge-metrics strong { --edge-metric-size: clamp(24px, 1.25vw, 32px); }
.edge-display .edge-product-tile .edge-label { font-size: 13px; margin-bottom: 2px; }
.edge-display .edge-product-tile .edge-context { font-size: 11px; line-height: 1.2; margin-top: 2px; }
.edge-display .edge-product-tile .edge-sales { font-size: 13px; }
.edge-display .edge-product-reference { margin-top: 5px; padding-top: 4px; border-top: 1px solid var(--edge-line); }
.edge-display .edge-product-comparison .edge-metrics { padding-top: 2px; }
.edge-display .edge-product-comparison .edge-metrics .edge-label { display: none; }
.edge-display .edge-product-comparison .edge-metrics strong { --edge-metric-size: 19px; color: var(--edge-muted); }
.edge-display .edge-product-comparison .edge-sales { font-size: 12px; }
.edge-display .edge-product-comparison .edge-context { display: none; }
.edge-display .edge-product-pagination { display: flex; align-items: center; justify-content: center; gap: 8px 18px; flex: 0 0 auto; min-height: 44px; color: var(--edge-muted); font-size: 12px; }
.edge-display .edge-product-pagination .edge-control { border-color: var(--edge-line); }
.edge-display .edge-product-pagination .edge-control:disabled { opacity: .45; cursor: default; }
.edge-display .edge-products-scroll { overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; scrollbar-gutter: stable; flex: 1 1 auto; min-height: 80px; margin: 0; padding: 2px; }
.edge-display .edge-products-scroll, .edge-display .edge-products-scroll * { -webkit-user-select: none; user-select: none; cursor: grab; }
.edge-display .edge-products-scroll.edge-campaign-grabbing, .edge-display .edge-products-scroll.edge-campaign-grabbing * { cursor: grabbing; }
.edge-display .edge-products-scroll::-webkit-scrollbar { width: 20px; height: 20px; background: #142019; }
.edge-display .edge-products-scroll::-webkit-scrollbar-thumb { min-width: 44px; min-height: 44px; border: 3px solid #142019; border-radius: 10px; background: #a8b9ae; }
.edge-display .edge-products-scroll::-webkit-scrollbar-corner { background: #142019; }
.edge-display .edge-product-table { table-layout: fixed; min-width: 920px; border-collapse: separate; border-spacing: 0; }
.edge-display .edge-product-table thead { position: sticky; top: 0; z-index: 2; }
.edge-display .edge-product-table thead th { background: var(--edge-surface); font-size: 13px; }
.edge-display .edge-product-table th:first-child { width: 27%; }
.edge-display .edge-product-table th:nth-child(2) { width: 15%; }
.edge-display .edge-product-table th:nth-child(3), .edge-display .edge-product-table th:nth-child(4) { width: 11%; }
.edge-display .edge-product-table th:last-child { width: 36%; }
.edge-display .edge-product-table :is(th, td) { vertical-align: middle; padding: 7px 12px; overflow-wrap: anywhere; }
.edge-display .edge-product-table small { font-size: 11px; margin-top: 2px; }
.edge-display .edge-product-table .edge-control { width: 100%; min-height: 44px; padding: 6px 0; color: var(--edge-text); text-align: left; white-space: normal; font-size: 17px; font-weight: 500; line-height: 1.25; }
.edge-display .edge-product-table :is(.edge-product-account-toggle, .edge-product-campaign) { display: flex; align-items: center; }
.edge-display .edge-product-name-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; max-height: 2.5em; overflow: hidden; }
.edge-display .edge-product-account-toggle::before { content: "›"; display: inline-block; flex: 0 0 auto; margin-right: 8px; color: var(--edge-muted); }
.edge-display .edge-product-account-toggle[aria-expanded="true"]::before { content: "⌄"; }
.edge-display .edge-product-row-metric { min-height: 32px; }
.edge-display .edge-product-row-metric strong { font-size: 20px; font-weight: 500; letter-spacing: -.025em; white-space: nowrap; }
.edge-display .edge-product-row-context { font-size: 12px; color: var(--edge-muted); }
.edge-display .edge-product-row-context > div { min-height: 32px; }
.edge-display .edge-product-row-metric + .edge-product-row-metric, .edge-display .edge-product-row-context > div + div { margin-top: 6px; }
.edge-display .edge-product-row-metric [data-roas-band="zero"] { color: var(--edge-roas-zero); }
.edge-display .edge-product-row-metric [data-roas-band="low"] { color: var(--edge-roas-low); }
.edge-display .edge-product-row-metric [data-roas-band="caution"] { color: var(--edge-roas-caution); }
.edge-display .edge-product-row-metric [data-roas-band="neutral"] { color: var(--edge-roas-neutral); }
.edge-display .edge-product-row-metric [data-roas-band="good"] { color: var(--edge-roas-good); }
.edge-display .edge-product-row-metric [data-roas-band="unavailable"] { color: var(--edge-muted); }
.edge-display .edge-product-expanded { background: #030604; }
.edge-display .edge-product-expanded-heading { display: flex; align-items: center; gap: 16px; margin: 2px 0 8px; }
.edge-display .edge-product-expanded-heading .edge-control { width: auto; padding-inline: 10px; border: 1px solid var(--edge-line); font-size: 13px; flex-shrink: 0; }
.edge-display .edge-product-expanded-heading strong { font-weight: 500; font-size: 14px; }
.edge-display .edge-product-campaigns { max-height: min(390px, 48dvh); }
.edge-display .edge-product-expanded .edge-product-pagination .edge-control { width: auto; padding: 6px 12px; font-size: 13px; }
@media (max-width: 1499px) {
  .edge-display .edge-products-content > .edge-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  .edge-display:has(> .edge-products:not([hidden])) { height: calc(100dvh - 22px); min-height: 0; }
  .edge-display .edge-products-content > .edge-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edge-display .edge-products-scroll { max-height: 65dvh; }
}
@media (max-width: 760px) {
  .edge-display:has(> .edge-products:not([hidden])) { height: calc(100dvh - 20px); }
  .edge-display:has(> .edge-products:not([hidden])) .edge-refresh-controls { margin-left: 0; }
  .edge-display:has(> .edge-products:not([hidden])) .edge-view-controls { width: auto; margin-left: auto; }
  .edge-display .edge-product-provenance-body { position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; max-height: min(440px, 55dvh); }
  .edge-display .edge-products-total { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 6px 8px; }
  .edge-display .edge-product-total-label { max-width: none; min-width: 0; }
  .edge-display .edge-products-total > .edge-product-metric { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 8px; grid-column: 1 / -1; order: 2; }
  .edge-display .edge-products-total .edge-metrics { min-width: 0; }
  .edge-display .edge-products-total .edge-product-observed { grid-column: 2; }
  .edge-display .edge-product-provenance { margin-left: 0; }
  .edge-display .edge-products-content > .edge-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .edge-display .edge-product-tile { padding: 10px; }
  .edge-display .edge-product-tile .edge-metrics strong { --edge-metric-size: 25px; }
  .edge-display .edge-product-table { min-width: 840px; }
  .edge-display .edge-product-table > :is(thead, tbody) > tr > th:first-child { position: sticky; left: 0; z-index: 1; background: var(--edge-surface); border-right: 1px solid var(--edge-line); }
  .edge-display .edge-product-table th:first-child { width: 150px; }
  .edge-display .edge-product-table thead th:nth-child(2) { width: 100px; }
  .edge-display .edge-product-table thead th:nth-child(3) { width: 84px; }
  .edge-display .edge-product-table thead th:nth-child(4) { width: 70px; }
  .edge-display .edge-product-table thead th:last-child { width: auto; }
  .edge-display .edge-products-scroll { max-height: 65dvh; }
  .edge-display .edge-product-campaigns { max-height: 45dvh; }
  .edge-display .edge-product-expanded-heading { flex-wrap: wrap; gap: 6px; }
  .edge-display .edge-product-expanded-content { position: sticky; left: 0; width: calc(100vw - 46px); max-width: 100%; margin-left: -12px; }
  .edge-display .edge-product-expanded-content > .edge-product-expanded-heading { padding-inline: 10px; }
  .edge-display .edge-product-expanded-content > .edge-product-pagination { gap: 8px; }
  .edge-display .edge-product-expanded-content > .edge-product-campaigns { padding: 0; }
  .edge-display .edge-product-expanded-content > .edge-product-campaigns::-webkit-scrollbar { width: 8px; height: 12px; }
}
@media (max-width: 440px) {
  .edge-display .edge-products-content > .edge-product-grid { grid-template-columns: 1fr; }
  .edge-display .edge-product-tile .edge-metrics strong { --edge-metric-size: 32px; }
}
@media (min-width: 1200px) and (max-height: 580px) {
  .edge-display .edge-products { gap: 4px; }
  .edge-display .edge-products-total { padding-block: 3px; }
  .edge-display .edge-product-tile .edge-context { font-size: 10px; }
  .edge-display .edge-product-reference { margin-top: 5px; }
  .edge-display .edge-product-tile .edge-metrics { padding-block: 4px; }
  .edge-display .edge-product-comparison .edge-metrics strong { --edge-metric-size: 17px; }
}
.edge-display .edge-campaign-dialog[data-product-scope] .edge-product-campaign-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-bottom: 8px; }
.edge-display .edge-campaign-dialog[data-product-scope] .edge-product-campaign-scope { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 4px 0 8px; }
.edge-display .edge-campaign-dialog[data-product-scope] .edge-product-campaign-context { margin: 4px 0 8px; }

/* Phone Stats: every Edge screen and drilldown, condensed for portrait and short touch landscapes.
   Desktop and wall displays keep the layout above; edge.js uses the same breakpoint. */
.edge-display .edge-period-short, .edge-display .nav-menu-toggle { display: none; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) and (max-width: 1000px) {
  body.edge-mode main.workspace { padding: 0 max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  /* Clip (not scroll) stray overflow such as the screen-reader heading; sticky still works. */
  body.edge-mode main.workspace { overflow-x: clip; }
  .edge-display { position: relative; gap: 8px; }
  .edge-display .edge-phone-bar { position: sticky; top: 0; z-index: 20; margin-inline: calc(-1 * max(10px, env(safe-area-inset-left))) calc(-1 * max(10px, env(safe-area-inset-right))); padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); background: #000; border-bottom: 1px solid var(--edge-line); }
  .edge-display .edge-shell-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; margin: 0; }
  .edge-display .edge-shell-controls > .nav-menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto; width: auto; min-width: 44px; min-height: 44px; margin: 0; padding: 8px 12px; border: 1px solid #394a3f; border-radius: 7px; background: #18221c; color: var(--edge-text); font-size: 15px; font-weight: 600; white-space: nowrap; }
  .edge-display .edge-shell-controls > .nav-menu-toggle::before { content: "☰" / ""; font-size: 17px; line-height: 1; }
  .edge-display .edge-shell-controls > .nav-menu-toggle[aria-expanded="true"] { border-color: #8baa94; background: #263e2e; }
  .edge-display .edge-shell-controls > .edge-brand { display: none; }
  .edge-display #company-switch { flex: 1 1 0; width: 0; min-width: 0; max-width: none; }
  .edge-display .edge-account-menu summary { padding-inline: 8px; }
  .edge-display .edge-shell-controls > .app-sidebar.is-open { display: block; order: 10; flex: 0 0 100%; position: static; max-height: min(70dvh, calc(100dvh - 80px)); margin: 2px 0 4px; padding: 8px; overflow-y: auto; overscroll-behavior: contain; border-radius: 7px; }
  .edge-display .edge-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; }
  .edge-display .edge-toolbar > * { min-width: 0; margin: 0; }
  .edge-display .edge-toolbar > .edge-shell-controls { grid-column: 1 / -1; }
  .edge-display .edge-toolbar > .edge-totals { grid-column: 1 / -1; grid-row: 1; width: auto; }
  /* Without periods (account detail, AI usage) Dim joins the first row instead of its own. */
  .edge-display .edge-toolbar:has(> .edge-periods[hidden]) > .edge-totals { grid-column: 1 / 3; }
  .edge-display .edge-toolbar:has(> .edge-periods[hidden]) > .edge-view-controls { grid-row: 1; }
  .edge-display .edge-toolbar > .edge-navigation { grid-column: 1; grid-row: 2; display: flex; gap: 3px; padding: 0; border: 0; }
  .edge-display .edge-navigation > .edge-control { flex: 1 1 0; min-width: 0; padding-inline: 6px; }
  .edge-display .edge-toolbar > .edge-refresh-controls { grid-column: 2 / -1; grid-row: 2; justify-content: flex-end; }
  .edge-display .edge-toolbar > .edge-periods { grid-column: 1 / 3; grid-row: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; width: auto; }
  .edge-display .edge-toolbar > .edge-view-controls { grid-column: 3; grid-row: 3; width: auto; }
  .edge-display .edge-view-controls .edge-control { flex: 0 0 auto; }
  .edge-display .edge-period { padding: 8px 4px; font-size: 14px; white-space: nowrap; }
  .edge-display .edge-period-long { display: none; }
  .edge-display .edge-period-short { display: inline; }
  /* Accounts: one compact row per account, metrics before labels stay in the same order. */
  .edge-display .edge-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .edge-display .edge-tile:not(.edge-product-tile) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; min-height: 0; padding: 10px 12px; }
  .edge-display .edge-tile:not(.edge-product-tile) > :is(.edge-account, .edge-context, .edge-metrics) { grid-column: 1 / -1; }
  .edge-display .edge-tile:not(.edge-product-tile) > .edge-account { font-size: 16px; }
  .edge-display .edge-tile:not(.edge-product-tile) > .edge-metrics { gap: 2px 10px; padding: 6px 0 4px; }
  .edge-display .edge-tile:not(.edge-product-tile) .edge-metrics strong { --edge-metric-size: 26px; }
  /* Sales shares the footer row; Yesterday stays aligned beneath Today as on the wall display. */
  .edge-display .edge-tile:not(.edge-product-tile) > .edge-sales { grid-column: 1; grid-row: 4; align-self: end; font-size: 13px; white-space: nowrap; }
  .edge-display .edge-tile:not(.edge-product-tile) > .edge-tile-footer { grid-column: 2; grid-row: 4; margin: 0; padding-top: 0; }
  .edge-display .edge-tile:not(.edge-product-tile) :is(.edge-state, .edge-freshness) { font-size: 12px; }
  /* Account detail and campaigns: compact phone type and spacing so Campaign, Today and Budget
     fit a 402px phone; Yesterday and Last change stay in the bounded sideways scroll. */
  .edge-display .edge-detail-heading { gap: 4px 10px; margin-bottom: 4px; }
  .edge-display .edge-detail-heading h2 { font-size: 19px; }
  .edge-display .edge-detail-products { margin-top: 2px; font-size: 14px; -webkit-line-clamp: 2; }
  .edge-display .edge-detail-status { margin-bottom: 4px; }
  .edge-display :is(.edge-detail-status, .edge-campaign-context) { font-size: 12px; line-height: 1.35; }
  .edge-display .edge-campaign-scroll { max-height: min(60dvh, calc(100dvh - 120px)); margin: 6px 0; }
  .edge-display .edge-campaign-table { width: 100%; min-width: 568px; }
  .edge-display .edge-campaign-table thead { z-index: 3; }
  .edge-display .edge-campaign-table thead th { font-size: 12px; line-height: 1.25; padding: 6px 8px; }
  .edge-display .edge-campaign-table thead th:first-child { width: 124px; }
  .edge-display .edge-campaign-table thead th:nth-child(2), .edge-display .edge-campaign-table thead th:nth-child(4) { width: 116px; }
  .edge-display .edge-campaign-table thead th:nth-child(3) { width: 104px; }
  .edge-display .edge-campaign-table thead th:last-child { width: 108px; }
  .edge-display .edge-campaign-table tbody :is(th, td) { padding: 5px 8px; }
  /* The Campaign column scrolls sideways with the other columns on phones (not pinned). */
  .edge-display .edge-campaign-table tr > th:first-child { border-right: 1px solid var(--edge-line); }
  .edge-display .edge-campaign-table .edge-campaign-name-button { gap: 2px; }
  .edge-display .edge-campaign-chevron { font-size: 18px; }
  .edge-display .edge-campaign-name { font-size: 14px; line-height: 1.25; }
  /* Spend and ROAS may wrap onto two lines inside the narrower Today/Yesterday columns. */
  .edge-display .edge-campaign-metric { gap: 0 4px; }
  .edge-display :is(.edge-campaign-spend, .edge-campaign-roas, .edge-campaign-budget) { font-size: 16px; line-height: 1.25; }
  .edge-display .edge-at { font-size: 12px; }
  .edge-display .edge-campaign-percent { margin-top: 1px; font-size: 13px; line-height: 1.25; }
  .edge-display .edge-campaign-change { font-size: 14px; line-height: 1.25; }
  .edge-display .edge-campaign-table small { margin-top: 2px; font-size: 12px; line-height: 1.25; }
  .edge-display :is(.edge-history, .edge-delivery-status) summary { font-size: 15px; }
  /* Campaign popup: a full-screen sheet inside the safe area; Back closes it (edge.js). */
  .edge-display .edge-campaign-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); border: 0; border-radius: 0; font-size: 15px; }
  .edge-display .edge-campaign-dialog h3 { margin: 4px 0 12px; font-size: 20px; }
  .edge-display .edge-campaign-dialog h4 { font-size: 18px; }
  html:has(body.edge-mode .edge-campaign-dialog[open]) { overflow: hidden; }
  /* Products: compact cards and the same drilldown table with a sticky identity column. */
  .edge-display .edge-products { gap: 6px; }
  .edge-display .edge-products-heading { gap: 6px 10px; }
  .edge-display .edge-products-heading h2 { font-size: 20px; }
  .edge-display .edge-products-content > .edge-product-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .edge-display .edge-product-tile { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 10px 12px; }
  .edge-display .edge-product-tile > :is(.edge-account, .edge-context) { grid-column: 1 / -1; }
  .edge-display .edge-product-tile > .edge-product-metric:not(.edge-product-comparison) { grid-column: 1; grid-row: 3 / span 3; }
  .edge-display .edge-product-tile > .edge-product-reference { grid-column: 2; grid-row: 3; margin: 5px 0 0; padding: 0; border: 0; }
  .edge-display .edge-product-tile > .edge-product-comparison { grid-column: 2; grid-row: 4; }
  .edge-display .edge-product-tile .edge-metrics strong { --edge-metric-size: 24px; }
  .edge-display .edge-product-comparison .edge-metrics { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .edge-display .edge-product-comparison .edge-metrics strong { --edge-metric-size: 17px; }
  .edge-display .edge-product-table > :is(thead, tbody) > tr > th:first-child { position: sticky; left: 0; z-index: 1; background: var(--edge-surface); border-right: 1px solid var(--edge-line); }
  .edge-display .edge-product-table .edge-control { font-size: 15px; }
  .edge-display .edge-product-row-metric strong { font-size: 17px; }
  /* Refresh/freshness status lines above the stats keep their height as their text changes:
     the totals status keeps one line even while empty, and account detail status reserves the
     lines its ordinary states use. Longer failure text still wraps in full. */
  .edge-display .edge-totals .edge-total-status { min-height: 17px; }
  .edge-display .edge-totals .edge-total-status[hidden] { display: block !important; visibility: hidden; }
  .edge-display .edge-detail-status { min-height: calc(2 * 1.35em); }
}
/* Portrait phones: Today/Yesterday put spend on its own line and "@ ROAS" beneath it. */
@media (max-width: 760px) {
  .edge-display .edge-campaign-table .edge-campaign-spend { flex-basis: 100%; }
  .edge-display .edge-detail-status { min-height: calc(3 * 1.35em); }
}
/* Short touch landscapes: totals and screens share one row; content scrolls with the page. */
@media (pointer: coarse) and (max-height: 500px) and (max-width: 1000px) {
  .edge-display .edge-toolbar { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .edge-display .edge-toolbar > .edge-totals, .edge-display .edge-toolbar:has(> .edge-periods[hidden]) > .edge-totals { grid-column: 1; grid-row: 1; }
  .edge-display .edge-toolbar > .edge-navigation { grid-column: 2; grid-row: 1; }
  .edge-display .edge-toolbar > .edge-refresh-controls { grid-column: 3; grid-row: 1; }
  .edge-display .edge-toolbar > .edge-view-controls { grid-column: 4; grid-row: 1; }
  .edge-display .edge-toolbar > .edge-periods { grid-column: 1 / -1; grid-row: 2; }
  .edge-display .edge-shell-controls > .edge-brand { display: inline-flex; }
  .edge-display .edge-grid, .edge-display .edge-products-content > .edge-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edge-display:has(> .edge-products:not([hidden])) { height: auto; min-height: 0; }
  .edge-display .edge-products-scroll { max-height: none; }
  .edge-display .edge-product-campaigns { max-height: 70dvh; }
}
