/* ============================================================================
   DEEP DIVE v2 (#deep-dive-v2-screen) — admin-only build tab (2026-10-18).
   GSB Design System v3 tokens, same names as gsb-deep-dive.css. Rendered by
   js/dd2-view.js (markup + charts) and js/dd2-app.js (scope picker, switches).
   ============================================================================ */

#deep-dive-v2-screen {
  --dd2-moss: var(--ds-moss);
  --dd2-s1: var(--ds-pine); --dd2-s2: var(--ds-accent-text); --dd2-s3: var(--ds-slate); --dd2-s4: var(--ds-sage); --dd2-s5: var(--ds-mist);
  background: var(--ds-snow);
  color: var(--ds-ink);
  font-family: var(--ds-font);
  font-variant-numeric: tabular-nums;
}
#deep-dive-v2-screen * { box-sizing: border-box; }
#deep-dive-v2-screen .dd2-page { padding: 10px 16px 40px; max-width: 1480px; margin: 0 auto; }
#deep-dive-v2-screen .dd2-dim { color: var(--ds-fg-3); font-weight: 400; }

/* ── header / command bar ───────────────────────────────────────────────── */
#deep-dive-v2-screen .dd2-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0 12px; }
#deep-dive-v2-screen .dd2-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
#deep-dive-v2-screen .dd2-badge { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-ochre); background: rgba(185,139,50,.12); padding: 3px 8px; }
#deep-dive-v2-screen .dd2-head-spacer { flex: 1 1 auto; }
#deep-dive-v2-screen .dd2-scope { position: relative; display: flex; align-items: stretch; gap: 0; }
#deep-dive-v2-screen .dd2-scope button { font: inherit; border: 0; background: var(--ds-pine); color: var(--ds-snow); cursor: pointer; }
#deep-dive-v2-screen .dd2-scope .dd2-step { width: 30px; font-size: 14px; background: var(--ds-forest); }
#deep-dive-v2-screen .dd2-scope .dd2-step:disabled { opacity: .35; cursor: default; }
#deep-dive-v2-screen .dd2-scope .dd2-scope-btn { min-width: 240px; max-width: 420px; text-align: left; padding: 7px 12px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
#deep-dive-v2-screen .dd2-scope-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
#deep-dive-v2-screen .dd2-scope-btn small { font-weight: 400; opacity: .7; font-size: 11px; white-space: nowrap; }
#deep-dive-v2-screen .dd2-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; width: 420px; max-width: calc(100vw - 32px); background: var(--ds-snow); box-shadow: 0 8px 28px rgba(26,30,27,.18); border: 1px solid var(--ds-mist); }
#deep-dive-v2-screen .dd2-pop input { width: 100%; border: 0; border-bottom: 1px solid var(--ds-mist); padding: 10px 12px; font: inherit; font-size: 13px; background: #fff; outline: none; }
#deep-dive-v2-screen .dd2-pop-list { max-height: 420px; overflow: auto; }
#deep-dive-v2-screen .dd2-pop-group { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-fg-3); padding: 8px 12px 4px; background: var(--ds-frost); }
#deep-dive-v2-screen .dd2-pop-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ds-ink); }
#deep-dive-v2-screen .dd2-pop-item small { color: var(--ds-fg-3); font-size: 11px; white-space: nowrap; }
#deep-dive-v2-screen .dd2-pop-item:hover, #deep-dive-v2-screen .dd2-pop-item.is-on { background: rgba(79,122,90,.10); }

#deep-dive-v2-screen .dd2-seg { display: inline-flex; background: var(--ds-frost); padding: 2px; gap: 2px; }
#deep-dive-v2-screen .dd2-seg button { font: inherit; font-size: 12px; font-weight: 600; border: 0; background: none; color: var(--ds-muted); padding: 6px 12px; cursor: pointer; }
#deep-dive-v2-screen .dd2-seg button.on { background: var(--ds-pine); color: var(--ds-snow); }
#deep-dive-v2-screen .dd2-seg-sm button { font-size: 11px; padding: 4px 10px; }

