:root {
  color-scheme: light;
  --topbar-height: 72px;
  --ink: #30445b;
  --muted: #718096;
  --line: #dfe7e7;
  --paper: #fffaf0;
  --panel: #ffffff;
  --blue: #43a9dd;
  --blue-dark: #267daa;
  --blue-soft: #e7f6ff;
  --green: #48a77a;
  --green-soft: #e2f7eb;
  --orange: #f39a3c;
  --orange-soft: #fff0d8;
  --yellow: #fff1a8;
  --reading-sentence-highlight: rgba(255, 229, 46, 0.22);
  --reading-selection-highlight: rgba(255, 222, 28, 0.32);
  --reading-word-highlight: rgba(255, 211, 0, 0.66);
  --wood: #a96332;
  --wood-dark: #77401f;
  --reader-bg: #f5f2e9;
  --shadow: 0 16px 36px rgba(70, 84, 96, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 7% 18%, rgba(255, 201, 102, 0.13) 0 4px, transparent 5px),
    radial-gradient(circle at 92% 34%, rgba(92, 190, 227, 0.12) 0 5px, transparent 6px),
    #fff9ec;
  background-size: 88px 88px, 120px 120px, auto;
  color: var(--ink);
  font-family: ui-rounded, "Arial Rounded MT Bold", "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.reader-open {
  --topbar-height: 0px;
  height: 100dvh;
  overflow: hidden;
  background: var(--reader-bg);
}

body.reader-open .app-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.reader-open .topbar {
  background: var(--reader-bg);
  border-bottom-color: #ded8ca;
  backdrop-filter: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(255, 250, 240, 0.94);
  border-bottom: 1px solid rgba(174, 130, 76, 0.18);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #fff0b8;
  box-shadow: inset 0 0 0 2px rgba(218, 157, 51, 0.18);
  font-size: 23px;
}

.brand-text {
  display: grid;
  line-height: 1.1;
}

.brand-title {
  color: #31546b;
  font-size: 17px;
  font-weight: 900;
}

.brand-subtitle {
  color: #7c91a0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-settings {
  position: relative;
}

.settings-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #496174;
  box-shadow: none;
}

.settings-button:hover,
.settings-button:focus-visible,
.settings-button[aria-expanded="true"] {
  background: rgba(48, 68, 91, 0.08);
  color: var(--ink);
  outline: 0;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 15px;
  width: min(330px, calc(100vw - 28px));
  max-height: calc(100dvh - 110px);
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #9aabbb #edf0f3;
  padding: 19px;
  border: 1px solid #ddd6c8;
  border-radius: 19px;
  background: #fffdf8;
  box-shadow: 0 20px 44px rgba(65, 57, 43, 0.2);
}

.settings-menu[hidden] {
  display: none;
}

.settings-menu-heading {
  display: grid;
  gap: 3px;
  padding-bottom: 11px;
  border-bottom: 1px solid #e7e0d3;
}

.settings-menu-heading strong {
  font-size: 18px;
}

.settings-menu-heading span,
.settings-tip {
  color: var(--muted);
  font-size: 12px;
}

.settings-field {
  display: grid;
  gap: 7px;
}

.settings-highlight-mode {
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-highlight-mode legend {
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 900;
}

.settings-radio-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.settings-radio-option:has(input:checked) {
  background: rgba(75, 140, 190, 0.1);
}

.settings-radio-option input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #3278a8;
}

.settings-radio-option span {
  display: grid;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
}

.settings-radio-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.settings-highlight-unavailable {
  display: block;
  margin: 3px 8px 0 34px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.settings-field > span {
  font-size: 13px;
  font-weight: 900;
}

.settings-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d9d2c4;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

.voice-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.voice-picker-row button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c8d7e5;
  border-radius: 11px;
  background: #eef6fb;
  color: #245b7d;
  font-weight: 800;
}

.voice-picker-row button:hover {
  background: #dff0fa;
}

.settings-tip {
  margin: 0;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f1eee5;
  line-height: 1.5;
}

.nav-link,
.ghost-button,
.primary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 13px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 700;
}

.nav-link,
.ghost-button,
.icon-button {
  background: #f1f4ef;
  color: var(--ink);
}

.primary-button {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 8px 18px rgba(230, 134, 43, 0.24);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #e8892d;
  transform: translateY(-1px);
}

.icon-button {
  width: 38px;
  padding: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.home-library,
.series-page {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 36px clamp(18px, 4vw, 54px) 70px;
}

.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.welcome-row h1 {
  margin: 0;
  color: #324e63;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
}

.welcome-doodle {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f0aa47;
  font-size: 25px;
}

.welcome-doodle span:nth-child(2) {
  color: #78c8e8;
  font-size: 40px;
}

.dashboard-welcome {
  align-items: center;
  margin-bottom: 27px;
}

.dashboard-welcome h1 {
  font-size: clamp(29px, 3.4vw, 42px);
}

.dashboard-welcome-note {
  margin: 10px 0 0;
  color: #718191;
  font-size: 14px;
  font-weight: 650;
}

.dashboard-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.72fr);
  gap: 20px;
  align-items: stretch;
}

.dashboard-focus-panel,
.dashboard-review-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(62, 83, 96, 0.1);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(66, 80, 88, 0.08);
}

.dashboard-panel-heading,
.dashboard-section-heading,
.dashboard-review-topline,
.dashboard-review-copy,
.dashboard-review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-panel-heading {
  margin-bottom: 14px;
}

.dashboard-panel-heading span,
.dashboard-section-heading > div > span,
.dashboard-review-topline > span {
  color: #718a80;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.dashboard-panel-heading h2,
.dashboard-section-heading h2,
.dashboard-review-copy h2 {
  margin: 3px 0 0;
  color: #304b5e;
  font-size: 22px;
  line-height: 1.15;
}

.dashboard-panel-heading small {
  color: #849189;
  font-size: 11px;
  font-weight: 750;
}

.continue-row.dashboard-continue-row {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-continue-row .continue-card {
  min-height: 184px;
  border-width: 1px;
  box-shadow: 0 8px 20px rgba(71, 91, 102, 0.08);
}

.dashboard-review-card {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 92% 8%, rgba(75, 174, 126, 0.16), transparent 28%),
    rgba(249, 253, 250, 0.94);
}

.dashboard-review-topline svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #4ba97a;
  stroke-width: 1.7;
}

.dashboard-review-copy {
  align-items: flex-end;
  flex: 1;
  padding: 25px 0 22px;
}

.dashboard-review-copy p {
  max-width: 260px;
  margin: 9px 0 0;
  color: #6f8178;
  font-size: 12px;
  line-height: 1.55;
}

.dashboard-review-count {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  border: 1px solid #d7e9df;
  border-radius: 50%;
  background: #fff;
  color: #3a8060;
}

.dashboard-review-count strong {
  font-size: 24px;
  line-height: 1;
}

.dashboard-review-count span {
  margin-top: -7px;
  color: #829289;
  font-size: 10px;
  font-weight: 800;
}

.dashboard-review-actions {
  align-items: center;
}

.dashboard-review-actions .primary-button {
  min-width: 112px;
  min-height: 40px;
}

.dashboard-review-actions .primary-button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.dashboard-review-actions > a,
.dashboard-section-heading > a,
.dashboard-words-empty a {
  color: #397a5c;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.dashboard-section-heading {
  align-items: flex-end;
  margin-bottom: 16px;
}

.dashboard-section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.dashboard-section-heading.compact {
  margin-bottom: 13px;
}

.dashboard-section-heading.compact h2 {
  font-size: 20px;
}

.dashboard-recent-words {
  padding: 19px 20px 20px;
  border: 1px solid rgba(61, 83, 96, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
}

.dashboard-word-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-word-preview {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 78px;
  padding: 8px;
  border: 1px solid #e3e9e5;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.dashboard-word-preview:hover,
.dashboard-word-preview:focus-visible {
  transform: translateY(-2px);
  border-color: #a9d2bb;
  outline: none;
}

.dashboard-word-preview-visual {
  display: grid;
  place-items: center;
  width: 58px;
  height: 60px;
  overflow: hidden;
  border-radius: 10px;
  background: #edf3ef;
  color: #4c8f6b;
  font-size: 24px;
  font-weight: 900;
}

.dashboard-word-preview-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dashboard-word-preview > span:last-child {
  display: grid;
  min-width: 0;
}

.dashboard-word-preview strong {
  overflow: hidden;
  color: #2f4e60;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-word-preview small {
  margin-top: 2px;
  color: #87958e;
  font-size: 9px;
  font-weight: 750;
}

.dashboard-word-preview em {
  overflow: hidden;
  margin-top: 5px;
  color: #64766d;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-words-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 74px;
  padding: 14px 16px;
  border-radius: 13px;
  background: #f4f7f3;
}

.dashboard-words-empty p {
  margin: 0;
  color: #74837b;
  font-size: 12px;
}

.dashboard-home-section {
  margin: 0;
}

.dashboard-home-section .dashboard-section-heading h1 {
  margin: 3px 0 0;
  color: #304b5e;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
}

.dashboard-section-heading > small {
  color: #849189;
  font-size: 11px;
  font-weight: 750;
}

.dashboard-continue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  scrollbar-width: none;
}

.dashboard-continue-grid::-webkit-scrollbar {
  display: none;
}

.dashboard-continue-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  min-height: 158px;
  padding: 12px;
  border: 1px solid rgba(55, 77, 89, 0.12);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 9px 24px rgba(59, 77, 86, 0.07);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-continue-card:hover,
.dashboard-continue-card:focus-visible {
  border-color: rgba(73, 153, 111, 0.48);
  outline: none;
  box-shadow: 0 13px 28px rgba(59, 77, 86, 0.12);
  transform: translateY(-2px);
}

.dashboard-continue-cover {
  display: block;
  min-height: 134px;
  overflow: hidden;
  border-radius: 12px;
  background: #eef2ee;
}

.dashboard-continue-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-continue-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.dashboard-continue-copy > small {
  overflow: hidden;
  color: #da832f;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-continue-copy > strong {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 12px;
  color: #2f495c;
  font-size: 14px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.dashboard-continue-copy .progress-line {
  height: 6px;
}

.dashboard-continue-copy > em {
  margin-top: 7px;
  color: #7c8a83;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.dashboard-continue-copy > b {
  margin-top: 9px;
  color: #397a5c;
  font-size: 11px;
  font-weight: 900;
}

.dashboard-reading-goal .dashboard-section-heading {
  margin-bottom: 17px;
}

.dashboard-reading-goal {
  position: relative;
}

.reading-goal-settings-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #d9e2dc;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #526a60;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.reading-goal-settings-button:hover,
.reading-goal-settings-button:focus-visible,
.reading-goal-settings-button[aria-expanded="true"] {
  border-color: #8fc4a5;
  background: #f4faf6;
  color: #317252;
  outline: none;
}

.reading-goal-settings-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.reading-goal-settings-panel {
  position: absolute;
  z-index: 12;
  top: 73px;
  right: 0;
  width: min(330px, calc(100vw - 32px));
  padding: 17px;
  border: 1px solid #dce5df;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(42, 61, 53, 0.18);
}

.reading-goal-settings-panel[hidden] {
  display: none;
}

.reading-goal-settings-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reading-goal-settings-panel > div:first-child > span {
  color: #29495a;
  font-size: 14px;
  font-weight: 900;
}

.reading-goal-settings-panel > div:first-child > button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0f3f1;
  color: #718078;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.reading-goal-settings-panel > p {
  margin: 6px 0 14px;
  color: #7b8982;
  font-size: 11px;
  line-height: 1.45;
}

.reading-goal-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.reading-goal-presets button {
  min-height: 36px;
  padding: 0 5px;
  border: 1px solid #e0e6e2;
  border-radius: 10px;
  background: #f8faf8;
  color: #64756c;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.reading-goal-presets button:hover,
.reading-goal-presets button.active {
  border-color: #7fbc99;
  background: #eaf6ef;
  color: #2f7653;
}

.reading-goal-settings-panel > label {
  display: block;
  margin: 15px 0 6px;
  color: #66766e;
  font-size: 10px;
  font-weight: 850;
}

.reading-goal-custom-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.reading-goal-custom-row input {
  width: 100%;
  height: 39px;
  padding: 0 9px;
  border: 1px solid #cfdbd4;
  border-radius: 10px;
  background: #fff;
  color: #29495a;
  font: inherit;
  font-weight: 850;
  text-align: center;
}

.reading-goal-custom-row > span {
  color: #7b8982;
  font-size: 10px;
  font-weight: 700;
}

.reading-goal-custom-row > button {
  min-height: 39px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: #203c50;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.reading-goal-card {
  overflow: hidden;
  border: 1px solid rgba(55, 77, 89, 0.11);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(59, 77, 86, 0.07);
}

.reading-goal-main {
  position: relative;
  display: grid;
  min-height: 350px;
  place-items: center;
  padding: 27px 24px 17px;
  background:
    radial-gradient(circle at 50% 92%, rgba(72, 166, 116, 0.08), transparent 32%),
    #fff;
}

.reading-goal-arc {
  display: block;
  width: min(710px, 82%);
  overflow: visible;
}

.reading-goal-track,
.reading-goal-progress {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}

.reading-goal-track {
  stroke: #e8ece9;
}

.reading-goal-progress {
  stroke: #4ca777;
  transition: stroke-dasharray 300ms ease;
}

.reading-goal-center {
  position: absolute;
  bottom: 29px;
  left: 50%;
  display: grid;
  width: min(500px, 68%);
  justify-items: center;
  transform: translateX(-50%);
  text-align: center;
}

.reading-goal-center > span {
  color: #526a79;
  font-size: 13px;
  font-weight: 850;
}

.reading-goal-center > strong {
  margin-top: 3px;
  color: #203c50;
  font-size: clamp(52px, 7vw, 78px);
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1;
}

.reading-goal-center > small {
  margin-top: 6px;
  color: #7f8b86;
  font-size: 11px;
  font-weight: 700;
}

.reading-goal-center > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(460px, 100%);
  min-height: 54px;
  margin-top: 19px;
  padding: 9px 17px;
  border-radius: 18px;
  background: #203c50;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 9px 18px rgba(32, 60, 80, 0.18);
}

.reading-goal-center > a > span,
.reading-goal-center > a > em {
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.reading-goal-center > a > b {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading-goal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 20px 28px 22px;
  border-top: 1px solid #e8ece9;
  background: #fafbf9;
}

.reading-goal-day {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  color: #88938e;
}

.reading-goal-day > span,
.reading-goal-day > small {
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.reading-goal-day > i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #dfe5e1;
  border-radius: 50%;
  background: #fff;
  color: #778680;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.reading-goal-day.is-today > i {
  border: 2px solid #4ca777;
  color: #2f7653;
}

.reading-goal-day.is-complete > i {
  border-color: #4ca777;
  background: #4ca777;
  color: #fff;
}

.reading-goal-day.is-today > span {
  color: #2f7653;
}

.wordbook-page-header {
  max-width: 670px;
  margin-top: 23px;
}

.wordbook-page-header h1 {
  margin: 0;
  color: #304b5e;
  font-size: clamp(31px, 4vw, 46px);
}

.wordbook-page-header > p:last-child {
  margin: 10px 0 0;
  color: #728279;
  font-size: 14px;
}

.wordbook-page > .home-wordbook {
  margin-top: 28px;
}

.home-section {
  margin-top: 38px;
}

.playful-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.playful-heading h2 {
  margin: 0;
  color: #314b60;
  font-size: clamp(23px, 2.5vw, 30px);
  line-height: 1.05;
}

.playful-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.heading-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  color: #fff;
  font-weight: 900;
  transform: rotate(-3deg);
}

.heading-icon-orange {
  background: var(--orange);
  box-shadow: 0 7px 0 #d97e28;
}

.heading-icon-blue {
  background: var(--blue);
  box-shadow: 0 7px 0 #2585b6;
}

.heading-icon-green {
  background: #4faa78;
  box-shadow: 0 7px 0 #37875b;
  font-size: 15px;
  letter-spacing: -0.06em;
}

.home-wordbook {
  position: relative;
  padding: clamp(18px, 2.6vw, 30px);
  border: 1px solid rgba(65, 119, 101, 0.13);
  border-radius: 28px;
  background:
    radial-gradient(circle at 96% 5%, rgba(95, 193, 143, 0.14), transparent 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(242, 249, 245, 0.96));
  box-shadow: 0 16px 34px rgba(54, 83, 70, 0.09);
}

.home-wordbook-heading {
  margin-bottom: 23px;
}

.home-wordbook-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 22px;
  align-items: start;
}

.home-wordbook-main {
  min-width: 0;
}

.home-wordbook-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(3, minmax(128px, 0.8fr));
  gap: 9px;
  margin-bottom: 13px;
}

.home-wordbook-filters > label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-wordbook-filters > label > span {
  padding-left: 3px;
  color: #6f8379;
  font-size: 10px;
  font-weight: 850;
}

