.abr-er-error {
  padding: 1rem 1.25rem;
  background: #fff3f3;
  border: 1px solid #e0a0a0;
  border-radius: 12px;
  color: #8b0000;
  font-size: 0.95rem;
}

.abr-er-root,
.abr-er-list-root,
.abr-er-ebook-wrap {
  --abr-er-bg: #f4f6fb;
  --abr-er-panel: #ffffff;
  --abr-er-accent: #1e4d8c;
  --abr-er-accent-2: #2d6a4f;
  --abr-er-accent-soft: #e8eef8;
  --abr-er-border: #dde3ef;
  --abr-er-text: #1a2233;
  --abr-er-muted: #5c677d;
  --abr-er-shadow: 0 18px 40px rgba(20, 35, 70, 0.08);
  --abr-er-radius: 16px;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  color: var(--abr-er-text);
  max-width: 880px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.abr-er-ebook-wrap {
  background: linear-gradient(180deg, #f3f5f9 0%, #e8edf5 100%);
  border-radius: 24px;
  padding: 1.5rem 1rem 2.2rem;
}

.abr-er-brand {
  font-size: 0.82rem;
  color: var(--abr-er-muted);
  margin: 0 0 0.35rem;
  letter-spacing: 0.04em;
}
.abr-er-brand a {
  color: var(--abr-er-accent);
  text-decoration: none;
  font-weight: 700;
}

.abr-er-list-header {
  margin-bottom: 1.5rem;
  text-align: center;
}
.abr-er-list-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin: 0 0 0.5rem;
  line-height: 1.25;
  color: #152238;
  font-weight: 800;
}
.abr-er-list-desc {
  color: var(--abr-er-muted);
  margin: 0 auto;
  max-width: 36rem;
  line-height: 1.65;
  font-size: 0.98rem;
}

/* Level selection */
.abr-er-level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}
.abr-er-level-card {
  appearance: none;
  border: 2px solid var(--abr-er-border);
  background: var(--abr-er-panel);
  border-radius: var(--abr-er-radius);
  padding: 1.1rem 0.85rem;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 18px rgba(20, 35, 70, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.abr-er-level-card:hover {
  transform: translateY(-2px);
  border-color: #b8c7e6;
  box-shadow: var(--abr-er-shadow);
}
.abr-er-level-card.is-active {
  border-color: var(--abr-er-accent);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  box-shadow: var(--abr-er-shadow);
}
.abr-er-level-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
.abr-er-level-badge--beginner { background: #e7f6ef; color: #1f6b4a; }
.abr-er-level-badge--intermediate { background: #e8eef8; color: #1e4d8c; }
.abr-er-level-badge--advanced { background: #f7ece8; color: #9a3b1f; }
.abr-er-level-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  color: #152238;
}
.abr-er-level-desc {
  display: block;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--abr-er-muted);
}
.abr-er-level-count {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--abr-er-accent);
}

.abr-er-header { margin-bottom: 1rem; }
.abr-er-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.abr-er-title-en {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  margin: 0;
  line-height: 1.35;
  color: #152238;
}
.abr-er-title-ko {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: #334155;
  font-weight: 700;
}
.abr-er-meta {
  font-size: 0.82rem;
  color: var(--abr-er-muted);
  margin: 0;
}
.abr-er-level-pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}
.abr-er-go-home {
  white-space: nowrap;
  border-color: #cfd8ea;
  background: #f8fbff;
}

.abr-er-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: center;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid #d7e1f1;
  border-radius: 14px;
  margin-bottom: 1rem;
  box-shadow: 0 8px 22px rgba(20, 35, 70, 0.06);
}