#deep-dive-v2-screen .dd2-facts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ds-muted); padding: 0 0 12px; }
#deep-dive-v2-screen .dd2-facts b { color: var(--ds-ink); font-weight: 600; }

#deep-dive-v2-screen .dd2-loading { padding: 60px 0; text-align: center; color: var(--ds-muted); font-size: 13px; }
#deep-dive-v2-screen .dd2-empty { padding: 40px 0; text-align: center; color: var(--ds-muted); font-size: 13px; }

/* ── chips ──────────────────────────────────────────────────────────────── */
#deep-dive-v2-screen .dd2-chip { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 3px 8px; white-space: nowrap; }
#deep-dive-v2-screen .dd2-good { color: #2E5A3A; } #deep-dive-v2-screen .dd2-chip.dd2-good { background: rgba(79,122,90,.14); }
#deep-dive-v2-screen .dd2-bad { color: #9A4423; }  #deep-dive-v2-screen .dd2-chip.dd2-bad { background: rgba(181,83,46,.13); }
#deep-dive-v2-screen .dd2-flat { color: var(--ds-muted); } #deep-dive-v2-screen .dd2-chip.dd2-flat { background: var(--ds-mist); }

#deep-dive-v2-screen .dd2-band { margin-bottom: 18px; }
#deep-dive-v2-screen .dd2-band-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
#deep-dive-v2-screen .dd2-band-head .dd2-lab { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-fg-3); }
#deep-dive-v2-screen .dd2-band-key { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--ds-fg-3); }
#deep-dive-v2-screen .dd2-key { display: inline-flex; align-items: center; gap: 5px; }
#deep-dive-v2-screen .dd2-key i { display: inline-block; width: 14px; height: 0; margin-left: 6px; border-top: 2px solid var(--ds-moss); }
#deep-dive-v2-screen .dd2-key i.k-ly { border-top: 1.5px solid var(--ds-sage); }
#deep-dive-v2-screen .dd2-key i.k-bud { border-top: 1.5px dashed var(--ds-ink); }

/* ── concept A: tiles ───────────────────────────────────────────────────── */
#deep-dive-v2-screen .dd2-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#deep-dive-v2-screen .dd2-tile { background: var(--ds-frost); padding: 14px 16px 12px; display: flex; flex-direction: column; min-width: 0; border-top: 4px solid var(--ds-sage); }
#deep-dive-v2-screen .dd2-tile.dd2-v-good { border-top-color: var(--ds-moss); }
#deep-dive-v2-screen .dd2-tile.dd2-v-bad { border-top-color: var(--ds-clay); }
#deep-dive-v2-screen .dd2-tile .dd2-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-muted); }
#deep-dive-v2-screen .dd2-tile-big { font-size: 38px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin-top: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#deep-dive-v2-screen .dd2-tile-big small { font-size: 15px; font-weight: 600; color: var(--ds-muted); letter-spacing: 0; }
#deep-dive-v2-screen .dd2-tile-sub { font-size: 12px; color: var(--ds-fg-3); margin-top: 3px; }
#deep-dive-v2-screen .dd2-tile-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
#deep-dive-v2-screen .dd2-tile-spark { margin-top: 10px; height: 54px; }
#deep-dive-v2-screen .dd2-spark { display: block; width: 100%; height: 100%; overflow: visible; }
#deep-dive-v2-screen .dd2-spark-area { fill: rgba(79,122,90,.12); stroke: none; }
#deep-dive-v2-screen .dd2-spark-line { fill: none; stroke: var(--ds-moss); stroke-width: 2; }
#deep-dive-v2-screen .dd2-spark-ly { fill: none; stroke: var(--ds-sage); stroke-width: 1.5; }
#deep-dive-v2-screen .dd2-spark-bud { fill: none; stroke: var(--ds-ink); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .55; }
#deep-dive-v2-screen .dd2-tile .dd2-f { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ds-mist); font-size: 11.5px; color: var(--ds-muted); }
#deep-dive-v2-screen .dd2-tile .dd2-f b { color: var(--ds-ink); font-weight: 600; }