.home-wordbook-filters input,
.home-wordbook-filters select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dce8e1;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  color: #334e5c;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  outline: none;
}

.home-wordbook-filters input:focus,
.home-wordbook-filters select:focus {
  border-color: #65b98d;
  box-shadow: 0 0 0 3px rgba(79, 170, 120, 0.13);
}

.home-word-search {
  position: relative;
  align-self: end;
}

.home-word-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: #738a7e;
  stroke-width: 1.8;
  pointer-events: none;
}

.home-word-search input {
  padding-left: 37px;
}

.home-wordbook-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 6px 8px 6px 12px;
  border-radius: 11px;
  background: rgba(228, 241, 234, 0.7);
}

.home-wordbook-selection-bar p {
  margin: 0;
  color: #657b70;
  font-size: 11px;
}

.home-wordbook-selection-bar p strong {
  color: #315b49;
}

.home-wordbook-selection-bar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.home-wordbook-selection-bar button,
.home-word-more {
  min-height: 29px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #477461;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.home-wordbook-selection-bar button:hover,
.home-wordbook-selection-bar button:focus-visible,
.home-word-more:hover,
.home-word-more:focus-visible {
  background: #fff;
  outline: none;
}

.home-wordbook-selection-bar button:disabled {
  cursor: default;
  opacity: 0.42;
}

.home-word-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.home-word-card {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  border: 1px solid #e0e8e3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.home-word-detail-button {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  width: 100%;
  min-height: 112px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.home-word-detail-button:focus-visible {
  outline: 2px solid rgba(68, 143, 101, 0.72);
  outline-offset: -2px;
}

.home-word-card:hover {
  transform: translateY(-2px);
  border-color: #a8d2bb;
  box-shadow: 0 8px 18px rgba(54, 88, 71, 0.1);
}

.home-word-card.is-selected {
  border-color: #54aa7d;
  box-shadow: inset 0 0 0 1px #54aa7d, 0 8px 18px rgba(54, 88, 71, 0.1);
}

.home-word-selector {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  cursor: pointer;
}

.home-word-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.home-word-check {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(60, 90, 75, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.home-word-check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: transparent;
  stroke-width: 2.5;
}

.home-word-card.is-selected .home-word-check {
  border-color: #4faa78;
  background: #4faa78;
}

.home-word-card.is-selected .home-word-check svg {
  stroke: #fff;
}

.home-word-selector:focus-within .home-word-check {
  box-shadow: 0 0 0 3px rgba(79, 170, 120, 0.18);
}

.home-word-visual {
  display: grid;
  place-items: center;
  min-height: 112px;
  overflow: hidden;
  background: linear-gradient(145deg, #dfeee6, #cfe4db);
  color: #4c8269;
  font-size: 34px;
  font-weight: 900;
}

.home-word-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-word-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 27px 10px 10px;
}

.home-word-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
}

.home-word-title strong {
  min-width: 0;
  overflow: hidden;
  color: #29495b;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-word-title em {
  color: #74877d;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.home-word-meaning {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 5px;
  color: #526b5f;
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-word-meta {
  overflow: hidden;
  margin-top: auto;
  padding-top: 7px;
  color: #91a099;
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-word-tags {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.home-word-tags small {
  max-width: 92px;
  overflow: hidden;
  padding: 2px 5px;
  border-radius: 999px;
  background: #edf5f0;
  color: #538168;
  font-size: 8px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-word-detail-dialog {
  grid-template-rows: auto minmax(0, 1fr);
}

.home-word-sense-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.home-word-sense-switcher button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d7e1e6;
  border-radius: 11px;
  background: #fff;
  color: #36556a;
  text-align: left;
}

.home-word-sense-switcher button.active {
  border-color: #7dbb9b;
  background: #f1faf5;
  box-shadow: inset 0 0 0 1px rgba(79, 170, 120, 0.18);
}

.home-word-sense-switcher span,
.home-word-sense-switcher small {
  color: #7d8f98;
  font-size: 9px;
  font-weight: 800;
}

.home-word-sense-switcher strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-word-sense-switcher {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-width: thin;
}

.reader-word-sense-switcher button {
  display: grid;
  flex: 0 0 168px;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d5e0e6;
  border-radius: 11px;
  background: #fff;
  color: #36566b;
  text-align: left;
}

.reader-word-sense-switcher button.active {
  border-color: #78b99a;
  background: #f0faf5;
  box-shadow: inset 0 0 0 1px rgba(70, 159, 112, 0.16);
}

.reader-word-sense-switcher button:hover {
  border-color: #9ac9b1;
}

.reader-word-sense-switcher span,
.reader-word-sense-switcher small {
  overflow: hidden;
  color: #7b8d97;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-word-sense-switcher strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-word-sense-switcher .reader-word-sense-add {
  border-style: dashed;
  background: #f8fafb;
}

.reader-word-sense-switcher .reader-word-sense-add > span {
  color: #4c8098;
  font-size: 16px;
  line-height: 1;
}

.home-word-detail-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
}

.word-detail-header .home-word-detail-header-actions > button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf2f4;
  color: #637783;
  cursor: pointer;
}

.word-detail-header .home-word-detail-header-actions > button:hover {
  background: #e3edf1;
  color: #31566c;
}

.word-detail-header .home-word-detail-header-actions .home-word-detail-speak {
  background: #eef7f2;
  color: #3d8060;
}

.home-word-detail-speak svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-word-other-example-refresh .refresh-arrowhead,
.occurrence-refresh-button .refresh-arrowhead {
  fill: currentColor;
  stroke: none;
}

.home-word-detail-speak svg path:first-child {
  fill: currentColor;
  stroke: none;
}

.home-word-detail-close {
  font: inherit;
  font-size: 21px;
}

.home-word-source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-word-source-heading > span {
  color: #738394;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.home-word-source-heading button,
.home-word-other-example-item > button {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eaf3f8;
  color: #416f88;
  cursor: pointer;
}

.home-word-source-heading button:hover,
.home-word-other-example-item > button:hover {
  background: #dcecf4;
  color: #275c77;
}

.home-word-source-heading svg,
.home-word-other-example-item svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.home-word-other-examples {
  overflow: hidden;
  border: 1px solid #d5e1e9;
  border-radius: 10px;
  background: #fbfdff;
}

.home-word-confirmed-examples {
  overflow: hidden;
  border: 1px solid #d5e1e9;
  border-radius: 10px;
  background: #fbfdff;
}

.home-word-confirmed-examples > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border-bottom: 1px solid #e1e9ee;
}

.home-word-confirmed-examples > header > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.home-word-confirmed-examples > header strong {
  color: #31566c;
  font-size: 12px;
}

.home-word-confirmed-examples > header em {
  color: #7d8e9a;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.home-word-confirmed-example-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.home-word-other-examples > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

.home-word-other-examples > summary::-webkit-details-marker {
  display: none;
}

.home-word-other-examples > summary .home-word-summary-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.home-word-summary-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.home-word-other-examples > summary strong {
  color: #31566c;
  font-size: 12px;
}

.home-word-other-examples > summary em {
  color: #7d8e9a;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.home-word-other-examples > summary .home-word-summary-chevron {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #668194;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.home-word-other-examples[open] > summary .home-word-summary-chevron {
  transform: rotate(180deg);
}

.home-word-other-example-body {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid #e1e9ee;
}

.occurrence-context-section {
  display: grid;
  gap: 8px;
  padding-top: 3px;
}

.occurrence-context-section + .occurrence-context-section {
  margin-top: 3px;
  padding-top: 11px;
  border-top: 1px solid #e4ebef;
}

.occurrence-context-section > h3 {
  margin: 0;
  color: #31566c;
  font-size: 11px;
  font-weight: 900;
}

.home-word-other-example-group {
  display: grid;
  gap: 6px;
}

.home-word-other-example-group h3,
.home-word-other-example-group h4 {
  margin: 0;
  color: #668092;
  font-size: 10px;
  font-weight: 900;
}

.home-word-other-example-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f2f7fa;
}

.home-word-other-example-item > div {
  min-width: 0;
}

.home-word-other-example-item > .occurrence-example-image {
  flex: 0 0 74px;
}

.home-word-other-example-item p {
  margin: 0;
  color: #304b5f;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.home-word-other-example-item mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #fff0a6;
  color: inherit;
}

.home-word-other-example-item small {
  color: #81919d;
  font-size: 9px;
  font-weight: 750;
}

.home-word-other-example-item.is-accepted small {
  color: #438060;
}

.home-word-other-example-item.is-other-sense {
  opacity: 0.72;
}

.home-occurrence-saved {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #dff4e9;
  color: #18815a;
  font-size: 13px;
  font-weight: 900;
}

.home-word-other-example-status {
  margin: 0;
  color: #718594;
  font-size: 10px;
}

.home-word-other-example-status.is-error {
  color: #a65e55;
}

.home-word-other-example-refresh {
  display: grid;
  width: 30px;
  height: 30px;
  justify-self: end;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: #e8f1f7;
  color: #42677d;
}

.home-word-summary-actions .home-word-other-example-refresh {
  width: 28px;
  height: 28px;
}

.home-word-other-example-refresh svg,
.occurrence-refresh-button svg,
.home-word-other-example-refresh img,
.occurrence-refresh-button img {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-word-other-example-refresh:hover,
.occurrence-refresh-button:hover {
  background: #dceaf3;
  color: #315f78;
}

.home-word-other-example-refresh:disabled,
.occurrence-refresh-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.home-word-other-example-refresh:disabled svg,
.occurrence-refresh-button:disabled svg {
  animation: wordbookSpin 800ms linear infinite;
}

.home-word-surface-form {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: #eef4f1;
  color: #31566c;
  font-size: 13px;
  font-weight: 800;
}

.home-word-surface-form span {
  color: #7a8c98;
  font-size: 9px;
  font-weight: 900;
}

.home-word-more {
  display: block;
  margin: 13px auto 0;
  background: #edf5f0;
}

.home-game-picker {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 9px;
  padding: 15px;
  border-radius: 18px;
  background: #273f50;
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 57, 70, 0.18);
}

.home-game-picker-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 2px;
}

.home-game-picker-heading > span {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: #f4b04d;
  color: #263f50;
  font-size: 19px;
}

.home-game-picker-heading strong,
.home-game-picker-heading small {
  display: block;
}

.home-game-picker-heading strong {
  font-size: 16px;
}

.home-game-picker-heading small {
  margin-top: 2px;
  color: #b9c9d2;
  font-size: 10px;
}

.home-game-card {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 73px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.home-game-card:hover,
.home-game-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.home-game-card:disabled {
  cursor: default;
  opacity: 0.43;
}

.home-game-card-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  background: #e99b43;
}

.game-match .home-game-card-icon {
  background: #4eaf83;
}

.home-game-card svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.home-game-card strong,
.home-game-card small {
  display: block;
}

.home-game-card strong {
  font-size: 12px;
}

.home-game-card small {
  margin-top: 3px;
  color: #c5d2d9;
  font-size: 9px;
  line-height: 1.35;
}

.home-game-card em {
  color: #9fb4bf;
  font-size: 17px;
  font-style: normal;
}

.home-game-requirement,
.home-game-notice {
  margin: 1px 2px 0;
  color: #c2d0d7;
  font-size: 9px;
  line-height: 1.45;
}

.home-game-notice {
  padding: 7px;
  border-radius: 8px;
  background: rgba(239, 173, 63, 0.16);
  color: #ffd995;
}

.home-game-next {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #8fa5b0;
  font-size: 8px;
  line-height: 1.45;
}

.home-wordbook-loading,
.home-wordbook-empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 24px;
  border: 1px dashed #c9ddd2;
  border-radius: 16px;
  color: #678074;
  text-align: center;
}

.home-wordbook-loading span {
  width: 30px;
  height: 30px;
  border: 3px solid #d9ebe1;
  border-top-color: #4faa78;
  border-radius: 50%;
  animation: wordbookSpin 800ms linear infinite;
}

.home-wordbook-loading p,
.home-wordbook-empty p {
  margin: 8px 0 0;
  font-size: 12px;
}

.home-wordbook-empty.compact {
  min-height: 112px;
}

@keyframes wordbookSpin {
  to { transform: rotate(360deg); }
}

.home-game-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background: rgba(22, 36, 45, 0.72);
  backdrop-filter: blur(8px);
}

.home-game-dialog {
  position: relative;
  width: min(860px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  background: #f8f8f3;
  box-shadow: 0 28px 70px rgba(18, 29, 37, 0.3);
}

.home-game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 36px;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 12px 18px 12px 22px;
  border-bottom: 1px solid #e3e7e2;
  background: #fff;
}

.home-game-header span {
  color: #4faa78;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.home-game-header h2 {
  margin: 2px 0 0;
  color: #29495b;
  font-size: 20px;
}

.home-game-score,
.home-game-round {
  display: grid;
  place-items: center;
  min-width: 56px;
  color: #5e7268;
  font-size: 11px;
}

.home-game-score strong {
  color: #e5872d;
  font-size: 19px;
}

.home-game-score span {
  color: #839289;
  font-size: 8px;
  letter-spacing: 0;
}

.home-game-round {
  min-height: 31px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf3ef;
  font-weight: 850;
}

.home-game-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf1ee;
  color: #526c5f;
  cursor: pointer;
}

.home-game-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.word-choice-progress {
  height: 4px;
  background: #e6ebe7;
}

.word-choice-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4faa78, #78c7a0);
  transition: width 180ms ease;
}

.word-choice-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 26px;
  align-items: center;
  padding: 28px;
}

.word-choice-stage figure {
  margin: 0;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: 18px;
  background: #e7eee9;
  box-shadow: 0 13px 30px rgba(57, 79, 67, 0.14);
}

.word-choice-stage figure img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.word-choice-stage figcaption {
  padding: 7px 10px 3px;
  color: #86958d;
  font-size: 9px;
  text-align: center;
}

.word-choice-question > p {
  margin: 0 0 14px;
  color: #354f5e;
  font-size: 17px;
  font-weight: 850;
}

.word-choice-options {
  display: grid;
  gap: 8px;
}

.word-choice-options button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 53px;
  padding: 7px 12px;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #fff;
  color: #314e5d;
  text-align: left;
  cursor: pointer;
}

.word-choice-options button:hover:not(:disabled),
.word-choice-options button:focus-visible:not(:disabled) {
  border-color: #76b996;
  outline: 3px solid rgba(79, 170, 120, 0.11);
}

.word-choice-options button > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #edf3ef;
  color: #6b7f75;
  font-size: 11px;
  font-weight: 900;
}

.word-choice-options button strong {
  font-size: 14px;
}

.word-choice-options button.is-correct {
  border-color: #4faa78;
  background: #e8f6ee;
}

.word-choice-options button.is-correct > span {
  background: #4faa78;
  color: #fff;
}

.word-choice-options button.is-wrong {
  border-color: #dc7b72;
  background: #fff0ed;
}

.word-choice-options button.is-wrong > span {
  background: #d96b62;
  color: #fff;
}

.word-choice-feedback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 12px;
  background: #e8f6ee;
  color: #3d7558;
}

.word-choice-feedback.is-wrong {
  background: #fff0ed;
  color: #9a514b;
}

.word-choice-feedback strong,
.word-choice-feedback span {
  display: block;
}

.word-choice-feedback strong {
  font-size: 12px;
}

.word-choice-feedback span {
  font-size: 9px;
}

.word-choice-feedback button {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: #3e805e;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.match-dialog {
  width: min(920px, 100%);
}

.word-match-instruction {
  margin: 17px 20px 0;
  color: #6f7f77;
  font-size: 11px;
  text-align: center;
}

.word-match-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.72fr);
  gap: 150px;
  padding: 20px 35px 14px;
}

