/* Senheng Intelligence Console - components built for this console.
   Loaded after app.css. Base shell/typography/table styles live in app.css. */

/* Sidebar: guided-demo launcher */
.nav-item--tour { border: 1px dashed var(--accent-line); margin-bottom: 10px; }
.nav-item__badge--ghost { background: transparent; color: var(--accent-hover); border: 1px solid var(--accent-line); }

/* Topbar right-hand context (data window, freshness) */
.topbar__kicker { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); white-space: nowrap; }

/* Insight callouts are information, not alerts - keep them off the brand red so
   an amber warning or a red critical badge still reads as the exceptional thing
   on the page. Only the icon and a hairline rule carry the accent. */
.callout {
  background: var(--bg-elevated);
  border-color: var(--border-light);
  border-left: 2px solid var(--accent);
}
.callout svg { color: var(--accent-hover); }
.callout--insight .insight-line + .insight-line {
  border-top: 1px dashed var(--border-light);
}

/* Provenance footnote under a card or table - every figure says where it came from */
.src-note { margin-top: 10px; font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
.src-note strong { color: var(--text-tertiary); font-weight: 600; }

/* Simulated-data banner - Brand Radar carries this on every page */
.sim-banner {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--warning-dim); border: 1px solid rgba(245,158,11,0.4);
  border-radius: var(--radius); padding: 12px 15px; margin-bottom: 20px;
}
.sim-banner svg { width: 17px; height: 17px; color: var(--warning); flex-shrink: 0; margin-top: 1px; }
.sim-banner__title { font-weight: 600; font-size: 13px; color: #fde68a; margin-bottom: 2px; }
.sim-banner__body { font-size: 12.5px; color: var(--text-secondary); }

/* Chart legend - always present for >=2 series so identity is never colour-alone */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-item--self { color: var(--text); font-weight: 600; }

/* Hero figure (single headline number, no plot) */
.hero-figure { font-family: var(--font-display); font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.hero-figure--sm { font-size: 32px; }
.hero-sub { color: var(--text-secondary); font-size: 13px; margin-top: 6px; }

/* Price-position scale: marketplace min..max track, with the Senheng price marked */
.pp-scale { position: relative; height: 8px; background: var(--bg-sunk); border-radius: 4px; margin: 14px 0 6px; }
.pp-scale__range { position: absolute; height: 100%; background: var(--border-strong); border-radius: 4px; }
.pp-scale__median { position: absolute; width: 2px; height: 16px; top: -4px; background: var(--text-secondary); }
.pp-scale__self { position: absolute; width: 13px; height: 13px; border-radius: 50%; top: -3px; transform: translateX(-50%);
  background: var(--c-self); border: 2px solid var(--text); box-shadow: 0 0 0 3px var(--accent-dim); }
.pp-scale__labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }

/* Position wording - always carries a word, never colour alone */
.pos-below { color: var(--success); }
.pos-above { color: var(--warning); }
.pos-at { color: var(--text-secondary); }

/* AI mention matrix (brand x query-category grid) */
.matrix { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.matrix th { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-tertiary); font-weight: 500; padding: 4px 6px; text-align: left; vertical-align: bottom; }
.matrix td.matrix__brand { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; padding-right: 10px; }
.matrix tr.is-self td.matrix__brand { color: var(--text); font-weight: 600; }
.matrix__cell { width: 46px; height: 30px; border-radius: 4px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--text); background: var(--bg-sunk); }
.matrix__cell[data-lvl="0"] { background: var(--bg-sunk); color: var(--text-dim); }
.matrix__cell[data-lvl="1"] { background: rgba(57,135,229,0.18); }
.matrix__cell[data-lvl="2"] { background: rgba(57,135,229,0.38); }
.matrix__cell[data-lvl="3"] { background: rgba(57,135,229,0.62); }
.matrix__cell[data-lvl="4"] { background: rgba(57,135,229,0.85); color: #fff; }
.matrix__cell--gap { outline: 1.5px solid var(--warning); outline-offset: -1.5px; }

/* Store network - map toolbar (lens / rings / tier chips) */
.map-toolbar { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; }
.map-toolbar__group { display: flex; align-items: center; gap: 10px; }
.chip-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-sunk); border: 1px solid var(--border-light); color: var(--text-tertiary);
  border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  font-family: var(--font-body); cursor: pointer; transition: all var(--transition);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip--on { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.chip .legend-swatch { width: 9px; height: 9px; }

/* Map inspector overlay (aria-live selection card) */
.map-inspector {
  position: absolute; top: 12px; right: 12px; z-index: 500;
  background: rgba(19,19,20,0.94); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 9px 13px; max-width: 260px;
  box-shadow: var(--shadow); pointer-events: none;
}
.map-inspector__kicker { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-hover); }
.map-inspector__title { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; margin: 2px 0 1px; }
.map-inspector__meta { font-size: 11.5px; color: var(--text-secondary); }