/* ── concept B: flow ────────────────────────────────────────────────────── */
#deep-dive-v2-screen .dd2-flow { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2.6fr) minmax(200px, 1fr); gap: 10px; }
#deep-dive-v2-screen .dd2-flow > * { background: var(--ds-frost); padding: 14px 16px; min-width: 0; }
#deep-dive-v2-screen .dd2-flow .dd2-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-muted); }
#deep-dive-v2-screen .dd2-flow-hero.is-ebitda { background: var(--ds-pine); color: var(--ds-snow); }
#deep-dive-v2-screen .dd2-flow-hero.is-ebitda .dd2-h, #deep-dive-v2-screen .dd2-flow-hero.is-ebitda .dd2-flow-sub { color: var(--ds-sage); }
#deep-dive-v2-screen .dd2-flow-hero.is-ebitda .dd2-chip.dd2-good { background: rgba(130,187,144,.22); color: #CFE6D4; }
#deep-dive-v2-screen .dd2-flow-hero.is-ebitda .dd2-chip.dd2-bad { background: rgba(227,154,126,.22); color: #F2C3B0; }
#deep-dive-v2-screen .dd2-flow-hero.is-ebitda .dd2-spark-line { stroke: var(--ds-leaf); }
#deep-dive-v2-screen .dd2-flow-hero.is-ebitda .dd2-spark-area { fill: rgba(130,187,144,.16); }
#deep-dive-v2-screen .dd2-flow-hero.is-ebitda .dd2-spark-bud { stroke: var(--ds-snow); }
#deep-dive-v2-screen .dd2-flow-num { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; margin-top: 10px; line-height: 1.05; }
#deep-dive-v2-screen .dd2-flow-sub { font-size: 12px; color: var(--ds-fg-3); margin-top: 4px; }
#deep-dive-v2-screen .dd2-flow-mini { height: 40px; margin-top: 14px; }
#deep-dive-v2-screen .dd2-flow-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; margin-top: 8px; }
#deep-dive-v2-screen .dd2-flow-lbl { font-size: 11.5px; font-weight: 600; color: var(--ds-muted); text-align: right; }
#deep-dive-v2-screen .dd2-flow-bar { display: flex; height: 26px; gap: 1px; }
#deep-dive-v2-screen .dd2-flow-bar span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; min-width: 0; overflow: hidden; }
#deep-dive-v2-screen .dd2-flow-bar span:nth-child(4), #deep-dive-v2-screen .dd2-flow-bar span:nth-child(5) { color: var(--ds-ink); }
#deep-dive-v2-screen .dd2-flow-bar span.is-hero { box-shadow: inset 0 0 0 2px var(--ds-pine); }
#deep-dive-v2-screen .dd2-flow-empty { font-size: 11.5px; color: var(--ds-fg-3); }
#deep-dive-v2-screen .dd2-led-head, #deep-dive-v2-screen .dd2-led { display: grid; grid-template-columns: 10px minmax(110px, 1fr) 64px 70px 92px 92px; gap: 8px; align-items: center; }
#deep-dive-v2-screen .dd2-led-head { margin-top: 14px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-fg-3); padding-bottom: 4px; border-bottom: 1px solid var(--ds-mist); }
#deep-dive-v2-screen .dd2-led { font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid rgba(26,30,27,.06); }
#deep-dive-v2-screen .dd2-led i { width: 10px; height: 10px; display: block; }
#deep-dive-v2-screen .dd2-led b { font-weight: 600; text-align: right; }
#deep-dive-v2-screen .dd2-led-d { font-size: 11.5px; color: var(--ds-fg-3); text-align: right; }
#deep-dive-v2-screen .dd2-led .dd2-chip { justify-content: center; }
#deep-dive-v2-screen .dd2-led.is-hero { font-weight: 600; border-bottom: 0; }