.word-match-lines {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.word-match-lines path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.word-match-images,
.word-match-words {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.word-match-images button,
.word-match-words button {
  position: relative;
  height: 132px;
  min-height: 132px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 16px rgba(45, 65, 54, 0.09);
  cursor: pointer;
}

.word-match-images button {
  padding: 8px;
  background: #f4f6f2;
}

.word-match-images img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.word-match-images button > span {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: rgba(39, 63, 80, 0.86);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.word-match-words button {
  display: grid;
  place-items: center;
  align-content: center;
  padding: 12px;
  color: #29495b;
}

.word-match-words strong {
  font-size: 16px;
}

.word-match-words small {
  margin-top: 3px;
  color: #819188;
  font-size: 9px;
}

.word-match-images button.is-active,
.word-match-words button.is-active {
  border-color: #e89d42;
  box-shadow: 0 0 0 3px rgba(232, 157, 66, 0.18);
}

.word-match-images button.is-matched,
.word-match-words button.is-matched {
  border-color: #55aa74;
  opacity: 0.82;
}

.word-match-images button.is-wrong,
.word-match-words button.is-wrong {
  border-color: #d96861;
  animation: wordMatchShake 280ms ease;
}

@keyframes wordMatchShake {
  33% { transform: translateX(-4px); }
  66% { transform: translateX(4px); }
}

.word-match-status {
  min-height: 34px;
  margin: 0 20px 18px;
  color: #587064;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.result-dialog {
  display: grid;
  justify-items: center;
  width: min(480px, 100%);
  padding: 44px 28px 36px;
  text-align: center;
}

.result-dialog .home-game-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.word-game-result-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: #f5b74f;
  color: #fff;
  font-size: 34px;
  transform: rotate(-4deg);
  box-shadow: 0 7px 0 #d99031;
}

.result-dialog > span {
  color: #4faa78;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-dialog h2 {
  margin: 5px 0 10px;
  color: #29495b;
}

.word-game-result-score {
  color: #e5872d;
  font-size: 42px;
}

.result-dialog p {
  margin: 7px 0 20px;
  color: #6e8177;
  font-size: 13px;
}

.result-dialog > div:last-child {
  display: flex;
  gap: 8px;
}

.result-dialog > div:last-child button {
  min-height: 40px;
}

.continue-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.continue-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 20px;
  min-height: 176px;
  padding: 15px;
  overflow: hidden;
  border: 2px solid rgba(76, 159, 189, 0.13);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(71, 91, 102, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.continue-card:hover,
.continue-card:focus-visible {
  transform: translateY(-4px) rotate(-0.3deg);
  box-shadow: var(--shadow);
  outline: 3px solid rgba(67, 169, 221, 0.2);
}

.continue-cover {
  overflow: hidden;
  border-radius: 13px;
  background: #e4eef1;
  box-shadow: 0 8px 16px rgba(44, 67, 79, 0.16);
}

.continue-cover img,
.single-shelf-cover img,
.series-book-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.continue-info {
  align-self: center;
  min-width: 0;
}

.continue-series {
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.continue-info h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 13px;
  font-size: 18px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.progress-line {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7ece8;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60c58e, #83dca8);
}

.continue-info p {
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.resume-label,
.series-book-action {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.continue-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 132px;
  padding: 22px 25px;
  border: 2px dashed #e8bf81;
  border-radius: 22px;
  background: rgba(255, 247, 222, 0.82);
}

.continue-empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.continue-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-sparkles {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff;
  color: #efad3f;
  font-size: 28px;
  transform: rotate(-5deg);
}

.shelf-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: clamp(18px, 3vw, 38px);
  padding: 10px 22px 0;
}

.shelf-item {
  display: grid;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease;
}

.shelf-item:hover,
.shelf-item:focus-visible {
  transform: translateY(-8px);
  outline: none;
}

.shelf-cover-area {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 244px;
  padding: 18px 10px 0;
  border-radius: 90px 90px 20px 20px;
}

.series-mint .shelf-cover-area {
  background: linear-gradient(180deg, rgba(204, 242, 220, 0.72), rgba(232, 247, 228, 0.2));
}

.series-sky .shelf-cover-area {
  background: linear-gradient(180deg, rgba(201, 235, 249, 0.75), rgba(229, 244, 250, 0.18));
}

.series-sun .shelf-cover-area {
  background: linear-gradient(180deg, rgba(253, 231, 180, 0.75), rgba(255, 243, 214, 0.18));
}

.cover-stack {
  position: relative;
  width: 172px;
  height: 218px;
}

.stack-cover {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: block;
  width: 132px;
  height: 188px;
  object-fit: cover;
  border: 5px solid #fff;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 23px rgba(49, 68, 79, 0.23);
  transform-origin: bottom center;
}

.stack-cover-1 {
  z-index: 1;
  transform: translateX(-73%) rotate(-10deg);
}

.stack-cover-2 {
  z-index: 2;
  transform: translateX(-27%) rotate(9deg);
}

.stack-cover-3 {
  z-index: 3;
  transform: translateX(-50%) rotate(0deg);
}

.cover-stack:has(.stack-cover:nth-child(3)) .stack-cover-1 {
  transform: translateX(-82%) rotate(-11deg);
}

.cover-stack:has(.stack-cover:nth-child(3)) .stack-cover-2 {
  transform: translateX(-18%) rotate(10deg);
}

.cover-stack:has(.stack-cover:nth-child(3)) .stack-cover-3 {
  transform: translateX(-50%);
}

.book-count {
  position: absolute;
  right: 9px;
  bottom: 9px;
  z-index: 5;
  padding: 6px 10px;
  border: 3px solid #fff;
  border-radius: 99px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(94, 74, 50, 0.18);
}

.shelf-label {
  padding: 16px 7px 12px;
  text-align: center;
}

.shelf-label h3 {
  margin: 0 0 5px;
  font-size: 19px;
}

.shelf-label p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shelf-label > span {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.single-shelf-cover {
  align-self: end;
  width: min(150px, 100%);
  height: 214px;
  margin: 0 auto;
  overflow: hidden;
  border: 6px solid #fff;
  border-radius: 10px;
  box-shadow: 0 12px 23px rgba(49, 68, 79, 0.22);
}

.wood-shelf {
  position: relative;
  z-index: 2;
  height: 25px;
  border-radius: 7px 7px 11px 11px;
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(87, 42, 18, 0.12) 6.5% 7%, transparent 7.5% 35%, rgba(87, 42, 18, 0.13) 35.5% 36%, transparent 36.5%),
    linear-gradient(180deg, #c47a42 0%, var(--wood) 62%, #8a4d26 100%);
  box-shadow: 0 9px 0 var(--wood-dark), 0 15px 18px rgba(80, 49, 25, 0.2);
}

.wood-shelf span::before,
.wood-shelf span::after {
  content: "";
  position: absolute;
  top: 25px;
  width: 58px;
  height: 21px;
  border-radius: 0 0 9px 9px;
  background: #77401f;
}

.wood-shelf span::before { left: 7%; }
.wood-shelf span::after { right: 7%; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  color: var(--blue-dark);
  text-decoration: none;
  font-weight: 900;
}

.series-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 40px;
  min-height: 300px;
  padding: 34px clamp(25px, 5vw, 62px);
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(135deg, #dff4eb, #f5f5d8);
}

.series-sky .series-hero {
  background: linear-gradient(135deg, #d9f0fb, #eee7ff);
}

.series-sun .series-hero {
  background: linear-gradient(135deg, #fdf3d8, #ffe9c7);
}

.series-hero h1 {
  margin: 0 0 5px;
  color: #294b61;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1;
}

.series-zh {
  margin: 0 0 18px;
  color: var(--orange);
  font-size: 20px;
  font-weight: 900;
}

.series-description {
  max-width: 500px;
  margin: 0;
  color: #587083;
  font-size: 17px;
  line-height: 1.7;
}

.cover-stack-large {
  width: 250px;
  height: 245px;
  margin: 0 auto;
}

.cover-stack-large .stack-cover {
  width: 154px;
  height: 220px;
}

.series-books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 34px;
}

.series-book-card {
  position: relative;
  display: grid;
  justify-items: start;
  padding: 17px 17px 22px;
  border: 2px solid rgba(70, 121, 143, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(67, 88, 99, 0.09);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.series-book-card:hover,
.series-book-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  outline: 3px solid rgba(67, 169, 221, 0.2);
}

.series-book-number {
  position: absolute;
  top: 27px;
  left: 28px;
  z-index: 2;
  padding: 6px 9px;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.series-book-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 14px;
  background: #e2ebed;
}

.series-book-card h2 {
  margin: 17px 0 8px;
  font-size: 19px;
  line-height: 1.28;
}

.series-book-card p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.library-search {
  position: relative;
  z-index: 30;
  min-width: 0;
}

.library-search-home {
  width: min(820px, 100%);
  margin: 0 auto 28px;
}

.library-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 5px 6px 5px 15px;
  border: 1px solid rgba(201, 207, 205, 0.96);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 28px rgba(54, 66, 69, 0.09);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.library-search-form:focus-within {
  border-color: rgba(55, 124, 114, 0.72);
  box-shadow: 0 10px 30px rgba(46, 104, 96, 0.14), 0 0 0 3px rgba(55, 124, 114, 0.1);
}

.library-search-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: #55706d;
  fill: currentColor;
}

.library-search-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.library-search-form input::placeholder {
  color: #8a9694;
}

.library-search-form input::-webkit-search-decoration,
.library-search-form input::-webkit-search-cancel-button,
.library-search-form input::-webkit-search-results-button,
.library-search-form input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

.library-search-form input::-ms-clear,
.library-search-form input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.library-search-clear,
.library-search-submit {
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
}

.library-search-clear {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: #7c8987;
  font-size: 22px;
  line-height: 1;
}

.library-search-clear:hover,
.library-search-clear:focus-visible {
  background: #eef2f1;
  color: var(--ink);
  outline: 0;
}

.library-search-submit {
  min-width: 62px;
  height: 36px;
  border-radius: 11px;
  background: #347d72;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.library-search-submit:hover,
.library-search-submit:focus-visible {
  background: #28685f;
  outline: 0;
}

.library-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(620px, calc(100vw - 32px));
  max-width: calc(100vw - 24px);
  max-height: min(540px, calc(100dvh - 72px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(204, 211, 209, 0.98);
  border-radius: 16px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(37, 51, 54, 0.2);
}

.library-search-home .library-search-results {
  width: 100%;
}

.library-search-reader .library-search-results {
  left: 0;
  width: min(620px, calc(100vw - 24px));
  transform: none;
}

.library-search-status {
  margin: 0;
  padding: 22px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.library-search-status.is-error {
  color: #a84e46;
}

.library-search-results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px 9px;
  color: #667572;
  font-size: 12px;
}

.library-search-results-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.library-search-result-list {
  display: grid;
  gap: 4px;
}

.library-search-result {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.library-search-result:hover,
.library-search-result:focus-visible {
  border-color: #d6e2df;
  background: #f4f8f7;
  outline: 0;
}

.library-search-result.is-preferred {
  border-color: rgba(69, 139, 127, 0.2);
  background: rgba(226, 241, 237, 0.56);
}

.library-search-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.library-search-result-meta b,
.library-search-result-meta em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  background: #dceeea;
  color: #28685f;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.library-search-result-meta em {
  background: #f0f1ef;
  color: #66716f;
}

.library-search-result-meta small {
  overflow: hidden;
  color: #7e8987;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.library-search-result > strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-search-result > span:last-child:not(.library-search-result-meta) {
  display: -webkit-box;
  overflow: hidden;
  color: #667572;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-pane-width, 390px);
  gap: 0;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--reader-bg);
}

.reader.side-pane-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.reader.side-pane-collapsed .book-pane {
  border-right: 0;
}

.book-pane {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid #ded8ca;
  background: var(--reader-bg);
}

.reader-toolbar {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(220px, 340px) auto auto auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 7px 10px 7px 14px;
  border-bottom: 1px solid #ded8ca;
  background: var(--reader-bg);
}

.library-search-reader {
  width: 100%;
}

.library-search-reader .library-search-form {
  min-height: 40px;
  padding: 2px 4px 2px 11px;
  border-radius: 13px;
  box-shadow: none;
}

.library-search-reader .library-search-icon {
  width: 18px;
  height: 18px;
}

.library-search-reader .library-search-form input {
  height: 34px;
  font-size: 13px;
}

.library-search-reader .library-search-submit {
  min-width: 52px;
  height: 32px;
}

.reader-title {
  min-width: 0;
}

.reader-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 850;
}

.reader-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.reader-line-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: transparent;
  color: #53687a;
  text-decoration: none;
}

.reader-line-button:hover,
.reader-line-button:focus-visible {
  background: rgba(48, 68, 91, 0.08);
  color: var(--ink);
  outline: 0;
}

.reader-line-icon,
.page-jump-chevron,
.player-play-icon,
.player-pause-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-toolbar-image-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.reader-dictionary-image-icon {
  width: 21px;
  height: 21px;
}

.audio-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.reader-audio-tools {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: min(520px, 52vw);
  min-width: 40px;
  max-width: min(520px, 52vw);
  overflow: visible;
  transition: none;
}

.reader-audio-element {
  display: none;
}

.picture-book-player {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  width: 330px;
  min-width: 40px;
  height: 40px;
  overflow: visible;
  border: 1px solid rgba(209, 217, 222, 0.95);
  border-radius: 16px;
  padding: 4px 8px 4px 4px;
  background: rgba(255, 253, 247, 0.97);
  box-shadow: 0 5px 16px rgba(51, 64, 75, 0.1);
}

.picture-book-controls {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  opacity: 1;
  visibility: visible;
}

@container (max-width: 1000px) {
  .reader-toolbar {
    grid-template-columns: minmax(170px, 1fr) minmax(205px, 260px) 124px auto;
  }

  .reader-title {
    display: none;
  }

  .library-search-reader .library-search-submit {
    display: none;
  }

  .reader-toolbar .toolbar-page-jump {
    width: 124px;
    min-width: 124px;
  }

  .reader-toolbar .toolbar-page-jump .page-jump-control {
    justify-content: center;
  }

  .reader-toolbar .toolbar-page-jump .page-total {
    display: none;
  }

  .reader-audio-tools {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .picture-book-player {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .picture-book-controls {
    position: static;
    z-index: auto;
    top: auto;
    left: auto;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .reader-toolbar .reader-audio-tools .audio-time-jump {
    display: none;
  }

  .picture-book-player > .picture-book-time,
  .picture-book-player > .picture-book-progress,
  .picture-book-player > .picture-book-volume {
    display: initial;
  }
}

.picture-book-play,
.picture-book-volume {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.picture-book-play {
  padding: 0;
  background: transparent;
  color: #4e6477;
  box-shadow: none;
}

.picture-book-play.is-playing {
  padding: 0;
  background: rgba(48, 68, 91, 0.08);
  color: var(--blue-dark);
}

.player-pause-icon {
  display: none;
}

.picture-book-play.is-playing .player-play-icon {
  display: none;
}

.picture-book-play.is-playing .player-pause-icon {
  display: block;
}

.picture-book-volume {
  background: transparent;
  color: var(--blue);
}

.volume-line-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.volume-line-icon-muted {
  display: none;
}

.picture-book-volume.is-muted .volume-line-icon-on {
  display: none;
}

.picture-book-volume.is-muted .volume-line-icon-muted {
  display: block;
}

.picture-book-play:hover,
.picture-book-play:focus-visible,
.picture-book-volume:hover,
.picture-book-volume:focus-visible {
  transform: none;
  outline: 2px solid rgba(66, 153, 204, 0.23);
  outline-offset: 1px;
}

.picture-book-time {
  flex: 0 0 auto;
  min-width: 31px;
  color: #485d72;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.picture-book-progress {
  --audio-progress: 0%;
  flex: 1 1 auto;
  min-width: 70px;
  height: 18px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.picture-book-progress::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f49a3e 0 var(--audio-progress), #dbe5ec var(--audio-progress) 100%);
}

.picture-book-progress::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border: 3px solid #fff;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #f28b28;
  box-shadow: 0 2px 7px rgba(134, 81, 27, 0.34);
}

.picture-book-progress::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: #dbe5ec;
}

.picture-book-progress::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: #f49a3e;
}

.picture-book-progress::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #f28b28;
  box-shadow: 0 2px 7px rgba(134, 81, 27, 0.34);
}

.audio-time-jump {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.audio-time-jump label {
  display: flex;
  align-items: center;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.audio-time-jump input {
  width: 65px;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 4px 0 8px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.audio-time-jump em {
  padding-right: 7px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.audio-time-jump button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  padding: 0;
  background: transparent;
  color: #53687a;
  cursor: pointer;
}

.audio-time-jump button:hover,
.audio-time-jump button:focus-visible {
  background: #d9edfa;
}

.dictionary-aa-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.45;
}

.dictionary-aa-icon text {
  fill: currentColor;
  stroke: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8.7px;
  font-weight: 500;
  letter-spacing: -0.6px;
}

.storybook-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 20px 22px 12px;
  background: var(--reader-bg);
}

.page-turn-button {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 36px;
  height: 58px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.34);
  color: rgba(48, 68, 91, 0.48);
  transform: translateY(-50%);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
  backdrop-filter: blur(5px);
}

.page-turn-previous {
  left: 12px;
}

.page-turn-next {
  right: 12px;
}

.page-turn-button:hover,
.page-turn-button:focus-visible {
  border-color: rgba(149, 165, 176, 0.42);
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  outline: 0;
}

.page-turn-button:disabled {
  opacity: 0;
  pointer-events: none;
}

.page-turn-button .reader-line-icon {
  width: 24px;
  height: 24px;
}

.page-stage {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

/* A page shown larger than the stage (fit-width or a zoom step) must be
   scrollable instead of clipped, and it aligns to the top so the reader can pan
   down the page. */
.page-stage.is-page-zoomed {
  overflow: auto;
  place-items: start center;
  padding: 10px 0;
}

.settings-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-zoom button {
  min-width: 28px;
  padding: 2px 6px;
}

/* The spread and its shells are sized by the reader's layout algorithm, never by
   a percentage clamp: the leaves can differ in width (a double-page plate beside
   an interior page), and a `max-width`/`max-height` here would shrink the frame
   while the content inside kept drawing at the size the layout asked for, which
   both distorts the page and clips it. Overflow is the stage's decision. */
.page-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  place-items: center;
  width: 1px;
  height: 1px;
}

.page-spread.is-spread {
  grid-template-columns: repeat(2, auto);
  gap: 14px;
}

.page-shell {
  position: relative;
  width: 1px;
  height: 1px;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 18px 38px rgba(65, 57, 43, 0.18);
  overflow: hidden;
}

.page-shell-secondary[hidden] {
  display: none;
}

.page-content {
  position: absolute;
  width: 100%;
  height: 100%;
}

/* `display: block` below would override the `hidden` attribute, so a page surface
   that is not the active one needs its own rule.  Without it a PDF-display book
   shows a broken image and its alt text over the page while it renders. */
.book-page-image[hidden] {
  display: none;
}
.book-page-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/*
 * PDF direct-render surface.
 *
 * The canvas keeps the canonical OCR frame as its intrinsic size -- the same
 * pixel frame the pre-generated PNG would have had -- so every existing
 * percentage-based OCR box, mark and screenshot coordinate keeps working
 * unchanged. `object-fit: contain` only absorbs the difference between that
 * frame's aspect ratio and the CSS box.
 */
.book-page-pdf-canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  /* The canvas holds exactly the canonical frame, and the reader sizes its box to
     that frame; the box is then fit to the stage, so no scaling filter is added. */
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
}

.book-page-pdf-canvas[hidden] {
  display: none;
}

.page-content.is-page-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    linear-gradient(100deg, rgba(244, 241, 234, 0.9) 30%, rgba(255, 255, 255, 0.85) 50%, rgba(244, 241, 234, 0.9) 70%);
  background-size: 220% 100%;
  animation: pageLoadingSweep 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pageLoadingSweep {
  0% {
    background-position: 140% 0;
  }
  100% {
    background-position: -40% 0;
  }
}

.page-render-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fdfbf6;
  color: #4a3f31;
  text-align: center;
}

.page-render-error strong {
  font-size: 15px;
}

.page-render-error span {
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.6;
  color: #7a6b57;
}

.page-render-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.page-render-error-actions button {
  padding: 6px 14px;
  border: 1px solid #d9cfbc;
  border-radius: 999px;
  background: #fff;
  color: #4a3f31;
  cursor: pointer;
}

.page-render-error-actions button:hover {
  border-color: #b9ab92;
}

/* Which surface the reader is really showing, so a fallback is never silent. */
.page-shell[data-page-mode]::after {
  content: attr(data-page-mode);
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 7;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(20, 35, 45, 0.42);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.page-shell[data-page-mode="png"]::after,
.page-shell[data-page-mode="png-fallback"]::after {
  display: none;
}

.ocr-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.ocr-layer:not(.active) {
  opacity: 0.58;
}

.ocr-line {
  position: absolute;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  /* The box is positioned and sized as a percentage of the printed word's own
     bbox.  Without this the user agent's default button padding and content-box
     sizing are added on top, so every click box is a dozen pixels wider than the
     word it stands for -- 30 page units on a phone-width page, which is enough for
     a click near a word to land on its neighbour. */
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

.ocr-line:hover {
  background: transparent;
  box-shadow: none;
  outline: none;
}

.ocr-line:focus-visible {
  background: transparent;
  box-shadow: none;
  outline: 2px dashed rgba(36, 91, 125, 0.35);
  outline-offset: 1px;
}

.ocr-line.has-audio,
.ocr-line.needs-review {
  background: transparent;
  box-shadow: none;
}

.reader.review-mode .ocr-line.needs-review {
  background: rgba(245, 158, 11, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(217, 119, 6, 0.68),
    0 0 0 2px rgba(251, 191, 36, 0.26);
}

.reader.review-mode .ocr-line.needs-review:hover,
.reader.review-mode .ocr-line.needs-review:focus-visible {
  background: rgba(245, 158, 11, 0.5);
  box-shadow:
    inset 0 0 0 2px rgba(180, 83, 9, 0.82),
    0 0 0 3px rgba(251, 191, 36, 0.35);
}

.ocr-word {
  border-radius: 3px;
  transition:
    background-color 90ms linear,
    border-radius 90ms linear;
}

.ocr-word.is-notebook-marked::after,
.ocr-word.is-notebook-pending::after,
.ocr-word.is-notebook-global::after {
  content: "";
  position: absolute;
  z-index: 5;
  right: 2%;
  bottom: -1px;
  left: 2%;
  border-bottom: clamp(1.5px, 0.16vw, 3px) solid var(--notebook-mark-color, rgba(13, 148, 136, 0.9));
  border-radius: 999px;
  pointer-events: none;
}

.ocr-word.is-notebook-global::after {
  right: 6%;
  left: 6%;
  border-bottom-width: clamp(1px, 0.12vw, 2px);
  opacity: 0.82;
}

.ocr-word.is-notebook-pending::after {
  border-bottom-style: dashed;
  opacity: 0.72;
}

.ocr-line.is-sentence-selected,
.ocr-line.is-sentence-selected.has-audio,
.ocr-line.is-sentence-selected.needs-review {
  z-index: 3;
  border-radius: 1px;
  background: var(--reading-selection-highlight);
  box-shadow: none;
}

.ocr-word.is-playing-sentence,
.ocr-word.is-playing-sentence.is-sentence-selected,
.ocr-word.is-playing-sentence.is-sentence-selected.has-audio,
.ocr-word.is-playing-sentence.is-sentence-selected.needs-review {
  z-index: 3;
  border-radius: 1px;
  background: var(--reading-sentence-highlight);
  box-shadow: none;
}

.ocr-word.is-current-word,
.ocr-word.is-current-word.is-sentence-selected,
.ocr-word.is-current-word.is-sentence-selected.has-audio,
.ocr-word.is-current-word.is-sentence-selected.needs-review {
  z-index: 4;
  border-radius: 1px;
  background: var(--reading-word-highlight);
  box-shadow: none;
}

.ocr-line.is-drag-selected,
.ocr-line.is-drag-selected.has-audio,
.ocr-line.is-drag-selected.needs-review {
  z-index: 4;
  border-radius: 1px;
  background: var(--reading-selection-highlight);
  box-shadow: none;
}

.ocr-layer.is-drag-selecting {
  cursor: grabbing;
}

@keyframes wordPulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.sentence-box {
  border-radius: 3px;
  transform: scale(1.04, 1.14);
  transform-origin: center;
}

.mark-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;
  cursor: crosshair;
}

.phrase-screenshot-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(20, 35, 45, 0.16);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.phrase-screenshot-layer[hidden] {
  display: none;
}

.phrase-screenshot-box {
  position: absolute;
  z-index: 1;
  border: 3px dashed #fff;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 9999px rgba(13, 29, 39, 0.28), 0 0 0 2px #e8873f;
  pointer-events: none;
}

.phrase-screenshot-box[hidden] {
  display: none;
}

.reader.screenshot-capture-mode .page-shell {
  box-shadow: 0 0 0 3px rgba(232, 135, 63, 0.72), 0 18px 38px rgba(65, 57, 43, 0.2);
}

.page-control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  max-width: 100%;
  overflow: visible;
  padding: 6px 22px 8px;
  border-top: 1px solid #ded8ca;
  background: var(--reader-bg);
}

.page-slider {
  width: min(720px, 100%);
  height: 8px;
  margin: 0;
  border-radius: 999px;
  accent-color: var(--orange);
  cursor: pointer;
}

.page-jump-menu {
  position: relative;
  z-index: 12;
}

.toolbar-page-jump {
  width: 144px;
  min-width: 144px;
}

.page-jump-control {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  color: #556a7b;
  cursor: text;
  user-select: none;
}

.page-jump-control:focus-within {
  background: rgba(48, 68, 91, 0.07);
  color: var(--ink);
}

.page-jump-prefix,
.page-jump-secondary {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.page-jump-control input {
  width: 27px;
  min-width: 0;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 24px;
  text-align: center;
  appearance: textfield;
}

.page-jump-control input::-webkit-inner-spin-button,
.page-jump-control input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.page-jump-control input:focus {
  outline: 0;
}

.page-jump-menu summary {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  color: #556a7b;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.page-jump-menu summary::-webkit-details-marker {
  display: none;
}

.page-jump-menu summary:hover,
.page-jump-menu summary:focus-visible,
.page-jump-menu[open] summary {
  background: rgba(48, 68, 91, 0.07);
  color: var(--ink);
  outline: 0;
}

.page-jump-menu summary .reader-line-icon {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
}

.page-jump-menu summary strong {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.page-total {
  flex: 0 0 auto;
  white-space: nowrap;
  color: #8a98a4;
  font-size: 11px;
  font-weight: 750;
}

.page-jump-chevron {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.page-jump-menu[open] .page-jump-chevron {
  transform: rotate(180deg);
}

.side-pane {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--reader-bg);
}

.side-pane-resize-handle {
  position: absolute;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.side-pane-resize-handle span {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 4px;
  height: 52px;
  border-radius: 999px;
  background: #b9c9d7;
  box-shadow: 0 1px 4px rgba(39, 66, 91, 0.16);
  transform: translateY(-50%);
  transition: width 160ms ease, left 160ms ease, background 160ms ease;
}

.side-pane-resize-handle:hover span,
.side-pane-resize-handle:focus-visible span,
.side-pane-resize-handle.is-dragging span {
  left: 1px;
  width: 6px;
  background: var(--blue);
}

.side-pane-resize-handle:focus-visible {
  outline: 0;
}

.side-pane.is-collapsed .side-pane-resize-handle {
  display: none;
}

.side-pane-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #ded8ca;
  background: var(--reader-bg);
}

.side-collapse-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.side-collapse-button:hover,
.side-collapse-button:focus-visible {
  background: rgba(48, 68, 91, 0.08);
  color: var(--ink);
  outline: 0;
}

.side-pane.is-collapsed {
  display: none;
}

.side-pane.is-collapsed .side-pane-toolbar {
  display: flex;
  height: 100%;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 0;
}

.side-pane.is-collapsed .side-collapse-button {
  width: 38px;
  height: 38px;
  padding: 0;
}

.side-pane.is-collapsed .side-tabs,
.side-pane.is-collapsed .side-section {
  display: none;
}

.side-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.side-tab {
  min-width: 0;
  min-height: 38px;
  padding: 0 6px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.side-tab:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.side-tab.active {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.side-section {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.side-section[hidden] {
  display: none;
}

.phrase-panel,
.ocr-panel,
.note-panel,
.tag-panel {
  padding: 18px;
}

.phrase-panel h2,
.ocr-panel h2,
.note-panel h2,
.tag-panel h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.side-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.side-section-heading h2 {
  margin: 0 0 3px;
}

.side-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.add-phrase-button {
  flex: none;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #9ec2ef;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.phrase-list {
  display: grid;
  gap: 8px;
}

.phrase-type-filters {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.phrase-type-filters::-webkit-scrollbar {
  display: none;
}

.phrase-type-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid #d7dee5;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.phrase-type-filter span {
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 9px;
}

.phrase-type-filter.active {
  border-color: #91b8e8;
  background: var(--blue-soft);
  color: var(--blue);
}

.study-phrase-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.study-phrase-card.active {
  border-color: #95b7ff;
  background: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(149, 183, 255, 0.18);
}

.study-phrase-card.is-global-notebook-card {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.study-phrase-card.is-global-notebook-card:hover,
.study-phrase-card.is-global-notebook-card:focus-visible {
  border-color: #8dbbad;
  box-shadow: 0 0 0 3px rgba(83, 146, 125, 0.12);
  outline: none;
}

.phrase-select-readonly {
  pointer-events: none;
}

.phrase-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: start;
}

.phrase-card-summary.has-selector {
  grid-template-columns: 38px minmax(0, 1fr) 42px;
}

.phrase-select-button {
  display: grid;
  width: 24px;
  height: 24px;
  margin: 13px 0 0 10px;
  place-items: center;
  padding: 0;
  border: 1.5px solid #b8c5ce;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.phrase-select-button > span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  transform: scale(0.45);
  transition: background 140ms ease, transform 140ms ease;
}

.phrase-select-button:hover,
.phrase-select-button:focus-visible {
  border-color: #5d91c5;
  box-shadow: 0 0 0 3px rgba(93, 145, 197, 0.14);
  outline: none;
}

.phrase-select-button.is-selected {
  border-color: #397cb9;
}

.phrase-select-button.is-selected > span {
  background: #397cb9;
  transform: scale(1);
}

.phrase-button {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 12px 8px 11px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.phrase-button-static {
  cursor: default;
  user-select: none;
}

.phrase-side-actions {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: 9px 8px 8px 0;
}

.phrase-color-control {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.phrase-color-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  box-sizing: border-box;
  border: 1px solid #e1ebe5;
  border-radius: 10px;
  background: #f8fbf8;
}

.phrase-color-swatch {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(35, 58, 50, 0.18);
  border-radius: 50%;
  background: var(--swatch-color);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.phrase-color-swatch.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--swatch-color);
}

.phrase-color-swatch:hover,
.phrase-color-swatch:focus-visible {
  transform: scale(1.12);
  outline: none;
}

@media (max-width: 560px) {
  .phrase-color-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .phrase-color-control {
    flex-wrap: wrap;
  }
}

.phrase-detail-button,
.phrase-audio-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #eef5fb;
  color: #355f7c;
}

.phrase-detail-button:hover,
.phrase-audio-button:hover {
  border-color: #b8d4eb;
  background: #fff;
  color: var(--blue);
}

.phrase-detail-button svg,
.phrase-audio-button svg {
  width: 19px;
  height: 19px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phrase-source-thumbnail {
  display: block;
  width: 58px;
  height: 48px;
  overflow: hidden;
  border: 1px solid #d9dfe4;
  border-radius: 7px;
  background: #f4f5f2;
}

.phrase-source-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phrase-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
}

.phrase-card-actions button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  background: #f1f4ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.phrase-card-actions button:hover {
  color: var(--ink);
}

.phrase-detail-source,
.phrase-card-actions .phrase-surface-form {
  margin-right: auto;
  color: #718294;
  font-size: 10px;
  font-weight: 750;
}

.phrase-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #b9d5f6;
  border-radius: 12px;
  background: #f4f9ff;
}

.phrase-editor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phrase-editor-title button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8eef5;
  color: var(--muted);
  font-size: 18px;
}

.phrase-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.phrase-editor [hidden] {
  display: none;
}

.phrase-editor input,
.phrase-editor textarea,
.phrase-editor select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c7d4df;
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
  color: var(--ink);
}

.phrase-editor textarea {
  min-height: 72px;
  resize: vertical;
}

.phrase-editor label > small {
  color: #82909d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.tag-editor-fields {
  display: grid;
  gap: 9px;
  margin: 2px 0 0;
  padding: 11px;
  border: 1px solid #d3dce4;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
}

.tag-editor-fields legend {
  padding: 0 5px;
  color: #46637b;
  font-size: 12px;
  font-weight: 900;
}

.phrase-editor-actions {
  display: flex;
  gap: 8px;
}

.phrase-editor-actions button {
  min-height: 36px;
}

.word-detail-edit-scroll {
  padding: 18px 22px 22px;
}

.word-detail-edit-scroll .phrase-editor.is-modal {
  gap: 13px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.word-detail-edit-scroll .phrase-editor.is-modal input,
.word-detail-edit-scroll .phrase-editor.is-modal textarea,
.word-detail-edit-scroll .phrase-editor.is-modal select {
  border-color: #cbd9e2;
  border-radius: 10px;
}

.word-detail-edit-scroll .phrase-editor.is-modal .phrase-editor-actions {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  margin: 2px -22px -22px;
  padding: 13px 22px 15px;
  border-top: 1px solid #e1e8ec;
  background: rgba(249, 251, 252, 0.96);
  backdrop-filter: blur(8px);
}

.phrase-db-status {
  display: none;
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f1eee5;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.phrase-db-status.is-visible {
  display: block;
}

.phrase-screenshot-capture {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid #efb275;
  border-radius: 12px;
  background: #fff7e9;
  box-shadow: 0 5px 14px rgba(121, 79, 35, 0.09);
}

.phrase-screenshot-capture-heading {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.phrase-screenshot-capture-heading > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffe1bc;
}

.phrase-screenshot-capture-heading strong {
  display: block;
  color: #6e431b;
  font-size: 13px;
  line-height: 1.35;
}

.phrase-screenshot-capture-heading p {
  margin: 3px 0 0;
  color: #87694d;
  font-size: 11px;
  line-height: 1.45;
}

.phrase-screenshot-notice {
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #fff4d8;
  color: #8a5a16;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.phrase-screenshot-preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(48vh, 520px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.phrase-screenshot-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-height: min(48vh, 520px);
  overflow: hidden;
  border: 1px solid #e5c49d;
  border-radius: 9px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.phrase-screenshot-arrow-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.screenshot-arrow-line {
  fill: none;
  stroke: var(--screenshot-arrow-color, #ed5b3a);
  stroke-width: 6;
  stroke-linecap: butt;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.screenshot-arrow-line.is-draft {
  opacity: 0.75;
}

.phrase-screenshot-arrow-hint {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(42, 50, 56, 0.76);
  color: #fff;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
  pointer-events: none;
}

.phrase-screenshot-color-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.phrase-screenshot-ocr-toggle {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(174, 126, 72, 0.18);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.phrase-screenshot-ocr-toggle > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.phrase-screenshot-toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d5d4cf;
  transition: background 140ms ease;
}

.phrase-screenshot-toggle-track > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(54, 48, 40, 0.25);
  transition: transform 140ms ease;
}

.phrase-screenshot-ocr-toggle > input:checked + .phrase-screenshot-toggle-track {
  background: #e8873f;
}

.phrase-screenshot-ocr-toggle > input:checked + .phrase-screenshot-toggle-track > span {
  transform: translateX(14px);
}

.phrase-screenshot-ocr-toggle > input:focus-visible + .phrase-screenshot-toggle-track {
  outline: 2px solid rgba(36, 91, 125, 0.72);
  outline-offset: 2px;
}

.phrase-screenshot-ocr-toggle > span:last-child {
  display: grid;
  gap: 1px;
}

.phrase-screenshot-ocr-toggle strong {
  color: #6e431b;
  font-size: 11px;
  line-height: 1.25;
}

.phrase-screenshot-ocr-toggle small {
  color: #87694d;
  font-size: 9px;
  line-height: 1.35;
}

.phrase-screenshot-ocr-toggle.is-unavailable {
  cursor: default;
  opacity: 0.55;
}

.phrase-screenshot-color-picker > span {
  flex: 0 0 auto;
  color: #87694d;
  font-size: 11px;
  font-weight: 800;
}

.phrase-screenshot-color-picker > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.phrase-screenshot-color-swatch {
  position: relative;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid rgba(77, 53, 32, 0.2);
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow: 0 1px 2px rgba(77, 53, 32, 0.14);
  cursor: pointer;
}

.phrase-screenshot-color-swatch.is-active {
  box-shadow: 0 0 0 2px #fff7eb, 0 0 0 4px #7d5230;
}

.phrase-screenshot-color-swatch::after {
  content: "";
  position: absolute;
  inset: -5px;
}

.phrase-screenshot-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
  margin: 0 -2px -2px;
  padding: 8px 2px 2px;
  background: linear-gradient(to bottom, rgba(255, 247, 233, 0), #fff7e9 12px);
}

.phrase-screenshot-actions button {
  min-height: 34px;
}

.phrase-screenshot-actions button:disabled {
  cursor: default;
  opacity: 0.42;
}

.phrase-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 24px 14px;
  text-align: center;
}

.phrase-empty span {
  font-size: 26px;
}

.phrase-empty p {
  margin: 0;
}

.phrase-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.phrase-text strong {
  overflow: hidden;
  color: #27415d;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-phrase-card:not(.phrase-card-word) .phrase-text strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.study-phrase-card:not(.phrase-card-word) .phrase-headwords {
  width: 100%;
}

.phrase-title-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.phrase-title-line > .cefr-badge {
  flex: 0 0 auto;
}

.phrase-headwords {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.phrase-text .phrase-headwords small {
  color: #7c8c99;
  font-size: 10px;
  font-weight: 750;
}

.phrase-title-line em {
  flex: none;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf1f4;
  color: #657687;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.phrase-text span {
  color: var(--muted);
  font-size: 13px;
}

.phrase-text small {
  color: #8a795f;
  font-size: 11px;
  font-weight: 700;
}

.phrase-text .phrase-grammar {
  color: #54728b;
  font-size: 11px;
  font-weight: 800;
}

.phrase-text .phrase-surface-form {
  color: #647d91;
}

.phrase-text .phrase-meaning {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.phrase-text .phrase-meaning-zh {
  color: #3f5366;
  font-weight: 750;
}

.phrase-text .phrase-meaning-en {
  color: #607386;
  font-size: 12px;
}

.phrase-summary-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding-top: 2px;
}

.phrase-summary-tags .tag-chip {
  max-width: 42%;
  min-height: 20px;
  padding: 2px 7px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phrase-text .phrase-more-tags {
  flex: none;
  color: #8190a0;
  font-size: 10px;
  font-weight: 800;
}

.phrase-notebook-detail {
  display: grid;
  gap: 10px;
  padding: 11px;
  border-top: 1px solid rgba(149, 183, 255, 0.45);
  background: rgba(255, 255, 255, 0.72);
}

.word-detail-modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.word-detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(23, 35, 43, 0.46);
  backdrop-filter: blur(4px);
  cursor: default;
}

.word-detail-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(720px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid rgba(69, 91, 104, 0.16);
  border-radius: 23px;
  background: #f9fbfc;
  box-shadow: 0 28px 70px rgba(18, 34, 43, 0.28);
}

.word-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  justify-content: space-between;
  column-gap: 18px;
  row-gap: 8px;
  padding: 21px 23px 18px;
  border-bottom: 1px solid #e1e8ec;
  background: #fff;
}

.word-detail-header > div:first-child {
  min-width: 0;
}

.word-detail-header > div > span {
  color: #6f8b7c;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.word-detail-header h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 3px 0 0;
  color: #28475b;
  font-size: 29px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.word-detail-header h2 .cefr-badge {
  flex: 0 0 auto;
  transform: translateY(1px);
}

.word-detail-header p {
  margin: 6px 0 0;
  color: #607789;
  font-size: 11px;
  font-weight: 800;
}

.word-detail-header > button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf2f4;
  color: #637783;
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}

.word-detail-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.word-detail-header-actions .word-detail-icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf2f4;
  color: #637783;
  cursor: pointer;
}

.word-detail-header-actions .word-detail-icon-button:hover {
  background: #e3edf1;
  color: #31566c;
}

.word-detail-header-actions .word-detail-delete-button:hover {
  background: #fae9e8;
  color: #b34e4a;
}

.word-delete-confirm-layer {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.word-delete-confirm-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(31, 48, 58, 0.38);
  backdrop-filter: blur(3px);
}

.word-delete-confirm-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid #ead8d5;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 20px 54px rgba(25, 41, 50, 0.25);
}

.word-delete-confirm-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #faecea;
  color: #b54d49;
}

.word-delete-confirm-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.word-delete-confirm-card > div > span {
  color: #a25c58;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.word-delete-confirm-card h3 {
  margin: 3px 0 7px;
  color: #29495c;
  font-size: 22px;
}

.word-delete-confirm-card p {
  margin: 0;
  color: #697d89;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.word-delete-confirm-actions {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-top: 3px;
}

.word-delete-confirm-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #dbe5ea;
  border-radius: 11px;
  background: #f5f8f9;
  color: #38576a;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.word-delete-confirm-actions button small {
  color: inherit;
  font-size: 9px;
  opacity: 0.72;
}

.word-delete-confirm-actions .is-danger {
  border-color: #e9b8b3;
  background: #f9e8e6;
  color: #a84340;
}

.word-delete-confirm-actions .is-cancel {
  justify-content: center;
  border-color: transparent;
  background: transparent;
  color: #70828d;
}

.word-detail-header-actions .word-detail-speak-button {
  background: #eef7f2;
  color: #3d8060;
}

.word-detail-header-actions .word-detail-icon-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.word-detail-header-actions .word-detail-speak-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.word-detail-header-actions .word-detail-screenshot-button svg {
  fill: currentColor;
  stroke: none;
}

.word-detail-header-actions .word-detail-speak-button .speaker-fill {
  fill: currentColor;
  stroke: none;
}

.word-detail-header-actions .word-detail-close-button {
  font: inherit;
  font-size: 21px;
}

.word-detail-scroll {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 13px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.word-detail-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.word-detail-source-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.word-detail-source-grid .phrase-context-image {
  min-width: 0;
  padding: 9px;
  border: 1px solid #d5e1e9;
  border-radius: 10px;
  background: #fbfdff;
}

.word-detail-source-grid .phrase-context-image.is-empty {
  min-height: 164px;
}

.word-detail-page-label,
.word-detail-source-grid .phrase-context-image .word-detail-page-label,
.word-detail-source-sentence .word-detail-page-label {
  max-width: 100%;
  justify-self: end;
  margin: 0;
  color: #8b99a5;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: right;
}

.word-detail-source-grid .phrase-context-image img {
  height: 164px;
  max-height: none;
  border: 0;
  background: transparent;
}

.word-detail-source-sentence {
  position: relative;
  min-width: 0;
  align-content: start;
  padding: 11px 12px;
}

.word-detail-source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.word-detail-source-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.word-detail-source-heading.is-label-free {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  pointer-events: none;
}

.word-detail-source-heading.is-label-free button {
  pointer-events: auto;
}

.word-detail-source-sentence:has(.word-detail-source-heading.is-label-free) > p {
  padding-right: 38px;
}

.word-detail-source-heading > span {
  color: #738394;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.word-detail-source-heading button {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eaf3fa;
  color: #3c6e8b;
  cursor: pointer;
}

.word-detail-source-heading .word-detail-occurrence-decision {
  width: 29px;
  height: 29px;
  min-height: 29px;
  border-radius: 50%;
  background: #edf3f7;
  color: #567184;
}

.word-detail-source-heading .word-detail-occurrence-decision.is-confirm {
  background: #dff4e9;
  color: #18815a;
}

.word-detail-source-heading .word-detail-occurrence-decision.is-reject {
  background: #f1f4f6;
  color: #607889;
}

.word-detail-source-heading .word-detail-occurrence-decision:hover {
  filter: brightness(0.97);
}

.word-detail-source-heading button:hover {
  background: #dcecf5;
  color: #275c77;
}

.word-detail-source-heading svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.word-detail-dictionary-shell {
  position: relative;
  align-self: start;
  min-width: 0;
  min-height: min-content;
  overflow: hidden;
  border: 1px solid #cbdde9;
  border-radius: 10px;
  background: #f7fbfe;
}

.word-detail-dictionary-details {
  display: block;
  min-height: 43px;
}

.word-detail-dictionary-details[open] {
  display: block;
}

.word-detail-dictionary-details > summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 43px;
  padding: 7px 10px 7px 11px;
  cursor: pointer;
  list-style: none;
}

.word-detail-dictionary-details > summary::-webkit-details-marker {
  display: none;
}

.word-detail-dictionary-details > summary span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.word-detail-dictionary-details > summary strong {
  color: #31566c;
  font-size: 12px;
}

.word-detail-dictionary-details > summary em {
  color: #7d8e9a;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.word-detail-dictionary-details > summary > svg {
  position: static;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin-left: 8px;
  fill: none;
  stroke: #668194;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.word-detail-dictionary-details[open] > summary > svg {
  transform: rotate(180deg);
}

.word-detail-dictionary-details > div {
  max-height: none;
  overflow: visible;
  padding: 0 10px 10px;
  border-top: 1px solid #dce9f1;
}

.word-detail-dictionary-details .saved-dictionary-list {
  max-height: none;
  overflow: hidden;
  margin-top: 10px;
}

.word-detail-dictionary-details .dictionary-lookup-panel {
  margin-top: 10px;
}

.word-detail-dictionary-settings {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 31px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e7f0f5;
  color: #527286;
  cursor: pointer;
  transform: translateY(-50%);
}

.word-detail-dictionary-details > summary .word-detail-dictionary-settings {
  position: static;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  margin-left: auto;
  transform: none;
}

.word-detail-dictionary-shell > .word-detail-dictionary-settings {
  display: none;
}

.word-detail-dictionary-settings:hover {
  background: #d8e8f0;
  color: #31566c;
}

.word-detail-dictionary-settings svg {
  display: none;
}

.word-detail-dictionary-settings {
  background-image: none;
}

.word-detail-dictionary-settings .preferred-settings-icon {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.word-detail-dictionary-empty {
  margin: 10px 0 0;
  color: #718594;
  font-size: 10px;
}

.word-detail-meanings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.word-detail-meanings > div {
  padding: 13px 14px;
  border: 1px solid #dce6eb;
  border-radius: 13px;
  background: #fff;
}

.word-detail-meanings span {
  color: #7a8c98;
  font-size: 9px;
  font-weight: 900;
}

.word-detail-meanings p {
  margin: 5px 0 0;
  color: #334f63;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.word-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  padding: 13px 22px 16px;
  border-top: 1px solid #e1e8ec;
  background: #fff;
}

.word-detail-actions button {
  min-height: 36px;
}

.phrase-context-image {
  display: grid;
  gap: 5px;
  margin: 0;
}

.phrase-context-image img {
  display: block;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border: 1px solid #d7dee5;
  border-radius: 9px;
  background: #fff;
}

.phrase-context-image figcaption {
  color: #7b8996;
  font-size: 10px;
  font-weight: 800;
}

.saved-dictionary-list {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #cbdde9;
  border-radius: 10px;
  background: #f8fcff;
}

.saved-dictionary-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.saved-dictionary-heading strong {
  color: #294c60;
  font-size: 17px;
}

.saved-dictionary-heading span {
  color: #78909d;
  font-size: 9px;
  font-weight: 900;
}

.saved-dictionary-entry {
  display: grid;
  gap: 9px;
  padding-top: 9px;
  border-top: 1px solid #dce9f1;
}

.dictionary-entry-heading,
.dictionary-result-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.dictionary-entry-heading strong,
.dictionary-result-heading span {
  color: #31566c;
  font-size: 13px;
}

.dictionary-entry-heading em,
.dictionary-result-heading em {
  color: #738394;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.selected-definitions {
  display: grid;
  gap: 4px;
}

.selected-definitions > span {
  color: #748696;
  font-size: 10px;
  font-weight: 900;
}

.selected-definitions ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.selected-definitions li {
  color: #334f63;
  font-size: 12px;
  line-height: 1.45;
}

.english-definitions li {
  color: #426476;
}

.dictionary-full-details {
  border-top: 1px dashed #cfdae2;
  padding-top: 7px;
}

.dictionary-full-details summary {
  color: #527084;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.dictionary-entry-source {
  display: block;
  padding-top: 1px;
  color: #93a1ad;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.dictionary-sense-details {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.dictionary-sense-details > section {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}

.dictionary-sense-details p {
  margin: 0;
  color: #425d70;
  font-size: 11px;
  line-height: 1.45;
}

.dictionary-sense-details p + p {
  color: #596f7f;
}

.dictionary-sense-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dictionary-sense-label strong {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dff1fb;
  color: #2d7697;
  font-size: 10px;
}

.dictionary-sense-label span {
  color: #6d8392;
  font-size: 10px;
  font-weight: 850;
}

.cefr-badge {
  display: inline-grid;
  min-width: 25px;
  min-height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 6px;
  background: #e8f5ee;
  color: #34745a;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.cefr-badge.cefr-b1,
.cefr-badge.cefr-b2 {
  background: #fff1d9;
  color: #9b611c;
}

.cefr-badge.cefr-c1,
.cefr-badge.cefr-c2 {
  background: #f1e9fb;
  color: #74509d;
}

.dictionary-examples {
  display: grid;
  gap: 5px;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px dashed #e0e6ea;
}

.dictionary-examples p {
  display: grid;
  gap: 2px;
}

.dictionary-examples small {
  color: #85939d;
  font-size: 10px;
}

.dictionary-lookup-panel {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #8fc6de;
  border-radius: 11px;
  background: #f1fbff;
  box-shadow: 0 5px 14px rgba(50, 103, 128, 0.09);
}

.dictionary-lookup-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.dictionary-lookup-heading > div {
  display: grid;
  gap: 2px;
}

.dictionary-lookup-heading strong {
  color: #255e78;
  font-size: 13px;
}

.dictionary-lookup-heading span {
  color: #738a96;
  font-size: 10px;
}

.dictionary-lookup-heading button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #dbeef6;
  color: #497587;
  font-size: 17px;
}

.dictionary-source-picker {
  display: grid;
  gap: 4px;
  color: #637b88;
  font-size: 10px;
  font-weight: 900;
}

.dictionary-query-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: end;
  gap: 7px;
}

.dictionary-query-form label {
  display: grid;
  gap: 4px;
  color: #637b88;
  font-size: 10px;
  font-weight: 900;
}

.dictionary-query-form input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #b8d4e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
}

.dictionary-query-form button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #b8d4e1;
  border-radius: 9px;
  background: #e5f3f9;
  color: #356b83;
}

.dictionary-query-form button:hover {
  background: #fff;
  color: var(--blue);
}

.dictionary-query-form svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dictionary-source-picker select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #b8d4e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
}

.dictionary-lookup-status {
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: #e6f4f9;
  color: #567482;
  font-size: 11px;
  line-height: 1.45;
}

.dictionary-lookup-status.is-error {
  background: #fff0eb;
  color: #a45138;
}

.dictionary-result-heading strong {
  color: #294c60;
  font-size: 17px;
}

.dictionary-sense-picker {
  display: grid;
  gap: 7px;
  max-height: 390px;
  overflow: auto;
  padding-right: 2px;
}

.dictionary-sense-option {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d3e3ea;
  border-radius: 9px;
  background: #fff;
}

.dictionary-sense-option > label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  color: #3c5668;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
}

