:root {
  color-scheme: light;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #183b36;
  background: #ffffff;
  font-synthesis: none;
  --green: #176852;
  --blue: #1765b0;
  --ink: #183b36;
  --muted: #5e706e;
  --line: #dce6e3;
}

* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: 0.35; }
button, a, select, summary { touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible,
h2:focus-visible { outline: 3px solid #1765b0; outline-offset: 4px; }
button { color: inherit; }
h1, h2, p { margin: 0; }
.skip-link { position: fixed; z-index: 5; top: 8px; left: 12px; padding: 12px; background: #ffffff; color: var(--blue); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { border-top: 4px solid var(--green); border-bottom: 1px solid var(--line); }
.header-inner, .page, .site-footer { width: min(100%, 1080px); margin-inline: auto; padding-inline: 24px; }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 750; color: var(--green); font-size: 23px; overflow-wrap: anywhere; }
.header-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.page { padding-top: 28px; padding-bottom: 40px; }
.catalog-state { min-height: 300px; padding-block: 36px; }
.catalog-state h1 { font-size: 28px; margin-bottom: 20px; overflow-wrap: anywhere; }
.catalog-state p { color: var(--muted); font-size: 15px; line-height: 1.7; }
.retry-button { min-height: 44px; border: 1px solid var(--green); border-radius: 5px; padding: 8px 16px; margin-top: 20px; background: white; color: var(--green); }
.book-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.field-label { font-size: 13px; font-weight: 650; color: var(--muted); }
.book-options { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; }
.book-option { min-width: 68px; min-height: 40px; background: transparent; border: 0; border-radius: 3px; padding: 8px 12px; font-weight: 650; font-size: 15px; }
.book-option[aria-pressed="true"] { color: #ffffff; background: var(--green); }
.book-option:not([aria-pressed="true"]):hover { background: #edf5f0; }
.library-layout { display: grid; gap: 30px; align-items: start; }
.listening { min-width: 0; }
.book-summary { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 22px; }
.cover-frame { width: 112px; aspect-ratio: 5 / 7; background: #f4f7f6; position: relative; }
.cover { width: 100%; height: 100%; display: block; object-fit: contain; box-shadow: 0 4px 12px #183b3614; }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); font-size: 12px; line-height: 1.6; text-align: center; color: var(--muted); }
.eyebrow { font-size: 11px; color: var(--green); font-weight: 700; margin-bottom: 9px; }
.book-identity h1 { font-size: 26px; line-height: 1.15; font-weight: 780; overflow-wrap: anywhere; max-width: 250px; }
.volume-label { color: var(--blue); font-size: 27px; font-weight: 700; margin-top: 10px; }
.unit-count { color: var(--muted); font-size: 11px; margin-top: 12px; font-weight: 600; }
.now-playing { margin-top: 30px; }
.current-unit { font-size: 12px; font-weight: 700; color: var(--green); margin-bottom: 8px; }
.now-playing h2 { font-size: 23px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.track-meta { min-height: 19px; line-height: 19px; color: var(--muted); font-size: 12px; margin-top: 8px; }
audio { display: block; width: 100%; height: 54px; margin-top: 20px; }
.playback-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.transport, .playback-options { display: flex; align-items: center; gap: 8px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; position: relative; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #ffffff; font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif; font-size: 18px; line-height: 1; }
.icon-button:hover:not(:disabled) { background: #edf5f0; border-color: #a8c4b8; }
.icon-button.primary { background: var(--blue); color: #ffffff; border-color: var(--blue); width: 48px; height: 48px; flex-basis: 48px; font-size: 20px; }
.icon-button.primary:hover { background: #125496; border-color: #125496; }
.repeat-button { font-size: 28px; }
.repeat-one { position: absolute; inset: 19px 0 auto; font: 650 9px/1 "Segoe UI", sans-serif; }
.repeat-button[aria-pressed="true"] { color: var(--green); border-color: var(--green); background: #edf5f0; }
.speed-label { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: var(--muted); font-size: 10px; }
.speed-label select { border: 0; border-bottom: 1px solid #b5c6c0; border-radius: 0; color: var(--ink); background: #ffffff; font-size: 14px; min-height: 28px; padding: 2px 2px 2px 0; width: 70px; cursor: pointer; }
.playback-status { margin-top: 16px; min-height: 44px; }
#playback-status { color: var(--muted); font-size: 12px; line-height: 1.6; }
#playback-status[data-phase="playing"] { color: var(--green); }
#playback-status[data-phase="loading"] { color: var(--blue); }
.error-message { color: #a42c35; font-size: 13px; line-height: 1.65; margin-top: 8px; overflow-wrap: anywhere; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; margin-bottom: 10px; }
.section-heading h2 { font-size: 17px; font-weight: 700; }
.unit-progress { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.unit-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.unit-list li { border-bottom: 1px solid var(--line); }
.unit-button { width: 100%; min-height: 66px; display: grid; grid-template-columns: 28px minmax(0, 1fr) 37px 22px; align-items: center; gap: 12px; text-align: left; border: 0; border-left: 3px solid transparent; border-radius: 0; background: #ffffff; padding: 14px 12px 14px 9px; }
.unit-button:hover { background: #f4f8f6; }
.unit-button.is-selected { border-left-color: var(--blue); background: #edf5fc; }
.unit-button:focus-visible { outline-offset: -3px; }
.unit-number { font-size: 13px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.unit-title { font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.unit-duration { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.unit-icon { color: var(--blue); font: 18px/1 "Segoe UI Symbol", "Apple Symbols", sans-serif; text-align: center; }
.vocab-button { display: flex; align-items: center; gap: 9px; min-height: 36px; margin: -3px 12px 12px 52px; padding: 5px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }
.vocab-button:hover { background: #edf5f0; }
.vocab-button.is-selected { background: #dff0e8; box-shadow: inset 2px 0 var(--green); }
.vocab-duration { color: var(--muted); font-size: 11px; font-weight: 400; }
.vocab-words { margin-top: 15px; font-size: 16px; line-height: 1.9; color: var(--green); overflow-wrap: anywhere; }
.unit-button[data-state="playing"] .unit-icon { color: var(--green); }
.unit-button[data-state="error"] .unit-icon { color: #a42c35; }
.unit-button[data-state="loading"] .unit-icon { animation: turn 1.4s linear infinite; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding-block: 22px 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.audio-credits { display: flex; gap: 18px; align-items: flex-start; }
.ai-note { white-space: nowrap; }
details { max-width: 260px; }
summary { cursor: pointer; min-height: 24px; }
details p { margin-top: 8px; max-width: 240px; }
@keyframes turn { to { transform: rotate(360deg); } }

@media (min-width: 800px) {
  .page { padding-top: 36px; padding-bottom: 56px; }
  .book-nav { margin-bottom: 36px; }
  .library-layout { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 40px; }
  .listening { position: sticky; top: 24px; }
  .unit-section { border-left: 1px solid var(--line); padding-left: 36px; min-width: 0; }
  .book-summary { grid-template-columns: 124px minmax(0, 1fr); gap: 22px; }
  .cover-frame { width: 124px; }
  .book-identity h1 { font-size: 27px; }
  .now-playing { margin-top: 36px; }
}

@media (max-width: 359px) {
  .header-inner, .page, .site-footer { padding-inline: 16px; }
  .book-summary { grid-template-columns: 92px minmax(0, 1fr); gap: 16px; }
  .cover-frame { width: 92px; }
  .book-identity h1 { font-size: 23px; }
  .book-option { min-width: 61px; padding-inline: 9px; }
  .unit-button { gap: 8px; grid-template-columns: 24px minmax(0, 1fr) 33px 18px; padding-right: 7px; }
  .unit-title { font-size: 14px; }
  .playback-controls { gap: 8px; }
  .transport, .playback-options { gap: 5px; }
  .icon-button { width: 40px; flex-basis: 40px; }
  .icon-button.primary { width: 44px; flex-basis: 44px; }
  .speed-label select { width: 63px; }
}

@media (prefers-reduced-motion: reduce) {
  .unit-button[data-state="loading"] .unit-icon { animation: none; }
}