/* ── concept C: grid ────────────────────────────────────────────────────── */
#deep-dive-v2-screen .dd2-grid-wrap { background: var(--ds-frost); padding: 12px 14px; }
#deep-dive-v2-screen .dd2-grid-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ds-muted); margin-bottom: 8px; }
#deep-dive-v2-screen .dd2-grid-top .dd2-seg { background: var(--ds-mist); }
#deep-dive-v2-screen .dd2-grid-scroll { overflow-x: auto; }
#deep-dive-v2-screen .dd2-grid { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 12px; }
#deep-dive-v2-screen .dd2-grid th, #deep-dive-v2-screen .dd2-grid td { border: 0; }
#deep-dive-v2-screen .dd2-grid th { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ds-fg-3); text-align: center; padding: 2px 4px; white-space: nowrap; }
#deep-dive-v2-screen .dd2-grid thead th small { display: block; font-weight: 400; opacity: .8; letter-spacing: 0; }
#deep-dive-v2-screen .dd2-grid .dd2-g-name { text-align: left; font-size: 12.5px; text-transform: none; letter-spacing: 0; color: var(--ds-ink); font-weight: 600; padding-right: 10px; }
#deep-dive-v2-screen .dd2-grid td { text-align: center; padding: 6px 4px; white-space: nowrap; }
#deep-dive-v2-screen .dd2-grid td.dd2-g-val { font-size: 15px; font-weight: 600; text-align: right; padding-right: 8px; }
#deep-dive-v2-screen .dd2-grid tbody td:nth-child(n+6) { font-size: 11px; color: var(--ds-ink); min-width: 42px; }
#deep-dive-v2-screen .dd2-grid .dd2-g-spacer { width: 6px; padding: 0; }
#deep-dive-v2-screen .dd2-grid tbody tr:nth-child(2) { box-shadow: 0 1px 0 var(--ds-mist); }