.dictionary-sense-option input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.dictionary-sense-option label span {
  display: grid;
  gap: 2px;
}

.dictionary-sense-option small {
  color: #78909d;
  font-size: 9px;
  font-weight: 900;
}

.dictionary-lookup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dictionary-lookup-actions button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 11px;
}

.semantic-bridge {
  display: grid;
  gap: 3px;
  margin: 0;
  color: #344c60;
  font-size: 13px;
  line-height: 1.45;
}

.phrase-source-sentence,
.phrase-collocation-list {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #d5e1e9;
  border-radius: 9px;
  background: #fbfdff;
}

.phrase-source-sentence > span,
.phrase-collocation-list > span {
  color: #738394;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.phrase-source-sentence p {
  margin: 0;
  color: #304b5f;
  font-size: 13px;
  line-height: 1.55;
}

.phrase-source-sentence mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #fff0a6;
  color: #203c50;
  font-weight: 900;
}

.phrase-source-sentence small {
  color: #8b99a5;
  font-size: 9px;
  font-weight: 700;
}

.phrase-source-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.phrase-source-meta button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf3fa;
  color: #3c6e8b;
  font-size: 9px;
  font-weight: 850;
}

.phrase-usage-organization {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #d7e1e8;
  border-radius: 10px;
  background: #fff;
}

