/* Scoped to the approved Souvislosti details; uses the application's theme tokens. */
.detail-drawer.mi-drawer { grid-template-columns: minmax(24px, 1fr) minmax(0, 1050px); }
.detail-drawer.mi-drawer .drawer-card { width: 100%; }
.metric-insights { min-width: 0; }
.mi-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 18px; border-bottom: 1px solid var(--border); }
.mi-nav button { border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; padding: 9px 14px; cursor: pointer; }
.mi-nav button[aria-current] { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--brand-text); font-weight: 650; }
.metric-insights :is(button, select, input):focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; }
.mi-heading { padding: 24px 0 18px; }
.mi-heading .mi-source { color: var(--brand-text); font-size: 11px; font-weight: 650; letter-spacing: .06em; margin: 0 0 10px; }
.mi-heading h3 { font-size: clamp(23px, 4vw, 31px); line-height: 1.2; letter-spacing: -.035em; margin: 0 0 12px; }
.mi-heading p { color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 72ch; margin: 0; }
.mi-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 0 24px; gap: 18px; border-bottom: 1px solid var(--border); }
.mi-stats > div + div { border-left: 1px solid var(--border); padding-left: 20px; }
.mi-stats span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.mi-stats strong { display: block; font-size: clamp(21px, 3.2vw, 30px); font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mi-stats small { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.mi-chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; }
.mi-chart { min-width: 0; padding: 22px 0 8px; }
.mi-primary { grid-column: 1 / -1; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.mi-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.mi-chart-head h4 { margin: 0; font-size: 13px; font-weight: 600; }
.mi-chart-head > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.mi-plot svg { display: block; width: 100%; overflow: visible; }
.mi-plot text { fill: var(--muted); font-family: inherit; font-size: 10px; }
.mi-grid { stroke: var(--border); stroke-dasharray: 3 5; }
.mi-band { fill: var(--brand); opacity: .07; }
.mi-plot [data-mi-index] { cursor: pointer; }
.mi-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 11px; color: var(--muted); padding-top: 6px; min-height: 24px; }
.mi-legend span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mi-legend b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 550; }
.mi-legend i { display: inline-block; height: 7px; width: 7px; border-radius: 50%; }
.mi-selection { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 20px 0 12px; }
.mi-selection label, .mi-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.metric-insights select { background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font: inherit; padding: 9px 10px; min-width: 0; max-width: 70%; }
.mi-selection input, .mi-scenario input { width: 100%; accent-color: var(--brand-text); cursor: pointer; margin: 18px 0 6px; }
.mi-readout { font-size: 12px; color: var(--text); margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.mi-note { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 12px 0 20px; }
.mi-context { justify-content: flex-start; margin: 0 0 10px; }
.mi-scenario { display: block; padding: 16px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.mi-scenario strong { float: right; color: var(--brand-text); font-size: 15px; }
.mi-empty { min-height: 150px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; font-size: 12px; line-height: 1.5; }
.mi-evidence { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 12px; }
.mi-evidence > summary { cursor: pointer; font-size: 13px; color: var(--soft); padding: 6px 0 18px; }
@media (max-width: 600px) {
  .detail-drawer.mi-drawer { grid-template-columns: minmax(0, 1fr); }
  .detail-drawer.mi-drawer .drawer-card { width: 100%; }
  .mi-nav { gap: 2px; }
  .mi-nav button { padding: 9px 11px; font-size: 12px; }
  .mi-stats { gap: 10px; }
  .mi-stats > div + div { padding-left: 10px; }
  .mi-stats span { font-size: 10px; }
  .mi-stats strong { font-size: 22px; }
  .mi-stats small { display: block; font-size: 10px; margin-top: 3px; }
  .mi-chart-grid { grid-template-columns: minmax(0, 1fr); }
  .mi-chart { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  .mi-selection label { align-items: flex-start; flex-direction: column; }
  .metric-insights .mi-selection select { width: 100%; max-width: 100%; }
}
