:root {
  color-scheme: only light;
  --reader-shell-ink: #f1eee7;
  --reader-shell-muted: #a8a7a2;
  --reader-shell-cream: #d8c9aa;
  --reader-shell-line: rgba(241, 238, 231, .14);
}

body.reader-shell-ready { display: block !important; padding: 0 !important; }
body.reader-shell-ready > main { width: min(100%,720px) !important; max-width: 720px !important; margin-inline: auto !important; }

.reader-progress { position: fixed; z-index: 70; top: 0; left: 0; width: 100%; height: 3px; background: rgba(255,255,255,.07); }
.reader-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#8d3431,#d8c9aa); }

.reader-topbar {
  position: sticky;
  z-index: 60;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px max(14px,env(safe-area-inset-right)) 8px max(14px,env(safe-area-inset-left));
  border-bottom: 1px solid var(--reader-shell-line);
  background: rgba(6,8,12,.9);
  color: var(--reader-shell-ink);
  backdrop-filter: blur(16px);
}

.reader-topbar a,
.reader-topbar button,
.future-view-setting {
  padding: 9px 12px;
  border: 1px solid var(--reader-shell-line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--reader-shell-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.reader-topbar__title { min-width: 0; text-align: center; }
.reader-topbar__title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.reader-topbar__title span { display: block; margin-top: 2px; color: var(--reader-shell-muted); font-size: 10px; letter-spacing: .08em; }
.reader-topbar__actions { display: flex; justify-content: flex-end; gap: 7px; }




.reader-episode-nav {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  width: min(100% - 28px,620px);
  margin: 28px auto 0;
}

.reader-episode-nav a,
.reader-episode-nav span {
  display: grid;
  min-height: 54px;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--reader-shell-line);
  border-radius: 4px;
  background: rgba(255,255,255,.035);
  color: var(--reader-shell-ink);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.reader-episode-nav span { opacity: .35; }
.reader-episode-nav a:hover,.reader-episode-nav a:focus-visible { border-color: rgba(216,201,170,.65); outline: none; }
.end-card:has(.reader-episode-nav) { align-content: center; justify-items: stretch; padding-inline: 14px; }

.reader-to-top {
  position: fixed;
  z-index: 55;
  right: max(14px,env(safe-area-inset-right));
  bottom: max(16px,env(safe-area-inset-bottom));
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--reader-shell-line);
  border-radius: 50%;
  background: rgba(12,14,18,.82);
  color: var(--reader-shell-ink);
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.future-view-setting { margin-left: 8px; }

.reader-mode-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3,5,8,.84);
  backdrop-filter: blur(18px);
}
.reader-mode-backdrop[hidden] { display: none; }
.reader-mode-dialog { width: min(100%,500px); padding: 28px; border: 1px solid var(--reader-shell-line); border-radius: 8px; background: linear-gradient(145deg,rgba(20,31,36,.98),rgba(8,11,16,.98)); box-shadow: 0 32px 100px rgba(0,0,0,.68); color: var(--reader-shell-ink); }
.reader-mode-dialog p { margin: 0 0 10px; color: var(--reader-shell-cream); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.reader-mode-dialog h2 { margin: 0; font: 700 clamp(27px,7vw,38px)/1.1 Georgia,"Noto Serif KR",serif; letter-spacing: -.045em; }
.reader-mode-dialog > span { display: block; margin: 13px 0 22px; color: var(--reader-shell-muted); font-size: 13px; line-height: 1.65; }
.reader-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reader-mode-options button { min-height: 94px; padding: 16px; border: 1px solid var(--reader-shell-line); border-radius: 5px; background: rgba(255,255,255,.035); color: inherit; text-align: left; cursor: pointer; }
.reader-mode-options button:hover,.reader-mode-options button:focus-visible { border-color: rgba(216,201,170,.7); background: rgba(127,165,173,.12); outline: none; }
.reader-mode-options strong { display: block; font-size: 16px; }
.reader-mode-options small { display: block; margin-top: 7px; color: var(--reader-shell-muted); font-size: 11px; line-height: 1.5; }
.reader-mode-options em { display: inline-block; margin-top: 8px; color: var(--reader-shell-cream); font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .07em; }
body.reader-mode-open { overflow: hidden !important; }

@media (max-width: 600px) {
  .reader-topbar { gap: 7px; }
  .reader-topbar__actions { gap: 5px; }
  .reader-topbar a,.reader-topbar button { padding-inline: 9px; }
  .reader-topbar__mode { font-size: 0 !important; }
  .reader-topbar__mode::after { content: attr(data-short-label); font-size: 10px; }
  .reader-mode-options { grid-template-columns: 1fr; }
  .reader-mode-dialog { padding: 24px 20px; }
}

/* keep full mode labels on narrow screens */
@media (max-width: 600px) {
  .reader-topbar__mode {
    padding-inline: 8px !important;
    font-size: 11px !important;
  }
  .reader-topbar__mode::after {
    content: none !important;
    display: none !important;
  }
}
.reader-topbar__mode,[data-view-toggle],.future-view-setting,.reader-mode-backdrop{display:none!important}
