/* Views A: overview and brand page. */

/* Live strip */
.live-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.live-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.live-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--profit); box-shadow: 0 0 0 3px var(--profit-bg); }
.live-sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.live-grid { display: grid; gap: 0; border-top: 1px solid var(--line); }
.live-cell { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lc-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.lc-when { font-size: 12px; color: var(--text-3); }
.lc-val { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.lc-sub { font-size: 12px; color: var(--text-3); }
.lc-delta { min-height: 18px; }
.lc-spark { margin-top: 4px; }
.live-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.live-note .ico, .vat-note .ico, .wi-caveat .ico { margin-top: 2px; }

/* KPI row */
.kpis { padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); overflow: hidden; }
.kp { background: var(--surface); padding: 14px 16px; display: grid; align-content: start; gap: 2px; min-width: 0; }
.kp-kept { grid-column: 1 / -1; }
.kp-label { display: flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--text-2); }
.kp-val { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.kp-kept .kp-val { font-size: 32px; }
.kp-share { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.kp-margin { font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.kp-delta { min-height: 18px; display: flex; flex-wrap: wrap; align-items: center; }
.kp .spark { margin-top: 6px; max-width: 100%; }
.vat-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--text-3); max-width: 90ch; }
.ov-pair { display: grid; gap: 16px; }
.ov-pair > * { margin-top: 0 !important; }
.ov-pair > :only-child { grid-column: 1 / -1; }

/* Alerts preview + Noon card */
.al-list { display: grid; }
.al-row + .al-row { border-top: 1px solid var(--line); }
.al-link { display: grid; gap: 4px; padding: 12px 0; text-decoration: none; min-height: 44px; }
.al-link:hover .al-title { text-decoration: underline; text-underline-offset: 3px; }
.al-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.al-brand { font-size: 13px; font-weight: 600; color: var(--text-2); }
.al-title { font-weight: 500; }
.al-stake { font-size: 13px; color: var(--text-2); }
.noon-card { display: grid; align-content: start; gap: 10px; }
.noon-card .card-head { margin-bottom: 0; }
.nc-line { color: var(--text-2); }
.nc-gap { font-size: 16px; }
.nc-amz { color: var(--text-2); padding-top: 10px; border-top: 1px solid var(--line); }
.noon-card .btn { justify-self: start; }

/* Brand page */
.brand-top { display: grid; gap: 12px; align-items: start; }
.hl { font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; max-width: 34ch; }
.hl-kept, .hl-lost { white-space: nowrap; }
.hl-lost { color: var(--loss); }
.hl-sub { margin-top: 6px; color: var(--text-2); }
.proj { position: sticky; top: calc(8px + env(safe-area-inset-top)); z-index: 10; display: grid; gap: 2px; align-content: center; min-height: 78px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); }
.proj-zone { display: grid; gap: 16px; align-items: start; }
.proj-zone > * { margin-top: 0 !important; }
/* Idle: quiet hint, not sticky (only becomes sticky once a slider has moved); space is reserved so nothing jumps */
.proj:not(.on) { position: static; box-shadow: none; background: var(--surface-2); border-style: dashed; }
.pj-idle { font-size: 13px; color: var(--text-2); }
.pj-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.pj-main { font-size: 18px; font-weight: 600; }
.pj-delta { font-size: 13px; font-weight: 600; }
.brand-grid { display: grid; gap: 16px; }
.brand-grid > * { margin-top: 0 !important; }
.river-host { width: 100%; min-height: 268px; }
@media (max-width: 600px) { .river-host { min-height: 288px; } }
.river-card { align-self: stretch; }
.stream .hit { pointer-events: all; }
.river-svg { display: block; direction: ltr; max-width: 100%; height: auto; overflow: visible; font-family: inherit; }
.river-read { margin-top: 8px; min-height: 22px; font-size: 13px; color: var(--text-2); }
.rb { transition: opacity 180ms ease; }
.rb-rev, .rb-net { fill: var(--flow-sales); }
.rb-cogs { fill: var(--flow-cogs); } .rb-ads { fill: var(--flow-ads); } .rb-refunds { fill: var(--flow-refunds); }
.rb-fulfil { fill: var(--flow-fulfil); } .rb-referral { fill: var(--flow-referral); }
.rb-net { fill: color-mix(in srgb, var(--profit) 30%, var(--flow-sales)); }
.rb-loss { fill: color-mix(in srgb, var(--loss) 38%, var(--flow-sales)); }
.nd { fill: var(--text-3); } .nd-net { fill: var(--profit); } .nd-loss { fill: var(--loss); }
.dot-net { fill: var(--profit); stroke: var(--surface); stroke-width: 2; }
.dot-loss { fill: var(--loss); stroke: var(--surface); stroke-width: 2; }
.stream { outline: none; cursor: default; }
.stream:focus-visible .rb, .stream.on .rb { stroke: var(--text); stroke-width: 1; }
.river-svg.has-on .stream:not(.on) .rb { opacity: 0.45; }
.lb { fill: var(--text-2); } .lb-net { fill: var(--text); font-weight: 600; } .lb-loss { fill: var(--loss); font-weight: 600; }
.lv { fill: var(--text); font-weight: 600; } .ls { fill: var(--text-3); }
.lead { stroke: var(--line-2); stroke-width: 1; fill: none; }

/* What-if */
.wi-sub, .wi-caveat { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.wi-caveat { display: flex; gap: 6px; margin: 12px 0 0; color: var(--text-3); font-size: 12px; }
.sl { margin-bottom: 14px; }
.sl-top { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.sl-label { font-weight: 500; }
.sl-val { font-weight: 600; }
.sl-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.sl input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; }
.sl input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.sl input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.sl input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-1); }
.sl input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.wi-out { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.wi-out > div { display: grid; gap: 2px; }
.wo-v { font-size: 20px; font-weight: 600; } .wo-m { font-size: 12px; color: var(--text-3); }
.al-stack { display: grid; gap: 12px; }

@media (min-width: 720px) {
  .live-grid { grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
  .live-cell { padding: 14px 20px; border-bottom: 0; border-inline-end: 1px solid var(--line); }
  .live-cell:first-child { padding-inline-start: 0; }
  .live-cell:last-child { border-inline-end: 0; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kp-kept { grid-column: span 2; }
  .ov-pair { grid-template-columns: 1.5fr 1fr; }
}
@media (min-width: 1024px) {
  .proj { position: static; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; min-height: 52px; box-shadow: none; }
  .brand-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .whatif { align-self: start; position: sticky; top: 24px; }
  .river-card { display: flex; flex-direction: column; }
  .river-card .river-host { flex: 1 1 auto; }
  .river-card .river-read { margin-top: 12px; }
  .hl { font-size: 28px; }
}
