/* Reading workspace: quiet controls, continuous text, persistent audio. */
.search:focus-within {
  outline: none;
  box-shadow: none;
  border-bottom-color: #52634d;
}
.search input,
.search input:focus,
.search input:focus-visible {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
}
.search:has(input:focus-visible) {
  border-bottom: 2px solid #52634d;
}
.audio-player {
  display: grid;
  grid-template-columns: 130px 138px minmax(100px, 1fr) 64px;
  align-items: center;
  gap: 18px;
  padding: 11px 18px;
  margin: 0 0 28px;
  border: 1px solid #d6d8c8;
  background: #edeedfef;
  backdrop-filter: blur(12px);
  z-index: 20;
  min-height: 76px;
  top: 10px;
}
.audio-source-wrap {
  min-width: 0;
}
.audio-source-wrap select,
#audio-speed {
  width: 100%;
  border: 0;
  background: transparent;
  font: 13px var(--serif);
  color: var(--ink);
  padding: 8px 2px;
  cursor: pointer;
}
.audio-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.audio-controls > button {
  padding: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #52634d;
  background: none;
}
.audio-controls svg {
  width: 35px;
  height: 35px;
}
.audio-controls svg text {
  font: 12px var(--ui);
  fill: currentColor;
  letter-spacing: -0.7px;
}
.audio-controls > .play-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #52634d;
  color: #fff9ed;
  font-size: 14px;
  flex-shrink: 0;
}
.audio-track {
  display: flex;
  align-items: center;
  gap: 17px;
  width: auto;
  min-width: 0;
  position: relative;
}
#audio-seek {
  min-width: 50px;
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: #52634d;
  background: transparent;
  cursor: pointer;
}
#audio-time {
  font: 10px var(--ui);
  color: #717665;
  white-space: nowrap;
  min-width: 81px;
  font-variant-numeric: tabular-nums;
}
#audio-error {
  position: absolute;
  left: 0;
  top: 28px;
  background: #f9f5eb;
  padding: 6px 9px;
  border: 1px solid #bd9b80;
  font-size: 11px;
  z-index: 2;
}
#audio-speed {
  font: 16px var(--serif);
  min-height: 35px;
}
.article-gallery {
  margin-bottom: 40px;
  max-width: 100%;
}
.article-gallery .lead-figure {
  margin: 0;
}
.lead-figure img {
  height: 390px;
  max-height: 45vw;
}
.article-figure figcaption {
  align-items: baseline;
}
.article-figure figcaption > span:last-child {
  flex-shrink: 1;
  text-align: right;
  max-width: 42%;
  overflow-wrap: anywhere;
}
.article-figure figcaption > span:empty {
  display: none;
}
.topic-label {
  margin-left: 12px;
  opacity: 0.7;
  font: 9px var(--ui);
}
.gallery-more {
  border-top: 1px solid var(--line);
  margin-top: 18px;
}
.gallery-more > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 13px 0;
  font-size: 12px;
  color: var(--muted);
}
.gallery-more > summary span {
  font-size: 10px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.gallery-grid .article-figure {
  margin: 5px 0 16px;
}
.gallery-grid img {
  height: 300px;
  object-fit: contain;
}
.gallery-grid figcaption {
  flex-wrap: wrap;
  gap: 3px;
}
.gallery-grid figcaption > span:last-child {
  max-width: 100%;
}
.article-toolbar {
  position: relative;
  flex-wrap: wrap;
}
.reader-notes-button {
  border: 0;
  background: none;
  font: 12px var(--serif);
  color: #657150;
  padding: 7px 10px;
  white-space: nowrap;
}
.article-toolbar > .reader-notes-button {
  order: 3;
  margin-left: auto;
}
.article-toolbar > div {
  margin-right: auto;
}
.exam-intro > .reader-notes-button {
  float: right;
}
.document-bar > .reader-notes-button {
  margin-left: auto;
  order: 2;
}
.document-bar > button:last-child {
  order: 3;
}
[data-reading-block] {
  cursor: text;
}
.english [data-reading-block]:hover {
  cursor: text;
}
::selection {
  background: #c9d6c5;
  color: #26362a;
}
.syntax-subject {
  --syntax: #dae7ec;
  --syntax-ink: #345c6d;
}
.syntax-verb {
  --syntax: #f2dccc;
  --syntax-ink: #864c31;
}
.syntax-object {
  --syntax: #e2e9c9;
  --syntax-ink: #556735;
}
.syntax-complement {
  --syntax: #e8ddec;
  --syntax-ink: #73537d;
}
.syntax-adverbial {
  --syntax: #fae8bd;
  --syntax-ink: #856928;
}
.syntax-connector {
  --syntax: #f1dce1;
  --syntax-ink: #865669;
}
.syntax-modifier {
  --syntax: #e0e7df;
  --syntax-ink: #546755;
}
mark[class^="syntax-"] {
  background: var(--syntax);
  color: var(--syntax-ink);
  padding: 1px 4px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  cursor: help;
}
.syntax-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.syntax-legend span {
  background: var(--syntax);
  color: var(--syntax-ink);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px;
}
.syntax-legend span:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--syntax-ink);
  display: inline-block;
  margin-right: 5px;
  vertical-align: 2px;
}
.reader-mark {
  color: inherit;
  border-radius: 2px;
  padding: 1px 0;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.mark-gold {
  background: #ebd988b3;
}
.mark-green {
  background: #b5cbaeaa;
}
.mark-rose {
  background: #e9bfc5aa;
}
#reading-toolbar {
  position: fixed;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #d8d1bd;
  background: #fffdf4;
  padding: 6px 8px;
  box-shadow: 0 6px 26px #302a2020;
  border-radius: 9px;
  font-family: var(--serif);
}
#reading-toolbar[hidden],
#word-popup[hidden] {
  display: none !important;
}
#reading-toolbar button {
  border: 0;
  background: none;
  white-space: nowrap;
  padding: 8px 6px;
  color: #5b5849;
  font-size: 12px;
  min-height: 34px;
}
#reading-toolbar button:hover {
  background: #eeeee0;
  border-radius: 4px;
}
#reading-toolbar button:disabled {
  opacity: 0.35;
}
#reading-toolbar .tool-ask {
  color: #52634d;
}
#reading-toolbar .color-dot {
  width: 22px;
  height: 23px;
  min-height: 0;
  padding: 0;
  margin: 0 2px;
  border-radius: 5px;
  border: 2px solid #fffdf4;
}
#reading-toolbar .color-dot:hover {
  outline: 1px solid #9c9276;
}
.color-dot.gold {
  background: #eed681 !important;
}
.color-dot.green {
  background: #b3c9a9 !important;
}
.color-dot.rose {
  background: #e4b7bd !important;
}
.tool-divider {
  width: 1px;
  height: 21px;
  background: #e2decf;
  margin: 0 3px;
}
#word-popup {
  position: fixed;
  z-index: 190;
  background: #fbf8ee;
  border: 1px solid #d5cfbd;
  border-radius: 12px;
  box-shadow: 0 15px 55px #342b2326;
  overflow: auto;
  color: var(--ink);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.word-popup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #ded7c6;
  position: sticky;
  top: 0;
  background: #fbf8eef5;
  backdrop-filter: blur(8px);
  z-index: 2;
  font: 12px var(--serif);
  color: #7a735e;
}
.word-popup-heading > button {
  font: 22px var(--serif);
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  color: var(--ink);
  border-radius: 50%;
}
.word-popup-heading > button:hover {
  background: #e8e6d7;
}
.word-popup-content {
  padding: 18px 23px 21px;
}
.word-popup-content > h3 {
  font: 400 33px/1.08 var(--serif);
  margin: 0 0 17px;
  overflow-wrap: anywhere;
}
.word-source {
  font: 10px/1.6 var(--serif);
  color: #7f856b;
  display: block;
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}
.word-handout .prose {
  font-size: 15px;
  line-height: 1.9;
}
.word-handout p {
  margin: 9px 0;
}
.word-handout {
  padding-bottom: 17px;
}
.word-generated {
  padding-top: 14px;
  border-top: 1px solid #ded7c6;
  font: 15px/1.8 var(--serif);
}
.word-generated .phonetics {
  font:
    13px/1.8 Georgia,
    serif;
  color: #777363;
  word-break: break-word;
}
.word-generated h4 {
  font: 13px var(--serif);
  margin: 19px 0 9px;
}
.word-meaning {
  font-size: 17px;
}
.word-meaning small {
  font: italic 16px var(--serif);
  color: #777363;
}
.word-generated blockquote {
  border-left: 2px solid #b0b99a;
  margin: 17px 0;
  padding: 0 0 0 14px;
  font: 22px/1.35 var(--serif);
}
.word-generated blockquote > span {
  display: block;
  font: 14px/1.8 var(--serif);
  color: #747666;
  margin-top: 6px;
}
.word-roots > p {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  margin: 6px 0;
}
.word-roots strong {
  font: 600 22px var(--serif);
}
.word-roots span {
  font-size: 13px;
  color: #74705f;
}
.word-muted {
  font: 13px/1.8 var(--serif);
  color: #807966;
  margin: 10px 0;
}
.word-popup-actions {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 19px;
  padding-top: 13px;
}
.word-popup-actions button,
#word-retry,
.chat-retry,
.chat-copy {
  font: 12px var(--serif);
  border: 1px solid #c9c9b4;
  padding: 8px 12px;
  background: none;
  color: #536248;
  border-radius: 4px;
}
.chat-copy,
.chat-retry {
  margin-top: 13px;
}
.note-quote {
  margin: 18px 23px;
  padding: 0 0 0 12px;
  border-left: 2px solid #b6bd96;
  font: 22px/1.45 var(--serif);
  max-height: 160px;
  overflow: auto;
}
#reader-note-form {
  padding: 0 23px 23px;
}
#reader-note-text {
  width: 100%;
  resize: vertical;
  border: 1px solid #cbc8b5;
  border-radius: 6px;
  background: #fffdf5;
  padding: 12px;
  font: 16px/1.8 var(--serif);
  color: var(--ink);
}
.note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  gap: 10px;
}
.note-actions button {
  font: 12px var(--serif);
  padding: 9px 12px;
}
.note-actions > button:not(.primary) {
  background: none;
  color: #876c58;
}
.reading-notes-list {
  padding: 12px 22px 20px;
}
.saved-note {
  display: block;
  text-align: left;
  width: 100%;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
}
.saved-note blockquote {
  font: 21px/1.45 var(--serif);
  margin: 0;
}
.saved-note p {
  font: 13px/1.8 var(--serif);
  color: #79745f;
  margin: 8px 0 0;
}
.ai-panel {
  width: 420px;
  padding: 0;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 90;
  border-left: 1px solid #c9caba;
  box-shadow: -6px 0 40px #342b2310;
  display: flex;
  flex-direction: column;
  background: #f8f6ed;
}
.ai-panel[hidden] {
  display: none;
}
.ai-heading {
  padding: 21px 23px 14px;
  flex-shrink: 0;
}
.ai-heading h2 {
  font-size: 24px;
  margin-top: 5px;
}
.ai-heading .small-cap {
  font-size: 8px;
  letter-spacing: 1.8px;
}
.ai-model {
  padding: 0 23px 13px;
  margin: 0;
  border-bottom: 1px solid #daddcc;
}
.ai-scroll {
  padding: 24px 24px 16px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.ai-intro {
  padding: 4px 0 25px;
}
.ai-intro h3 {
  font-size: 23px;
  margin: 0 0 11px;
}
.ai-intro p {
  font-size: 14px;
  color: #817a66;
}
.chat-user {
  background: #e9edde;
  border: 1px solid #dce1ce;
  border-radius: 9px;
  padding: 12px 15px;
  margin: 16px 0 22px;
}
.chat-user > blockquote {
  font: 19px/1.4 var(--serif);
  padding: 0 0 0 10px;
  margin: 0 0 12px;
  border-left: 2px solid #a8b38e;
  max-height: 130px;
  overflow: auto;
  color: #6d755b;
}
.chat-user > p {
  margin: 0;
  font: 15px/1.8 var(--serif);
}
.chat-answer {
  font: 16px/1.95 var(--serif);
  margin-bottom: 27px;
}
.chat-answer blockquote {
  font-size: 20px;
}
.chat-answer table {
  font-size: 14px;
}
.chat-answer .table-scroll {
  margin: 15px 0;
}
.chat-answer td,
.chat-answer th {
  padding: 10px;
}
.chat-answer h2,
.chat-answer h3 {
  font-size: 21px;
}
#ai-form {
  flex-shrink: 0;
  padding: 14px 20px 16px;
  background: #f1f1e5;
  border-top: 1px solid #d5d8c7;
}
#ai-quote {
  margin: 0 0 12px;
  background: #e7eadb;
  border: 0;
  border-radius: 7px;
  padding: 10px 13px;
}
#ai-quote > div {
  font-size: 10px;
  color: #697756;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#ai-quote blockquote {
  max-height: 95px;
  overflow: auto;
  font: 18px/1.45 var(--serif);
  margin: 7px 0 0;
}
#clear-quote {
  background: none;
  padding: 0 6px;
  color: #697756;
  font-size: 20px;
}
.quick-prompts {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.quick-prompts button {
  flex: 1;
  padding: 7px 4px;
  border: 1px solid #cbcfbb;
  font-size: 11px;
  border-radius: 5px;
  background: #faf8ed;
}
#ai-question {
  min-height: 78px;
  max-height: 210px;
  resize: vertical;
  font: 15px/1.7 var(--serif);
  border: 1px solid #cdd0be;
  border-radius: 7px;
  padding: 12px;
  background: #fffdf6;
  width: 100%;
}
.ai-send-row {
  margin-top: 9px;
  align-items: center;
}
.ai-send-row > #ai-send {
  padding: 8px 15px;
  font-size: 13px;
  border-radius: 5px;
}
#ai-state {
  font: 10px var(--serif);
  color: #798068;
}
.ai-footnote {
  font: 10px/1.6 var(--serif);
  margin: 10px 0 0;
  color: #8a8572;
}
.ai-open #ai-launcher {
  display: none;
}
@media (min-width: 1180px) {
  .ai-open .shell {
    margin-right: 420px;
  }
  .ai-open .site-header {
    padding-right: 5%;
  }
  .ai-open .desktop-nav {
    gap: 20px;
    margin: 0;
  }
  .ai-open .desktop-nav small {
    display: none;
  }
  .ai-open .lesson-title-grid {
    gap: 6%;
    grid-template-columns: 1fr 0.85fr;
  }
  .ai-open .lesson-heading h1 {
    font-size: 47px;
  }
  .ai-open .lesson-cn {
    font-size: 21px;
  }
  .ai-open .reading-layout {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 25px;
  }
  .ai-open .reading-margin nav a {
    gap: 9px;
  }
  .ai-open .audio-player {
    grid-template-columns: 110px 125px minmax(90px, 1fr) 48px;
    gap: 10px;
    padding: 10px 13px;
  }
  .ai-open .audio-track {
    gap: 8px;
  }
  .ai-open #audio-time {
    font-size: 9px;
    min-width: 74px;
  }
  .ai-open .hero-copy h1 {
    font-size: 78px;
  }
}
#document-dialog.with-ai {
  width: calc(100vw - 465px);
  max-width: 1050px;
  margin-right: 435px;
}
#document-dialog.with-ai .ai-panel {
  position: fixed;
  top: 0;
  right: 0;
}
.document-bar {
  z-index: 30;
}
@media (max-width: 760px) {
  .audio-player {
    grid-template-columns: 1fr auto auto;
    padding: 9px 12px;
    gap: 7px 16px;
    top: 5px;
    margin-bottom: 24px;
  }
  .audio-source-wrap {
    grid-column: 1;
    grid-row: 2;
    max-width: 145px;
  }
  .audio-source-wrap select {
    font-size: 12px;
  }
  .audio-controls {
    grid-column: 2;
    grid-row: 2;
    gap: 13px;
  }
  .audio-controls > button {
    width: 32px;
    height: 32px;
  }
  .audio-controls svg {
    width: 32px;
    height: 32px;
  }
  .audio-controls > .play-button {
    width: 36px;
    height: 36px;
  }
  .audio-track {
    grid-column: 1/-1;
    grid-row: 1;
    width: auto;
    gap: 12px;
    flex-direction: row;
  }
  .audio-player #audio-speed {
    grid-column: 3;
    grid-row: 2;
    width: 47px;
    font-size: 15px;
  }
  #audio-time {
    font-size: 9px;
    min-width: 76px;
  }
  #audio-seek {
    height: 18px;
  }
  .article-gallery {
    margin-bottom: 28px;
  }
  .lead-figure img {
    height: auto;
    max-height: 370px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .gallery-grid img {
    height: auto;
    max-height: 350px;
  }
  .article-toolbar > .reader-notes-button {
    order: 0;
    margin: 0;
    font-size: 11px;
    padding: 4px 0;
  }
  .article-toolbar {
    gap: 12px;
  }
  .article-toolbar > div {
    margin: 0;
    flex: 1;
  }
  .article-toolbar h2 {
    font-size: 18px;
  }
  .article-toolbar .eyebrow {
    display: none;
  }
  .article-figure figcaption > span:last-child {
    max-width: 100%;
  }
  .ai-panel {
    width: 100vw;
    max-width: 420px;
  }
  .ai-heading {
    padding: 17px 20px 10px;
  }
  .ai-scroll {
    padding: 20px;
  }
  #ai-form {
    padding: 12px 17px 17px;
  }
  .ai-intro h3 {
    font-size: 21px;
  }
  .ai-open .shell {
    margin: 0;
  }
  #document-dialog.with-ai {
    margin: auto;
    width: 96vw;
  }
  #document-content {
    padding: 22px 19px;
  }
  .document-bar strong {
    font-size: 13px;
  }
  .document-bar {
    padding: 12px;
  }
  .syntax-legend {
    gap: 6px;
  }
  .syntax-legend span {
    font-size: 10px;
    padding: 4px 6px;
  }
  .word-popup-content {
    padding: 16px 20px;
  }
  .word-popup-heading {
    padding: 10px 16px;
  }
  .word-popup-content > h3 {
    font-size: 30px;
  }
  #reading-toolbar {
    padding: 5px 6px;
  }
  #reading-toolbar button {
    font-size: 11px;
    padding: 7px 4px;
  }
  .word-handout .prose {
    font-size: 14px;
  }
  .word-popup-actions button {
    min-height: 40px;
  }
  .note-actions button {
    min-height: 42px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #word-popup,
  #reading-toolbar,
  .ai-panel {
    animation: none;
    transition: none;
  }
}

.ai-heading > div {
  margin-right: auto;
}
.ai-heading {
  gap: 7px;
}
.ai-heading > .icon-button {
  width: 31px;
  height: 31px;
  padding: 0;
  flex-shrink: 0;
  color: #637151;
  font-size: 22px;
}
.ai-heading #ai-new {
  font-size: 20px;
}

.chat-source {
  display: block;
  font: 10px var(--serif);
  color: #7b816b;
  margin-bottom: 6px;
}

.course-cover img {
  object-position: center 35%;
}
.footer > a:last-child:not(.footer-brand) {
  font-size: 11px;
  color: #72765f;
  text-decoration: underline;
}
