/* =========================================================================
   GLAS scan visuals. One severity ramp used by every chart so a colour means
   the same thing wherever it appears.
   ========================================================================= */
:root {
  --sv-critical: #b03030;
  --sv-high:     #d1662b;
  --sv-medium:   #c9a227;
  --sv-low:      #3d8f63;
  --sv-info:     #6b7f92;
  --sv-liquidity: #2f6f9f;
  --sv-excluded:  #9aa7b4;
  --sv-rest:      #dfe4e9;
}

/* Five cards do not divide into four columns — one always strands on its own
   row. A 6-column track lets row 1 run 2+2+2 and row 2 run 3+3. */
.scan-visuals {
  display: grid; gap: 16px; grid-template-columns: 1fr; margin: 24px 0 8px;
}
@media (min-width: 720px) {
  .scan-visuals { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1120px) {
  .scan-visuals { grid-template-columns: repeat(6, 1fr); }
  /* 1 average buy price (headline, wide) | 2 gauge | 3 control
     4 concentration | 5 supply | 6 findings */
  .scan-visuals > :nth-child(1) { grid-column: span 3; }
  .scan-visuals > :nth-child(2) { grid-column: span 3; }
  .scan-visuals > :nth-child(3),
  .scan-visuals > :nth-child(4),
  .scan-visuals > :nth-child(5),
  .scan-visuals > :nth-child(6) { grid-column: span 2; }
}

.sv-card {
  border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--paper);
  padding: 18px; min-width: 0;
}
.sv-card__k {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 14px;
}
.sv-note { font-size: 11px; color: var(--ink-soft); margin: 14px 0 0; line-height: 1.45; }

/* ---- gauge ---- */
.sv-card--gauge { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sv-gauge { width: 100%; max-width: 260px; height: auto; overflow: visible; }
.sv-gauge__track { fill: none; stroke: var(--rule); stroke-width: 16; stroke-linecap: round; }
.sv-gauge__fill  { fill: none; stroke-width: 16; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.sv-gauge__tick  { stroke: var(--rule-strong); stroke-width: 1.5; }
.sv-gauge__score {
  text-anchor: middle; font-size: 46px; font-weight: 700; letter-spacing: -.03em;
  font-family: var(--mono);
}
.sv-gauge__of {
  text-anchor: middle; font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; fill: var(--ink-soft);
}
.sv-gauge__end {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase;
  fill: var(--ink-soft);
}
.sv-gauge__end--r { text-anchor: end; }
.sv-gauge__label { text-align: center; margin-top: 4px; }
.sv-gauge__label b {
  display: block; font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 700;
}
.sv-gauge__label span { font-size: 11px; color: var(--ink-soft); }

/* ---- concentration bars ---- */
.sv-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.sv-bar:last-of-type { margin-bottom: 0; }
.sv-bar__k {
  flex: none; width: 48px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
}
.sv-bar__track {
  position: relative; flex: 1; height: 10px; background: var(--rule);
  border-radius: 999px; overflow: hidden; min-width: 0;
}
.sv-bar__track i {
  display: block; height: 100%; background: var(--accent);
  border-radius: 999px; transition: width .5s ease;
}
/* Concern threshold marker. */
.sv-bar__track u {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: var(--ink); opacity: .35;
}
.sv-bar__v {
  flex: none; width: 52px; text-align: right; font-family: var(--mono);
  font-size: 12px; font-weight: 600;
}
.sv-bar__v.is-over { color: var(--sv-high); }

/* ---- donut ---- */
.sv-donut__row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sv-donut { width: 132px; height: 132px; flex: none; }
.sv-donut__v {
  text-anchor: middle; font-family: var(--mono); font-size: 22px; font-weight: 700;
  fill: var(--ink); letter-spacing: -.02em;
}
.sv-donut__k {
  text-anchor: middle; font-family: var(--mono); font-size: 7.5px; letter-spacing: .1em;
  text-transform: uppercase; fill: var(--ink-soft);
}
.sv-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 130px; }
.sv-legend li { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 3px 0; }
.sv-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sv-legend span { color: var(--ink-soft); flex: 1; min-width: 0; }
.sv-legend b { font-family: var(--mono); font-size: 11.5px; }

/* ---- severity strip ---- */
.sv-strip {
  display: flex; height: 12px; border-radius: 999px; overflow: hidden;
  background: var(--rule); margin-bottom: 16px;
}
.sv-strip i { display: block; }
.sv-sevlist {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center;
}
.sv-sevlist li { min-width: 0; }
.sv-sevlist i { display: block; width: 100%; height: 3px; border-radius: 999px; margin-bottom: 6px; }
.sv-sevlist b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 700; }
.sv-sevlist span {
  display: block; font-family: var(--mono); font-size: 7.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin-top: 2px;
}
.sv-sevlist li.is-zero { opacity: .32; }

/* ---- status chips ---- */
.sv-chips { list-style: none; margin: 0; padding: 0; }
.sv-chips li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 12px;
}
.sv-chips li:last-child { border-bottom: 0; }
.sv-chips__k { color: var(--ink-soft); }
.sv-chips b {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.sv-chips li.is-good b { background: color-mix(in srgb, var(--sv-low) 14%, var(--paper)); color: var(--sv-low); }
.sv-chips li.is-bad  b { background: color-mix(in srgb, var(--sv-critical) 12%, var(--paper)); color: var(--sv-critical); }

/* ---- average buy price: the headline number ---- */
.sv-avg { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--paper)); }
.sv-avg__v { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 4px; }
.sv-avg__v b {
  font-family: var(--mono); font-weight: 700; letter-spacing: -.04em; line-height: 1;
  font-size: clamp(34px, 5.2vw, 60px); color: var(--accent);
}
.sv-avg__v span {
  font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent);
}
.sv-avg__sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 16px;
}
.sv-avg__none {
  font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--ink-soft);
  margin: 6px 0 4px;
}
.sv-avg__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  border-top: 1px solid var(--rule); padding-top: 14px;
}
.sv-avg__grid div { min-width: 0; }
.sv-avg__grid span {
  display: block; font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px;
}
.sv-avg__grid b {
  display: block; font-family: var(--mono); font-size: 13px; font-weight: 700;
  overflow-wrap: break-word;
}
@media (max-width: 560px) { .sv-avg__grid { grid-template-columns: repeat(2, 1fr); } }
