/* result: snapshot view for one IP or prefix. Top block (header, flags, main route) + shared tabs.
   Tokens only; logical properties; colour = status only. */

.res { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(16px, 2vw, 24px); min-width: 0; }
.res-err { gap: 14px; justify-items: start; }
.res .card:hover { border-color: var(--line); box-shadow: var(--shadow-card); }

/* ── header card: title centred, one row of equal-size controls, facts, counts ── */
.res-head { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.res-head-t { display: grid; gap: 4px; justify-items: center; text-align: center; min-width: 0; }
.res-head-t .dim { font-size: .9rem; line-height: 1.8; max-width: 60ch; }
.res-title { overflow-wrap: anywhere; line-height: 1.3; }
.res-title bdi { letter-spacing: -.02em; }
.res-focus:focus { outline: none; }
.res-focus:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 6px; }

.res-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-width: 0; }
.res-tool { flex: 0 1 190px; min-inline-size: 0; height: var(--target); padding-inline: 14px; font-size: .9rem; }
.btn.res-tool > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* vantage select styled as the same soft-key pill as the buttons next to it */
.res-vsel { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-pill);
  background: var(--ghost-bg); border: 1px solid var(--ghost-border); box-shadow: var(--ghost-inset);
  color: var(--text); font-weight: 700; cursor: pointer; transition: border-color var(--dur-hover) ease; }
.res-vsel:hover { border-color: var(--hair-2); }
.res-vsel:focus-within { border-color: var(--hair-focus); box-shadow: 0 0 0 3px var(--ring); }
.res-vsel-k { flex: 0 0 auto; white-space: nowrap; font-size: .85rem; color: var(--muted-ink); }
.res-vsel select { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: none; outline: none;
  font: 700 .9rem var(--font); color: var(--strong); cursor: pointer; text-overflow: ellipsis; }
.res-vsel select:disabled { cursor: default; color: var(--text); }
.res-vsel select option { background: var(--white); color: var(--text); }

/* definition grid (facts) */
.res-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 0 24px; border-top: 1px solid var(--line); min-width: 0; }
.res-facts > div { display: grid; gap: 2px; padding-block: 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.res-facts dt { font-size: .82rem; color: var(--text-2); }
.res-facts dd { font-weight: 600; color: var(--strong); overflow-wrap: anywhere; min-width: 0; }
.res-facts dd .dim { font-weight: 400; }
.res-facts dd .badge { vertical-align: middle; }

.res-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.res-counts .chip b { color: var(--strong); font-weight: 800; }

/* ── flags + main route (compact, always above the tabs) ── */
.res-flags { display: grid; gap: 10px; min-width: 0; }
.res-route-card { display: grid; gap: 14px; justify-items: stretch; }
.res-route-h { text-align: center; }
.res-route { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; direction: ltr; }
.res-hop { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 14px; border-radius: var(--radius-pill);
  background: var(--chip-bg); border: 1px solid var(--line); font-weight: 700; }
.res-hop-p { background: var(--input); border-color: var(--hair-2); }
.res-hop-p a { color: var(--strong); font-weight: 700; }
.res-arrow { color: var(--text-2); font-weight: 700; }
.res-share-line { display: grid; gap: 8px; justify-items: center; inline-size: min(100%, 560px); margin-inline: auto; }
.res-share-line .res-bar { inline-size: 100%; }
.res-share-line p { color: var(--text-2); font-size: .94rem; text-align: center; }
.res-share-line .num { color: var(--strong); font-weight: 700; }
.res-branches { border-top: 1px solid var(--line); }
.res-branches li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-block: 10px;
  border-bottom: 1px solid var(--line); font-size: .92rem; }
.res-branches li:last-child { border-bottom: 0; padding-bottom: 0; }
.res-br-at { font-weight: 700; color: var(--strong); min-width: 9rem; }

