:root {
  --navy: #1f4e78;
  --navy-dark: #163a5a;
  --blue: #2e75b6;
  --green: #548235;
  --gray: #595959;
  --paper: #ffffff;
  --page: #eef3f8;
  --highlight: #fff2a8;
  --line-hover: #f4f8fc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  background: var(--page);
  color: #222;
  min-height: 100vh;
}

.doc-header {
  background: var(--paper);
  padding: 1.5rem 0 1.15rem;
  border-bottom: 1px solid #d9e4ef;
}

.doc-title {
  color: var(--navy);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

.doc-subtitle {
  color: var(--gray);
  font-size: 1.05rem;
  margin: 0;
}

.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 30;
}

.player-full {
  width: 100%;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
}

.player-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
}

.player-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.player-btn:hover,
.player-btn:focus-visible {
  background: #e8f1fa;
  outline: none;
}

.player-time {
  flex: 0 0 auto;
  font-size: 0.82rem;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
  min-width: 2.4rem;
}

.progress-input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, #7eb6e6 0%, #ffffff55 0%);
  outline: none;
  cursor: pointer;
}

.progress-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cfe3f5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.progress-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cfe3f5;
}

.filters {
  background: var(--paper);
  border-bottom: 1px solid #d9e4ef;
  padding: 0.85rem 0;
}

.filter-label {
  font-size: 0.92rem;
  color: var(--gray);
  margin-right: 0.5rem;
  font-weight: 600;
}

.filters .btn-filter {
  min-width: 3rem;
  font-weight: 700;
  background: #fff;
}

.filters .btn-filter-all {
  color: #343a40;
  border-color: #343a40;
}

.filters .btn-filter-all.active,
.filters .btn-filter-all:hover {
  background: #343a40;
  border-color: #343a40;
  color: #fff;
}

.filters .btn-filter-a {
  color: var(--navy);
  border-color: var(--navy);
}

.filters .btn-filter-a.active,
.filters .btn-filter-a:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.filters .btn-filter-b {
  color: var(--blue);
  border-color: var(--blue);
}

.filters .btn-filter-b.active,
.filters .btn-filter-b:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.filters .btn-filter-c {
  color: var(--green);
  border-color: var(--green);
}

.filters .btn-filter-c.active,
.filters .btn-filter-c:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.dialogue-wrap {
  background: var(--paper);
  margin: 1rem auto 2rem;
  padding: 1.15rem 1.1rem 1.4rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 18px rgba(31, 78, 120, 0.08);
}

.dialogue-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.4rem;
  border-radius: 0.4rem;
}

.dialogue-line + .dialogue-line {
  margin-top: 0.15rem;
}

.dialogue-line:hover {
  background: var(--line-hover);
}

.dialogue-line.is-playing {
  background: #eaf3fb;
}

.dialogue-line.is-hidden {
  display: none;
}

.line-play {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-top: 1px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.dialogue-line[data-speaker="A"] .line-play {
  color: var(--navy);
}

.dialogue-line[data-speaker="B"] .line-play {
  color: var(--blue);
}

.dialogue-line[data-speaker="C"] .line-play {
  color: var(--green);
}

.line-play:hover,
.line-play:focus-visible {
  background: rgba(31, 78, 120, 0.1);
  outline: none;
}

.dialogue-line.is-playing .line-play {
  color: #fff;
}

.dialogue-line[data-speaker="A"].is-playing .line-play {
  background: var(--navy);
  color: #fff;
}

.dialogue-line[data-speaker="B"].is-playing .line-play {
  background: var(--blue);
  color: #fff;
}

.dialogue-line[data-speaker="C"].is-playing .line-play {
  background: var(--green);
  color: #fff;
}

.dialogue-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #222;
}

.speaker {
  font-weight: 700;
  margin-right: 0.2rem;
}

.speaker-a {
  color: var(--navy);
}

.speaker-b {
  color: var(--blue);
}

.speaker-c {
  color: var(--green);
}

.hl {
  background: var(--highlight);
  padding: 0 0.12em;
}

@media (max-width: 575.98px) {
  .doc-title {
    font-size: 1.22rem;
  }

  .doc-subtitle {
    font-size: 0.95rem;
  }

  .player-inner {
    padding: 0.75rem 0.75rem;
    gap: 0.6rem;
  }

  .player-btn {
    width: 44px;
    height: 44px;
  }

  .dialogue-wrap {
    margin: 0.75rem 0 1.25rem;
    padding: 0.75rem 0.55rem 1rem;
    border-radius: 0;
  }

  .dialogue-line {
    gap: 0.35rem;
    padding: 0.45rem 0.2rem;
  }

  .dialogue-text {
    font-size: 1rem;
  }
}
