/* ---------- Listening library ---------- */

.listening-hero .eyebrow {
  color: #3f7c6e;
}

.listening-hero .hero-copy h1 {
  max-width: 660px;
}

.listening-grid .article-card {
  min-height: 210px;
  padding-top: 17px;
}

.listening-grid .article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #6d9fc5;
}

.listening-grid .article-card.section-2::before {
  background: #77a57d;
}

.listening-grid .article-card.section-3::before {
  background: #9b82ac;
}

.listening-grid .article-card.section-4::before {
  background: #c39b5d;
}

.listen-section-chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 3px;
  background: #eaf1f8;
  color: #356b9c;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-2 .listen-section-chip {
  background: #ebf2e8;
  color: #4d794f;
}

.section-3 .listen-section-chip {
  background: #f2ecf3;
  color: #77567f;
}

.section-4 .listen-section-chip {
  background: #f7f0e5;
  color: #966d2f;
}

.listen-duration {
  color: #9aa19b;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.listening-grid h3 {
  margin-top: 14px;
  padding-right: 30px;
  font-size: 16.5px;
}

.listen-cn {
  margin: -2px 0 8px;
  color: #969d97;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listen-play-glyph {
  position: absolute;
  right: 17px;
  bottom: 17px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #d7dbd4;
  border-radius: 50%;
  background: #ffffff;
  color: #537b9d;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.listen-play-glyph svg {
  width: 11px;
  height: 11px;
  margin-left: 1px;
}

.article-card:hover .listen-play-glyph {
  border-color: #356b9c;
  background: #356b9c;
  color: #ffffff;
}

.listening-grid .card-excerpt {
  display: none;
}

.listening-grid .card-bottom {
  padding-top: 10px;
  padding-right: 35px;
}

/* ---------- Listening player ---------- */

.listening-page .page {
  padding-top: 0;
}

.listen-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 470px;
  margin-top: 0;
  border-top: 1px solid #eeeeea;
}

.listen-paper-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  border-right: 1px solid #e7e7e1;
}

.listen-paper-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 27px 38px 80px 30px;
  scrollbar-width: thin;
  scrollbar-color: #a7aaa4 transparent;
}

.listen-paper-scroll::-webkit-scrollbar {
  width: 8px;
}

.listen-paper-scroll::-webkit-scrollbar-thumb {
  background: #a7aaa4;
  border-radius: 8px;
}

.listen-paper-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.listen-paper-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
  color: #8b918b;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.listen-paper-head span:first-child {
  color: #58615b;
  font-weight: 700;
}

.listen-paper-head span:last-child {
  text-transform: none;
  letter-spacing: 0;
}

.listen-title {
  margin: 0 0 5px;
  color: #26323b;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.listen-cn-title {
  margin: 0 0 20px;
  color: #8e958f;
  font-size: 12.5px;
  line-height: 1.4;
  min-height: 0;
}

.listen-cn-title:empty {
  display: none;
}

.listen-paper-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 19px;
  color: #8d948e;
  font-size: 11px;
}

.listen-paper-meta span + span::before {
  content: "·";
  padding-right: 10px;
  color: #c1c5be;
}

.paper-pages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.paper-page {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  border: 1px solid #dcded7;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 50, 43, 0.055);
  cursor: zoom-in;
  overflow: hidden;
  line-height: 0;
  position: relative;
}

.paper-page img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
}

.paper-page::after {
  content: "Click to zoom";
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(30, 39, 34, 0.62);
  color: #ffffff;
  font-size: 9px;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.paper-page:hover::after {
  opacity: 1;
}

/* ---------- Sidebar ---------- */

.listen-side {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 22px 32px;
  background: #fafaf7;
  scrollbar-width: thin;
  scrollbar-color: #b9bcb5 transparent;
}

.listen-side::-webkit-scrollbar {
  width: 7px;
}

.listen-side::-webkit-scrollbar-thumb {
  background: #b9bcb5;
  border-radius: 7px;
}

.listen-audio {
  padding: 14px 14px 12px;
  border: 1px solid #dedfd8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(35, 47, 40, 0.055);
}

.audio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.audio-label {
  color: #7a837b;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.audio-duration-badge {
  color: #9ba29b;
  font-size: 10.5px;
}

.audio-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-play {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1d3b5d;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.audio-play:hover {
  background: #142d4a;
}

.audio-play:active {
  transform: scale(0.97);
}

.audio-play svg {
  width: 19px;
  height: 19px;
  display: block;
}

.audio-play .icon-pause {
  display: none;
}

.audio-play.is-playing .icon-play {
  display: none;
}

.audio-play.is-playing .icon-pause {
  display: block;
}

.audio-track {
  flex: 1;
  min-width: 0;
}

.audio-range {
  --range-progress: 0%;
  width: 100%;
  height: 17px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.audio-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    #4f7d9e 0%,
    #4f7d9e var(--range-progress),
    #e4e6df var(--range-progress),
    #e4e6df 100%
  );
}

.audio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #2f6b92;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.audio-range::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: #e4e6df;
}

.audio-range::-moz-range-progress {
  height: 4px;
  border-radius: 4px;
  background: #4f7d9e;
}

.audio-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #2f6b92;
}

.audio-time {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  color: #8e958f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.audio-bottom {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #f0f0ec;
}

