.card-note {
  margin-top: 4px;
}

.pill {
  display: flex;
  align-items: center;
  width: fit-content;
  height: 28px;
  margin-top: 12px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  color: var(--cyan-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .05em;
}

.gauge-card .alert {
  margin-top: 18px;
}

.alert .rec {
  margin-top: 8px;
  font-weight: 500;
}

.alert.risk .rec {
  color: var(--red);
}

.alert.edge .rec {
  color: var(--yellow);
}

.alert.ok .rec {
  color: var(--green);
}

.alert.info .rec {
  color: var(--cyan);
}

.report {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--line-2);
  background: rgba(10, 18, 28, .55);
}

.report svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  background: rgba(34, 211, 238, .06);
  color: var(--cyan);
}

.report-text {
  flex: 1;
  min-width: 0;
}

.report-text b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.report-text small {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
}

.report-action {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--cyan);
}

.report .spin {
  display: none;
}

.report[aria-busy="true"] .report-action svg {
  display: none;
}

.report[aria-busy="true"] .spin {
  display: block;
}

@media (max-width: 380px) {
  .report {
    gap: 12px;
  }
  .report-text b {
    font-size: 14px;
  }
}

.period-note {
  margin: -4px 2px 0;
  font-size: 10.5px;
  letter-spacing: .04em;
}

.gauge-card .alert {
  margin-top: 14px;
}

/* ---------- Пять показателей RDE ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.metric {
  grid-column: span 2;
  min-width: 0;
  border: 1px solid var(--line-dim);
  background: #0e141c;
  padding: 11px 10px 10px;
}

.metric.m-cs,
.metric.m-oc {
  grid-column: span 3;
}

.metric .small-mono {
  font-size: 9.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric b {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric .delta {
  display: block;
  min-height: 15px;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
}

.metric small {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--muted);
}

.metric.m-rc {
  border-top: 2px solid var(--pos);
}

.metric.m-dp {
  border-top: 2px solid var(--neg);
}

/* ---------- Графики ---------- */

.chart-wrap {
  position: relative;
  margin-top: 10px;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y;
}

.c-grid {
  stroke: rgba(244, 247, 251, .07);
  stroke-width: 1;
}

.c-grid.zero {
  stroke: rgba(244, 247, 251, .35);
}

.c-axis {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.c-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.c-line.pos,
.c-dot.pos {
  stroke: var(--pos);
}

.c-line.neg,
.c-dot.neg {
  stroke: var(--neg);
}

.c-dot {
  fill: var(--bg);
  stroke-width: 2;
}

.c-area.pos {
  fill: color-mix(in srgb, var(--pos) 22%, transparent);
}

.c-area.neg {
  fill: color-mix(in srgb, var(--neg) 22%, transparent);
}

.c-bar.pos {
  fill: var(--pos);
}

.c-bar.neg {
  fill: var(--neg);
}

.c-bar.zero {
  fill: var(--text-2);
}

.c-missing {
  stroke: var(--dim);
  stroke-width: 2;
  stroke-dasharray: 2 2;
}

.c-cross {
  stroke: var(--text-2);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.c-hit {
  fill: transparent;
  cursor: crosshair;
}

.c-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.c-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.k-line {
  display: inline-block;
  width: 16px;
  height: 2px;
}

.k-line.pos {
  background: var(--pos);
}

.k-line.neg {
  background: var(--neg);
}

.c-tip {
  position: absolute;
  top: -6px;
  z-index: 3;
  min-width: 112px;
  padding: 7px 9px;
  border: 1px solid var(--line-2);
  background: rgba(5, 10, 18, .95);
  pointer-events: none;
  font-size: 11.5px;
}

.c-tip .t-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 3px;
}

.c-tip .t-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  color: var(--text-2);
}

.c-tip .t-row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.c-tip .t-row.muted {
  color: var(--muted);
}

.c-line.oc,
.c-dot.oc {
  stroke: var(--text);
}