.phrase-usage-organization h3 {
  margin: 0;
  color: #31566c;
  font-size: 12px;
}

.usage-organization-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.usage-organization-row > span {
  padding-top: 3px;
  color: #7a8b98;
  font-size: 10px;
  font-weight: 850;
}

.usage-organization-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.usage-organization-row em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef5fa;
  color: #3f6279;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.phrase-collocation-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.phrase-collocation-list em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eaf4fb;
  color: #37657e;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.cross-book-occurrences {
  border: 1px solid #cbdde9;
  border-radius: 10px;
  background: #f7fbfe;
}

.same-sense-contexts {
  border: 1px solid #cfe0d7;
  border-radius: 10px;
  background: #f7fcf9;
}

.same-sense-contexts > summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.same-sense-contexts > summary::-webkit-details-marker {
  display: none;
}

.same-sense-contexts > summary span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.same-sense-contexts > summary strong {
  color: #365f4d;
  font-size: 12px;
}

.same-sense-contexts > summary em {
  color: #7d9187;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.same-sense-contexts > summary svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #668579;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.same-sense-contexts[open] > summary svg {
  transform: rotate(180deg);
}

.same-sense-context-list {
  display: grid;
  gap: 7px;
  padding: 0 9px 9px;
  border-top: 1px solid #deebe4;
}