.audio-icon-btn {
  height: 25px;
  min-width: 25px;
  padding: 0 6px;
  border: 1px solid #e0e2db;
  border-radius: 4px;
  background: #ffffff;
  color: #616b64;
  font-size: 10.5px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.audio-icon-btn:hover {
  border-color: #aeb5ad;
  color: #263b30;
}

.audio-icon-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.volume-range {
  width: 62px;
  height: 14px;
  accent-color: #5a829d;
  cursor: pointer;
}

.audio-error {
  margin: 9px 0 0;
  color: #9c4b3e;
  font-size: 10.5px;
  line-height: 1.45;
}

.audio-hint {
  margin: 8px 0 0;
  color: #a0a69f;
  font-size: 9.5px;
  line-height: 1.45;
}

/* ---------- Answer sheet ---------- */

.listen-answer-panel {
  margin-top: 14px;
  padding: 13px 14px 12px;
  border: 1px solid #dedfd8;
  border-radius: 6px;
  background: #ffffff;
}

.listen-answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.listen-answer-head h2 {
  margin: 0;
  color: #34423a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.listen-answer-progress {
  color: #969d96;
  font-size: 10.5px;
}

.listen-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
}

.listen-answer-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px 0;
  border-bottom: 1px dotted #ecece7;
}

.listen-answer-row:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.listen-qnum {
  flex: 0 0 22px;
  color: #535d56;
  font-size: 11.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.listen-answer-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  padding: 0 6px;
  border: 1px dotted #a3a69f;
  border-radius: 1px;
  background: #ffffff;
  color: #1d3d5e;
  font-family: inherit;
  font-size: 12px;
  line-height: 25px;
  outline: none;
}

.listen-answer-input:focus {
  border: 1px dashed #4c8fd8;
  background: #fbfdff;
}

.listen-answer-input.has-value {
  border-style: solid;
  border-color: #b7bab4;
  background: #fcfcfa;
}

.listen-answer-row .flag-btn {
  position: static;
  flex: 0 0 18px;
  width: 18px;
  height: 23px;
  padding: 0;
  opacity: 1;
  pointer-events: auto;
}

.listen-answer-row .flag-btn svg {
  width: 16px;
  height: 16px;
}

.listen-answer-row .flag-btn.is-flagged {
  color: #c58c35;
}

.listen-hint {
  margin: 13px 2px 0;
  color: #a0a69f;
  font-size: 10px;
  line-height: 1.55;
}

.listen-side-note {
  margin: 11px 1px 0;
  padding: 9px 10px;
  border: 1px solid #e6e2d4;
  border-radius: 4px;
  background: #fffdf5;
  color: #8c815e;
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- Footer ---------- */

.listening-page .statusbar {
  padding-right: 22px;
}

.listen-footer-meta {
  margin-left: auto;
  color: #959c96;
  font-size: 11.5px;
  white-space: nowrap;
}

.listen-footer-meta strong {
  color: #63716a;
  font-weight: 600;
}

/* ---------- Image lightbox ---------- */

.paper-lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(17, 24, 20, 0.73);
  cursor: zoom-out;
}

.paper-lightbox img {
  max-width: min(1200px, 94vw);
  max-height: 90vh;
  width: auto;
  height: auto;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.paper-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Listening modal bits ---------- */

.listen-finish-stats {
  display: flex;
  gap: 24px;
  margin: 17px 0 0;
  color: #8b928b;
  font-size: 12px;
}

.listen-finish-stats strong {
  color: #34443a;
  font-size: 14px;
  font-weight: 600;
}

.listen-finished-note {
  margin: 0;
  color: #818981;
  font-size: 13px;
  line-height: 1.65;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .listen-workspace {
    grid-template-columns: minmax(0, 1fr) 420px;
  }

  .listen-paper-scroll {
    padding-left: 24px;
    padding-right: 26px;
  }

  .listen-side {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 980px) {
  .listen-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .listen-paper-pane {
    border-right: 0;
    border-bottom: 1px solid #e7e7e1;
  }

  .listen-paper-scroll {
    overflow: visible;
  }

  .listen-side {
    overflow: visible;
    padding: 18px 20px 36px;
  }

  .listen-audio,
  .listen-answer-panel {
    max-width: none;
  }

  .listening-page .page {
    overflow: visible;
  }

  .listen-paper-scroll {
    padding-bottom: 32px;
  }
}

@media (max-width: 620px) {
  .listen-paper-scroll {
    padding: 18px 14px 28px;
  }

  .listen-title {
    font-size: 20px;
  }

  .listen-answer-grid {
    grid-template-columns: 1fr;
  }

  .listen-answer-row:nth-last-child(-n + 2) {
    border-bottom: 1px dotted #ecece7;
  }

  .listen-answer-row:last-child {
    border-bottom: 0;
  }

  .listen-footer-meta {
    display: none;
  }
}

.listen-answer-input:disabled {
  background: #f6f6f2;
  color: #666c66;
  border-color: #c9ccc5;
  opacity: 1;
  cursor: default;
}

.listen-answer-row .flag-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.audio-play:disabled {
  background: #aeb4ad;
  cursor: default;
}

.listen-finished-note {
  margin: 12px 0 0;
  color: #7e867e;
  font-size: 12px;
  line-height: 1.55;
}
