/* One document flow at every viewport; legacy HUD grid placements must not overlap. */
#projectWallDialog { overflow-y:auto!important;overflow-x:hidden!important; }
#projectWallDialog .command-center-layout { display:flex!important;flex-direction:column;gap:18px;height:auto!important;min-height:100dvh;overflow:visible!important;padding:24px; }
#projectWallDialog .command-center-layout > :is(header,.project-wall-controls,#projectWallMetrics,#projectWallAds,#projectWallAttribution,#projectWallCommerceMetrics,#projectWallEmailEngagement,#projectWallGrid) { flex:none;position:relative!important;inset:auto!important;transform:none!important;grid-column:auto!important;grid-row:auto!important;width:100%;min-width:0;height:auto;margin:0!important; }
#projectWallDialog .command-center-layout > .project-wall-hud-header { min-height:80px!important;gap:20px;flex-wrap:wrap; }
#projectWallDialog .project-wall-hud-status { flex-wrap:wrap; }
#projectWallDialog .project-wall-controls { flex-wrap:wrap;min-height:54px;padding:10px;gap:12px; }
#projectWallDialog #projectWallMetrics { grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-template-rows:none!important;grid-auto-rows:minmax(150px,auto);gap:12px!important; }
#projectWallDialog #projectWallMetrics .project-wall-kpi { min-height:150px;height:auto;padding:16px!important; }
#projectWallDialog #projectWallMetrics .project-wall-kpi > strong { font-size:clamp(28px,3vw,54px)!important; }
#projectWallDialog #projectWallMetrics .project-wall-kpi header { font-size:12px; }
#projectWallDialog .command-ad-performance { padding:22px;border:1px solid #718b37;border-radius:16px;background:rgba(8,20,13,.96);color:#edf6ed; }
.command-ad-header { display:flex;justify-content:space-between;align-items:start;gap:16px;flex-wrap:wrap; }
.command-ad-header .eyebrow { color:#aef145;font-size:11px;margin:0 0 6px; }
.command-ad-header h2 { margin:0;font:800 30px/1.1 var(--display); }
.command-ad-header p { margin:8px 0 0;font-size:13px;color:#bcc9bf; }
.command-ad-status { border:1px solid #806137;background:#342a19;color:#ffda91;border-radius:8px;padding:9px 12px;font-size:12px; }
.command-ad-cards { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:18px; }
.command-ad-card { min-width:0;padding:18px;border:1px solid #3c594a;border-radius:12px;background:rgba(255,255,255,.035); }
.command-ad-card h3 { font:800 22px/1.15 var(--display);margin:0 0 16px;color:#eff8ec; }
.command-ad-label { display:block;color:#b6c5bb;font-size:12px; }
.command-ad-sales { display:block;margin:8px 0;font:900 clamp(30px,3vw,46px)/1 var(--display);color:#c8ff83;overflow-wrap:anywhere; }
.command-ad-card p { font-size:13px;line-height:1.5;color:#b6c5bb;overflow-wrap:anywhere; }
.command-ad-card dl { margin:16px 0;border-top:1px solid #395140; }
.command-ad-card dl > div { padding:10px 0;display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;border-bottom:1px solid #395140;font-size:12px; }
.command-ad-card dd { margin:0;color:#ffda91; }
.command-ad-card summary { font-size:12px;cursor:pointer; }
.command-ad-note { font-size:12px;line-height:1.6;color:#b6c5bb;margin:14px 0 0; }
#projectWallDialog #projectWallAttribution { min-height:0!important;overflow:visible;padding:22px!important; }
#projectWallDialog #projectWallAttribution .purchase-attribution-visual { height:auto!important;min-height:0!important;grid-template-columns:minmax(200px,.6fr) minmax(0,1.4fr); }
#projectWallDialog #projectWallAttribution .purchase-attribution-pie-wrap { width:min(100%,300px); }
#projectWallDialog #projectWallAttribution .purchase-attribution-header h3 { font-size:28px; }
#projectWallDialog #projectWallAttribution :is(.purchase-attribution-header small,.purchase-attribution-header > span,.purchase-attribution-note,footer,footer small) { font-size:12px;line-height:1.5; }
#projectWallDialog #projectWallAttribution .purchase-attribution-legend-item header strong { font-size:14px; }
#projectWallDialog #projectWallAttribution .purchase-attribution-traffic-primary > strong { font-size:30px; }
#projectWallDialog #projectWallAttribution .purchase-attribution-sales-context > span { font-size:12px; }
#projectWallDialog #projectWallCommerceMetrics { grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:none!important;gap:14px!important; }
#projectWallDialog #projectWallCommerceMetrics > * { grid-column:auto!important;grid-row:auto!important;min-height:320px; }
#projectWallDialog .project-wall-product-ranking > header h3 { font-size:19px; }
#projectWallDialog .project-wall-rank-product strong { font-size:12px; }
#projectWallDialog #projectWallEmailEngagement { min-height:140px;grid-template-columns:1fr;overflow:visible;padding:20px; }
#projectWallDialog .project-wall-email-stats { grid-template-columns:repeat(5,minmax(0,1fr)); }
#projectWallDialog .project-wall-email-stats article { min-height:70px; }
#projectWallDialog .project-wall-email-stats small { font-size:11px; }
#projectWallDialog .project-wall-email-stats strong { font-size:26px; }
#projectWallDialog #projectWallEmailEngagement > p { position:static;max-width:none;white-space:normal; }
#projectWallDialog #projectWallGrid { min-height:80px;height:80px; }
html[data-color-mode="light"] #projectWallDialog .command-ad-performance { background:#f7fbf3;color:#172019; }
html[data-color-mode="light"] .command-ad-card { background:white;border-color:#bdcdb8; }
html[data-color-mode="light"] :is(.command-ad-header h2,.command-ad-card h3) { color:#172019; }
html[data-color-mode="light"] .command-ad-sales { color:#356416; }
html[data-color-mode="light"] :is(.command-ad-label,.command-ad-note,.command-ad-card p,.command-ad-header p) { color:#526252; }
html[data-color-mode="light"] .command-ad-card dd { color:#805416; }
@media(max-width:1100px) {
 #projectWallDialog #projectWallMetrics { grid-template-columns:repeat(3,minmax(0,1fr))!important; }
 #projectWallDialog #projectWallCommerceMetrics { grid-template-columns:1fr!important; }
 #projectWallDialog #projectWallCommerceMetrics > * { min-height:0; }
}
@media(max-width:700px) {
 #projectWallDialog .command-center-layout { padding:14px;gap:14px; }
 #projectWallDialog #projectWallMetrics { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
 #projectWallDialog .project-wall-hud-header h2 { font-size:32px; }
 #projectWallDialog .project-wall-control-actions { flex-wrap:wrap;justify-content:start; }
 .command-ad-cards { grid-template-columns:1fr; }
 #projectWallDialog #projectWallAttribution .purchase-attribution-visual { grid-template-columns:1fr; }
 #projectWallDialog #projectWallAttribution .purchase-attribution-legend { grid-template-columns:1fr; }
 #projectWallDialog .project-wall-email-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* Compact ad summary keeps spend and return visible without dominating the HUD. */
#projectWallDialog .command-ad-performance { padding:16px; }
.command-ad-header h2 { font-size:24px; }
.command-ad-cards { gap:10px;margin-top:12px; }
.command-ad-card { padding:12px; }
.command-ad-card h3 { font-size:20px;margin-bottom:9px; }
.command-ad-sales { font-size:clamp(26px,2.5vw,36px);margin:6px 0; }
.command-ad-card p { font-size:12px;line-height:1.35;margin:7px 0; }
.command-ad-card dl { margin:10px 0; }
.command-ad-card dl > div { padding:7px 0; }
.command-ad-note { margin-top:9px;line-height:1.4; }
.command-history { display:flex;align-items:center;gap:10px;flex-wrap:wrap;width:100%; }
.command-history input { flex:1;min-width:120px;accent-color:#aef145;cursor:pointer; }
.command-history button { padding:6px 12px;min-height:36px; }
.command-history label,.command-history output { font-size:12px; }
.command-history button:disabled { opacity:.45;cursor:default; }
/* History is a page-wide numerical treatment; current mode retains native colors. */
#projectWallDialog { --history-number:#79bcff; }
html[data-color-mode="light"] #projectWallDialog { --history-number:#135bb5; }
#projectWallDialog .command-history-status { flex:none;width:100%;padding:12px 16px;border:1px solid var(--history-number);border-radius:10px;color:var(--history-number);background:rgba(15,38,66,.9);font-size:14px; }
#projectWallDialog .command-history-status[hidden] { display:none; }
html[data-color-mode="light"] #projectWallDialog .command-history-status { background:#edf5ff; }
#projectWallDialog.is-history-loading :is(#projectWallMetrics,#projectWallAds,#projectWallAttribution,#projectWallCommerceMetrics,#projectWallEmailEngagement,#projectWallGrid,#commandMetricHud) { visibility:hidden;pointer-events:none; }
#projectWallDialog.is-history-loading .command-history-status::before { content:"";display:inline-block;width:12px;height:12px;margin-right:10px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:history-loading-spin .8s linear infinite; }
@keyframes history-loading-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { #projectWallDialog.is-history-loading .command-history-status::before { animation:none; } }
#projectWallDialog.is-historical :is(
 .project-wall-kpi > strong,.project-wall-kpi > small,
 .command-ad-sales,.command-ad-card dd,
 .purchase-attribution-pie-center strong,.purchase-attribution-pie-center > span,
 .purchase-attribution-traffic-primary strong,.purchase-attribution-traffic-primary b,
 .purchase-attribution-sales-context strong,.purchase-attribution-traffic-chip,
 .purchase-attribution-legend-item header b,
 .project-wall-product-value,.project-wall-product-ranking footer > span,
 .project-wall-email-stats strong,.project-wall-email-stats em,
 .project-wall-ticker-signal strong,.project-wall-ticker-signal small,
 .command-hud-summary strong,.command-hud-detail-grid strong,
 .command-hud-chart-panel text
) { color:var(--history-number)!important;-webkit-text-fill-color:var(--history-number)!important; }
#projectWallDialog.is-historical .command-hud-chart-panel text { fill:var(--history-number)!important; }
#projectWallDialog .historical-comparison .command-comparison-current { stroke:var(--selected-line)!important; }
#projectWallDialog .historical-comparison .command-comparison-current-point { fill:var(--selected-line)!important; }
#projectWallDialog .historical-comparison .command-comparison-prior { stroke:#ffa640!important; }
#projectWallDialog .historical-comparison .command-comparison-prior-point { fill:#ffa640!important; }
#projectWallDialog .command-comparison-now { fill:none;stroke:#fff;stroke-width:3;stroke-linejoin:round;stroke-linecap:round;filter:drop-shadow(0 1px 2px #000); }
#projectWallDialog .command-now-difference { position:relative!important;inset:auto!important;display:block;margin-top:4px;font-size:11px; }
#projectWallDialog.is-historical .project-wall-kpi { min-height:172px!important; }
#projectWallDialog .command-history-chart-key { font-size:13px;line-height:1.5; }