/* ── cards / sales section ──────────────────────────────────────────────── */
#deep-dive-v2-screen .dd2-card { background: #fff; padding: 16px 18px; margin-bottom: 18px; border-top: 3px solid var(--ds-pine); }
#deep-dive-v2-screen .dd2-card-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
#deep-dive-v2-screen .dd2-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
#deep-dive-v2-screen .dd2-card-head .dd2-dim { font-size: 12px; }
#deep-dive-v2-screen .dd2-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
#deep-dive-v2-screen .dd2-stat { background: var(--ds-frost); padding: 9px 14px; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
#deep-dive-v2-screen .dd2-stat span { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ds-fg-3); }
#deep-dive-v2-screen .dd2-stat b { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
#deep-dive-v2-screen .dd2-stat em { font-style: normal; font-size: 11.5px; color: var(--ds-muted); }
#deep-dive-v2-screen .dd2-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ds-ink); margin: 2px 0 6px; }
#deep-dive-v2-screen .dd2-legend span { display: inline-flex; align-items: center; gap: 6px; }
#deep-dive-v2-screen .dd2-legend i { display: inline-block; }
#deep-dive-v2-screen .lg-line { width: 18px; height: 0; border-top: 2.5px solid var(--ds-pine); }
#deep-dive-v2-screen .lg-line.lg-cmp { border-top: 2.5px dashed var(--ds-clay); }
#deep-dive-v2-screen .lg-bar { width: 11px; height: 11px; background: rgba(79,122,90,.38); }
#deep-dive-v2-screen .lg-bar.lg-cmp { background: rgba(181,83,46,.28); }
#deep-dive-v2-screen .lg-own { width: 14px; height: 11px; background: rgba(93,117,132,.16); }
#deep-dive-v2-screen .dd2-sss-chart { position: relative; overflow-x: auto; overflow-y: hidden; }
#deep-dive-v2-screen .dd2-sss-chart svg { display: block; font-family: var(--ds-font); }
#deep-dive-v2-screen .dd2-own { fill: rgba(93,117,132,.11); }
#deep-dive-v2-screen .dd2-own-t { font-size: 10.5px; font-weight: 600; fill: var(--ds-slate); letter-spacing: .04em; }
#deep-dive-v2-screen .dd2-gl { stroke: rgba(26,30,27,.08); stroke-width: 1; }
#deep-dive-v2-screen .dd2-zero { stroke: rgba(26,30,27,.45); stroke-width: 1; }
#deep-dive-v2-screen .dd2-ax { font-size: 11px; fill: var(--ds-fg-3); }
#deep-dive-v2-screen .dd2-ax.is-fy { fill: var(--ds-ink); font-weight: 600; }
#deep-dive-v2-screen .dd2-bar-main { fill: rgba(79,122,90,.38); }
#deep-dive-v2-screen .dd2-bar-cmp { fill: rgba(181,83,46,.28); }
#deep-dive-v2-screen .dd2-l-main { fill: none; stroke: var(--ds-pine); stroke-width: 2.5; stroke-linejoin: round; }
#deep-dive-v2-screen .dd2-l-main-dot { fill: var(--ds-pine); stroke: #fff; stroke-width: 1.2; }
#deep-dive-v2-screen .dd2-l-cmp { fill: none; stroke: var(--ds-clay); stroke-width: 2.2; stroke-dasharray: 6 4; stroke-linejoin: round; }
#deep-dive-v2-screen .dd2-l-cmp-dot { fill: var(--ds-clay); stroke: #fff; stroke-width: 1.2; }
#deep-dive-v2-screen .dd2-hit { fill: transparent; cursor: crosshair; }
#deep-dive-v2-screen .dd2-hit.on { fill: rgba(26,30,27,.05); }
#deep-dive-v2-screen .dd2-tip { position: absolute; pointer-events: none; background: var(--ds-pine); color: var(--ds-snow); padding: 8px 10px; font-size: 12px; min-width: 200px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
#deep-dive-v2-screen .dd2-tip div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-top: 3px; }
#deep-dive-v2-screen .dd2-tip em { font-style: normal; font-weight: 600; text-align: right; }
#deep-dive-v2-screen .dd2-tip small { display: block; margin-top: 5px; color: var(--ds-sage); font-size: 11px; }
#deep-dive-v2-screen .dd2-foot { font-size: 11px; color: var(--ds-fg-3); margin-top: 8px; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  #deep-dive-v2-screen .dd2-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #deep-dive-v2-screen .dd2-flow { grid-template-columns: 1fr 1fr; }
  #deep-dive-v2-screen .dd2-flow-mid { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 640px) {
  #deep-dive-v2-screen .dd2-page { padding: 8px 12px 32px; }
  #deep-dive-v2-screen .dd2-tiles, #deep-dive-v2-screen .dd2-flow { grid-template-columns: 1fr; }
  #deep-dive-v2-screen .dd2-tile-big, #deep-dive-v2-screen .dd2-flow-num { font-size: 32px; }
  #deep-dive-v2-screen .dd2-scope { width: 100%; }
  #deep-dive-v2-screen .dd2-scope .dd2-scope-btn { min-width: 0; flex: 1 1 auto; }
  #deep-dive-v2-screen .dd2-led-head, #deep-dive-v2-screen .dd2-led { grid-template-columns: 10px minmax(80px, 1fr) 52px 74px 74px; }
  #deep-dive-v2-screen .dd2-led-d, #deep-dive-v2-screen .dd2-led-head span:nth-child(4) { display: none; }
  #deep-dive-v2-screen .dd2-stat { min-width: calc(50% - 5px); flex: 1 1 calc(50% - 5px); }
  #deep-dive-v2-screen .dd2-flow-row { grid-template-columns: 70px 1fr; }
}