.c-line.oc {
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.k-line.oc {
  background: repeating-linear-gradient(90deg, var(--text) 0 4px, transparent 4px 7px);
}

.k-area {
  display: inline-block;
  width: 14px;
  height: 10px;
  background: color-mix(in srgb, var(--pos) 35%, transparent);
  border-top: 2px solid var(--pos);
}

/* Плитки, графики и отчёт — как карточки концепта */
.metric {
  border-radius: 10px;
  border-color: rgba(34, 211, 238, .22);
  background: rgba(6, 12, 20, .78);
  overflow: hidden;
}

.metric .small-mono {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.report {
  border-radius: 12px;
}

.report-icon {
  border-radius: 8px;
}

.c-tip {
  border-radius: 8px;
}

.gauge-card {
  text-align: center;
}

.gauge-card .gauge {
  max-width: 300px;
}

.period-note {
  font-family: var(--body);
}

.metric .small-mono {
  font-size: 10.5px;
  letter-spacing: .02em;
}

.g-values {
  gap: 6px 14px;
  font-size: 13px;
}

.g-values b {
  font-weight: 700;
}

.g-values b.k-rb-t {
  color: #5ee06a;
}

.g-values b.k-cs-t {
  color: var(--cyan);
}

.g-values b.k-oc-t {
  color: var(--text);
}

.metric .small-mono {
  white-space: normal;
  overflow: visible;

  min-height: 2.4em;
}

/* Подробная шкала по макету Gauge 03 Terminal */
.gauge-card .gauge {
  max-width: 340px;
}

.gauge-detail {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  --gd-cyan: #22e5f5;
  --gd-red: #e85a5a;
  --gd-green: #19e63a;
  --gd-green-dark: #0d4a24;
}

.gd-outline {
  fill: none;
  stroke: var(--gd-cyan);
  stroke-width: 1.6;
}

.gd-track {
  fill: none;
  stroke-width: 22;
}

.gd-track.neg {
  stroke: var(--gd-red);
  opacity: .85;
}

.gd-track.pos {
  stroke: var(--gd-green-dark);
}

.gd-fill {
  fill: none;
  stroke-width: 22;
}

.gd-fill.pos {
  stroke: var(--gd-green);
}

.gd-fill.neg {
  stroke: #ff7a7a;
}

.gd-cs {
  fill: none;
  stroke: var(--gd-cyan);
  stroke-width: 22;
  opacity: .38;
}

.gd-tick {
  stroke-width: 2;
}

.gd-tick.neg {
  stroke: #ff8a8a;
}

.gd-tick.pos {
  stroke: var(--gd-green);
}

.gd-zero,
.gd-rb {
  stroke: var(--gd-cyan);
  stroke-width: 2.5;
}

.gd-zero-t,
.gd-mark {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  fill: var(--gd-cyan);
}

.gd-oc {
  fill: #fff;
  stroke: var(--gd-cyan);
  stroke-width: 2.5;
}

.gd-oc.no-mood {
  fill: var(--bg);
  stroke: #fff;
}

.gd-end {
  font-family: var(--body);
  font-size: 30px;
  font-weight: 700;
}

.gd-end.neg {
  fill: var(--gd-red);
}

.gd-end.pos {
  fill: var(--gd-green);
}

.gauge-card .g-values {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gd-cyan, #22e5f5);
}

.gauge-card .g-values b {
  color: var(--text);
}

.gd-formula {
  flex-basis: 100%;
  justify-content: center;
  letter-spacing: .08em;
}

/* Подписи под шкалой тремя колонками, формула отдельной строкой — как в макете */
.gauge-card .g-values {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 8px 6px;
  font-size: 10px;
  letter-spacing: .02em;
}

.gauge-card .g-values span {
  white-space: nowrap;
}

.gauge-card .g-values .gd-formula {
  grid-column: 1 / -1;
  justify-self: center;
  font-size: 11px;
}

@media (max-width: 360px) {
  .gauge-card .g-values {
    grid-template-columns: auto;
    justify-content: center;
    justify-items: center;
    gap: 4px;
  }
}

/* На узких экранах плитки по две в ряд, «Сейчас» — на всю ширину */
@media (max-width: 360px) {
  .metric,
  .metric.m-cs {
    grid-column: span 3;
  }
  .metric.m-oc {
    grid-column: span 6;
  }
}
