:root {
  --text: #111;
  --muted: #555;
  --border: #e5e5e5;
  --bg: #fff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

a {
  color: #0b57d0;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.title {
  font-family: "Source Serif 4", serif;
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.authors {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.affiliations {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.venue {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 16px;
}

.btn-row {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.btn-primary {
  border-color: #0b57d0;
  color: #0b57d0;
}

.btn-outline {
  color: var(--text);
}

.hf-icon {
  height: 0.9em;
}

.section {
  margin-top: 36px;
}

.section h2 {
  font-family: "Source Serif 4", serif;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.lead {
  font-size: 1.08rem;
}

.viz-table {
  display: grid;
  gap: 16px;
}

.viz-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.viz-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.viz-tab.active {
  border-color: #0b57d0;
  color: #0b57d0;
}

.viz-panel[hidden] {
  display: none;
}

.viz-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.viz-query {
  font-weight: 600;
  margin-bottom: 10px;
}

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

.audio-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #fff;
}

.audio-play {
  border: 1px solid var(--border);
  background: #f7f7f7;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.audio-play.is-playing {
  border-color: #0b57d0;
  color: #0b57d0;
}

.waveform {
  height: 64px;
}

.waveform canvas {
  width: 100% !important;
}

.audio-native {
  display: none;
}

.audio-placeholder,
.placeholder {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.viz-empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.figure {
  width: 100%;
  max-width: 820px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.figure.centered {
  display: block;
  margin: 0 auto;
}

.figure-wide {
  max-width: 920px;
}

.figure-short {
  width: 75%;
  height: auto;
}

.caption {
  font-size: 1.05rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

.section-note {
  text-align: center;
  font-size: 1.4rem;
  margin-top: 12px;
  margin-bottom: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  justify-items: center;
}

.result-grid .figure {
  max-width: 100%;
}

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

@media (max-width: 720px) {
  .viz-audios {
    grid-template-columns: 1fr;
  }
}