.same-sense-context-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid #dce9e2;
  border-radius: 9px;
  background: #fff;
}

.same-sense-context-image {
  display: grid;
  width: 74px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dce9e2;
  border-radius: 7px;
  background: transparent;
  color: #789084;
  cursor: pointer;
}

.same-sense-context-image.is-empty {
  border-style: dashed;
  background: transparent;
}

.same-sense-context-image.is-empty:hover,
.same-sense-context-image.is-empty:focus-visible {
  border-color: #7ba08e;
  background: #f4faf7;
  outline: 0;
}

.same-sense-context-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.same-sense-context-item p {
  margin: 0;
  color: #355268;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.same-sense-context-item small {
  color: #83949d;
  font-size: 9px;
  font-weight: 750;
}

.same-sense-context-actions {
  display: grid;
  place-items: center;
}

.same-sense-context-actions > button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #edf5f1;
  color: #4b7964;
}

.same-sense-context-actions > button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.cross-book-occurrences > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.cross-book-occurrences > summary::-webkit-details-marker {
  display: none;
}

.cross-book-occurrences > summary .cross-book-summary-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.cross-book-summary-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.cross-book-occurrences > summary strong {
  color: #31566c;
  font-size: 12px;
}

.cross-book-occurrences > summary em {
  color: #7d8e9a;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.cross-book-occurrences > summary .cross-book-summary-chevron {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #668194;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.cross-book-occurrences[open] > summary .cross-book-summary-chevron {
  transform: rotate(180deg);
}

.cross-book-occurrence-body {
  display: grid;
  gap: 9px;
  padding: 0 10px 10px;
  border-top: 1px solid #dce9f1;
}

.cross-book-occurrence-body .occurrence-context-section > h3 {
  margin-top: 2px;
}

.occurrence-refresh-button {
  display: grid;
  width: 30px;
  height: 30px;
  justify-self: end;
  place-items: center;
  margin-top: 8px;
  padding: 0;
  border-radius: 50%;
  background: #e8f1f7;
  color: #42677d;
}

.cross-book-summary-actions .occurrence-refresh-button {
  width: 28px;
  height: 28px;
  margin-top: 0;
}

.cross-book-book-group {
  display: grid;
  gap: 6px;
}

.cross-book-book-group h4 {
  margin: 2px 0 0;
  color: #536f82;
  font-size: 10px;
}

.cross-book-occurrence-item button:disabled {
  cursor: default;
  opacity: 0.42;
}

.cross-book-occurrence-item {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid #dce6ed;
  border-radius: 8px;
  background: #fff;
}

.occurrence-example-layout {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.occurrence-example-image {
  display: grid;
  width: 74px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dce6ed;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.occurrence-example-image.is-empty {
  border-style: dashed;
}

.occurrence-example-image.is-empty:hover,
.occurrence-example-image.is-empty:focus-visible {
  border-color: #7ba08e;
  background: #f4faf7;
  outline: 0;
}

.occurrence-example-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cross-book-occurrence-item.is-accepted {
  border-color: #b9ddca;
  background: #f5fcf8;
}

.cross-book-occurrence-item.is-other-sense {
  border-color: #e2d3ae;
  background: #fffaf0;
}

.cross-book-occurrence-item p,
.cross-book-occurrence-status {
  margin: 0;
  color: #3a5668;
  font-size: 11px;
  line-height: 1.5;
}

.cross-book-occurrence-item p mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #fff0a6;
  color: #294a5f;
  font-weight: 900;
}

.cross-book-occurrence-item > small,
.cross-book-ignored-count {
  color: #8c9aa5;
  font-size: 9px;
  line-height: 1.4;
}

.occurrence-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.occurrence-meta-row > small {
  color: #8c9aa5;
  font-size: 9px;
}

.occurrence-sense-hint {
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf3f7;
  color: #6c8190;
  font-size: 8px;
  font-weight: 850;
}

.occurrence-sense-hint.is-suggested {
  background: #e3f1fa;
  color: #357495;
}

.occurrence-sense-hint.is-accepted {
  background: #dff4e9;
  color: #18815a;
}

.occurrence-sense-hint.is-other {
  background: #f6e8c7;
  color: #8a641d;
}

.occurrence-decision-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.occurrence-decision-actions button {
  min-height: 27px;
  border-radius: 7px;
  background: #edf3f7;
  color: #567184;
  font-size: 9px;
  font-weight: 850;
}

.occurrence-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  padding: 0;
}

.occurrence-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The open icon is a filled glyph, so it needs its own treatment instead of the decision icons' outline style. */
.occurrence-icon-button.occurrence-jump-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.occurrence-icon-button.is-selected {
  background: #dff4e9;
  color: #18815a;
}

.occurrence-icon-button.is-selected.is-rejected {
  background: #f4e9e9;
  color: #a34f55;
}

.occurrence-icon-button.occurrence-jump-button {
  background: #e9f2f7;
  color: #477188;
}

.occurrence-icon-button.occurrence-jump-button:hover {
  background: #dcecf4;
  color: #295f7c;
}

.occurrence-other-sense-button {
  padding: 3px 8px;
}

.occurrence-other-sense-button.is-selected {
  background: #f6e8c7;
  color: #8a641d;
}

.cross-book-occurrence-status.is-error {
  color: #b4533b;
}

.usage-discovery {
  border: 1px solid #d7dfeb;
  border-radius: 10px;
  background: #fbfcff;
}

.usage-discovery > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.usage-discovery > summary::-webkit-details-marker {
  display: none;
}

.usage-discovery > summary span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.usage-discovery > summary .usage-discovery-summary-actions {
  align-items: center;
  gap: 5px;
}

.usage-discovery-refresh {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf4fa;
  cursor: pointer;
}

.usage-discovery-refresh:hover {
  background: #dcecf7;
}

.usage-discovery-refresh svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.usage-discovery-refresh img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.home-word-other-example-refresh .refresh-icon,
.occurrence-refresh-button .refresh-icon,
.usage-discovery-refresh .refresh-icon {
  fill: currentColor;
  stroke: none;
}

.usage-discovery > summary strong {
  color: #405d76;
  font-size: 12px;
}

.usage-discovery > summary em {
  color: #7d8e9a;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.usage-discovery > summary > .usage-discovery-summary-actions > svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #668194;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.usage-discovery[open] > summary > .usage-discovery-summary-actions > svg {
  transform: rotate(180deg);
}

.usage-discovery-body {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
  border-top: 1px solid #e2e8f0;
}

.usage-discovery-note {
  margin: 8px 0 0;
  color: #788995;
  font-size: 9px;
  line-height: 1.45;
}

.usage-suggestion-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e0e6ee;
  border-radius: 8px;
  background: #fff;
}

.usage-suggestion-item > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.usage-suggestion-item span {
  color: #718494;
  font-size: 8px;
  font-weight: 900;
}

.usage-suggestion-item strong {
  overflow-wrap: anywhere;
  color: #36566c;
  font-size: 11px;
}

.usage-suggestion-item small {
  display: -webkit-box;
  overflow: hidden;
  color: #8a98a4;
  font-size: 8px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.usage-suggestion-actions {
  display: flex;
  gap: 5px;
}

.usage-suggestion-actions button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #edf3f7;
  color: #567184;
}

.usage-suggestion-actions button:hover,
.usage-suggestion-actions button:focus-visible {
  background: #dfedf6;
  color: #2f6f91;
}

.usage-suggestion-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Keep the three vocabulary summary rows on one visual baseline. */
.word-detail-dictionary-details > summary,
.cross-book-occurrences > summary,
.usage-discovery > summary {
  min-height: 43px;
}

.word-detail-dictionary-details > summary .word-detail-dictionary-settings,
.cross-book-summary-actions .occurrence-refresh-button,
.usage-discovery-summary-actions .usage-discovery-refresh {
  width: 29px;
  height: 29px;
  margin-top: 0;
  border-radius: 50%;
  background: #e7f0f5;
  color: #527286;
}

.word-detail-dictionary-details > summary .word-detail-dictionary-settings {
  background-image: none;
}

.word-detail-dictionary-details > summary .word-detail-dictionary-settings .preferred-settings-icon {
  display: block;
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: none;
}

.word-detail-dictionary-details > summary .word-detail-dictionary-settings::before {
  display: none;
}

.cross-book-summary-actions,
.usage-discovery-summary-actions {
  display: flex;
  height: 29px;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.word-detail-dictionary-details > summary .word-detail-dictionary-settings:hover,
.cross-book-summary-actions .occurrence-refresh-button:hover,
.usage-discovery-summary-actions .usage-discovery-refresh:hover {
  background: #d8e8f0;
  color: #31566c;
}

.word-detail-dictionary-details > summary .preferred-settings-icon,
.cross-book-summary-actions .occurrence-refresh-button .refresh-icon,
.usage-discovery-summary-actions .usage-discovery-refresh .refresh-icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: none;
}

/* One fixed action rail for dictionary, same-sense, and usage rows. */
.word-detail-dictionary-details > summary,
.cross-book-occurrences > summary,
.usage-discovery > summary {
  position: relative;
  padding-right: 72px;
}

.word-detail-dictionary-details > summary .word-detail-dictionary-settings {
  position: absolute;
  top: 50%;
  right: 31px;
  margin: 0;
  transform: translateY(-50%);
}

.word-detail-dictionary-details > summary > svg {
  position: absolute;
  top: 50%;
  right: 10px;
  margin: 0;
  transform: translateY(-50%);
}

.word-detail-dictionary-details[open] > summary > svg {
  transform: translateY(-50%) rotate(180deg);
}

.cross-book-summary-actions,
.usage-discovery-summary-actions {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 51px;
  height: 29px;
  grid-template-columns: 29px 17px;
  gap: 5px;
  align-items: center;
  transform: translateY(-50%);
}

.semantic-bridge span,
.personal-note-field > span {
  color: #738394;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.phrase-tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

button.tag-chip:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.tag-chip span {
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  font-size: 9px;
}

.tag-chip.concept {
  border-color: #b9d5f6;
  background: #e8f3ff;
  color: #235f9e;
}

.tag-chip.pattern {
  border-color: #e8c997;
  border-radius: 8px;
  background: #fff4df;
  color: #8a571c;
}

.tag-chip.scene {
  border-color: #b9dfc8;
  background: #e9f7ee;
  color: #28704a;
}

.untagged-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.personal-note-field {
  display: grid;
  gap: 5px;
}

.personal-note-field textarea {
  min-height: 76px;
  padding: 9px;
  font-size: 13px;
}

.notebook-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notebook-detail-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 11px;
}

.notebook-detail-actions .phrase-delete-button {
  color: #a45a52;
}

.tag-panel-heading {
  margin-bottom: 16px;
}

.tag-group-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid #ded8ca;
}

.tag-group-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.tag-group-section h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.tag-group-section p,
.active-tag-review > p,
.tag-guidance p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.tag-guidance {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #c6bda9;
  border-radius: 10px;
  background: #fffaf0;
}

.tag-guidance strong {
  color: #805d2d;
  font-size: 12px;
}

.active-tag-review {
  display: grid;
  gap: 10px;
}

.tag-review-back {
  justify-self: start;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  background: #eef2f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.active-tag-title .tag-chip {
  min-height: 34px;
  padding-inline: 11px;
  font-size: 14px;
}

.tagged-phrase-list {
  display: grid;
  gap: 7px;
}

.tagged-phrase-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: left;
}

.tagged-phrase-list button:hover {
  border-color: #9abbe3;
  background: #f5f9ff;
}

.tagged-phrase-list strong {
  color: var(--ink);
  font-size: 13px;
}

.tagged-phrase-list span {
  color: var(--muted);
  font-size: 11px;
}

.speaker {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eef3f8;
}

