/* ============================================================
   CORESAA — Explore interview page
   ============================================================ */

.layout--explore {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.explore-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.pos-filter-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
}
.card--collapsible > .collapsible-card__content {
  padding: 0.8rem 1.1rem 1rem;
}

.card--collapsible > .collapsible-card__content .hint {
  padding: 0;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.35;
}

.option-row input[type="checkbox"],
.option-row input[type="radio"] {
  accent-color: var(--accent);
  flex-shrink: 0;
}

.option-row--separated {
  border-top: 1px solid var(--border);
  margin-top: 0.85rem;
  padding-top: 0.85rem;
}

.frequency-word-options {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 0.55rem;
}

.explore-frequency-btn {
  margin-top: 0.8rem;
  width: 100%;
  justify-content: center;
}

.frequency-result {
  margin-top: 0.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-filter);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.frequency-result strong {
  color: var(--text);
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.summary-list div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-list dt {
  color: var(--text-faint);
  font-weight: 600;
}

.summary-list dd {
  color: var(--text);
  text-align: right;
}

.transcript-card {
  min-height: 65vh;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
}

.highlight-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: #fff;
}

.legend-chip__swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
}

.transcript-view {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.transcript-empty {
  font-family: var(--font-ui);
  color: var(--text-faint);
  font-style: italic;
  padding: 1rem 0;
}

.turn {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.turn--interviewer {
  background: rgba(0,0,0,0.018);
}

.turn__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: baseline;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: var(--text-faint);
  background: var(--bg-filter);
}

.turn__speaker {
  color: var(--text);
  font-weight: 700;
}

.turn__role {
  color: var(--text-muted);
}

.turn__body {
  padding: 0.75rem 0.85rem 0.85rem;
  font-size: 1.02rem;
  line-height: 1.85;
}

.sentence {
  display: block;
  margin-bottom: 0.35rem;
}

.tok {
  border-radius: 0.24rem;
  padding: 0.03rem 0.14rem;
  transition: box-shadow 0.12s, outline-color 0.12s;
}

.tok:hover {
  outline: 1px solid rgba(0,0,0,0.2);
}

.tok--pos-ADJ { background: rgba(255, 214, 102, 0.55); }
.tok--pos-ADV { background: rgba(157, 195, 230, 0.48); }
.tok--pos-AUX { background: rgba(190, 170, 225, 0.48); }
.tok--pos-DET { background: rgba(210, 210, 210, 0.62); }
.tok--pos-NOUN { background: rgba(169, 209, 142, 0.52); }
.tok--pos-PRON { background: rgba(244, 177, 131, 0.5); }
.tok--pos-PROPN { background: rgba(146, 208, 180, 0.5); }
.tok--pos-VERB { background: rgba(210, 83, 83, 0.24); }
.tok--pos-NUM { background: rgba(180, 198, 231, 0.52); }
.tok--pos-ADP { background: rgba(255, 230, 153, 0.45); }
.tok--pos-CCONJ,
.tok--pos-SCONJ { background: rgba(217, 210, 233, 0.55); }
.tok--pos-INTJ { background: rgba(234, 153, 153, 0.42); }
.tok--pos-PART { background: rgba(201, 218, 248, 0.48); }

.tok--codeswitch {
  background: rgba(215, 35, 35, 0.18);
  box-shadow: inset 0 -0.17em 0 rgba(215, 35, 35, 0.75);
}

.tok--frequency-hit {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.audio-player-container {
  margin: 0 0 1rem;
  padding: 0.65rem 0.8rem;
  background: var(--bg-filter);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.audio-player-container audio {
  display: block;
  width: 100%;
  height: 36px;
}

.sentence-wrapper {
  display: inline;
}

.sentence-wrapper + .sentence-wrapper::before {
  content: " ";
}

.sentence-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin: 0 0.25rem 0 0.1rem;
  padding: 0;
  vertical-align: 0.05em;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);

  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s,
    transform 0.08s;
}

.sentence-audio-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
  border-color: rgba(184, 48, 48, 0.35);
}

.sentence-audio-btn:active {
  transform: scale(0.92);
}

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

.sentence-audio-btn--playing {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .layout--explore {
    grid-template-columns: 1fr;
  }

  .explore-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .transcript-header {
    flex-direction: column;
  }
}
