/* =========================================================================
   RU-Monitor — "situation room" theme.
   An instrument panel of an observation post, not a marketing dashboard.
   Dark, dense, calm. Status colors are the ONLY saturated accents.
   ========================================================================= */

:root {
  /* Surfaces (near-black / graphite). */
  --bg:        #0d0f12;
  --panel:     #14171c;
  --panel-2:   #191d23;  /* slightly raised inner surface */
  --border:    #22262d;

  /* Text (muted greys). */
  --text:      #d7dce3;  /* primary */
  --text-dim:  #8b9199;  /* secondary */
  --text-faint:#5b616a;  /* tertiary / disabled */

  /* Status — the only saturated colors. */
  --green:     #35c46a;
  --amber:     #e2a53a;
  --red:       #e5484d;

  /* Dim / desaturated status variants for backgrounds & borders. */
  --green-dim: #1a3a28;
  --amber-dim: #3a2f16;
  --red-dim:   #3a1b1d;
  --green-bd:  #24603d;
  --amber-bd:  #5c4a20;
  --red-bd:    #6b2a2d;

  /* Typography. Data reads like data → monospace numbers. */
  --sans: system-ui, "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Monospace helper for all numeric / data values. */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------- */
/* Status color mapping                                                    */
/* --------------------------------------------------------------------- */
.s-green  { color: var(--green); }
.s-amber  { color: var(--amber); }
.s-red    { color: var(--red); }
.s-no_data,
.s-stale  { color: var(--text-dim); }

.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-faint);
}
.dot.s-green { background: var(--green); }
.dot.s-amber { background: var(--amber); }
.dot.s-red   { background: var(--red); }
.dot.s-no_data,
.dot.s-stale { background: var(--text-faint); }

/* --------------------------------------------------------------------- */
/* Tripwire banner — must read in one second, unmistakable.                */
/* --------------------------------------------------------------------- */
.tripwire-banner {
  display: block;
  width: 100%;
  background: var(--red-dim);
  border-bottom: 2px solid var(--red);
  color: var(--text);
  padding: 8px 14px;
  font-size: 13px;
}
.tripwire-banner .tw-tag {
  display: inline-block;
  background: var(--red);
  color: #0d0f12;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 3px;
  margin-right: 8px;
  text-transform: uppercase;
}
.tripwire-banner .tw-item { margin-right: 6px; }
.tripwire-banner .tw-item strong { color: var(--red); }
.tripwire-banner .tw-tail { color: var(--text-dim); }

/* --------------------------------------------------------------------- */
/* Sticky status bar                                                       */
/* --------------------------------------------------------------------- */
.status-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);          /* gap lines */
  border-bottom: 1px solid var(--border);
}
.status-bar:empty { display: none; }

