/* ROV impact — page-specific layout.
   Shared tokens and components live in labs.css; nothing here redefines the palette. */

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.query-panel { margin-top: 18px; }

.query-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
}

.query-field { display: flex; flex-direction: column; }

#asn { width: 190px; }
#family { min-width: 160px; }
.query-form button { min-width: 138px; }

.query-help {
  flex-basis: 100%;
  margin: 0;
  color: var(--faint);
  font-size: 11.5px;
}

.form-error {
  margin: 10px 0 0;
  color: var(--fail);
  font-size: 12px;
}

.error-box {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--fail) 42%, var(--rule));
  background: color-mix(in srgb, var(--fail) 6%, var(--panel));
  color: var(--fail);
  font-size: 12.5px;
}

.error-box strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kpi-value.is-ok { color: var(--accent); }
.kpi-value.is-fail { color: var(--fail); }
.kpi-value.is-muted { color: var(--unknown); }

/* Keep the numeric row on one baseline when a label wraps to two lines. */
.kpi-label { min-height: 30px; }

.impact-panel { margin-top: 18px; }

.impact {
  margin: 0;
  max-width: 980px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.scroll-hint { display: none; }

table.breakdown { min-width: 720px; }

table.breakdown td:first-child { white-space: nowrap; }

table.breakdown tbody tr:hover { background: var(--panel-sunk); }

button.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

button.sort-btn:hover { background: transparent; color: var(--ink); }

th.num button.sort-btn { justify-content: flex-end; }

.sort-mark { display: inline-block; min-width: 7px; color: var(--accent); }

th[aria-sort="ascending"] .sort-mark::after { content: "\2191"; }
th[aria-sort="descending"] .sort-mark::after { content: "\2193"; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

button.filter-chip {
  padding: 4px 10px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
}

button.filter-chip:hover {
  border-color: var(--ink-2);
  background: var(--panel-sunk);
  color: var(--ink);
}

button.filter-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--panel);
}

.filter-count { margin-left: 4px; opacity: 0.68; }

.caveat {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  max-width: 980px;
  color: var(--faint);
  font-size: 11.5px;
}

.caveat p { margin: 0; }

.foot p { margin: 0; }

@media (max-width: 760px) {
  .query-form { flex-direction: column; align-items: stretch; }
  #asn, #family, .query-form button { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(5), .kpi:nth-child(6) { grid-column: 1 / -1; }
  .impact { font-size: 16px; }
  .panel-head { flex-wrap: wrap; gap: 8px; }
  table.breakdown { min-width: 640px; }
  .scroll-hint { display: block; margin: 8px 0 0; color: var(--faint); font-size: 11px; }
}

@media (max-width: 359px) {
  .kpis { grid-template-columns: 1fr; }
}
