.viewer-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 74px;
}

.viewer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.viewer-hero.compact {
  min-height: auto;
}

.viewer-hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  line-height: 1.02;
}

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.stale {
  background: var(--red);
}

.viewer-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.viewer-stats article {
  min-height: 106px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.viewer-stats span {
  display: block;
  color: var(--green-dark);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 850;
}

.viewer-stats strong {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.viewer-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.search {
  width: min(100%, 340px);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.node-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
}

.node-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.node-card h3 {
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: #edf3f1;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 760;
}

.pill.warn {
  background: #fff4df;
  color: #835313;
}

.pill.ai {
  background: #eef5f8;
  color: var(--blue);
}

.profile-summary {
  max-width: 920px;
  line-height: 1.65;
}

.profile-summary p {
  margin: 0 0 10px;
}

.profile-mini-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 18px;
}

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

.score-grid article {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.score-grid span {
  display: block;
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 800;
}

.score-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-weight: 750;
}

.transcript-list {
  display: grid;
  gap: 12px;
}

.transcript-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
}

.transcript-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.transcript-card p {
  margin: 0;
}

.transcript-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.empty {
  color: var(--muted);
  padding: 18px 0;
}

.result-summary {
  margin: -6px 0 12px;
  color: var(--muted);
}

.callsign-link {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.callsign-link:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .viewer-hero,
  .panel-heading {
    grid-template-columns: 1fr;
    align-items: start;
    flex-direction: column;
  }

  .viewer-stats,
  .node-grid,
  .profile-mini-stats,
  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .viewer-stats,
  .node-grid,
  .profile-mini-stats,
  .score-grid {
    grid-template-columns: 1fr;
  }
}