.index-tile {
  background: var(--panel);
  padding: 12px 14px 10px;
  cursor: pointer;
  border: none;
  border-top: 2px solid transparent;
  text-align: left;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.index-tile:hover { background: var(--panel-2); }
.index-tile.s-green { border-top-color: var(--green); }
.index-tile.s-amber { border-top-color: var(--amber); }
.index-tile.s-red   { border-top-color: var(--red); }

.index-tile .tile-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.index-tile .tile-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.index-tile .tile-value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.index-tile .tile-trend {
  font-family: var(--mono);
  font-size: 13px;
}
.trend-up   { color: var(--red); }     /* up = worse */
.trend-down { color: var(--green); }   /* down = better */
.trend-flat { color: var(--text-dim); }

.index-tile .tile-spark { margin-top: 2px; height: 24px; }
.index-tile .tile-spark svg { display: block; width: 100%; height: 24px; }

/* --------------------------------------------------------------------- */
/* View container                                                          */
/* --------------------------------------------------------------------- */
.view {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 14px 40px;
}

.section-head {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 22px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.section-head:first-child { margin-top: 4px; }

/* --------------------------------------------------------------------- */
/* Indicator card grid                                                     */
/* --------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  min-width: 0;
}
.card:hover { border-color: #303640; background: var(--panel-2); }

/* Desaturated cards for no_data / stale. */
.card.inactive { opacity: 0.62; }
.card.inactive:hover { opacity: 0.8; }

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: space-between;
}
.card-title {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.3;
  font-weight: 500;
}
.card-tripwire-mark {
  color: var(--text-faint);
  font-size: 11px;
  margin-left: 4px;
  cursor: default;
}

.card-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.card-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.card-unit { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.card-nodata { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }

.card-spark { height: 30px; margin: 1px 0; }
.card-spark svg { display: block; width: 100%; height: 30px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.card-meta .badge {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 5px;
  color: var(--text-dim);
}
.card-meta .badge.flag { border-color: var(--amber-bd); color: var(--amber); }

/* --------------------------------------------------------------------- */
/* Detail views                                                            */
/* --------------------------------------------------------------------- */
.back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 12px;
  font-family: var(--mono);
}
.back-link:hover { color: var(--text); }

.detail-head { margin-bottom: 14px; }
.detail-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-current {
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.detail-sub { color: var(--text-dim); font-size: 12px; }
.detail-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin: 8px 0 0;
  max-width: 780px;
  white-space: pre-line;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 14px;
}
.panel-title {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  font-weight: 600;
}

.chart-wrap { width: 100%; }
.chart-empty {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

/* uPlot dark tweaks */
.uplot { font-family: var(--sans); }
.u-legend { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.u-title { color: var(--text-dim); }

/* --------------------------------------------------------------------- */
/* Commentary timeline                                                     */
/* --------------------------------------------------------------------- */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-item {
  border-left: 2px solid var(--border);
  padding: 0 0 2px 12px;
}
.tl-item.s-green { border-left-color: var(--green); }
.tl-item.s-amber { border-left-color: var(--amber); }
.tl-item.s-red   { border-left-color: var(--red); }
.tl-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-val { color: var(--text); }
.tl-body { font-size: 12.5px; color: var(--text); margin-top: 3px; line-height: 1.5; }
.tl-flags { margin-top: 3px; }
.tl-flags .badge {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--amber-bd);
  color: var(--amber);
  border-radius: 3px;
  padding: 0 5px;
  margin-right: 5px;
}

/* --------------------------------------------------------------------- */
/* Evidence feed                                                           */
/* --------------------------------------------------------------------- */
.ev-day { margin-bottom: 14px; }
.ev-day-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 3px;
}
.ev-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.ev-item:last-child { border-bottom: none; }
.ev-src {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.ev-title {
  display: block;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  margin: 2px 0;
}
.ev-title:hover { text-decoration: underline; color: #fff; }
.ev-snippet { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* --------------------------------------------------------------------- */
/* Index breakdown — stacked contribution bars                             */
/* --------------------------------------------------------------------- */
.bd-summary {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.bd-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.bd-row:last-child { border-bottom: none; }
.bd-row.excluded { opacity: 0.5; }
.bd-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 12.5px;
}
.bd-label .bd-name { color: var(--text); }
.bd-label .bd-nums {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.bd-track {
  height: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.bd-fill { height: 100%; }
.bd-fill.s-green { background: var(--green); }
.bd-fill.s-amber { background: var(--amber); }
.bd-fill.s-red   { background: var(--red); }
.bd-fill.neutral { background: var(--text-faint); }
.bd-note { font-size: 11px; color: var(--text-faint); font-family: var(--mono); }

/* --------------------------------------------------------------------- */
/* Footer                                                                  */
/* --------------------------------------------------------------------- */
.footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer .f-ok { color: var(--green); }
.footer .f-fail { color: var(--red); }

/* --------------------------------------------------------------------- */
/* Error / loading states                                                  */
/* --------------------------------------------------------------------- */
.notice {
  padding: 30px 14px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
}
.notice.error { color: var(--red); }

/* --------------------------------------------------------------------- */
/* Mobile: single column, sticky status bar stays.                         */
/* --------------------------------------------------------------------- */
@media (max-width: 560px) {
  .index-tile { padding: 10px 10px 8px; }
  .index-tile .tile-value { font-size: 24px; }
  .index-tile .tile-label { font-size: 10px; }
  .card-grid { grid-template-columns: 1fr; }
  .view { padding: 12px 10px 32px; }
  .tw-chips { flex-direction: column; }
  .tooltip { max-width: 78vw; }
}

/* ===================================================================== */
/* v2 readability: intro, "?" info, tooltips, threshold gauge, tripwire   */
/* chips, index-tile head/sub/hint.                                       */
/* ===================================================================== */

.intro {
  margin: 4px 0 18px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  line-height: 1.5;
}
.intro-line { font-size: 13px; color: var(--text); }
.intro-line + .intro-line { margin-top: 5px; }
.intro-dim { color: var(--text-dim); font-size: 12.5px; }
.intro b { font-weight: 600; }
.intro .tw-mark { color: var(--red); cursor: help; font-weight: 700; }
.info-inline {
  display: inline-block; color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 50%; width: 14px; height: 14px; line-height: 12px; text-align: center;
  font-size: 10px; font-weight: 700;
}

.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--text-dim);
  font: 700 10px/1 var(--sans); cursor: help; vertical-align: middle; flex: none;
}
.info:hover { color: var(--text); border-color: var(--text-dim); background: var(--panel-2); }

.tooltip {
  position: fixed; z-index: 100; max-width: 320px; padding: 9px 11px;
  background: #05070a; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font: 12.5px/1.45 var(--sans);
  box-shadow: 0 8px 26px rgba(0,0,0,0.6); pointer-events: none; white-space: pre-line;
}
.tooltip[hidden] { display: none; }

.v-scale { color: var(--text-dim); font-size: 0.62em; font-weight: 600; }
.tile-scale { color: var(--text-dim); font-size: 14px; font-weight: 600; margin-left: 2px; }

.gauge { margin: 8px 0 2px; }
.g-track {
  position: relative; height: 7px; border-radius: 4px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border);
}
.g-zone { position: absolute; top: 0; bottom: 0; }
.g-zone.g-green { background: rgba(53,196,106,0.34); }
.g-zone.g-amber { background: rgba(226,165,58,0.34); }
.g-zone.g-red   { background: rgba(229,72,77,0.38); }
.g-marker {
  position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px;
  background: var(--text); box-shadow: 0 0 0 1px rgba(0,0,0,0.6);
}
.g-scale { position: relative; height: 13px; margin-top: 2px; }
.g-tick {
  position: absolute; transform: translateX(-50%); font: 9px/1 var(--mono);
  color: var(--text-dim); white-space: nowrap;
}
.g-tick.g-tick-start { transform: translateX(0); }
.g-tick.g-tick-end { transform: translateX(-100%); }

.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tile-sub { color: var(--text-dim); font-size: 11px; margin: 1px 0 6px; }
.index-tile { cursor: pointer; }
.index-tile:focus-visible { outline: 2px solid var(--text-dim); outline-offset: 2px; }
.tile-hint { color: var(--text-dim); font-size: 10.5px; margin-top: 6px; opacity: 0.75; }
.index-tile:hover .tile-hint { opacity: 1; color: var(--text); }

.tripwire-banner { display: block; padding: 9px 14px; }
.tw-headline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tw-lead { color: var(--text); font-weight: 600; font-size: 13px; }
.tw-info { border-color: var(--red-bd); color: var(--red); }
.tw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tw-chip {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: 6px 10px; border: 1px solid var(--red-bd); border-radius: 6px;
  background: rgba(229,72,77,0.10); text-decoration: none;
}
.tw-chip:hover { background: rgba(229,72,77,0.18); }
.tw-chip-name { color: var(--red); font-weight: 700; font-size: 12.5px; }
.tw-chip-val { color: var(--text); font: 11px var(--mono); }

.detail-gauge { max-width: 460px; margin: 12px 0 6px; }
.detail-thr { color: var(--text-dim); font-size: 12.5px; margin: 2px 0 0; }
.detail-tripwire {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--red-bd); background: rgba(229,72,77,0.10);
  color: var(--red); font: 600 12px var(--sans); cursor: help; vertical-align: middle;
}
.badge.subtle { opacity: 0.8; }
.card-nodata { cursor: help; }

/* ===================================================================== */
/* v3 clarity pass — matches the current app.js class names.              */
/* (Supersedes the v2 block above; app.js renders these classes.)         */
/* ===================================================================== */

/* "?" help affordance */
.help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 3px;
  border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-dim); font: 700 9.5px/1 var(--sans);
  cursor: help; vertical-align: middle; flex: none; user-select: none;
}
.help:hover, .help:focus-visible { color: var(--text); border-color: var(--text-dim); background: var(--panel-2); outline: none; }

/* Tooltip box (re-affirm; shared with v2) */
.tooltip {
  position: fixed; z-index: 100; max-width: 320px; padding: 9px 11px;
  background: #05070a; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font: 12.5px/1.45 var(--sans);
  box-shadow: 0 8px 26px rgba(0,0,0,0.6); pointer-events: none; white-space: pre-line;
}
.tooltip[hidden] { display: none; }

/* Threshold gauge (green/amber/red zones + value marker) */
.gauge { position: relative; margin: 9px 0 2px; }
.gauge-track {
  position: relative; height: 9px; border-radius: 5px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border);
}
.gauge-seg { position: absolute; top: 0; bottom: 0; }
.gauge-seg.s-green { background: rgba(53,196,106,0.32); }
.gauge-seg.s-amber { background: rgba(226,165,58,0.34); }
.gauge-seg.s-red   { background: rgba(229,72,77,0.38); }
/* value marker — a clear round knob ("trackball") sitting proud of the bar,
   plus a thin dark precision line so it aligns exactly with the scale ticks. */