.abr-er-btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid #d3ddee;
  background: #fbfdff;
  padding: 0.52rem 0.95rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a3159;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.abr-er-btn:hover:not(:disabled) {
  background: #f2f7ff;
  border-color: #b7c8e8;
  box-shadow: 0 4px 12px rgba(30, 77, 140, 0.08);
}
.abr-er-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.abr-er-btn-play {
  background: linear-gradient(180deg, #2b66c3 0%, #1e4f99 100%);
  color: #fff;
  border-color: #25579f;
}
.abr-er-btn-play:hover:not(:disabled) {
  background: linear-gradient(180deg, #2e70d5 0%, #2358a9 100%);
}
.abr-er-btn-primary {
  display: inline-block;
  background: var(--abr-er-accent-2);
  color: #fff;
  border-color: var(--abr-er-accent-2);
  text-decoration: none;
  margin-top: 0.75rem;
}
.abr-er-btn-primary:hover:not(:disabled) { background: #245a42; }

.abr-er-level-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin: 0 0 1rem;
}
.abr-er-level-switch .abr-er-btn {
  padding: 0.45rem 0.85rem;
}
.abr-er-level-switch .abr-er-btn.is-active {
  border-color: var(--abr-er-accent);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  box-shadow: 0 10px 28px rgba(30, 77, 140, 0.08);
}

.abr-er-speed,
.abr-er-toggle-ko {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.83rem;
  color: #4f6283;
  font-weight: 700;
}
.abr-er-rate {
  font: inherit;
  border: 1px solid #cfd8ea;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.4rem 1.9rem 0.4rem 0.6rem;
  font-weight: 700;
  color: #1b335c;
}
.abr-er-book-picker { min-width: 170px; }
.abr-er-story-picker { min-width: 320px; }
.abr-er-native-select {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.abr-er-custom-select {
  position: relative;
  width: 100%;
}
.abr-er-custom-trigger {
  width: 100%;
  text-align: left;
  font: inherit;
  border: 1px solid #cfd8ea;
  border-radius: 12px;
  background: #f8fbff;
  color: #152544;
  font-weight: 700;
  padding: 0.52rem 2.1rem 0.52rem 0.75rem;
  cursor: pointer;
  position: relative;
}
.abr-er-custom-trigger::after {
  content: '▾';
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-52%);
  color: #36517e;
  font-size: 0.85rem;
}
.abr-er-custom-select.is-open .abr-er-custom-trigger {
  border-color: #9bb5e8;
  box-shadow: 0 0 0 2px rgba(155, 181, 232, 0.25);
}
.abr-er-custom-menu {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.35rem;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid #d4deee;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(20, 35, 70, 0.12);
  max-height: 240px;
  overflow: auto;
  display: none;
}
.abr-er-custom-select.is-open .abr-er-custom-menu { display: block; }
.abr-er-custom-option {
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  cursor: pointer;
  color: #1b335c;
  font-weight: 600;
}
.abr-er-custom-option:hover {
  background: #eef4ff;
}
.abr-er-custom-option.is-active {
  background: #dfeafd;
  color: #15386f;
}
.abr-er-story-select {
  width: 100%;
  font: inherit;
  border: 1px solid #cfd8ea;
  border-radius: 12px;
  background: #f8fbff;
  padding: 0.52rem 0.75rem;
  color: #152544;
  font-weight: 700;
}
.abr-er-story-select:focus-visible {
  outline: 2px solid #9bb5e8;
  outline-offset: 2px;
}
.abr-er-reader-book-select {
  width: 100%;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid #cfd8ea;
  border-radius: 12px;
  background:
    linear-gradient(45deg, transparent 50%, #3a4f79 50%) calc(100% - 17px) calc(50% - 2px) / 7px 7px no-repeat,
    linear-gradient(135deg, #3a4f79 50%, transparent 50%) calc(100% - 12px) calc(50% - 2px) / 7px 7px no-repeat,
    #f8fbff;
  color: #152544;
  font-weight: 700;
  padding: 0.52rem 2rem 0.52rem 0.75rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.abr-er-reader-book-select:focus-visible {
  outline: 2px solid #9bb5e8;
  outline-offset: 2px;
}
.abr-er-reader-book-select:hover {
  border-color: #b8c8e7;
  background:
    linear-gradient(45deg, transparent 50%, #28426f 50%) calc(100% - 17px) calc(50% - 2px) / 7px 7px no-repeat,
    linear-gradient(135deg, #28426f 50%, transparent 50%) calc(100% - 12px) calc(50% - 2px) / 7px 7px no-repeat,
    #f1f6ff;
}

.abr-er-text {
  background: var(--abr-er-panel);
  border: 1px solid var(--abr-er-border);
  border-radius: var(--abr-er-radius);
  padding: 1.5rem 1.55rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 14px rgba(20, 35, 70, 0.04);
}

.abr-er-story-body {
  max-width: 100%;
}

.abr-er-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.72;
  text-align: justify;
  text-justify: inter-word;
  margin: 0;
  color: #111;
  hyphens: auto;
  word-wrap: break-word;
}

.abr-er-sentence-span {
  cursor: pointer;
  border-radius: 4px;
  padding: 0.1em 0.05em;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.abr-er-sentence-span:hover {
  background: rgba(30, 77, 140, 0.08);
}

.abr-er-sentence-span.is-active {
  background: #fff3cd;
  box-shadow: inset 0 -2px 0 #e6b800;
  outline: none;
}

.abr-er-sentence-span:focus-visible {
  outline: 2px solid var(--abr-er-accent);
  outline-offset: 2px;
}

.abr-er-vocab {
  background: linear-gradient(180deg, #fafbfd 0%, #f3f6fb 100%);
  border: 1px solid var(--abr-er-border);
  border-radius: var(--abr-er-radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.abr-er-vocab h3 {
  font-size: 0.84rem;
  margin: 0 0 0.65rem;
  color: #475569;
  font-weight: 800;
}
.abr-er-vocab-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.45rem 1rem;
  font-size: 0.88rem;
}
.abr-er-vocab-list li { display: flex; gap: 0.4rem; align-items: baseline; }
.abr-er-vocab-en {
  font-family: Georgia, serif;
  font-weight: 700;
  min-width: 5rem;
  color: #1e4d8c;
}
.abr-er-vocab-ko { color: #334155; }

.abr-er-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.abr-er-nav-pos { font-size: 0.88rem; color: var(--abr-er-muted); font-weight: 600; }
.abr-er-hint {
  font-size: 0.78rem;
  color: var(--abr-er-muted);
  margin: 0;
  text-align: center;
}

.abr-er-book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}
.abr-er-book-card {
  background: #fff;
  border: 1px solid #d9e1ef;
  border-radius: 16px;
  padding: 1.1rem 1rem 0.95rem;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.abr-er-book-card:hover {
  transform: translateY(-2px);
  border-color: #b9c8e5;
  box-shadow: 0 8px 20px rgba(18, 41, 80, 0.08);
}
.abr-er-book-icon-wrap {
  margin-bottom: 0.55rem;
}
.abr-er-book-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #dbe4f3;
  background: #f4f8ff;
  font-size: 18px;
}
.abr-er-book-card h2 {
  margin: 0 0 0.2rem;
  font-size: 1.7rem;
  line-height: 1.18;
  color: #0f2b55;
  letter-spacing: -0.02em;
}
.abr-er-book-en {
  margin: 0 0 0.5rem;
  color: #1f4d95;
  font-size: 0.97rem;
  font-weight: 700;
}
.abr-er-book-desc,
.abr-er-book-meta {
  font-size: 0.84rem;
  color: #6c7892;
  margin: 0 0 0.2rem;
  line-height: 1.45;
}
.abr-er-book-link {
  border: 0;
  background: none;
  padding: 0;
  margin-top: 0.35rem;
  color: #2f65d9;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}
.abr-er-book-link:hover {
  color: #1f4aa8;
  text-decoration: underline;
}

.abr-er-loading {
  text-align: center;
  padding: 2rem;
  color: var(--abr-er-muted);
}

.abr-er-empty-books {
  text-align: center;
  font-size: 0.92rem;
  color: var(--abr-er-muted);
  margin: 0.2rem 0 1rem;
}

.abr-er-panel-hidden { display: none !important; }

@media (max-width: 720px) {
  .abr-er-level-grid { grid-template-columns: 1fr; }
  .abr-er-title-row { flex-direction: column; align-items: stretch; }
  .abr-er-toolbar { flex-direction: column; align-items: stretch; }
  .abr-er-nav { flex-wrap: wrap; }
  .abr-er-book-picker { min-width: 100%; }
  .abr-er-story-picker { min-width: 100%; }
}
