/* Chapter reader */

/* Immersive bottom bar: fixed to the bottom, slides down while reading, tap/scroll to reveal */
.reader-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: rgba(9,8,14,0.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); transition: transform .25s ease; padding-bottom: env(safe-area-inset-bottom); }
.reader-bar.nav-hidden { transform: translateY(100%); }
.reader-bar .wrap { display: flex; align-items: center; gap: 12px; height: 58px; }
.rb-home { display: inline-grid; place-items: center; width: 42px; height: 38px; color: var(--muted); border-radius: 10px; border: 1px solid transparent; }
.rb-home:hover { color: var(--accent, #f0a92b); border-color: var(--line); }

.ch-select { position: relative; }
.ch-picker-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-solid); border: 1px solid var(--line); color: var(--text); padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; white-space: nowrap; }
.ch-picker-btn:hover { border-color: var(--accent, #f0a92b); }
.ch-picker-btn .caret { color: var(--muted); transition: transform .18s, color .18s; }
.ch-picker-btn.open .caret { transform: rotate(180deg); color: var(--accent, #f0a92b); }

/* Searchable chapter picker — opens upward, above the bottom bar */
.reader-picker { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 51; width: min(340px, calc(100vw - 28px)); max-height: 52vh; background: rgba(18,15,26,0.98); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -14px 44px rgba(0,0,0,0.55); overflow: hidden; display: flex; flex-direction: column; }
.rp-search { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rp-search svg { color: var(--muted-2); flex: none; }
.rp-search input { border: 0; background: transparent; color: var(--text); outline: none; width: 100%; font-size: 14px; font-family: inherit; }
.rp-search input::placeholder { color: var(--muted-2); }
.rp-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.rp-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 9px; color: var(--text); font-size: 14px; font-weight: 600; transition: background .12s; }
.rp-item:hover { background: var(--surface-2); }
.rp-item.current { background: var(--accent-soft); color: var(--accent, #f0a92b); }
.rp-item .rp-d { color: var(--muted-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rp-empty { padding: 18px; text-align: center; color: var(--muted-2); font-size: 13px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 13px; gap: 7px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600; transition: .16s; }
.icon-btn:hover { color: var(--text); border-color: var(--accent, #f0a92b); }
.rb-nav { display: inline-flex; gap: 6px; }
.rb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.width-toggle { display: inline-flex; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.width-toggle button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.width-toggle button.on { background: var(--accent, #f0a92b); color: #1a1200; }
.report-btn { color: var(--hot); }
.report-btn:hover { border-color: var(--hot); }

/* Progress line — thin, always visible at the very top */
.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 46; height: 3px; background: rgba(255,255,255,0.06); }
.progress .fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-deep), var(--accent, #f0a92b)); box-shadow: 0 0 10px var(--accent, #f0a92b); }

.reader-title { text-align: center; padding: 26px 22px 6px; }
.reader-title .eyebrow { display: block; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent, #f0a92b); font-weight: 700; margin-bottom: 8px; }
.reader-title h1 { font-size: clamp(20px, 3vw, 28px); font-weight: 800; }

/* Long-strip pages */
.strip { margin: 20px auto 0; display: block; transition: max-width .25s ease; cursor: pointer; }
.strip.fit { max-width: 720px; }
.strip.full { max-width: 1000px; }
.strip p { margin: 0; }
.strip img { display: block; width: 100%; height: auto; margin: 0 auto; }
.no-content { text-align: center; color: var(--muted); padding: 40px 20px; }

.chapter-end { max-width: 720px; margin: 26px auto 96px; padding: 0 22px; }
.next-card { display: block; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: center; transition: border-color .16s, transform .12s; }
.next-card:hover { border-color: var(--accent, #f0a92b); transform: translateY(-2px); }
.next-card .k { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.next-card .v { font-size: 22px; font-weight: 900; color: var(--accent, #f0a92b); margin-top: 6px; }

/* Report modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(6,5,10,0.72); backdrop-filter: blur(4px); z-index: 70; display: none; place-items: center; padding: 20px; }
.modal-overlay.open { display: grid; }
.modal { width: 100%; max-width: 440px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head .x { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-body label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; display: block; margin-bottom: 6px; }
.modal-body select, .modal-body textarea { width: 100%; background: var(--ink, #0d0b13); border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 11px 13px; font-family: inherit; font-size: 14px; outline: none; }
.modal-body select:focus, .modal-body textarea:focus { border-color: var(--accent, #f0a92b); }
.report-status { font-size: 14px; font-weight: 600; text-align: center; color: var(--good); }

/* Mobile: compact bar — icons only, no width toggle (mobile reads full-width) */
@media (max-width: 620px) {
  .reader-bar .wrap { gap: 8px; }
  .reader-bar .lbl { display: none; }
  .icon-btn { padding: 0 11px; }
  .width-toggle { display: none; }
  .ch-select select { max-width: 44vw; }
  .reader-title { padding-top: 22px; }
}