/* marker spans exactly the track height (9px) so top:50% == the track's centre line;
   both the knob and the precision line are centred on that point via translate. */
.gauge-marker { position: absolute; top: 0; height: 9px; width: 0; color: var(--text); pointer-events: none; }
.gauge-marker::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translate(-50%, -50%);
  width: 3px; height: 13px; background: #0b0d10; border-radius: 2px;
}
.gauge-marker::after {
  content: ''; position: absolute; left: 0; top: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%; background: currentColor;
  border: 2px solid #f2f5f8; box-shadow: 0 1px 5px rgba(0,0,0,0.8);
}
.gauge-marker.s-green { color: var(--green); }
.gauge-marker.s-amber { color: var(--amber); }
.gauge-marker.s-red   { color: var(--red); }
.gauge-scale {
  position: relative; height: 13px; margin-top: 8px;
  font: 9.5px/1 var(--mono); color: var(--text-dim);
}
.gauge-end { position: absolute; top: 0; left: 0; }
.gauge-end-r { left: auto; right: 0; }
.gauge-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; color: var(--text-faint); }

/* Value scales */
.card-scale { font-family: var(--mono); font-size: 12px; color: var(--text-dim); font-weight: 600; }
.card-hint  { font-size: 10.5px; color: var(--text-faint); }
.tile-max   { font-family: var(--mono); font-size: 13px; color: var(--text-dim); font-weight: 600; margin-left: -3px; }
.detail-scale { color: var(--text-dim); font-size: 0.7em; font-weight: 600; }
.detail-unit  { color: var(--text-dim); font-size: 0.8em; }