.current-card {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.current-card strong {
  font-size: 17px;
}

.current-card span {
  color: var(--muted);
  line-height: 1.45;
}

.ocr-result {
  display: grid;
  gap: 10px;
}

.ocr-result img {
  display: block;
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ocr-result p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.ocr-result .extraction-image-hint {
  padding: 7px 9px;
  border-radius: 8px;
  background: #f1f7ef;
  color: #56705a;
  font-size: 11px;
}

.ocr-field-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.ocr-result textarea {
  min-height: 82px;
}

.ocr-result textarea[data-ocr-word-text] {
  min-height: 46px;
}

.ocr-result select {
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid #c7d4df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.55;
}

.note-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.empty {
  color: var(--muted);
  line-height: 1.5;
}

@media (max-height: 800px) {
  .phrase-panel,
  .ocr-panel,
  .note-panel,
  .tag-panel {
    padding: 14px;
  }

  .phrase-panel h2,
  .ocr-panel h2,
  .note-panel h2,
  .tag-panel h2 {
    margin-bottom: 10px;
    font-size: 17px;
  }

  .phrase-list {
    gap: 6px;
  }

  .phrase-button {
    min-height: 44px;
    padding: 7px 10px;
  }

  .current-card {
    margin-bottom: 10px;
    padding: 10px;
  }

  textarea {
    min-height: 118px;
  }
}

@media (max-width: 900px) {
  .dashboard-continue-grid {
    grid-template-columns: none;
    grid-auto-columns: minmax(280px, 70vw);
    grid-auto-flow: column;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 2px 2px 10px;
    scroll-snap-type: inline proximity;
  }

  .dashboard-continue-card {
    scroll-snap-align: start;
  }

  .dashboard-focus-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-word-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .continue-row {
    grid-template-columns: 1fr;
  }

  .home-wordbook-layout {
    grid-template-columns: 1fr;
  }

  .home-game-picker {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-game-picker-heading,
  .home-game-requirement,
  .home-game-next,
  .home-game-notice {
    grid-column: 1 / -1;
  }

  .home-wordbook-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-word-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shelf-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .series-hero {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .series-books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(190px, 34vh);
    height: calc(100dvh - var(--topbar-height));
  }

  .reader.side-pane-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .book-pane {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-pane {
    min-height: 0;
  }

  .side-pane-resize-handle {
    display: none;
  }
}

@media (max-width: 620px) {
  :root {
    --topbar-height: 62px;
  }

  .topbar {
    padding: 10px 14px;
  }

  .brand-subtitle,
  .nav-link {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
  }

  .topbar-reading-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .home-library,
  .series-page {
    padding: 25px 16px 58px;
  }

  .dashboard-home-section .dashboard-section-heading h1 {
    font-size: 27px;
  }

  .dashboard-continue-grid {
    grid-auto-columns: minmax(276px, 88vw);
    gap: 10px;
    margin-inline: -2px;
  }

  .dashboard-continue-card {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 148px;
    border-radius: 17px;
  }

  .dashboard-continue-cover {
    min-height: 124px;
  }

  .reading-goal-card {
    border-radius: 20px;
  }

  .reading-goal-settings-button {
    min-width: 38px;
    padding: 0 10px;
  }

  .reading-goal-settings-button > span {
    display: none;
  }

  .reading-goal-settings-panel {
    top: 78px;
    right: 0;
    left: 0;
    width: auto;
  }

  .reading-goal-main {
    min-height: 292px;
    padding: 20px 10px 12px;
  }

  .reading-goal-arc {
    width: 108%;
  }

  .reading-goal-center {
    bottom: 22px;
    width: 78%;
  }

  .reading-goal-center > strong {
    font-size: 48px;
  }

  .reading-goal-center > a {
    min-height: 50px;
    margin-top: 16px;
    padding-inline: 13px;
  }

  .reading-goal-center > a > b {
    display: none;
  }

  .reading-goal-center > a {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reading-goal-week {
    gap: 2px;
    padding: 17px 8px 19px;
  }

  .reading-goal-day {
    gap: 6px;
  }

  .reading-goal-day > i {
    width: 31px;
    height: 31px;
  }

  .reading-goal-day > small {
    display: none;
  }

  .word-detail-modal {
    align-items: end;
    padding: 0;
  }

  .word-detail-dialog {
    width: 100%;
    max-height: 88dvh;
    border-radius: 22px 22px 0 0;
  }

  .word-detail-header {
    padding: 17px 18px 14px;
  }

  .word-detail-header h2 {
    font-size: 25px;
  }

  .word-detail-scroll {
    padding: 15px 16px 18px;
  }

  .word-detail-edit-scroll .phrase-editor.is-modal .phrase-editor-actions {
    bottom: -18px;
    margin: 2px -16px -18px;
    padding: 12px 16px 14px;
  }

  .word-detail-meanings {
    grid-template-columns: 1fr;
  }

  .word-detail-source-grid {
    grid-template-columns: 1fr;
  }

  .word-detail-source-grid .phrase-context-image img {
    height: auto;
    max-height: 220px;
  }

  .word-detail-header-actions {
    gap: 5px;
  }

  .word-detail-header-actions .word-detail-icon-button {
    width: 32px;
    height: 32px;
  }

  .word-detail-actions {
    justify-content: flex-start;
    padding: 12px 16px 15px;
  }

  .welcome-row {
    margin-bottom: 26px;
  }

  .welcome-doodle {
    display: none;
  }

  .welcome-row h1 {
    font-size: 31px;
  }

  .dashboard-welcome-note {
    max-width: 310px;
    font-size: 12px;
    line-height: 1.55;
  }

  .dashboard-focus-grid {
    gap: 14px;
  }

  .dashboard-focus-panel,
  .dashboard-review-card,
  .dashboard-recent-words {
    padding: 15px;
    border-radius: 18px;
  }

  .dashboard-review-copy {
    padding: 20px 0;
  }

  .dashboard-review-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-word-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-section-heading {
    align-items: flex-start;
  }

  .home-section {
    margin-top: 31px;
  }

  .home-wordbook {
    margin-inline: -4px;
    padding: 16px 12px 18px;
    border-radius: 21px;
  }

  .home-wordbook-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-word-search {
    grid-column: 1 / -1;
  }

  .home-wordbook-selection-bar {
    display: grid;
    gap: 5px;
  }

  .home-wordbook-selection-bar > div {
    justify-content: flex-start;
  }

  .home-word-grid {
    grid-template-columns: 1fr;
  }

  .home-word-card {
    min-height: 116px;
  }

  .home-word-detail-button {
    grid-template-columns: 90px minmax(0, 1fr);
    min-height: 116px;
  }

  .home-game-picker {
    grid-template-columns: 1fr;
  }

  .home-game-picker-heading,
  .home-game-requirement,
  .home-game-next,
  .home-game-notice {
    grid-column: auto;
  }

  .home-game-modal {
    place-items: start center;
    padding: 8px;
  }

  .home-game-dialog {
    margin-block: 8px;
    border-radius: 18px;
  }

  .home-game-header {
    grid-template-columns: minmax(0, 1fr) auto auto 34px;
    gap: 7px;
    min-height: 64px;
    padding: 9px 10px 9px 14px;
  }

  .home-game-header h2 {
    font-size: 17px;
  }

  .home-game-score {
    min-width: 42px;
  }

  .home-game-round {
    min-width: 45px;
    padding-inline: 7px;
  }

  .word-choice-stage {
    grid-template-columns: 1fr;
    gap: 17px;
    padding: 17px;
  }

  .word-choice-stage figure img {
    max-height: 340px;
  }

  .word-choice-question > p {
    font-size: 15px;
  }

  .word-match-board {
    grid-template-columns: minmax(115px, 1fr) minmax(110px, 0.82fr);
    gap: 52px;
    padding: 15px 10px 10px;
  }

  .word-match-images img {
    height: 100%;
  }

  .word-match-words button {
    padding: 7px;
  }

  .word-match-words strong {
    font-size: 13px;
  }

  .heading-icon {
    width: 42px;
    height: 42px;
  }

  .playful-heading h2 {
    font-size: 22px;
  }

  .continue-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    min-height: 154px;
    padding: 12px;
    border-radius: 18px;
  }

  .continue-info h3 {
    margin: 5px 0 10px;
    font-size: 16px;
  }

  .continue-empty {
    grid-template-columns: auto 1fr;
    padding: 18px;
  }

  .continue-empty .primary-button {
    grid-column: 1 / -1;
  }

  .shelf-row {
    gap: 16px;
    padding: 4px 4px 0;
  }

  .shelf-cover-area {
    min-height: 205px;
    padding-inline: 0;
  }

  .cover-stack {
    width: 132px;
    height: 177px;
  }

  .stack-cover {
    width: 92px;
    height: 145px;
    border-width: 4px;
  }

  .book-count {
    right: 2px;
    bottom: 5px;
  }

  .shelf-label {
    padding-inline: 2px;
  }

  .shelf-label h3 {
    font-size: 17px;
  }

  .wood-shelf {
    height: 20px;
    box-shadow: 0 7px 0 var(--wood-dark), 0 13px 16px rgba(80, 49, 25, 0.18);
  }

  .wood-shelf span::before,
  .wood-shelf span::after {
    top: 20px;
  }

  .series-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 22px 12px;
    text-align: center;
  }

  .series-description {
    font-size: 15px;
  }

  .cover-stack-large {
    width: 205px;
    height: 215px;
  }

  .cover-stack-large .stack-cover {
    width: 132px;
    height: 190px;
  }

  .series-books {
    grid-template-columns: 1fr;
  }

  .reader-toolbar {
    grid-template-columns: minmax(128px, 1fr) auto auto auto;
    gap: 5px;
    min-height: 52px;
    padding: 6px 8px;
  }

  .reader-title {
    display: none;
  }

  .library-search-reader .library-search-results {
    left: 0;
    width: calc(100vw - 16px);
    transform: none;
  }

  .library-search-reader .library-search-form {
    padding-left: 9px;
  }

  .library-search-reader .library-search-icon {
    width: 17px;
    height: 17px;
  }

  .library-search-reader .library-search-submit {
    display: none;
  }

  .reader-audio-tools {
    justify-self: start;
  }

  .picture-book-controls {
    left: 0;
    transform: translate(0, -4px);
  }

  .reader-audio-tools.is-expanded .picture-book-controls {
    transform: translate(0, 0);
  }

  .storybook-frame {
    grid-template-columns: minmax(0, 1fr);
    padding: 9px 7px 5px;
  }

  .page-control-bar {
    min-height: 30px;
    padding: 5px 12px 7px;
  }

  .toolbar-page-jump summary {
    padding-inline: 8px;
  }

  .toolbar-page-jump summary .reader-line-icon,
  .toolbar-page-jump .page-total {
    display: none;
  }

  .page-turn-button {
    width: 32px;
    height: 50px;
    border-radius: 10px;
  }

  .page-turn-previous {
    left: 4px;
  }

  .page-turn-next {
    right: 4px;
  }

  .side-tabs {
    padding: 6px;
  }

  .phrase-panel,
  .ocr-panel,
  .note-panel,
  .tag-panel {
    padding: 12px;
  }
}

@media (orientation: landscape) {
  .match-dialog {
    width: min(1100px, 100%);
  }

  .word-match-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 72px;
    padding: 18px 28px 12px;
  }

  .word-match-images,
  .word-match-words {
    grid-template-columns: repeat(var(--match-count, 4), minmax(0, 1fr));
  }

  .word-match-images button {
    height: clamp(140px, 22vh, 220px);
    min-height: 140px;
  }

  .word-match-words button {
    height: 82px;
    min-height: 82px;
  }
}

/* Shared vocabulary language across the full page and reader panel. */
.vocabulary-item-card {
  border-radius: 12px;
}

.vocabulary-core {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.vocabulary-core .vocabulary-title-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
}

.vocabulary-core .vocabulary-headwords {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
}

.vocabulary-core .vocabulary-headwords strong {
  min-width: 0;
  overflow: hidden;
  color: #29495b;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocabulary-core .vocabulary-headwords small {
  color: #74877d;
  font-size: 9px;
  font-weight: 800;
}

.vocabulary-core .vocabulary-headwords > .cefr-badge {
  flex: 0 0 auto;
}

.vocabulary-core .vocabulary-grammar {
  margin-top: 3px;
  color: #74877d;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 750;
}

.vocabulary-core .vocabulary-meaning {
  margin-top: 4px;
  color: #526b5f;
  font-size: 10px;
  line-height: 1.35;
}

.vocabulary-core .vocabulary-meaning-en {
  color: #718294;
}

.vocabulary-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.open-wordbook-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 8px;
  border-radius: 8px;
  color: #477461;
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.open-wordbook-link:hover,
.open-wordbook-link:focus-visible {
  background: #edf7f0;
  color: #2f7653;
  outline: none;
}

.phrase-panel .phrase-type-filter.active {
  border-color: #91c7a8;
  background: #edf7f0;
  color: #397c59;
}

.phrase-panel .study-phrase-card.active {
  border-color: #9bcbaa;
  background: #f1faf4;
  box-shadow: 0 0 0 2px rgba(79, 170, 120, 0.14);
}

.phrase-panel .phrase-select-button.is-selected {
  border-color: #4faa78;
}

.phrase-panel .phrase-select-button.is-selected > span {
  background: #4faa78;
}

.phrase-panel .phrase-detail-button,
.phrase-panel .phrase-audio-button {
  background: #edf7f0;
  color: #477461;
}

.phrase-panel .phrase-detail-button:hover,
.phrase-panel .phrase-audio-button:hover {
  border-color: #a8d2bb;
  color: #2f7653;
}

/* Text-labelled reader toolbar action (for example "待审问题"). The icon
   buttons are a fixed 32px square; a labelled action keeps the same height but
   sizes to its text. */
.reader-line-button.reader-line-text-button {
  width: auto;
  min-width: 32px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

/* Review-edition badge: shown wherever a book with unfinished matching work is
   listed, so it is never presented as a completed book. */
.review-edition-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid #d8a33a;
  border-radius: 999px;
  background: rgba(216, 163, 58, 0.14);
  color: #a4731a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Page-level review (审核模式).
   The panel is a working surface, so the sections stay compact, the save state
   stays visible, and every read-only "system" summary is visually distinct from
   an editable draft.
   --------------------------------------------------------------------------- */

.reader.review-editing .ocr-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.review-panel {
  display: grid;
  gap: 12px;
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.review-head h2 {
  margin: 0;
  font-size: 17px;
}

.review-head p {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.review-pick-banner {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #c58a2a;
  border-radius: 10px;
  background: #fdf6e6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.review-pick-banner strong {
  font-size: 13px;
}

.review-pick-selection {
  font-size: 12px;
  color: var(--muted);
}

.review-notice,
.review-error,
.review-warning {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.review-notice {
  background: #eef4fb;
  color: #2c4a6b;
}

.review-error {
  background: #fdecea;
  color: #a02c22;
}

.review-warning {
  background: #fdf6e6;
  color: #8a5b12;
}

.review-save-state {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f2f4f7;
  color: #47505c;
  font-size: 12px;
  line-height: 1.45;
}

.review-save-state[data-state="dirty"] {
  background: #fdf6e6;
  color: #8a5b12;
}

.review-save-state[data-state="saved"] {
  background: #eaf4ec;
  color: #2f6b3d;
}

.review-save-state[data-state="error"] {
  background: #fdecea;
  color: #a02c22;
}

.review-follow-paused {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px dashed #c58a2a;
  border-radius: 8px;
  font-size: 12px;
  color: #8a5b12;
}

.review-tabs,
.review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-tab {
  flex: 1 1 auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.review-tab.active {
  border-color: #2c4a6b;
  background: #eef4fb;
  font-weight: 600;
}

.review-section {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.review-section h3 {
  margin: 6px 0 0;
  font-size: 13px;
}

.review-section p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.review-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.review-list li {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.5;
}

.review-list code {
  font-size: 11px;
}

.review-audio-list li {
  display: grid;
  gap: 5px;
}

.review-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.review-word-ids {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(128, 128, 128, .12);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.review-crop {
  border: 1px solid var(--line);
  border-radius: 8px;
  background-repeat: no-repeat;
  background-color: #fff;
}

.review-region-preview {
  display: block;
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.review-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.review-field input,
.review-field textarea,
.review-field select {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
}

.review-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.review-choice-block {
  display: grid;
  gap: 5px;
}

.review-choice label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.review-range-row {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.review-range-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.review-range-row input,
.review-range-row select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
}

.review-range-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.review-range-actions .ghost-button,
.review-filters .ghost-button,
.review-list .ghost-button {
  padding: 3px 7px;
  font-size: 11px;
}

.review-filters .ghost-button.active {
  border-color: #2c4a6b;
  background: #eef4fb;
  font-weight: 600;
}

.review-link {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.review-draft-list li {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.review-muted-note {
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.reader-line-text-button.active {
  border-color: #c58a2a;
  color: #8a5b12;
}

.ocr-line.is-review-selected {
  outline: 2px solid #2c4a6b;
  outline-offset: 1px;
  background: rgba(44, 74, 107, .18);
}

/* 查看本批改动：草稿层的前后差异，冲突与占用关系单独标出。 */
.review-diff {
  line-height: 1.9;
  word-break: break-word;
}

.review-diff del {
  padding: 0 3px;
  border-radius: 4px;
  background: #fdecea;
  color: #a02c22;
  text-decoration: line-through;
}

.review-diff ins {
  padding: 0 3px;
  border-radius: 4px;
  background: #eaf4ec;
  color: #2f6b3d;
  text-decoration: none;
}

.review-batch {
  display: grid;
  gap: 12px;
}

.review-batch-group h3 {
  margin: 10px 0 6px;
  font-size: 13px;
}

.review-batch-item {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.review-batch-item header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.review-batch-item header code {
  font-size: 11px;
  word-break: break-all;
}

.review-batch-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.review-batch-label {
  color: var(--muted);
}

.review-batch-conflicts {
  margin: 0;
  padding-left: 18px;
  color: #8a5b12;
  font-size: 12px;
  line-height: 1.5;
}

.review-batch-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.review-details summary {
  font-size: 12px;
  cursor: pointer;
}

.review-share {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.review-pipeline {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.review-pipeline h3 {
  margin: 0;
  font-size: 13px;
}

.review-pipeline .review-batch-footer {
  border-top: 0;
  padding-top: 0;
}

.review-time-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #c58a2a;
  border-radius: 10px;
  background: #fdf6e6;
}

.review-time-editor h3 {
  margin: 0;
  font-size: 13px;
}

.review-unmatched-print {
  display: grid;
  gap: 8px;
  padding: 10px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(128, 128, 128, .06);
}

.review-unmatched-print h3 {
  margin: 0;
  font-size: 13px;
}

/* ---------------------------------------------------------------------------
   Page-level review workbench redesign (2026-09-26).

   The panel is now a header, a two-entry task switch, one task body and a fixed
   bottom bar.  The bar is the last grid row and sticks to the bottom of the
   scrolling pane, so the batch action is always reachable and never covers the
   content above it: the panel keeps its own bottom padding for that.
   --------------------------------------------------------------------------- */

/* The panel fills the scrolling side section as a column, so the bottom bar can
   be pushed to the bottom of the pane when there is room and stick there when
   the content is taller. */
.ocr-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.review-panel {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  gap: 0;
  padding: 0;
}

.review-scroll-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 10px;
  scrollbar-gutter: stable;
}

/* No header control may be squeezed into a wrapped label: 「退出」 breaking into
   「退出 / 核」 is exactly the defect the redesign removes. */
.review-head > button,
.review-head > a,
.review-head > .ghost-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.review-page-chip {
  flex: 0 0 auto;
  margin: 0 2px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.review-page-chip.active {
  border-color: #2c4a6b;
  background: #eef4fb;
  font-weight: 700;
}

.review-task-entries {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f4ef;
}

.review-task-entry {
  flex: 1 1 0;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.review-task-entry.active {
  border-color: #2c4a6b;
  background: #ffffff;
  font-weight: 700;
}

/* The fixed bottom bar: two status lines and the batch action. */
.review-bottom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-width: 0;
  gap: 8px;
  padding: 9px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--reader-bg);
  box-shadow: 0 -4px 14px rgba(48, 68, 91, 0.06);
}

.review-status-lines {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 180px;
}

.review-status-save,
.review-status-apply {
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.review-status-save[data-state="saved"] {
  color: #2f6b3a;
}

.review-status-save[data-state="dirty"],
.review-status-save[data-state="saving"] {
  color: #8a5b12;
}

.review-status-save[data-state="error"],
.review-status-save[data-state="load-error"],
.review-status-apply[data-state="failed"],
.review-status-apply[data-state="load-failed"] {
  color: #a33228;
}

.review-status-apply[data-state="effective"] {
  color: #2f6b3a;
  font-weight: 600;
}

.review-status-apply[data-state="updated"],
.review-status-apply[data-state="saved"],
.review-status-apply[data-state="submitting"] {
  color: #53687a;
}

.review-status-apply[data-state="pending-rebuild"],
.review-status-apply[data-state="pending-quota"],
.review-status-apply[data-state="needs-reverify"] {
  color: #8a5b12;
}

.review-bottom-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.review-bottom-actions .primary-button,
.review-bottom-actions .ghost-button {
  white-space: nowrap;
}

.review-warning-list {
  margin: 0;
  padding: 8px 10px 8px 26px;
  border-radius: 8px;
  background: #fdf3e2;
  color: #8a5b12;
  font-size: 12px;
}

.review-effective-ranges {
  margin: 0;
}

.review-effective-ranges code {
  margin-right: 6px;
}

.review-bottom-bar > .review-details {
  flex: 0 1 100%;
  min-width: 0;
  max-height: min(32vh, 18rem);
  overflow: auto;
  overscroll-behavior: contain;
}

/* Narrow panes: the status lines stack above the action, and the action fills
   the width so its two-character labels never break. */
@media (max-width: 460px) {
  .review-bottom-bar {
    align-items: stretch;
  }

  .review-bottom-actions {
    flex: 1 1 100%;
  }

  .review-bottom-actions .primary-button {
    flex: 1 1 auto;
  }
}

/* The batch preview and the formal pipeline are a wide overlay, not a long
   column squeezed into a narrow side pane: the reviewer reads the whole batch
   and its plan at once, and 返回审核 closes it. */
.review-batch[data-review-panel] {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: block;
  overflow: auto;
  margin: 0;
  padding: 14px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 26, 20, 0.18);
}

@media (max-width: 720px) {
  .review-batch[data-review-panel] {
    inset: 0;
    border-radius: 0;
  }
}

/* Simple review card: the current edit and its primary action stay readable. */
.review-panel [data-review-text] { min-height: 5.5rem; height: auto; }
.review-page-audio-summary { padding: .65rem 0; border-bottom: 1px solid var(--border-color, #dedbd1); font-size: .9rem; }
.review-panel .review-task-entries { flex-wrap: wrap; margin-bottom: 1rem; }
.review-panel .review-bottom-bar pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }

.review-manual-binding {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.review-manual-binding > .muted,
.review-manual-effective { min-width: 0; overflow-wrap: anywhere; }
.review-manual-binding .review-field select { width: 100%; min-width: 0; }
.review-manual-source-name { display: block; overflow-wrap: anywhere; }
.review-manual-binding [data-manual-binding-audio] { display: none; }
.review-manual-player { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.review-manual-transport,
.review-manual-audition { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.review-manual-transport [data-manual-audio-clock] { font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-manual-player [data-manual-audio-seek] { display: block; width: 100%; min-width: 0; }
.review-manual-points { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; min-width: 0; }
.review-manual-points label { display: grid; gap: 4px; min-width: 0; font-size: .88em; }
.review-manual-points input { box-sizing: border-box; width: 100%; min-width: 0; }
.review-manual-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin: 10px 0; padding: 8px; }
.review-manual-nudge legend { padding: 0 4px; }
.review-manual-audition [data-manual-audio-message] { flex: 1 1 150px; min-width: 0; overflow-wrap: anywhere; }
.review-manual-binding .review-details,
.review-manual-binding .review-list,
.review-manual-binding .review-list li { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .review-manual-points { grid-template-columns: minmax(0, 1fr); }
  .review-manual-transport { gap: 5px; }
  .review-manual-transport .ghost-button,
  .review-manual-audition .primary-button,
  .review-manual-audition .ghost-button { max-width: 100%; white-space: normal; }
}
.review-panel .review-time-editor { padding: .5rem 0; }

/* At the target reading width the search field gets its own row. The player,
   page jump and all toolbar actions remain in a second row with their natural
   sizes; the book area below this grid reflows through its flex layout. */
@container (max-width: 840px) {
  .reader-toolbar {
    grid-template-columns: minmax(190px, 1fr) 100px max-content;
    grid-template-areas:
      "search search search"
      "audio page actions";
    row-gap: 4px;
    flex: 0 0 auto;
  }

  .reader-toolbar .library-search-reader {
    grid-area: search;
    min-width: 0;
  }

  .reader-toolbar .reader-audio-tools {
    grid-area: audio;
  }

  .reader-toolbar .toolbar-page-jump {
    grid-area: page;
    width: 100px;
    min-width: 0;
  }

  .reader-toolbar .toolbar-page-jump .page-jump-control {
    padding-inline: 4px;
  }

  .reader-toolbar .picture-book-controls [data-audio-current] {
    display: none;
  }

  .reader-toolbar .picture-book-progress {
    min-width: 60px;
  }

  .reader-toolbar .reader-toolbar-actions {
    grid-area: actions;
    justify-content: flex-end;
    min-width: 0;
    gap: 0;
  }
}

/* Keep the player inline whenever the toolbar can hold it. Only collapse the
   controls to a popover below the width needed by the player, page jump and
   toolbar actions together. */
@container (max-width: 537px) {
  .reader-toolbar {
    grid-template-columns: minmax(40px, 1fr) 100px;
    grid-template-areas:
      "search search"
      "audio page"
      "actions actions";
    row-gap: 4px;
  }

  .reader-toolbar .reader-audio-tools {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
  }

  .reader-toolbar .picture-book-player {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    padding: 4px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .reader-toolbar .picture-book-controls {
    position: absolute;
    z-index: 60;
    top: calc(100% + 55px);
    left: 0;
    width: min(300px, calc(100cqw - 28px));
    min-height: 40px;
    padding: 4px 8px;
    border: 1px solid rgba(209, 217, 222, 0.96);
    border-radius: 14px;
    background: rgba(255, 253, 247, 0.98);
    box-shadow: 0 8px 24px rgba(51, 64, 75, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(0, -4px);
    transition: opacity 160ms ease, visibility 160ms ease, transform 180ms ease;
  }

  .reader-toolbar .reader-audio-tools.is-expanded .picture-book-controls {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(0, 0);
  }

  .reader-toolbar .reader-toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@container (max-width: 220px) {
  .reader-toolbar .reader-toolbar-actions {
    justify-content: flex-start;
  }

  .reader-toolbar .picture-book-controls {
    top: calc(100% + 80px);
  }
}

/* Batch updates keep one primary action and wrap long status messages. */
.review-batch-submit {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel, #fff);
  overflow-wrap: anywhere;
}
.review-batch-submit p { margin: 0; }
.review-batch-item header label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.review-batch-item input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; }

.review-batch[data-review-panel] { display: flex; flex-direction: column; overflow: hidden; gap: 12px; padding: 12px; }
.review-batch > .review-head { flex: 0 0 auto; margin: 0; }
.review-batch-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 4px; scrollbar-gutter: stable; }
.review-batch > .review-batch-submit { flex: 0 0 auto; gap: 8px; padding: 12px; }
.review-batch-submit p { font-size: 13px; line-height: 1.5; max-height: 7em; overflow: auto; font-weight: normal; }
.review-batch-item { margin-bottom: 10px; padding: 12px; }
.review-batch-item .note-actions { gap: 8px; flex-wrap: wrap; }
.review-batch-item .quote { margin: 8px 0; overflow-wrap: anywhere; }
.review-batch-scroll > .review-details { margin: 12px 0; }
.review-sentence-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; display: grid; gap: 8px; }
.review-sentence-card p { margin: 0; font-size: 13px; line-height: 1.5; }
.review-sentence-words { display: flex; flex-wrap: wrap; gap: 5px; }
.review-sentence-words input { width: 100px; min-width: 0; flex: 1 1 80px; }
.review-sentence-card textarea { min-height: 65px; }
.review-page-audio-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Keep review controls readable in the narrow reader sidebar. */
.review-panel { font-size: 13px; }
.review-panel :is(button, input, select, textarea) { font-family: inherit; font-size: 13px; }
.review-panel :is(h2, h3) { font-size: 14px; }
.review-panel button { white-space: nowrap; }
.review-sentence-card > b { font-size: 14px; }
.review-sentence-times { display: grid; gap: 8px; min-width: 0; }
.review-sentence-time-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.review-sentence-time-row label { display: flex; align-items: center; gap: 6px; flex: 1 1 155px; min-width: 0; }
.review-sentence-time-row input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.review-time-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.review-sentence-card :is(.review-time-tools, .review-sentence-actions) button { min-height: 30px; padding: 6px 9px; border-radius: 8px; line-height: 1.3; flex: 0 0 auto; }
.review-sentence-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.review-sentence-card [data-sentence-time-notice]:empty { display: none; }
.review-sentence-time-row label { white-space: nowrap; }
.review-sentence-time-row input { flex: 1 1 0; }
.review-range-choice { width: min(480px, calc(100vw - 32px)); box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 20px; color: var(--ink); background: var(--paper, #fffdf7); font: inherit; font-size: 13px; }
.review-range-choice::backdrop { background: rgba(0,0,0,.3); }
.review-range-choice h3 { font-size: 15px; }
.review-range-choice p { overflow-wrap: anywhere; line-height: 1.6; }
.review-range-choice .note-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-range-choice button { font: inherit; white-space: nowrap; }
.review-text-unify { display: flex; flex-wrap: wrap; gap: 6px; }
.review-text-unify button { padding: 6px 9px; min-height: 30px; border-radius: 8px; line-height: 1.3; }
.review-word-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.review-word-time { display: grid; grid-template-columns: minmax(60px,1fr) minmax(0,1fr) minmax(0,1fr); gap: 6px; align-items: center; margin: 5px 0; }
.review-word-time input { width: 100%; min-width: 0; box-sizing: border-box; }

/* Toolbar rows follow their contents, including the optional title and seek form. */
.book-pane > .reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  height: auto;
  overflow: visible;
}
.reader-toolbar > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.reader-toolbar .reader-title { display: block; flex: 0 1 auto; }
.reader-toolbar .reader-title strong { white-space: normal; overflow-wrap: anywhere; }
.reader-toolbar .library-search-reader { flex: 1 1 210px; width: auto; }
.reader-toolbar .reader-audio-tools { display: flex; flex-wrap: wrap; flex: 1 1 340px; width: auto; min-width: 0; max-width: 100%; gap: 6px; }
.reader-toolbar .picture-book-player { flex: 1 1 210px; width: auto; min-width: 0; max-width: 100%; box-sizing: border-box; }
.reader-toolbar .picture-book-controls,
.reader-toolbar .reader-audio-tools.is-expanded .picture-book-controls {
  position: static; display: flex; flex: 1 1 auto; width: auto; min-width: 0;
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  padding: 0; border: 0; box-shadow: none; background: transparent;
}
.reader-toolbar .picture-book-controls [data-audio-current] { display: inline; }
.reader-toolbar .picture-book-progress { flex: 1 1 60px; width: 60px; min-width: 20px; }
.reader-toolbar .reader-audio-tools .audio-time-jump { display: flex; flex: 0 1 auto; max-width: 100%; }
.reader-toolbar .toolbar-page-jump { flex: 0 1 auto; width: auto; min-width: 0; }
.reader-toolbar .toolbar-page-jump .page-total { display: inline; }
.reader-toolbar .reader-toolbar-actions { display: flex; flex-wrap: wrap; flex: 0 1 auto; min-width: 0; max-width: 100%; margin-left: auto; gap: 2px; }
.reader-toolbar .reader-toolbar-actions > * { flex-shrink: 0; }
.review-word-time[hidden] { display: none; }
.review-sentence-words .review-insert-word { flex: 0 0 14px; min-width: 14px; width: 14px; padding: 0; min-height: 28px; font-size: 16px; opacity: .15; border-radius: 4px; }
.review-sentence-words:hover .review-insert-word, .review-insert-word:focus-visible { opacity: 1; }
@media (hover: none) { .review-sentence-words .review-insert-word { opacity: 1; } }

.review-range-row .review-range-current {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 5px 8px;
  font: inherit;
}

.reader-contents {
  width: min(420px, calc(100vw - 32px));
  max-height: 80vh;
  box-sizing: border-box;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper, #f5f2e9);
  color: inherit;
  font: inherit;
}
.reader-contents::backdrop { background: rgb(0 0 0 / 25%); }
.reader-contents h2 { margin: 0; font-size: 18px; }
.reader-contents-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.reader-contents-item.active, .reader-contents-item:hover { background: #e8f3ff; }
.reader-contents-item small { opacity: .75; }

/* Same letters with different capitalization or punctuation are reviewable
   typography differences, not lexical errors. */
.review-diff-equivalent {
  background: #fff1a8; color: #795500; padding: 0 3px; border-radius: 4px;
}
.reader.review-mode .ocr-word.review-equivalent-word:not(.is-current-word) {
  background: rgba(250, 204, 21, .30); box-shadow: inset 0 0 0 1px rgba(202, 138, 4, .65);
}
.reader.review-mode .ocr-word.review-lexical-difference:not(.is-current-word) {
  background: rgba(239, 68, 68, .25); box-shadow: inset 0 0 0 1px rgba(185, 28, 28, .7);
}

.review-diff ins.review-diff-lexical { background: #fde2e2; color: #a02c22; }

/* Keep the settings scroll rail visible on systems with overlay scrollbars. */
.settings-menu::-webkit-scrollbar { width: 12px; }
.settings-menu::-webkit-scrollbar-track { background: #edf0f3; border-radius: 10px; }
.settings-menu::-webkit-scrollbar-thumb { background: #9aabbb; border: 3px solid #edf0f3; border-radius: 10px; }
.settings-menu::-webkit-scrollbar-thumb:hover { background: #71869a; }

/* Hide only audit marks; selection and audio playback keep their own highlight. */
.reader.review-mode[data-review-yellow="false"] .ocr-line.needs-review:not(.review-lexical-difference):not(.is-current-word):not(.is-playing-sentence):not(.is-sentence-selected):not(.is-drag-selected),
.reader.review-mode[data-review-yellow="false"] .ocr-word.review-equivalent-word:not(.is-current-word):not(.is-playing-sentence):not(.is-sentence-selected):not(.is-drag-selected),
.reader.review-mode[data-review-red="false"] .ocr-word.review-lexical-difference:not(.is-current-word):not(.is-playing-sentence):not(.is-sentence-selected):not(.is-drag-selected) {
  background: transparent;
  box-shadow: none;
}

.settings-review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-review-actions a { text-decoration: none; display: inline-flex; align-items: center; }

.publication-update { position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:1000; display:flex; align-items:center; gap:18px; padding:12px 18px; border:1px solid #9cbdcd; border-radius:14px; background:#fffdf8; box-shadow:0 5px 24px #0002; color:#263b4c; }
.publication-update button { border:0; border-radius:8px; padding:8px 12px; background:#3278a8; color:white; cursor:pointer; }
