:root {
  --navy: #0d1b2a;
  --accent-dim: rgba(0, 255, 157, 0.35);
}

.loading-line {
  padding: 0 0 1rem;
  max-width: 1100px;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
}

.disclaimer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.disclaimer strong {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.35rem;
}

.grid-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .grid-main {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.panel h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.viewer-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface2);
  margin-bottom: 1rem;
}

.viewer-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 520px);
  object-fit: contain;
}

.nav-sample {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: rgba(0, 255, 157, 0.08);
  border-color: rgba(0, 255, 157, 0.35);
  color: var(--accent);
}

.btn-primary:hover {
  box-shadow: 0 0 0 1px rgba(0, 255, 157, 0.2);
}

.label-mono {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.prediction {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.prediction.normal {
  color: var(--accent2);
}

.prediction.pneumonia {
  color: var(--accent);
}

.pred-match {
  font-family: 'DM Mono', monospace;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.pred-match.match-correct {
  color: var(--accent2);
}

.pred-match.match-wrong {
  color: #e06c75;
}

.conf-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface2);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.conf-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.25s ease;
}

.conf-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.note-block {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: 0.85rem;
}

.note-block .label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.35rem;
}

.meta-strip {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.meta-strip span {
  font-family: 'DM Mono', monospace;
  color: var(--text);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.thumb-btn {
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.thumb-btn img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.thumb-btn:hover {
  border-color: rgba(0, 255, 157, 0.4);
}

.thumb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.thumb-btn[aria-selected='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 255, 157, 0.25);
}

details.model-details {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
}

details.model-details summary {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  padding: 1rem 1.25rem;
  list-style: none;
}

details.model-details summary::-webkit-details-marker {
  display: none;
}

details.model-details .inner {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

.metrics-table th,
.metrics-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.metrics-table th {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
}

.metrics-table td.num {
  font-family: 'DM Mono', monospace;
  font-variant-numeric: tabular-nums;
}

ul.limitations {
  margin: 0.75rem 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

footer.site-footer {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

footer.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

footer.site-footer a:hover {
  text-decoration: underline;
}

#loadErr {
  padding: 6.5rem 1.5rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
  color: var(--text);
}

#loadErr code {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  nav {
    padding: 1rem 1.5rem;
  }
  .nav-links {
    gap: 1rem;
  }
}