/* ── tabs area ── */
.res-tabs { min-width: 0; padding-top: clamp(8px, 1.6vw, 16px); }
/* the tab count is a solid --strong pill; on the selected (also --strong) tab invert it so it stays visible */
.res-tabs .tab[aria-selected="true"] .count { background: var(--paper); color: var(--strong); }
.res-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sec-gap); min-width: 0; }
.res-panel-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* sub-blocks inside a panel */
.res-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.res-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: var(--target); }
.res-sub { display: grid; gap: 10px; align-content: start; min-width: 0; }
.res-strong { color: var(--strong); font-weight: 800; }
.res-link { color: var(--strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.res-rpki { display: grid; gap: 12px; align-content: start; }

/* upstream shares */
.res-ups { display: grid; gap: clamp(12px, 1.6vw, 20px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .res-ups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.res-up { display: grid; gap: 12px; align-content: start; }
.res-up-h { font-weight: 700; color: var(--strong); }
.res-up-h .dim { font-weight: 400; font-size: .9rem; }
.res-shares { display: grid; gap: 10px; }
.res-shares li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; }
.res-share-k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-share-n { white-space: nowrap; font-size: .88rem; text-align: end; }
.res-share-n b { color: var(--strong); font-weight: 800; }
@media (max-width: 560px) {
  .res-shares li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .res-shares .res-share-k { grid-column: 1 / -1; }
}
.res-bar { display: block; min-width: 48px; }
.res-cell-bar { display: inline-flex; align-items: center; gap: 10px; }
.res-cell-bar .res-bar { inline-size: 96px; }
.res-cell-bar b { color: var(--strong); }

/* graph panel */
.res-graph-panel { gap: 12px; }
.res-graph-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.res-seg .tab[aria-pressed="true"] { background: var(--strong); color: var(--paper); }
.res-graph-exp { display: flex; flex-wrap: wrap; gap: 8px; }
.res-graph { position: relative; min-height: clamp(320px, 55vh, 600px); min-width: 0; overflow: hidden; }
.res-graph > .state { padding: 18px; }
.res-graph-hint { text-align: center; max-width: 70ch; margin-inline: auto; }

/* tables */
.res .table td .dim { font-size: .88em; }
.res-path a { color: inherit; }
.res-path a:hover { color: var(--strong); text-decoration: underline; text-underline-offset: 3px; }
.res-src { font-size: .82rem; }

/* looking glass */
.res-lg-tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.res-lg-filter { flex: 1 1 260px; max-width: 420px; }
.res-lg-filter .input { text-align: start; font-family: var(--font-mono); font-size: .94rem; }
.res-lg-filter .input::placeholder { font-family: var(--font); }
.res-lg-panel { gap: 12px; }
.res-lg thead th[data-sort-th] { padding-block: 0; }
.res-sort { display: inline-flex; align-items: center; gap: 6px; min-height: var(--target); padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.res-sort:hover { color: var(--strong); }
.res-sort-i { width: 14px; height: 14px; opacity: 0; transition: transform var(--dur-hover) var(--ease), opacity var(--dur-hover) ease; }
.res-sort:hover .res-sort-i { opacity: .5; }
th[aria-sort="ascending"] .res-sort, th[aria-sort="descending"] .res-sort { color: var(--strong); }
th[aria-sort="ascending"] .res-sort-i { opacity: 1; transform: rotate(180deg); }
th[aria-sort="descending"] .res-sort-i { opacity: 1; }
.res-pager { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.res-pager .dim { font-size: .9rem; }
.res-flip { transform: scaleX(-1); }

/* evidence */
.res-evidence { margin: 0; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--line);
  color: var(--text); font: .88rem/2 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 360px; overflow: auto; min-width: 0; }

/* owner */
.res-owner { display: grid; gap: 12px; align-content: start; }
.res-owner > p { color: var(--text-2); }
.res-owner .badge .ico { width: 14px; height: 14px; }

/* multiple targets */
.res-pick { display: grid; gap: 12px; }
.res-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.res-chip { height: auto; min-height: var(--target); padding: 0 16px; cursor: pointer;
  transition: background-color var(--dur-hover) ease, border-color var(--dur-hover) ease; }
.res-chip:hover { background: var(--nav-hover); border-color: var(--hair-2); color: var(--strong); }

@media (max-width: 700px) {
  .res-lg-filter .input, .res-vsel select, html .search .pill-form input, html .search-vantage .select { font-size: 16px; }
  .res-br-at { min-width: 0; flex: 1 1 100%; }
  .res-graph-bar { justify-content: center; }
  .res-lg-filter { max-width: none; }
}
/* phones: two equal columns; the share-link key and the vantage pill take a full row each */
@media (max-width: 560px) {
  .res-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-tool { inline-size: 100%; }
  .res-tool-wide { grid-column: 1 / -1; }
  .res-lg-tools > .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .res > * { animation: rv-in var(--dur-reveal) var(--ease) both; }
  .res-tabs .tab-panel:not([hidden]) { animation: rv-in .3s var(--ease) both; }
}