/* Map legend strip */
.map-legend {
  position: absolute; bottom: 12px; left: 12px; z-index: 500;
  display: flex; gap: 12px; flex-wrap: wrap;
  background: rgba(19,19,20,0.92); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 11px; pointer-events: none;
}
.map-legend .legend-item { font-size: 11px; }

/* Key-value rows inside the drilldown panel */
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: none; }
.kv-row--hot { background: var(--accent-dim); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 4px; }
.kv-row--click { cursor: pointer; transition: background var(--transition); }
.kv-row--click:hover { background: var(--bg-hover); }

/* Audience-lens muting in the store list */
.store-row--muted { opacity: 0.35; }

/* Store network */
.store-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
@media (max-width: 1000px) { .store-grid { grid-template-columns: 1fr; } }
.store-list { max-height: 620px; overflow-y: auto; }
.store-row { display: block; padding: 11px 13px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.store-row:last-child { border-bottom: none; }
.store-row:hover { background: var(--bg-hover); }
.store-row.active { background: var(--accent-dim); }
.store-row__name { font-size: 13px; font-weight: 600; color: var(--text); }
.store-row__meta { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
#storeMap { height: 620px; border-radius: var(--radius); background: var(--bg-sunk); }
@media (max-width: 1000px) { #storeMap { height: 420px; } }

/* Income tier pill */
.tier { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.05em; padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.tier--T20 { background: var(--success-dim); color: var(--success); }
.tier--M40 { background: rgba(57,135,229,0.16); color: #7cb3f0; }
.tier--B40 { background: var(--warning-dim); color: var(--warning); }
.tier--na  { background: var(--bg-hover); color: var(--text-dim); }

/* Value-proposition cards (Your Data / IPSOS pages) */
.value-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.value-card__icon { width: 38px; height: 38px; border-radius: var(--radius); background: var(--accent-dim); display: grid; place-items: center; margin-bottom: 13px; }
.value-card__icon svg { width: 19px; height: 19px; color: var(--accent-hover); }
.value-card h3 { margin-bottom: 7px; }
.value-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.value-card--locked { border-style: dashed; }

/* Numbered step list (sovereign-AI flow) */
.steps { display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
.step__n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-dim); color: var(--accent-hover);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.step__title { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.step__body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* Alert rows */
.alert-row { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--border); }
.alert-row:last-child { border-bottom: none; }
.alert-row__title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.alert-row__body { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }

/* Review / social cards */
.post-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.post-card__head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.post-card__who { font-size: 12.5px; font-weight: 600; }
.post-card__body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.post-card__reply { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border-light); font-size: 12.5px; color: var(--text-tertiary); }
.stars { color: var(--warning); font-size: 12px; letter-spacing: 1px; }

/* Segmented proportion bar - 2px surface gap between fills */
.segbar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg-sunk); }
.segbar span { display: block; height: 100%; }

/* Scrollable wide content must scroll inside its own container */
.scroll-x { overflow-x: auto; }

/* Print (Board Pack) */
@media print {
  .sidebar, .topbar, .tour-veil, .tour-card, .btn, .card__tools, .no-print { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; color: #111; }
  .card, .stat { border-color: #ccc; background: #fff; break-inside: avoid; }
  .content { padding: 0; max-width: none; }
  a { color: #111; }
}