/* Intro + legend */
.intro { margin: 2px 0 16px; padding: 0; background: transparent; border: none; }
.help-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; padding: 6px 11px; font: 12.5px var(--sans); cursor: pointer;
}
.help-toggle:hover, .help-toggle.open { color: var(--text); border-color: var(--text-dim); background: var(--panel-2); }
.help-body {
  margin-top: 10px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
}
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.legend b { color: var(--text); font-weight: 600; }
.legend .dot { margin-right: 4px; }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--border); border-radius: 3px; padding: 0 5px;
  color: var(--text); background: var(--panel-2);
}
.chip.inactive-chip { color: var(--text-dim); }

/* Tripwire banner (clickable items) */
.tripwire-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tw-items { display: inline; }
.tw-item { text-decoration: none; margin: 0 3px; white-space: nowrap; }
.tw-item:hover { text-decoration: underline; }
.tw-item strong { color: var(--red); }
.tw-num { font-family: var(--mono); color: var(--text); font-size: 12px; }
.tw-sep { color: var(--text-dim); margin: 0 2px; }

/* Detail extras */
.detail-gauge-cap { display: block; color: var(--text-dim); font-size: 11px; margin-top: 5px; }
.detail-trip {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--red-bd); background: rgba(229,72,77,0.10);
  color: var(--red); font: 600 12px var(--sans); vertical-align: middle;
}
.idx-explain {
  margin-top: 10px; padding: 10px 12px; max-width: 820px;
  background: var(--panel); border: 1px solid var(--border);
  border-left: 2px solid var(--text-faint); border-radius: 6px;
  color: var(--text-dim); font-size: 12.5px; line-height: 1.55;
}
.chart-single { font-family: var(--mono); font-size: 26px; color: var(--text); margin-bottom: 6px; }

/* Breakdown rows are links now */
a.bd-row { text-decoration: none; color: inherit; cursor: pointer; }
a.bd-row:hover .bd-name { text-decoration: underline; color: #fff; }

@media (max-width: 560px) {
  .tooltip { max-width: 80vw; }
  .index-tile .tile-sub { display: none; }   /* keep tiles compact on phones */
}

/* Methodology panel ("как считается этот индикатор") */
.meth .panel-title { margin-bottom: 6px; }
.meth-row { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; padding: 9px 0; border-top: 1px solid var(--border); }
.meth-row:first-of-type { border-top: none; }
.meth-label { color: var(--text-dim); font: 12px var(--sans); padding-top: 1px; }
.meth-body { color: var(--text); font: 13px var(--sans); line-height: 1.5; }
.rubric { white-space: pre-line; font: 12.5px/1.55 var(--mono); color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 11px; }
.th-list { display: flex; flex-wrap: wrap; gap: 5px 18px; }
.th-band { display: inline-flex; align-items: center; gap: 6px; font: 13px var(--sans); }
.th-band b { font-family: var(--mono); }
.src-chip { display: inline-block; font: 12px var(--mono); color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 2px 8px; margin: 0 5px 5px 0; }
.meth-note { margin-top: 7px; font: 12px/1.5 var(--sans); color: var(--text-dim); }
@media (max-width: 640px) { .meth-row { grid-template-columns: 1fr; gap: 3px; } }
