/* =====================================================================
   Darash — UI layer v2.7.0
   โหลดต่อท้าย <style> เดิมใน index.html (ต้องอยู่หลังสุดของ <head>)
   ===================================================================== */

:root {
    --gold: #D4AF37;
    --gold-ink: #D4AF37;          /* สีทองสำหรับตัวหนังสือ (เข้มขึ้นในโหมดกลางวัน) */
    --accent: #00E5FF;
    --surface: #131A2E;
    --surface-2: #1A2340;
    --chip-bg: rgba(255, 255, 255, 0.06);
    --line: rgba(255, 255, 255, 0.09);
    --muted: #A0AABF;
    --topbar-bg: rgba(8, 12, 24, 0.84);
    --bar-bg: rgba(8, 12, 24, 0.94);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --bar-h: 108px;
}
[data-theme="light"] {
    --gold-ink: #8A6A00;
    --accent: #0284C7;
    --surface: #FFFFFF;
    --surface-2: #EEF2F7;
    --chip-bg: rgba(0, 0, 0, 0.05);
    --line: rgba(0, 0, 0, 0.1);
    --muted: #5B677A;
    --topbar-bg: rgba(244, 246, 249, 0.88);
    --bar-bg: rgba(244, 246, 249, 0.96);
}

/* ---------- โครงหน้า ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { padding: 0 0 calc(var(--bar-h) + var(--safe-b) + 28px) !important; }
.container { padding: 0 14px; }
.header { display: none !important; }            /* หัวเรื่องใหญ่ + badge ย้ายเข้า topbar/ตั้งค่า */
#controlsArea { display: none !important; }     /* ตัวควบคุมเดิมถูกย้ายไปแผงตั้งค่า (ยังอยู่ใน DOM เพื่อให้โค้ดเดิมทำงาน) */
.status-bar { margin: 14px 0 0; }
.status-bar:has(.dot.ready) { display: none; }
.drop-zone { margin-top: 16px; border-color: rgba(212, 175, 55, .35); }
.placeholder { padding: 64px 0; }

button, select, input { font-family: 'Kanit', sans-serif; }
button:focus-visible, select:focus-visible, input:focus-visible, .sheet-close:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- Topbar ---------- */
#appTopbar {
    position: sticky; top: 0; z-index: 1100;
    padding: calc(10px + var(--safe-t)) 14px 10px;
    background: var(--topbar-bg);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
}
#appTopbar .tb-inner { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.tb-title {
    flex: 1; min-width: 0; height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 10px;
    background: var(--chip-bg); border: 1px solid var(--line); border-radius: 14px;
    color: var(--text-color); cursor: pointer; text-align: left; transition: background .2s;
}
.tb-title:active { background: rgba(212, 175, 55, .16); }
.tb-ico { color: var(--gold-ink); font-size: 1.15rem; flex-shrink: 0; }
.tb-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tb-book { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-caret { margin-left: auto; font-size: .8rem; color: var(--muted); flex-shrink: 0; }
.tb-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tb-btn {
    position: relative; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--chip-bg); border: 1px solid var(--line); border-radius: 14px;
    color: var(--text-color); font-size: 1.05rem; cursor: pointer; transition: background .2s, transform .1s;
}
.tb-btn:active { transform: scale(.94); }
.tb-btn.on { color: var(--gold-ink); border-color: rgba(212, 175, 55, .55); background: rgba(212, 175, 55, .14); }
.tb-badge {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    background: var(--gold); color: #0A0F1D; border-radius: 10px; font-size: .68rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.tb-badge[hidden] { display: none; }

/* ---------- Chips โหมดการเล่น ---------- */
.mode-chips {
    display: none; gap: 6px; overflow-x: auto; padding: 12px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.mode-chips::-webkit-scrollbar { display: none; }
body.has-chapter .mode-chips { display: flex; }
.mode-chips button {
    flex: 0 0 auto; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--chip-bg); color: var(--muted);
    font-size: .9rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: .2s; box-shadow: none;
}
.mode-chips button i { font-size: .95rem; }
.mode-chips button.active { background: rgba(212, 175, 55, .16); border-color: rgba(212, 175, 55, .6); color: var(--gold-ink); box-shadow: none; }
.mode-chips button:active { transform: scale(.96); }

/* ---------- รายการข้อ ---------- */
.verse-list { gap: 4px; margin-top: 8px; }
.chapter-header { transform: none !important; box-shadow: none; border-radius: 14px; margin-bottom: 8px; padding: 14px 16px; font-size: calc(1.15rem * var(--text-scale)); }
.chapter-header.active { background: rgba(212, 175, 55, .2); box-shadow: none; }
[data-theme="light"] .chapter-header, [data-theme="light"] .chapter-header i { color: var(--gold-ink); }
.verse-item {
    padding: 11px 12px 11px 14px; border-radius: 12px; border-left: 3px solid transparent;
    background: transparent; transform: none; box-shadow: none; transition: background .25s, border-color .25s;
}
[data-theme="light"] .verse-item { background: transparent; }
.verse-item:hover { background: var(--chip-bg); }
.verse-item.active { background: rgba(212, 175, 55, .14); border-left-color: var(--gold); transform: none; box-shadow: none; }
.verse-item.hold-syncing { background: rgba(0, 229, 255, .16); border-left-color: var(--accent); }
.verse-row-body { gap: 12px; }
.verse-number { color: var(--gold-ink); min-width: 28px; font-size: calc(.85rem * var(--text-scale)); padding-top: 5px; opacity: .95; }
.verse-text { line-height: 1.85; font-size: calc(1.15rem * var(--text-scale)); }
.verse-inline-story { color: var(--gold-ink); }
[data-theme="light"] .story-sub-badge { color: #0369A1; }

/* ---------- Player bar (ทำใหม่เป็น grid 2 แถว) ---------- */
body #player-bar {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "info ctrl vol" "prog prog prog";
    align-items: center; gap: 4px 14px;
    padding: 8px max(14px, env(safe-area-inset-right)) calc(8px + var(--safe-b)) max(14px, env(safe-area-inset-left));
    background: var(--bar-bg); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    overflow: visible; flex-wrap: nowrap;
}
body.has-chapter #player-bar { display: grid !important; }
body #player-bar .info { grid-area: info; max-width: none; min-width: 0; flex: none; font-size: .85rem; }
body #player-bar .info .ref { font-size: 1.02rem; font-weight: 600; color: var(--gold-ink); display: block; overflow: hidden; text-overflow: ellipsis; }
body #player-bar .controls-group { grid-area: ctrl; gap: 2px; }
body #player-bar .progress-wrap { grid-area: prog; flex: none; min-width: 0; gap: 10px; }
body #player-bar .volume-wrap { grid-area: vol; }
body #player-bar button {
    width: 46px; height: 46px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 1.25rem; color: var(--text-color); background: none; border: none; cursor: pointer;
}
body #player-bar button:active { background: var(--chip-bg); }
body #player-bar .play-pause-btn {
    width: 54px; height: 54px; font-size: 1.35rem; background: var(--gold); color: #0A0F1D;
    box-shadow: 0 4px 16px rgba(212, 175, 55, .35);
}
body #player-bar .play-pause-btn:active { background: var(--gold); transform: scale(.95); }
body #player-bar button.pb-stop { font-size: 0; width: 40px; height: 40px; background: var(--chip-bg); border: 1px solid var(--line); }
body #player-bar button.pb-stop i { font-size: .95rem; color: var(--muted); }
body #player-bar .time { font-size: .75rem; min-width: 38px; color: var(--muted); text-align: center; }
body #player-bar .progress-wrap input[type="range"] {
    height: 6px; border-radius: 3px; cursor: pointer;
    background: linear-gradient(to right, var(--gold) var(--pct, 0%), rgba(128, 128, 128, .35) var(--pct, 0%));
}
body #player-bar .progress-wrap input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
@media (min-width: 900px) {
    body #player-bar { padding-left: max(14px, calc((100vw - 860px) / 2 + 14px)); padding-right: max(14px, calc((100vw - 860px) / 2 + 14px)); }
}
@media (max-width: 600px) {
    body #player-bar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); gap: 2px 8px; }
    body #player-bar .info { font-size: .8rem; max-width: none; }
    body #player-bar .info .ref { font-size: .95rem; }
    body #player-bar button { width: 42px; height: 42px; font-size: 1.15rem; padding: 0; }
    body #player-bar .play-pause-btn { width: 50px; height: 50px; font-size: 1.25rem; }
    body #player-bar button.pb-stop { width: 36px; height: 36px; }
    body #player-bar .time { font-size: .7rem; min-width: 34px; }
}
.scroll-top-btn { bottom: calc(var(--bar-h) + var(--safe-b) + 12px) !important; }
.toast { bottom: calc(var(--bar-h) + var(--safe-b) + 16px) !important; z-index: 10030 !important; max-width: 92vw; }
.scroll-brake-pill { top: calc(var(--safe-t) + 66px) !important; }

/* ---------- OSD: safe area ---------- */
#osdModal { padding-top: max(20px, calc(var(--safe-t) + 10px)); padding-bottom: max(20px, calc(var(--safe-b) + 10px)); }
.osd-theme-btn, .osd-close-btn { width: 44px; height: 44px; }

/* ---------- Bottom sheet ---------- */
body.sheet-open { overflow: hidden; }
.sheet-root { position: fixed; inset: 0; z-index: 10010; }
.sheet-root[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .22s ease; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet {
    position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 600px;
    max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column;
    background: var(--surface); color: var(--text-color);
    border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: none;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, .45);
    transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet-root.open .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grab { flex: 0 0 auto; padding: 10px 0 2px; display: flex; justify-content: center; touch-action: none; cursor: grab; }
.sheet-grab::before { content: ''; width: 42px; height: 5px; border-radius: 3px; background: rgba(128, 128, 128, .5); }
.sheet-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 4px 16px 10px; touch-action: none; }
.sheet-head h2 { flex: 1; font-size: 1.15rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-back, .sheet-close {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip-bg);
    color: var(--text-color); font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheet-back[hidden] { display: none; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(24px + var(--safe-b)); }
@media (min-width: 700px) { .sheet { bottom: 4vh; border-radius: 22px; border-bottom: 1px solid var(--line); } }

/* ---------- แผงตั้งค่า ---------- */
.set-sec { margin: 6px 0 18px; }
.set-sec > h3 { font-size: .78rem; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 4px 8px; }
.set-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
.set-hint { font-size: .82rem; color: var(--muted); line-height: 1.5; padding: 10px 2px 2px; }
.set-hint i { color: var(--accent); margin-right: 4px; }
.set-card .slider-group {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "label label val" "il input ir";
    align-items: center; gap: 6px 10px; background: none; padding: 14px 0; border-radius: 0; color: var(--muted); flex: none;
}
.set-card .slider-group + .slider-group { border-top: 1px solid var(--line); }
.set-card .slider-group label { grid-area: label; font-size: .95rem; color: var(--text-color); font-weight: 500; }
.set-card .slider-group input[type="range"] { grid-area: input; width: 100%; height: 6px; background: rgba(128, 128, 128, .35); }
.set-card .slider-group input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.set-card .slider-group input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%; background: #D4AF37; }
.set-card .slider-group .icon-left { grid-area: il; }
.set-card .slider-group .icon-right { grid-area: ir; }
.set-card .slider-group .val { grid-area: val; color: var(--gold-ink); font-size: .95rem; }
.set-card #fontSizeGroup { display: flex !important; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; }
.set-card .font-ctrl-btn { min-height: 44px; min-width: 64px; border-radius: 12px; }
.set-card .font-scale-label { font-size: 1.05rem; color: var(--gold-ink); }
.set-card select {
    width: 100%; height: 48px; margin: 10px 0; padding: 0 12px; border-radius: 12px; font-size: 1rem;
    background: var(--surface); color: var(--text-color); border: 1px solid var(--line);
}
.set-card select option { background: var(--surface); color: var(--text-color); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; }
.seg button {
    height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color);
    font-size: .95rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.seg button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #0A0F1D; font-weight: 600; }
.set-foot { text-align: center; font-size: .78rem; color: var(--muted); padding: 6px 0 4px; }

/* ---------- แผงเลือกเล่ม/บท ---------- */
.pk-search {
    width: 100%; height: 46px; padding: 0 14px 0 40px; border-radius: 14px; font-size: 1rem;
    border: 1px solid var(--line); background: var(--chip-bg) no-repeat 14px center; color: var(--text-color);
}
.pk-search-wrap { position: relative; margin-bottom: 12px; }
.pk-search-wrap i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pk-h { font-size: .78rem; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 16px 4px 8px; display: flex; align-items: center; gap: 8px; }
.pk-h:first-child { margin-top: 4px; }
.stat-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 4px; }
.stat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stat-big { font-size: 1.05rem; font-weight: 600; }
.stat-big b { color: var(--gold-ink); font-size: 1.4rem; }
.stat-streak { font-size: .9rem; color: var(--gold-ink); font-weight: 600; white-space: nowrap; }
.bar { height: 8px; border-radius: 4px; background: rgba(128, 128, 128, .28); overflow: hidden; margin: 10px 0 6px; }
.bar > i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--gold), #F4D03F); border-radius: 4px; transition: width .4s ease; }
.stat-sub { font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.goal-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .85rem; color: var(--muted); }
.goal-row button { min-width: 38px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); cursor: pointer; font-size: .9rem; }
.goal-row button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #0A0F1D; font-weight: 700; }
.pk-primary {
    width: 100%; height: 48px; margin-top: 12px; border-radius: 14px; border: none; cursor: pointer;
    background: var(--gold); color: #0A0F1D; font-size: 1rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pk-primary:active { transform: scale(.98); }
.hist-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.hist-row::-webkit-scrollbar { display: none; }
.hist-card {
    flex: 0 0 auto; min-width: 150px; max-width: 200px; padding: 12px 14px; text-align: left; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; color: var(--text-color);
}
.hist-card:active { transform: scale(.97); }
.hist-card .hc-ref { font-weight: 600; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-card .hc-sub { font-size: .8rem; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.hist-card .hc-sub i { color: var(--gold-ink); }
.book-list { display: flex; flex-direction: column; gap: 4px; }
.book-row {
    display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 14px; border-radius: 12px; cursor: pointer; width: 100%;
    background: transparent; border: 1px solid transparent; color: var(--text-color); font-size: 1rem; text-align: left;
}
.book-row:active, .book-row:hover { background: var(--chip-bg); }
.book-row.cur { border-color: rgba(212, 175, 55, .5); background: rgba(212, 175, 55, .1); }
.book-row .bn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-row .bp { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.book-row .ba { font-size: .9rem; color: var(--gold-ink); width: 18px; text-align: center; }
.book-row.noaudio { opacity: .65; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; padding-top: 4px; }
.ch-btn {
    position: relative; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip-bg);
    color: var(--text-color); font-size: 1.05rem; cursor: pointer;
}
.ch-btn:active { transform: scale(.95); }
.ch-btn.done { border-color: rgba(34, 197, 94, .55); }
.ch-btn.done::after { content: '\2713'; position: absolute; top: 2px; right: 6px; font-size: .62rem; color: #22C55E; font-weight: 700; }
.ch-btn.cur { background: var(--gold); border-color: var(--gold); color: #0A0F1D; font-weight: 700; }
.pk-empty { text-align: center; color: var(--muted); padding: 28px 0; }

/* ---------- Sleep timer ---------- */
.sleep-status { text-align: center; padding: 6px 0 14px; color: var(--muted); font-size: .95rem; }
.sleep-status b { color: var(--gold-ink); font-size: 1.5rem; display: block; margin-top: 2px; }
.sleep-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sleep-opt {
    height: 58px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color);
    font-size: 1.02rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sleep-opt:active { transform: scale(.97); }
.sleep-opt.sel { border-color: var(--gold); background: rgba(212, 175, 55, .16); color: var(--gold-ink); }
.sleep-opt.wide { grid-column: 1 / -1; }
.sleep-opt.off { color: #EF4444; }
.sleep-note { font-size: .8rem; color: var(--muted); text-align: center; padding: 14px 6px 0; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
    .sheet, .sheet-backdrop, .bar > i { transition: none; }
}

/* ---------- ออฟไลน์ (ข้อ 2) ---------- */
.book-row .bo { font-size: .8rem; color: var(--gold-ink); opacity: .5; }
.book-row .bo.full { opacity: 1; }
.ch-btn.off::before { content: ''; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--gold-ink); }
.ch-btn.cur.off::before { background: #0A0F1D; }

.off-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 2px 0 14px; }
.off-top { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.off-top i { color: var(--gold-ink); }
.off-count { margin-left: auto; font-size: .82rem; color: var(--muted); }
.off-bar { height: 6px; border-radius: 6px; background: var(--chip-bg); overflow: hidden; margin: 10px 0; }
.off-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-ink)); border-radius: 6px; transition: width .25s; }
.off-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.off-actions.col { flex-direction: column; align-items: stretch; margin-top: 10px; }
.off-msg { font-size: .85rem; color: var(--muted); margin-right: auto; }
.off-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); font-family: inherit; font-size: .92rem; cursor: pointer;
}
.off-btn:active { transform: scale(.98); }
.off-btn[disabled] { opacity: .45; pointer-events: none; }
.off-btn.primary { background: var(--gold); border-color: var(--gold); color: #0A0F1D; font-weight: 600; }
.off-btn.danger { color: #EF4444; border-color: rgba(239, 68, 68, .4); }
.off-line { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.off-line i { color: var(--gold-ink); }
.off-stat { font-size: .82rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }
body.is-offline #tbSettings { position: relative; }
body.is-offline #tbSettings::after { content: ''; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 0 2px var(--topbar-bg); }

/* ---------- แชร์ (ข้อ 3) ---------- */
body .verse-item .verse-row-body { padding-right: 42px; }
body .verse-item .verse-inline-story { padding-right: 42px; }
body .verse-item { min-height: 70px; }
.v-share {
    position: absolute; top: 36px; right: 4px; width: 34px; height: 32px; border: 0; border-radius: 50%; background: transparent;
    color: var(--gold-ink); opacity: .45; font-size: .95rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.v-share:hover, .v-share:focus-visible, .verse-item.active .v-share { opacity: .95; }
.v-share:active { transform: scale(.9); background: var(--chip-bg); }
.verse-item.deep-hl { animation: deepHl 1.4s ease-in-out 4; }
@keyframes deepHl { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); background: rgba(212, 175, 55, .14); } 50% { box-shadow: 0 0 0 3px rgba(212, 175, 55, .6); background: rgba(212, 175, 55, .26); } }
@media (prefers-reduced-motion: reduce) { .verse-item.deep-hl { animation: none; background: rgba(212, 175, 55, .22); } }

.sh-ref { font-size: 1.15rem; font-weight: 600; color: var(--gold-ink); text-align: center; padding: 2px 0 10px; }
.sh-range { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .9rem; color: var(--muted); padding-bottom: 12px; flex-wrap: wrap; }
.sh-range b { min-width: 28px; text-align: center; color: var(--text-color); font-size: 1.05rem; }
.sh-step { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); cursor: pointer; }
.sh-step:active { transform: scale(.92); }
.sh-prev { display: flex; justify-content: center; padding: 4px 0 12px; }
.sh-canvas { max-width: 100%; max-height: 42vh; width: auto; height: auto; border-radius: 12px; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
.sh-opts { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.sh-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sh-actions .primary { grid-column: 1 / -1; }
.sh-link { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 8px; }
.sh-link-txt { font-size: .78rem; color: var(--muted); word-break: break-all; line-height: 1.45; max-height: 3.6em; overflow: hidden; }
.sh-copylink { width: 100%; }
.sh-opts .seg, .sh-link .seg { display: flex; gap: 4px; }
.sh-opts .seg button, .sh-link .seg button { flex: 1; min-width: 0; padding-left: 6px; padding-right: 6px; }

/* ---------- เลือกฉบับพระคัมภีร์ (v3.1) ---------- */
.tb-ver {
    flex-shrink: 0; height: 46px; min-width: 46px; max-width: 76px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--chip-bg); border: 1px solid var(--line); border-radius: 14px; color: var(--gold-ink);
    font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .01em; cursor: pointer; transition: background .2s, transform .1s;
}
.tb-ver span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-ver:active { transform: scale(.94); }
.tb-ver.alt { background: rgba(212, 175, 55, .14); border-color: rgba(212, 175, 55, .55); }
@media (max-width: 380px) { .tb-ver { min-width: 40px; max-width: 58px; padding: 0 6px; font-size: .66rem; } #appTopbar .tb-btn { width: 42px; } #appTopbar .tb-actions { gap: 6px; } }

.ver-card {
    width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin: 0 0 10px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--text-color); font: inherit; cursor: pointer;
    transition: background .2s, border-color .2s;
}
.ver-card:disabled { opacity: .65; cursor: default; }
.ver-card.on { border-color: rgba(212, 175, 55, .65); background: rgba(212, 175, 55, .12); }
.vc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vc-name { font-size: 1.05rem; font-weight: 700; color: var(--gold-ink); }
.vc-long { font-size: .85rem; color: var(--muted); }
.vc-sub { font-size: .78rem; color: var(--text-color); margin-top: 2px; }
.vc-end { flex-shrink: 0; color: var(--gold-ink); font-size: 1.15rem; min-width: 18px; text-align: center; }

.ver-line {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; text-align: left;
    background: var(--chip-bg); border: 1px solid var(--line); border-radius: 12px; color: var(--text-color); font: inherit; cursor: pointer;
}
.ver-line .vl-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ver-line b { color: var(--gold-ink); font-size: 1.02rem; }
.ver-line small { color: var(--muted); font-size: .8rem; }
.ver-line i { color: var(--muted); font-size: .85rem; }

/* ---------- บันทึกของฉัน / ค้นหา (v3.2) ---------- */
.v-study {
    position: absolute; top: 3px; right: 4px; width: 34px; height: 32px; border: 0; border-radius: 50%; background: transparent;
    color: var(--gold-ink); opacity: .32; font-size: .95rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.v-study:hover, .v-study:focus-visible, .verse-item.active .v-study { opacity: .8; }
.v-study.on { opacity: 1; }
.v-study:active { transform: scale(.9); background: var(--chip-bg); }
.verse-item .st-note {
    display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 2px 48px; padding: 6px 10px; border-radius: 8px;
    background: rgba(212, 175, 55, .09); border-left: 3px solid rgba(212, 175, 55, .55); color: var(--muted); font-size: .85rem; line-height: 1.5;
}
.verse-item .st-note i { color: var(--gold-ink); margin-top: 3px; font-size: .78rem; }
.verse-item .st-note span { min-width: 0; overflow-wrap: anywhere; }
.verse-item.st-hl-y .verse-text { background-image: linear-gradient(transparent 52%, rgba(250, 204, 21, .38) 52%); }
.verse-item.st-hl-g .verse-text { background-image: linear-gradient(transparent 52%, rgba(74, 222, 128, .34) 52%); }
.verse-item.st-hl-b .verse-text { background-image: linear-gradient(transparent 52%, rgba(56, 189, 248, .36) 52%); }
.verse-item.st-hl-p .verse-text { background-image: linear-gradient(transparent 52%, rgba(244, 114, 182, .34) 52%); }
.verse-item[class*="st-hl-"] .verse-text { -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.st-verse { font-size: 1rem; line-height: 1.7; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.st-row { margin-bottom: 4px; }
.st-pin {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 12px; cursor: pointer;
    background: var(--chip-bg); border: 1px solid var(--line); color: var(--text-color); font: inherit;
}
.st-pin[aria-pressed="true"] { background: rgba(212, 175, 55, .16); border-color: rgba(212, 175, 55, .6); color: var(--gold-ink); font-weight: 600; }
.st-lab { font-size: .82rem; color: var(--muted); margin: 14px 2px 6px; }
.st-sw { display: flex; gap: 12px; align-items: center; }
.st-dot { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.st-dot.none { background: var(--chip-bg); border: 1px solid var(--line); font-size: .9rem; }
.st-dot[aria-pressed="true"] { border-color: var(--text-color); box-shadow: 0 0 0 2px var(--bg-color, #0A0F1D) inset; }
.st-dot.none[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-ink); }
.st-note-input {
    width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--text-color);
    border: 1px solid var(--line); font: inherit; font-size: 1rem; line-height: 1.6; outline: none;
}
.st-note-input:focus { border-color: rgba(212, 175, 55, .6); }
.sheet-body .off-actions { margin-top: 14px; }

.pk-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pk-promise { flex: 1 1 100%; border-color: rgba(0, 229, 255, .35); background: linear-gradient(90deg, rgba(0, 229, 255, .10), transparent); }
.pk-tool {
    flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border-radius: 14px; cursor: pointer;
    background: var(--chip-bg); border: 1px solid var(--line); color: var(--text-color); font: inherit; font-size: .95rem;
}
.pk-tool i { color: var(--gold-ink); }
.pk-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: #0A0F1D; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }

.st-tabs, .sr-scope { margin-bottom: 12px; }
.sr-scope { flex-wrap: wrap; }
.st-list { display: flex; flex-direction: column; gap: 8px; }
.st-item { display: flex; align-items: stretch; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.st-go { flex: 1; min-width: 0; text-align: left; padding: 12px 6px 12px 14px; background: none; border: 0; color: var(--text-color); font: inherit; cursor: pointer; }
.si-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.si-ref { font-weight: 600; color: var(--gold-ink); }
.si-i { color: var(--gold-ink); font-size: .8rem; }
.si-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.si-text { font-size: .92rem; line-height: 1.55; color: var(--text-color); }
.si-note { display: flex; gap: 8px; margin-top: 6px; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.si-note i { color: var(--gold-ink); margin-top: 3px; font-size: .75rem; }
.si-edit { width: 46px; flex-shrink: 0; background: none; border: 0; border-left: 1px solid var(--line); color: var(--muted); cursor: pointer; border-radius: 0 14px 14px 0; }

.sr-status { font-size: .84rem; color: var(--muted); margin: 4px 2px 10px; min-height: 1.2em; line-height: 1.5; }
.sr-results { display: flex; flex-direction: column; gap: 8px; }
.sr-go {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 12px; cursor: pointer; text-align: left;
    background: rgba(212, 175, 55, .14); border: 1px solid rgba(212, 175, 55, .55); color: var(--gold-ink); font: inherit; font-weight: 600;
}
.sr-item { text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text-color); font: inherit; cursor: pointer; }
.sr-ref { font-weight: 600; color: var(--gold-ink); margin-bottom: 3px; font-size: .92rem; }
.sr-text { font-size: .95rem; line-height: 1.6; }
.sr-hit { background: rgba(250, 204, 21, .4); color: inherit; border-radius: 3px; padding: 0 1px; }
.st-tabs, .sr-scope { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }
.st-tabs button, .sr-scope button { flex: 1 1 auto; padding: 0 12px; }
.seg button[hidden] { display: none; }

/* ===== v3.3 ผู้ช่วย AI ===== */
.ai-open { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 14px 0 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--accent, #d4af37); background: transparent; color: var(--accent, #d4af37); font: inherit; font-weight: 600; cursor: pointer; }
.ai-open:active { transform: scale(.98); }
.ai-q { width: 100%; margin-top: 12px; }
.ai-out { margin-top: 12px; }
.ai-p { margin: 0 0 12px; line-height: 1.75; white-space: pre-wrap; }
.ai-wait { color: var(--muted); padding: 10px 2px; }
.ai-err { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(220, 70, 70, .12); border: 1px solid rgba(220, 70, 70, .4); }
.ai-disc { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.5; }
.ai-link { background: none; border: 0; color: var(--accent, #d4af37); font: inherit; text-decoration: underline; padding: 0; cursor: pointer; }
.ai-key, .ai-model, .ai-prov { width: 100%; margin: 10px 0 6px; box-sizing: border-box; height: 46px; padding: 0 14px; border-radius: 14px; font-size: 1rem; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); font-family: inherit; }
.ai-status { margin: 6px 2px 10px; }
.ai-send[disabled] { opacity: .5; }
.off-btn[hidden] { display: none; }

/* ===== v3.3.2 หน้าคำตอบ AI: บทสนทนา + ตัวอักษรอ่านง่าย ===== */
.ai-thread { margin: 14px 0 6px; }
.ai-turn { margin-bottom: 22px; }
.ai-qb { margin-left: auto; width: fit-content; max-width: 88%; padding: 9px 14px; border-radius: 16px 16px 4px 16px; background: color-mix(in srgb, var(--accent, #d4af37) 18%, transparent); border: 1px solid color-mix(in srgb, var(--accent, #d4af37) 45%, transparent); font-size: .92rem; line-height: 1.5; }
.ai-ac { margin-top: 10px; padding: 14px 16px 6px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: .98rem; line-height: 1.8; }
.ai-ac .ai-p { margin: 0 0 12px; white-space: normal; }
.ai-ac strong { color: var(--accent, #d4af37); font-weight: 700; }
.ai-ac em { font-style: italic; opacity: .95; }
.ai-ac .ai-h { margin: 14px 0 6px; font-weight: 700; color: var(--accent, #d4af37); }
.ai-ac .ai-list { margin: 0 0 12px; padding-left: 1.3em; }
.ai-ac .ai-list li { margin: 0 0 6px; padding-left: 2px; }
.ai-ac > :first-child { margin-top: 0; }
.ai-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 6px 4px 0; font-size: .76rem; color: var(--muted); }
.ai-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.ai-act { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; }
.ai-act:active { background: var(--surface-2); }
.ai-act.armed { color: #e05a5a; }
.ai-count-line { margin-top: 10px; font-size: .78rem; color: var(--muted); }
.ai-count { display: inline-block; min-width: 20px; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--accent, #d4af37); color: #1a1a1a; font-size: .72rem; line-height: 1.5; text-align: center; }
.ai-wait { margin-top: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.ai-q { margin-top: 6px; }

/* ===== v3.3.3 คำถามแนะนำ ===== */
.ai-sugg { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.ai-sugg-lab { width: 100%; display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.ai-chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; font-size: .88rem; line-height: 1.35; text-align: left; cursor: pointer; }
.ai-chip:active { transform: scale(.97); border-color: var(--accent, #d4af37); }
.ai-act.done { color: var(--accent, #d4af37); }
.verse-item .st-note { cursor: pointer; }

/* ===== v3.4 ห้องสมุดเทศนา ===== */
.ai-cite { display: inline-block; margin-left: 2px; padding: 0 5px; border-radius: 6px; background: color-mix(in srgb, var(--accent, #d4af37) 22%, transparent); color: var(--accent, #d4af37); font-size: .68rem; font-weight: 700; line-height: 1.5; vertical-align: super; }
.ai-src { display: flex; gap: 8px; align-items: flex-start; margin: 8px 4px 0; font-size: .76rem; color: var(--muted); line-height: 1.5; }
.lib-toggle { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-weight: 600; }
.lib-toggle input { width: 20px; height: 20px; accent-color: var(--accent, #d4af37); }
.lib-list { margin-top: 8px; }
.lib-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lib-ti { flex: 1; min-width: 0; }
.lib-name { font-weight: 600; overflow-wrap: anywhere; }
.lib-meta { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.lib-ptitle { margin: 8px 0; }
.lib-ptext { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.lib-prev { margin-top: 3px; font-size: .78rem; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }


/* =====================================================================
   พระสัญญา (v3.5.0) — การ์ดภาพจาก data/999_promises.js
   ===================================================================== */
.pm-intro { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; }
.pm-intro i { color: var(--accent); margin-top: 3px; }
.pm-resume { width: 100%; justify-content: flex-start; margin-bottom: 10px; }
.pm-q {
    width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 14px; border-radius: 14px; font: inherit; font-size: 1rem;
    background: var(--chip-bg); border: 1px solid var(--line); color: var(--text-color); margin-bottom: 10px;
}
.pm-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.pm-chips::-webkit-scrollbar { display: none; }
.pm-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; cursor: pointer;
    background: var(--chip-bg); border: 1px solid var(--line); color: var(--text-color); font: inherit; font-size: .85rem; white-space: nowrap;
}
.pm-chip i { font-style: normal; font-size: .72rem; color: var(--muted); }
.pm-chip.on { background: rgba(0, 229, 255, .16); border-color: var(--accent); color: var(--accent); }
.pm-gh { display: flex; justify-content: space-between; align-items: center; margin: 18px 2px 8px; font-size: .9rem; font-weight: 600; color: var(--pm-accent); }
.pm-gh span { font-size: .75rem; color: var(--muted); font-weight: 400; }
.pm-item {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin-bottom: 8px; text-align: left; cursor: pointer;
    background: var(--chip-bg); border: 1px solid var(--line); border-left: 4px solid var(--pm-accent, var(--accent)); border-radius: 12px;
    color: var(--text-color); font: inherit;
}
.pm-item:active { background: rgba(255, 255, 255, .1); }
.pm-emo { font-size: 1.5rem; width: 34px; text-align: center; flex-shrink: 0; }
.pm-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pm-tx b { font-weight: 600; font-size: .98rem; }
.pm-tx small { color: var(--muted); font-size: .78rem; }
.pm-seen { margin-left: auto; color: #4ADE80; font-size: .85rem; flex-shrink: 0; }
.pm-loading i { margin-right: 6px; }

.pm-tools { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; }
.pm-sp { flex: 1; }
.pm-pos { font-size: .82rem; color: var(--muted); }
.pm-sz {
    width: 40px; height: 40px; border-radius: 12px; cursor: pointer; background: var(--chip-bg); border: 1px solid var(--line); color: var(--text-color); font: inherit; font-size: .9rem;
}
.pm-sz.big { font-size: 1.2rem; }
.pm-sz[disabled] { opacity: .35; }
.pm-nav { display: flex; gap: 8px; margin-top: 16px; }
.pm-nav .off-btn { flex: 1; min-width: 0; justify-content: center; }
.pm-nav .off-btn[disabled] { visibility: hidden; }

.pm-card { --pm-accent: #00E5FF; --read-size: 1.15rem; }
.pm-card .main-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.pm-card .card-header { text-align: center; padding: 22px 16px 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--pm-accent) 22%, transparent), transparent); border-bottom: 1px solid var(--line); }
.pm-card .main-icon { display: flex; justify-content: center; }
.pm-card .card-title { margin: 0 0 4px; font-size: 1.35rem; color: var(--pm-accent); }
.pm-card .card-subtitle { margin: 0; color: var(--muted); font-size: .9rem; }
.pm-card .card-content { padding: 10px 12px 14px; }
.pm-card .v-row { position: relative; margin: 12px 0; padding: 14px; border-radius: 14px; background: var(--chip-bg); border: 1px solid var(--line); border-left: 4px solid var(--pm-accent); cursor: pointer; }
.pm-card .v-row.pm-sel { box-shadow: 0 0 0 2px var(--pm-accent); }
.pm-card .section-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pm-card .v-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; background: color-mix(in srgb, var(--pm-accent) 18%, transparent); color: var(--pm-accent); font-weight: 600; }
.pm-card .audio-led { display: none; }
.pm-card .v-text-body { display: block; line-height: 1.7; }
.pm-card .point-item .v-badge { background: none; padding: 0; margin-top: 0 !important; }
.pm-card .point-item { list-style: none; }
.pm-card .card-footer { display: none; }
.pm-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pm-abtn {
    flex: 1 1 calc(50% - 8px); min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text-color); font: inherit; font-size: .88rem;
}
.pm-abtn i { color: var(--gold-ink); }
.pm-abtn[disabled] { opacity: .4; pointer-events: none; }

/* พระสัญญา — เสียง + สคริปต์ทำเสียง */
.pm-card .v-row.pm-playing { box-shadow: 0 0 0 2px var(--pm-accent), 0 0 18px color-mix(in srgb, var(--pm-accent) 40%, transparent); background: color-mix(in srgb, var(--pm-accent) 10%, var(--chip-bg)); }
.pm-player {
    position: sticky; bottom: calc(-1 * (24px + var(--safe-b))); margin: 14px -16px 0; padding: 10px 16px calc(12px + var(--safe-b));
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 18px rgba(0, 0, 0, .25); z-index: 2;
}
.pm-prow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pm-seek { flex: 1; min-width: 0; accent-color: var(--accent); }
.pm-t { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.pm-pbtn.main {
    width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
    background: var(--gold); color: #0A0F1D; font-size: 1.15rem;
}
.pm-pbtn[disabled] { opacity: .4; }
.pm-modes { flex: 1; display: flex; gap: 6px; }
.pm-mode {
    flex: 1; min-height: 44px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
    background: var(--chip-bg); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font: inherit; font-size: .72rem;
}
.pm-mode.on { color: var(--accent); border-color: var(--accent); background: rgba(0, 229, 255, .12); }
.pm-pmsg { font-size: .8rem; color: #F59E0B; }
.pm-player:not(.err) .pm-pmsg:empty { display: none; }
.pm-voice i { color: var(--gold-ink); }
.pv-nav { margin: 0 0 10px; align-items: center; }
.pv-nav .off-btn { flex: 0 0 48px; }
.pv-title { flex: 1; text-align: center; font-weight: 600; min-width: 0; }
.pv-ta { width: 100%; box-sizing: border-box; min-height: 300px; line-height: 1.6; }
.pv-chunks { flex-direction: column; align-items: stretch; }
.pv-stat.ok { color: #4ADE80; }

/* พระสัญญา OSD เต็มจอ (v3.5.2) */
.pm-osd { display: none; position: fixed; inset: 0; z-index: 10050; flex-direction: column; background: var(--header-bg, var(--bg, #0A0F1D)); color: var(--text-color);
    padding: max(14px, calc(var(--safe-t) + 8px)) 20px max(14px, calc(var(--safe-b) + 8px)); box-sizing: border-box; gap: 10px; }
.pm-osd.active { display: flex; }
html.pm-osd-open { overflow: hidden; }
.pm-osd-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(212, 175, 55, .2); flex-shrink: 0; }
.pm-osd-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pm-osd-t { color: var(--gold); font-weight: 700; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-osd-c { color: var(--muted); font-size: .8rem; }
.pm-osd-ib { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.pm-osd-main { flex: 1; min-height: 0; display: flex; transition: opacity .25s ease, transform .25s ease; }
.pm-osd-main.fade-out { opacity: 0; transform: translateY(6px); }
.pm-osd-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; align-items: center; justify-content: center; }
.pm-osd-card {
    --osd-size: 2rem; width: 100%; box-sizing: border-box; margin: auto; padding: 22px 24px; cursor: pointer; text-align: center; user-select: none; -webkit-user-select: none;
    background: var(--surface-2, var(--chip-bg)); border: 2px solid var(--pm-accent, var(--gold)); border-radius: 18px; box-shadow: 0 0 28px color-mix(in srgb, var(--pm-accent, #D4AF37) 25%, transparent);
}
.pm-osd-ref { display: inline-block; padding: 4px 16px; border-radius: 16px; background: color-mix(in srgb, var(--pm-accent) 18%, transparent); color: var(--pm-accent); font-weight: 700; font-size: calc(var(--osd-size) * .55); margin-bottom: 12px; }
.pm-osd-verse { font-size: var(--osd-size); line-height: 1.5; word-break: break-word; }
.pm-osd-core { margin-top: 16px; padding: 10px 14px; border-left: 4px solid #00E5FF; background: rgba(0, 229, 255, .08); border-radius: 8px; text-align: left; font-size: calc(var(--osd-size) * .58); line-height: 1.5; }
.pm-osd-core b { display: block; color: #00E5FF; font-size: .8em; margin-bottom: 2px; }
.pm-osd-card.intro { padding: 36px 24px; }
.pm-osd-emo { font-size: calc(var(--osd-size) * 2.2); line-height: 1.1; }
.pm-osd-ititle { font-size: calc(var(--osd-size) * 1.15); font-weight: 700; color: var(--pm-accent); margin-top: 10px; }
.pm-osd-isub { font-size: calc(var(--osd-size) * .6); color: var(--muted); margin-top: 8px; }
.pm-osd-msg { text-align: center; color: #F59E0B; font-size: .85rem; flex-shrink: 0; }
.pm-osd-msg:empty { display: none; }
.pm-osd-foot { display: flex; justify-content: center; align-items: center; gap: 14px; flex-shrink: 0; }
.pm-osd-cb { width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1rem; background: rgba(212, 175, 55, .1); border: 1px solid rgba(212, 175, 55, .35); color: var(--gold); }
.pm-osd-cb.big { width: 64px; height: 64px; font-size: 1.3rem; background: var(--gold); color: #0A0F1D; border: 0; }
.pm-osd-modes { display: flex; gap: 8px; justify-content: center; flex-shrink: 0; }
.pm-osd-mode { flex: 0 1 110px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border-radius: 20px; background: var(--chip-bg); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: .8rem; }
.pm-osd-mode.on { color: var(--accent); border-color: var(--accent); background: rgba(0, 229, 255, .12); }
.pm-osd-prog { height: 3px; background: var(--line); border-radius: 2px; flex-shrink: 0; overflow: hidden; }
.pm-osd-bar { height: 100%; width: 0; background: var(--gold); }
.pm-osd-ctl { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
@media (max-height: 480px) {
    .pm-osd { padding: max(8px, var(--safe-t)) max(16px, var(--safe-r, 0px)) max(8px, var(--safe-b)); gap: 6px; }
    .pm-osd-head { padding-bottom: 4px; }
    .pm-osd-ttl { flex-direction: row; align-items: baseline; gap: 12px; }
    .pm-osd-t { font-size: 1rem; }
    .pm-osd-ib { width: 38px; height: 38px; }
    .pm-osd-card { padding: 12px 18px; }
    .pm-osd-ref { margin-bottom: 6px; padding: 2px 12px; }
    .pm-osd-core { margin-top: 8px; padding: 6px 10px; }
    .pm-osd-ctl { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
    .pm-osd-foot { gap: 10px; }
    .pm-osd-cb { width: 40px; height: 40px; }
    .pm-osd-cb.big { width: 50px; height: 50px; }
    .pm-osd-mode { min-height: 34px; flex: 0 0 auto; padding: 0 12px; white-space: nowrap; }
}


/* ---------- หน้าเปิดแอป (splash) v3.5.3 ----------
   ซ่อนช่องลากไฟล์/ข้อความ placeholder/overlay เดิมระหว่างโหลดอัตโนมัติ
   ช่องลากไฟล์จะโผล่เฉพาะเมื่อโหลดอัตโนมัติไม่สำเร็จ (html.need-file) */
html:not(.db-ready):not(.need-file) #dropZone { display: none !important; }
html:not(.boot-done) .loading-overlay { display: none !important; }
html:not(.boot-done) .container > .placeholder { display: none !important; }
#bootSplash {
    position: fixed; inset: 0; z-index: 10040; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center;
    background: radial-gradient(120% 80% at 50% 28%, #16203c 0%, #0a0f1d 62%);
    color: #EAEAEA; font-family: 'Kanit', sans-serif;
    transition: opacity .55s ease, visibility .55s ease;
}
[data-theme="light"] #bootSplash { background: radial-gradient(120% 80% at 50% 28%, #ffffff 0%, #e9eef5 65%); color: #1d2433; }
#bootSplash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
#bootSplash .bs-mark { width: 92px; height: 92px; filter: drop-shadow(0 6px 22px rgba(212,175,55,.35)); animation: bsFloat 3.2s ease-in-out infinite; }
#bootSplash .bs-title { font-size: 1.55rem; font-weight: 600; letter-spacing: .2px; color: var(--gold-ink); margin-top: 4px; }
#bootSplash .bs-sub { font-size: .9rem; color: var(--muted); margin-top: -8px; }
#bootSplash .bs-bar { width: min(240px, 62vw); height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 10px; }
#bootSplash .bs-bar i { display: block; width: 40%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: bsSlide 1.35s ease-in-out infinite; }
#bootSplash .bs-status { font-size: .78rem; color: var(--muted); min-height: 1.2em; }
#bootSplash .bs-foot { position: absolute; bottom: calc(22px + var(--safe-b)); font-size: .68rem; letter-spacing: 2px; color: var(--muted); opacity: .6; }
@keyframes bsSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }
@keyframes bsFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { #bootSplash .bs-mark, #bootSplash .bs-bar i { animation: none; } #bootSplash .bs-bar i { width: 100%; } }
/* เข้าแอปแบบนุ่ม ๆ หลัง splash หาย */
html.db-ready .container, html.need-file .container { animation: bsIn .5s ease both; }
@keyframes bsIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }


/* ---------- คู่มือการใช้งาน v3.5.4 ---------- */
.gd-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; overflow: hidden; }
.gd-item > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 48px; cursor: pointer; font-weight: 500; }
.gd-item > summary::-webkit-details-marker { display: none; }
.gd-item > summary i { width: 22px; text-align: center; color: var(--gold-ink); }
.gd-item > summary::after { content: '\203A'; margin-left: auto; font-size: 1.3rem; color: var(--muted); transition: transform .2s; }
.gd-item[open] > summary::after { transform: rotate(90deg); }
.gd-item[open] > summary { border-bottom: 1px solid var(--line); }
.gd-item ul { margin: 0; padding: 12px 18px 14px 34px; display: grid; gap: 9px; }
.gd-item li { font-size: .9rem; line-height: 1.65; color: var(--text-color); }


/* ---------- ข้ออ้างอิงข้ามข้อ v3.5.5 ---------- */
.xr-count { opacity: .8; margin-left: 2px; }
.xr-list { display: grid; gap: 8px; margin-top: 6px; }
.xr-row { display: flex; align-items: stretch; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.xr-main { flex: 1; min-width: 0; text-align: left; background: transparent; border: 0; color: var(--text-color); font: inherit; padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; }
.xr-main b { color: var(--gold-ink); font-weight: 600; font-size: .95rem; }
.xr-main span { font-size: .88rem; line-height: 1.6; color: var(--text-color); opacity: .92; }
.xr-main:active { background: var(--chip-bg); }
.xr-copy { flex: 0 0 46px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: .95rem; }
.xr-copy:active { background: var(--chip-bg); }
.xr-credit { text-align: center; margin-top: 14px; font-size: .74rem; }
.xr-back {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + var(--safe-b) + 14px); z-index: 900;
    display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--gold);
    background: var(--bar-bg); color: var(--gold-ink); font: inherit; font-weight: 600; box-shadow: 0 8px 26px rgba(0, 0, 0, .45); cursor: pointer;
}


/* ---------- v3.6.0 สิทธิ์ผู้ใช้ / โฟกัสการอ่าน / คำอธิบาย AMP ---------- */
.seg.seg4 { grid-template-columns: repeat(4, 1fr); }
.acc-input { width: 100%; box-sizing: border-box; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font: inherit; font-size: 1rem; }
.acc-rem { display: flex; align-items: center; gap: 10px; margin: 12px 2px; color: var(--muted); font-size: .9rem; }
.acc-line { display: flex; align-items: center; gap: 10px; padding: 6px 2px 10px; color: var(--text-color); }
.ver-local { margin-top: 6px; }
body.focus-dim.is-reading .verse-item:not(.active):not(.hold-syncing) { opacity: var(--dim-op, .66); }
@media (hover: hover) { body.focus-dim.is-reading .verse-item:not(.active):hover { opacity: 1; } }
.amp-note { font-size: .84em; font-style: italic; color: #7FB3FF; }
[data-theme="light"] .amp-note { color: #1D5FB8; }
body.amp-hide .amp-note { display: none; }

/* ---------- v3.7.0 หน้าถาม AI ให้มีชีวิตชีวา ---------- */
.ai-hero { position: relative; padding: 16px 18px 16px 20px; border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 35%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--gold, #d4af37) 14%, var(--surface)) 0%, var(--surface) 70%); overflow: hidden; }
.ai-hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #F4D03F, #B8921E); }
.ai-hero-ref { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .82rem; font-weight: 600; letter-spacing: .3px; color: var(--gold-ink); }
.ai-hero-ref i { opacity: .7; font-size: .8rem; }
.ai-hero-txt { font-size: 1.04rem; line-height: 1.85; }
.ai-empty { text-align: center; padding: 22px 16px 10px; margin: 4px 0 8px; border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--gold, #d4af37) 40%, var(--line)); background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--gold, #d4af37) 10%, transparent), transparent 70%); }
.ai-empty-av { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; color: #1a1a1a; background: linear-gradient(135deg, #F4D03F, #B8921E); box-shadow: 0 6px 20px rgba(212, 175, 55, .35); animation: aiPulse 2.8s ease-in-out infinite; }
.ai-empty-t { font-weight: 700; font-size: 1.05rem; }
.ai-empty-s { margin: 4px 0 14px; color: var(--muted); font-size: .86rem; line-height: 1.6; }
.ai-explain { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 0; background: linear-gradient(135deg, #F4D03F, #D4AF37); color: #1a1a1a; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgba(212, 175, 55, .3); }
.ai-explain:active { transform: scale(.97); }
@keyframes aiPulse { 0%, 100% { box-shadow: 0 6px 20px rgba(212, 175, 55, .3); } 50% { box-shadow: 0 6px 30px rgba(212, 175, 55, .55); } }
.ai-turn { animation: aiIn .35s ease both; }
@keyframes aiIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ai-who { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; font-size: .8rem; font-weight: 600; color: var(--gold-ink); }
.ai-av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; color: #1a1a1a; background: linear-gradient(135deg, #F4D03F, #B8921E); }
.ai-who + .ai-ac { margin-top: 6px; }
.ai-qb { background: linear-gradient(135deg, color-mix(in srgb, var(--gold, #d4af37) 30%, transparent), color-mix(in srgb, var(--gold, #d4af37) 14%, transparent)); border-color: color-mix(in srgb, var(--gold, #d4af37) 55%, transparent); font-weight: 500; }
.ai-ac { background: linear-gradient(180deg, color-mix(in srgb, var(--gold, #d4af37) 6%, var(--surface-2)), var(--surface-2) 40%); border-top: 2px solid color-mix(in srgb, var(--gold, #d4af37) 55%, transparent); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.ai-ac .ai-h { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 3px solid var(--gold, #d4af37); }
.ai-ac .ai-list { list-style: none; padding-left: 0; }
.ai-ac .ai-list li { position: relative; padding-left: 20px; }
.ai-ac .ai-list li::before { content: ''; position: absolute; left: 4px; top: .78em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold, #d4af37); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold, #d4af37) 22%, transparent); }
.ai-wait { display: flex; align-items: center; gap: 12px; margin-top: 6px; color: var(--muted); }
.ai-dots { display: inline-flex; gap: 5px; align-items: center; }
.ai-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold, #d4af37); animation: aiDot 1.2s ease-in-out infinite; }
.ai-dots i:nth-child(2) { animation-delay: .18s; } .ai-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes aiDot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-6px); opacity: 1; } }
.ai-sugg { padding: 12px 12px 4px; margin: 6px 0 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ai-chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 14px; padding: 10px 14px; }
.ai-chip i { font-size: .7rem; color: var(--gold-ink); opacity: .8; }
.ai-chip:hover, .ai-chip:focus-visible { border-color: var(--gold, #d4af37); }
.ai-disc { opacity: .85; font-size: .78rem; }
.ai-composer { position: static; margin-top: 10px; padding: 10px 10px 8px; border-radius: 18px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 35%, var(--line)); box-shadow: 0 -8px 24px rgba(0, 0, 0, .25); }
.ai-composer .ai-q { margin: 0; border: 0; background: transparent; box-shadow: none; min-height: 52px; resize: none; padding: 6px 6px; }
.ai-composer .ai-q:focus { outline: none; }
.ai-comp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-comp-hint { font-size: .72rem; color: var(--muted); }
.ai-composer .ai-send { margin: 0; border-radius: 999px; padding: 10px 20px; background: linear-gradient(135deg, #F4D03F, #D4AF37); color: #1a1a1a; border: 0; font-weight: 700; }
.ai-composer .ai-send[disabled] { opacity: .45; }

/* ---------- v3.7.0 ปุ่มแปลใต้ปุ่มแชร์ (เฉพาะผู้ใช้ภายใน/Admin เมื่ออ่านฉบับอังกฤษ) ---------- */
.v-trans { display: none; position: absolute; top: 69px; right: 4px; width: 34px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--gold-ink); opacity: .55; font-size: 1rem; cursor: pointer; align-items: center; justify-content: center; }
body.can-trans .v-trans { display: flex; }
body.can-trans .verse-item { min-height: 108px; }
.v-trans:hover, .v-trans:focus-visible, .verse-item.active .v-trans { opacity: .95; }
.v-trans:active { transform: scale(.9); background: var(--chip-bg); }
.v-trans-out { margin: 4px 42px 6px 48px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold, #d4af37) 8%, var(--surface)); border-left: 3px solid var(--gold, #d4af37); cursor: default; }
.vt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .74rem; font-weight: 600; letter-spacing: .3px; color: var(--gold-ink); }
.vt-body { font-size: .98rem; line-height: 1.85; color: var(--text-color); }
.vt-err { font-size: .85rem; color: #e05a5a; }
.vt-acts { display: flex; gap: 2px; margin: 4px -8px -4px; }

.ai-composer.sticky { position: sticky; bottom: calc(-24px - var(--safe-b)); margin-left: -4px; margin-right: -4px; border-radius: 18px 18px 0 0; padding-bottom: calc(12px + var(--safe-b)); }

/* ---------- v3.8.1: การ์ดอ่านต่อ + ปุ่มเปลี่ยนบท + ช่องพิมพ์เลขบท ---------- */
.resume-card { display: flex; align-items: stretch; gap: 10px; margin-bottom: 12px; }
.rc-main {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; padding: 12px 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .08)); border: 1px solid rgba(212, 175, 55, .5);
    border-radius: 16px; color: var(--text-color);
}
.rc-main:active { transform: scale(.98); }
.rc-k { font-size: .78rem; color: var(--gold-ink); font-weight: 600; letter-spacing: .02em; }
.rc-ref { font-size: 1.15rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-sub { font-size: .82rem; color: var(--muted); }
.rc-play {
    flex: 0 0 56px; border-radius: 16px; border: none; cursor: pointer; background: var(--gold); color: #0A0F1D; font-size: 1.15rem;
    display: flex; align-items: center; justify-content: center;
}
.rc-play:active { transform: scale(.95); }
.pk-jump { padding-left: 38px; }
.ch-nav { display: flex; gap: 10px; max-width: 860px; margin: 8px auto; }
.ch-nav[hidden] { display: none; }
.ch-nav.bottom { margin: 18px auto 12px; }
.chn-btn {
    flex: 1; min-width: 0; min-height: 44px; padding: 8px 14px; display: flex; align-items: center; gap: 8px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; color: var(--text-color); font-family: inherit; font-size: .95rem;
}
.chn-prev { justify-content: flex-start; }
.chn-next { justify-content: flex-end; }
.chn-btn i { color: var(--gold-ink); flex-shrink: 0; }
.chn-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chn-btn:active:not(:disabled) { transform: scale(.97); background: var(--chip-bg); }
.chn-btn:disabled { opacity: .4; cursor: default; }
.ch-nav.top .chn-btn { min-height: 38px; padding: 4px 12px; font-size: .88rem; border-radius: 12px; }
.ch-nav.bottom .chn-btn { min-height: 52px; font-weight: 600; }
body.sheet-open .ch-nav { visibility: hidden; }

/* ---------- v3.8.3: รายการหนังสือแบ่งพันธสัญญาและ 8 กลุ่ม ---------- */
.bk-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.bk-chips::-webkit-scrollbar { display: none; }
.bk-chip {
    flex: 0 0 auto; padding: 7px 13px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: .84rem; white-space: nowrap;
    background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--gc); color: var(--text-color);
}
.bk-chip:active { transform: scale(.96); }
.bk-test {
    display: flex; align-items: baseline; justify-content: space-between; margin: 18px 2px 10px; padding-bottom: 6px;
    border-bottom: 2px solid rgba(212, 175, 55, .45); color: var(--gold-ink); font-size: 1.1rem; font-weight: 700;
}
.bk-test small { font-size: .78rem; font-weight: 400; color: var(--muted); }
.bk-group { margin-bottom: 12px; border: 1px solid var(--line); border-left: 4px solid var(--gc); border-radius: 14px; background: rgba(255, 255, 255, .02); overflow: hidden; scroll-margin-top: 8px; }
.bk-group.cur { background: rgba(212, 175, 55, .05); }
.bk-gh { display: flex; align-items: center; gap: 8px; padding: 11px 14px 6px; font-weight: 600; font-size: .95rem; }
.bk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gc); flex-shrink: 0; }
.bk-gh .gn { margin-left: auto; font-size: .76rem; font-weight: 400; color: var(--muted); text-align: right; }
.bk-group .book-list { padding: 0 6px 8px; }

/* ---------- v3.8.4: แท็บพันธสัญญาเดิม / ใหม่ ---------- */
.bk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; position: sticky; top: 0; z-index: 3; box-shadow: 0 6px 12px -8px rgba(0, 0, 0, .5); }
.bk-tab { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 48px; padding: 6px 8px; border: none; border-radius: 12px; cursor: pointer; background: transparent; color: var(--muted); font-family: inherit; font-size: .98rem; font-weight: 600; }
.bk-tab small { font-size: .72rem; font-weight: 400; opacity: .85; }
.bk-tab[aria-selected="true"] { background: var(--gold); color: #0A0F1D; }
.bk-tab:active { transform: scale(.97); }

/* v3.8.8 มุมมองผู้ถาม */
.ai-lens-lab { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ai-lens { padding: 8px 12px; font-size: .84rem; }
.ai-lens i { color: var(--gold-ink); }

/* v3.8.9 ข้ออ้างอิงในคำตอบ AI + ปรับขนาดตัวอักษร */
#sheetAI { --ai-fs: 1; }
#sheetAI .ai-ac { font-size: calc(.98rem * var(--ai-fs)); }
#sheetAI .ai-qb { font-size: calc(.92rem * var(--ai-fs)); }
#sheetAI .ai-hero-txt { font-size: calc(1.04rem * var(--ai-fs)); }
#sheetAI .ai-chip { font-size: calc(.88rem * var(--ai-fs)); }
#sheetAI .ai-src { font-size: calc(.76rem * var(--ai-fs)); }
#sheetAI .ai-disc { font-size: calc(.8rem * var(--ai-fs)); }
.sheet-fsw { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.sheet-fs { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; font-weight: 700; line-height: 1; cursor: pointer; }
.sheet-fs.small { font-size: .78rem; }
.sheet-fs.big { font-size: 1.12rem; }
.sheet-fs:disabled { opacity: .35; cursor: default; }
.sheet-fs:active:not(:disabled) { border-color: var(--gold, #d4af37); }
.ai-ref { display: inline; padding: 0 2px; margin: 0; border: 0; border-bottom: 1.5px dotted var(--sky, #38bdf8); border-radius: 2px; background: color-mix(in srgb, var(--sky, #38bdf8) 12%, transparent); color: var(--sky, #38bdf8); font: inherit; font-weight: 600; line-height: inherit; cursor: pointer; text-align: inherit; }
.ai-ref:active, .ai-ref:focus-visible { background: color-mix(in srgb, var(--sky, #38bdf8) 28%, transparent); outline: none; }
.ref-pop { position: fixed; z-index: 10060; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 560px; max-height: 52vh; display: flex; flex-direction: column; border-radius: 18px; background: var(--surface, #141b2e); color: inherit; border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 55%, transparent); box-shadow: 0 14px 40px rgba(0, 0, 0, .55); overflow: hidden; }
.rp-head { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.rp-ref { flex: 1; min-width: 0; color: var(--gold, #d4af37); font-size: calc(1rem * var(--ai-fs, 1)); }
.rp-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: inherit; cursor: pointer; }
.rp-body { flex: 1 1 auto; overflow-y: auto; padding: 0 16px 8px; -webkit-overflow-scrolling: touch; }
.rp-v { margin: 0 0 8px; font-size: calc(1.02rem * var(--ai-fs, 1)); line-height: 1.8; }
.rp-v b { color: var(--gold, #d4af37); font-size: .8em; vertical-align: .1em; }
.rp-more { margin: 0 0 8px; font-size: .78rem; color: var(--muted); }
.rp-acts { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.rp-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; font-size: .84rem; cursor: pointer; }
.rp-btn.gold { background: var(--gold, #d4af37); border-color: var(--gold, #d4af37); color: #0A0F1D; font-weight: 700; }

/* v3.8.10 คงมุมมองไว้ในคำถามต่อ */
.ai-lens.on { border-color: var(--gold, #d4af37); background: color-mix(in srgb, var(--gold, #d4af37) 20%, var(--surface-2)); }
.ai-lens-tag { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0 auto; padding: 2px 9px; border-radius: 999px; font-size: .72rem; color: var(--gold-ink, var(--gold, #d4af37)); background: color-mix(in srgb, var(--gold, #d4af37) 12%, transparent); }
.ai-turn > .ai-lens-tag { display: flex; width: fit-content; margin-left: auto; }
.ai-lensbar:empty { display: none; }
.ai-lensbar { margin: 0 0 8px; }
.ai-lensbar-in { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 999px; font-size: .82rem; background: color-mix(in srgb, var(--gold, #d4af37) 16%, transparent); border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 45%, transparent); }
.ai-lensbar-x { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface-2); color: inherit; cursor: pointer; font-size: .7rem; }

/* v3.8.11 หน้าเปิดแอป: ซ่อนหน้าจอดิบไว้ใต้ splash จนพร้อมจริง + เบลอฉากหลังตอนโหลดข้อมูล */
html:not(.boot-done) .container, html:not(.boot-done) #player-bar { visibility: hidden; }
#bootSplash { backdrop-filter: blur(22px) saturate(.85); -webkit-backdrop-filter: blur(22px) saturate(.85); }
.loading-overlay { background: rgba(5, 8, 16, .62) !important; backdrop-filter: blur(14px) saturate(.85); -webkit-backdrop-filter: blur(14px) saturate(.85); }
[data-theme="light"] .loading-overlay { background: rgba(240, 244, 250, .6) !important; }
[data-theme="light"] .loading-overlay .msg { color: #1d2433; }

/* v3.8.12 ค้นหาคำในพระคัมภีร์จากช่องค้นหาของหน้าเลือกหนังสือ */
.pk-sub { margin: 10px 2px 6px; font-size: .78rem; color: var(--muted); letter-spacing: .3px; }
.pk-verse-hits { margin-top: 12px; }
.pk-verse-hits .sr-results { margin-top: 4px; }
.pk-adv { width: 100%; margin-top: 12px; justify-content: center; }

/* v3.8.13 ค้นหาแบบยืดหยุ่น (เดาคำ) */
.fx-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 2px 10px; font-size: .86rem; color: var(--muted); }
.fx-chip { padding: 7px 13px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 55%, transparent); background: color-mix(in srgb, var(--gold, #d4af37) 14%, transparent); color: var(--gold-ink, var(--gold, #d4af37)); font: inherit; font-weight: 600; cursor: pointer; }
.fx-chip:active { transform: scale(.97); }
.fx-results .sr-item { border-style: dashed; }

/* v3.8.14 ปุ่มเครื่องมือใต้ช่องค้นหา (ค้นหาละเอียด + ถาม AI เรื่องคำ) */
.pk-qtools{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 10px}
.pk-qtools .off-btn{flex:1 1 auto;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-size:.9em}
.pk-qtools .pk-ai{border-color:var(--accent,#d4a72c)}

/* v3.8.15 */
.ai-credit{font-size:.72em;opacity:.6;margin:-4px 2px 8px;line-height:1.4}

/* ===== v3.9.0 หน้าเลือกหนังสือแบบใหม่: เห็นเล่ม/บททันที ไม่ต้องเลื่อน ===== */
.resume-card { gap: 8px; margin-bottom: 10px; }
.resume-card .rc-main { padding: 8px 14px; border-radius: 14px; gap: 0; }
.resume-card .rc-k { font-size: .72rem; }
.resume-card .rc-ref { font-size: 1.05rem; line-height: 1.25; }
.resume-card .rc-sub { font-size: .76rem; line-height: 1.2; }
.rc-goal { flex: 0 0 auto; min-width: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; padding: 4px 8px; border-radius: 14px; cursor: pointer; font: inherit; font-size: .85rem; color: var(--muted); background: var(--chip-bg); border: 1px solid var(--line); }
.rc-goal b { color: var(--gold-ink); font-size: 1.15rem; }
.rc-goal small { font-size: .66rem; }
.resume-card .rc-play { flex: 0 0 48px; border-radius: 14px; font-size: 1.05rem; }
.pk-search-wrap { margin-bottom: 8px; }
.pk-tools { gap: 6px; margin: 0 0 10px; flex-wrap: nowrap; }
.pk-tools .pk-tool, .pk-tools .pk-promise { flex: 1 1 0; min-width: 0; min-height: 42px; padding: 0 6px; gap: 6px; font-size: .85rem; white-space: nowrap; border-radius: 12px; }
.pk-tools .pk-promise { background: var(--chip-bg); border-color: rgba(0, 229, 255, .35); }
.pk-tools .pk-tool span { overflow: hidden; text-overflow: ellipsis; }
.pk-tabs { display: flex; margin: 2px 0 10px; border-bottom: 1px solid var(--line); }
.pk-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
.pk-tab[aria-selected="true"] { color: var(--gold-ink); border-bottom-color: var(--gold); }
.pk-curbook { margin: 0 0 10px; padding: 8px 10px 10px; border: 1px solid rgba(212, 175, 55, .4); border-radius: 14px; background: rgba(212, 175, 55, .06); }
.pk-curh { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; font-weight: 600; margin: 0 2px 6px; }
.pk-curall { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; padding: 4px 2px; color: var(--gold-ink); font: inherit; font-size: .8rem; cursor: pointer; }
.ch-strip { display: flex; gap: 6px; overflow-x: auto; padding: 3px 2px 2px; position: relative; scrollbar-width: none; }
.ch-strip::-webkit-scrollbar { display: none; }
.ch-strip .ch-btn { flex: 0 0 auto; min-width: 46px; height: 42px; padding: 0 6px; }
/* ตารางเล่ม 3 คอลัมน์ */
.bk-group { margin-bottom: 10px; border-radius: 12px; }
.bk-gh { padding: 8px 12px 4px; font-size: .88rem; }
.bk-group .book-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 2px 8px 10px; }
.bk-group .book-row { flex-direction: column; justify-content: center; align-items: center; gap: 1px; min-height: 56px; padding: 6px 4px; text-align: center; border-color: var(--line); background: var(--chip-bg); border-radius: 10px; }
.bk-group .book-row .bn { flex: none; width: 100%; white-space: normal; font-size: .88rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; }
.bk-group .book-row .bp { font-size: .68rem; }
.bk-group .book-row .ba { display: none; }
.bk-group .book-row .bo { position: absolute; top: 3px; right: 5px; font-size: .62rem; }
.bk-group .book-row { position: relative; }
.bk-group .book-row.cur { background: rgba(212, 175, 55, .18); border-color: var(--gold); }
.pk-hist .pk-h { margin: 2px 4px 6px; }
.pk-hist { margin-bottom: 10px; }

/* v3.9.2 ปรับขนาดตัวอักษรหน้าเลือกหนังสือ (--pk-fs ตั้งจากปุ่ม A A) */
#sheetPicker { --pk-fs: 1; }
#sheetPicker .rc-k { font-size: calc(.72rem * var(--pk-fs)); }
#sheetPicker .rc-ref { font-size: calc(1.05rem * var(--pk-fs)); }
#sheetPicker .rc-sub { font-size: calc(.76rem * var(--pk-fs)); }
#sheetPicker .rc-goal { font-size: calc(.85rem * var(--pk-fs)); }
#sheetPicker .rc-goal b { font-size: calc(1.15rem * var(--pk-fs)); }
#sheetPicker .rc-goal small { font-size: calc(.66rem * var(--pk-fs)); }
#sheetPicker .pk-search { font-size: calc(1rem * var(--pk-fs)); height: calc(46px * var(--pk-fs)); }
#sheetPicker .pk-tools .pk-tool, #sheetPicker .pk-tools .pk-promise { font-size: calc(.85rem * var(--pk-fs)); min-height: calc(42px * var(--pk-fs)); }
#sheetPicker .pk-tab { font-size: calc(.95rem * var(--pk-fs)); }
#sheetPicker .pk-curh { font-size: calc(.85rem * var(--pk-fs)); }
#sheetPicker .pk-curall { font-size: calc(.8rem * var(--pk-fs)); }
#sheetPicker .ch-strip .ch-btn { font-size: calc(1.05rem * var(--pk-fs)); min-width: calc(46px * var(--pk-fs)); height: calc(42px * var(--pk-fs)); }
#sheetPicker .chapter-grid .ch-btn { font-size: calc(1.05rem * var(--pk-fs)); height: calc(52px * var(--pk-fs)); }
#sheetPicker .chapter-grid { grid-template-columns: repeat(auto-fill, minmax(calc(58px * var(--pk-fs)), 1fr)); }
#sheetPicker .pk-h, #sheetPicker .pk-sub { font-size: calc(.78rem * var(--pk-fs)); }
#sheetPicker .hist-card .hc-ref { font-size: calc(.98rem * var(--pk-fs)); }
#sheetPicker .hist-card .hc-sub { font-size: calc(.8rem * var(--pk-fs)); }
#sheetPicker .bk-tab { font-size: calc(.98rem * var(--pk-fs)); }
#sheetPicker .bk-tab small { font-size: calc(.72rem * var(--pk-fs)); }
#sheetPicker .bk-gh { font-size: calc(.88rem * var(--pk-fs)); }
#sheetPicker .bk-gh .gn { font-size: calc(.76rem * var(--pk-fs)); }
#sheetPicker .bk-group .book-row .bn { font-size: calc(.88rem * var(--pk-fs)); }
#sheetPicker .bk-group .book-row .bp { font-size: calc(.68rem * var(--pk-fs)); }
#sheetPicker .bk-group .book-row { min-height: calc(56px * var(--pk-fs)); }
#sheetPicker[data-fs="4"] .bk-group .book-list, #sheetPicker[data-fs="5"] .bk-group .book-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#sheetPicker .book-row { font-size: calc(1rem * var(--pk-fs)); }
#sheetPicker .book-row .bp { font-size: calc(.78rem * var(--pk-fs)); }
#sheetPicker .stat-big { font-size: calc(1.05rem * var(--pk-fs)); }
#sheetPicker .stat-big b { font-size: calc(1.4rem * var(--pk-fs)); }
#sheetPicker .stat-streak { font-size: calc(.9rem * var(--pk-fs)); }
#sheetPicker .stat-sub { font-size: calc(.82rem * var(--pk-fs)); }
#sheetPicker .goal-row { font-size: calc(.85rem * var(--pk-fs)); }
#sheetPicker .goal-row button { font-size: calc(.9rem * var(--pk-fs)); height: calc(34px * var(--pk-fs)); min-width: calc(38px * var(--pk-fs)); }
#sheetPicker .pk-primary { font-size: calc(1rem * var(--pk-fs)); }
#sheetPicker .sr-status { font-size: calc(.84rem * var(--pk-fs)); }
#sheetPicker .sr-ref { font-size: calc(.92rem * var(--pk-fs)); }
#sheetPicker .sr-text { font-size: calc(.95rem * var(--pk-fs)); }
#sheetPicker .sr-go { font-size: calc(1rem * var(--pk-fs)); }
#sheetPicker .fx-sug { font-size: calc(.86rem * var(--pk-fs)); }
#sheetPicker .fx-chip { font-size: calc(.9rem * var(--pk-fs)); }
#sheetPicker .off-btn { font-size: calc(.9rem * var(--pk-fs)); }
#sheetPicker .set-hint { font-size: calc(.82rem * var(--pk-fs)); }
#sheetPicker .pk-empty { font-size: calc(1rem * var(--pk-fs)); }
#sheetPicker .pk-tools .pk-tool, #sheetPicker .pk-tools .pk-promise { flex-direction: column; gap: 3px; padding: 6px 4px; text-align: center; white-space: normal; line-height: 1.15; min-height: calc(54px * var(--pk-fs)); }
#sheetPicker .pk-tools .pk-tool span { overflow: visible; text-overflow: clip; }
#sheetPicker .pk-tools .pk-count { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; font-size: .68rem; }
#sheetPicker .pk-tools .pk-tool { position: relative; }

/* v3.9.3 ปรับขนาดตัวอักษรหน้า "ค้นหาพระคำ" (ใช้ค่าเดียวกับหน้าเลือกหนังสือ) */
#sheetSearch { --pk-fs: 1; }
#sheetSearch .sr-input { font-size: calc(1rem * var(--pk-fs)); height: calc(46px * var(--pk-fs)); }
#sheetSearch .seg button { font-size: calc(.95rem * var(--pk-fs)); min-height: calc(44px * var(--pk-fs)); height: auto; padding-top: 4px; padding-bottom: 4px; line-height: 1.2; }
#sheetSearch .sr-status { font-size: calc(.84rem * var(--pk-fs)); }
#sheetSearch .sr-go { font-size: calc(1rem * var(--pk-fs)); }
#sheetSearch .sr-ref { font-size: calc(.92rem * var(--pk-fs)); }
#sheetSearch .sr-text { font-size: calc(.95rem * var(--pk-fs)); }
#sheetSearch .fx-sug { font-size: calc(.86rem * var(--pk-fs)); }
#sheetSearch .fx-chip { font-size: calc(.9rem * var(--pk-fs)); }
#sheetSearch .off-btn { font-size: calc(.9rem * var(--pk-fs)); }
#sheetSearch .pk-qtools .off-btn { min-height: calc(40px * var(--pk-fs)); }
#sheetSearch .set-hint, #sheetSearch .pk-empty { font-size: calc(.85rem * var(--pk-fs)); }

/* v3.10.0 สำรองข้อมูล */
.bk-card{display:flex;flex-direction:column;gap:10px}
.bk-chk{display:flex;gap:10px;align-items:flex-start;font-size:.95em;line-height:1.4}
.bk-chk input{width:20px;height:20px;margin-top:2px;flex:none}
.bk-btn{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:10px 14px;border-radius:12px;border:1px solid rgba(212,175,55,.35);background:transparent;color:inherit;font:inherit;cursor:pointer}
.bk-btn.bk-main{background:rgba(212,175,55,.16);border-color:#D4AF37;font-weight:600}
.bk-btn:disabled{opacity:.5}
.bk-imp{display:flex;flex-direction:column;gap:10px}
.bk-err{color:#ff8a80;margin:0}

/* v3.10.1 ขนาดตัวอักษร: ตั้งค่า / ตั้งเวลา / สำรองข้อมูล + พรีวิวโน้ต + ป้าย Strong's */
#sheetSettings, #sheetSleep, #sheetBackup { --pk-fs: 1; }
#sheetSettings .set-sec > h3 { font-size: calc(.78rem * var(--pk-fs)); }
#sheetSettings .set-hint, #sheetBackup .set-hint { font-size: calc(.82rem * var(--pk-fs)); }
#sheetSettings .set-card .slider-group label, #sheetSettings .set-card .slider-group .val { font-size: calc(.95rem * var(--pk-fs)); }
#sheetSettings .ver-line b { font-size: calc(1.02rem * var(--pk-fs)); }
#sheetSettings .ver-line small { font-size: calc(.8rem * var(--pk-fs)); }
#sheetSettings .seg button { font-size: calc(.95rem * var(--pk-fs)); min-height: calc(44px * var(--pk-fs)); height: auto; }
#sheetSettings .set-card select { font-size: calc(1rem * var(--pk-fs)); height: calc(48px * var(--pk-fs)); }
#sheetSettings .set-card .font-scale-label { font-size: calc(1.05rem * var(--pk-fs)); }
#sheetSettings .set-card .font-ctrl-btn { font-size: calc(1rem * var(--pk-fs)); min-height: calc(44px * var(--pk-fs)); }
#sheetSettings .set-foot { font-size: calc(.78rem * var(--pk-fs)); }
#sheetSleep .sleep-status { font-size: calc(.95rem * var(--pk-fs)); }
#sheetSleep .sleep-status b { font-size: calc(1.5rem * var(--pk-fs)); }
#sheetSleep .sleep-opt { font-size: calc(1rem * var(--pk-fs)); }
#sheetSleep .sleep-note { font-size: calc(.8rem * var(--pk-fs)); }
#sheetBackup .bk-btn, #sheetBackup .bk-chk { font-size: calc(1rem * var(--pk-fs)); }
#sheetBackup .bk-chk { font-size: calc(.95rem * var(--pk-fs)); }
.npv-verse { margin-bottom: 12px; }
.npv-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.npv-actions { flex-wrap: wrap; }
.npv-del { color: #EF4444; }
.ai-strongs { border-color: rgba(0, 229, 255, .35); }

/* v3.11.0 คำศัพท์น่ารู้ */
.ai-vocab { margin: 12px 0 4px; padding: 12px 12px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }
.ai-vocab .vc-lab { margin: 0 0 8px; }
.vc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vc-chip { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); font: inherit; cursor: pointer; text-align: left; }
.vc-chip.on { border-color: var(--gold); background: rgba(212, 175, 55, .16); }
.vc-w { color: var(--gold-ink); font-size: 1.12em; font-weight: 600; }
.vc-g { font-size: .86em; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.vc-n { font-style: normal; font-size: .7em; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 1px 6px; }
.vc-detail { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.vc-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.vc-big { font-size: 1.6em; color: var(--gold-ink); font-weight: 600; }
.vc-tr { color: var(--muted); font-style: italic; }
.vc-gl { font-weight: 600; }
.vc-def, .vc-freq { font-size: .88em; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.vc-ask { align-self: flex-start; margin-top: 4px; }
.vc-credit { margin-top: 8px; font-size: .72em; color: var(--muted); }

/* v3.11.1 พรีวิวโน้ต: ปรับขนาดตัวอักษรได้ */
#sheetNotePv { --pk-fs: 1; }
#sheetNotePv .npv-verse { font-size: calc(.95rem * var(--pk-fs)); }
#sheetNotePv .npv-note { font-size: calc(1rem * var(--pk-fs)); }
#sheetNotePv .off-btn { font-size: calc(.9rem * var(--pk-fs)); min-height: calc(40px * var(--pk-fs)); }

/* v3.12.0 คำศัพท์น่ารู้: ชิปคำไทย */
.vc-chip.th { align-items: center; padding: 9px 14px; }
.vc-th { font-size: 1.05em; font-weight: 600; color: var(--text-color); }
.vc-chip.th.on .vc-th { color: var(--gold-ink); }
.vc-thline { font-size: .95em; }
.vc-thline b { color: var(--gold-ink); }
.vc-note { line-height: 1.55; padding: 8px 10px; border-left: 3px solid var(--gold); background: rgba(212, 175, 55, .08); border-radius: 0 10px 10px 0; }
.vc-lab2 { font-size: .75em; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.vc-gen { width: 100%; justify-content: center; min-height: 46px; }
.vc-hint { font-size: .8em; color: var(--muted); line-height: 1.5; margin-top: 8px; }
.vc-hint.err { color: #ff8a80; }
.vc-redo { margin-top: 10px; background: none; border: none; color: var(--muted); font: inherit; font-size: .82em; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 6px 2px; }

/* v3.13.0 พระสัญญา: รีดีไซน์ให้เข้าธีมแอป (ทองเดียว · การ์ดเรียบ · แถบเสียงกะทัดรัด) */
.pm-card { --pm-accent: var(--gold); }
.pm-card .main-card { background: transparent; border: 0; border-radius: 0; overflow: visible; }
.pm-card .card-header { text-align: left; padding: 2px 2px 12px; background: none; border-bottom: 1px solid var(--line); }
.pm-card .card-title { margin: 0 0 3px; font-size: 1.22rem; font-weight: 600; color: var(--gold-ink); line-height: 1.3; }
.pm-card .card-subtitle { font-size: .88rem; color: var(--muted); }
.pm-card .card-content { padding: 4px 0 8px; }
.pm-card .v-row { margin: 12px 0; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); border-left: 1px solid var(--line); box-shadow: none; transition: border-color .15s, background .15s; }
.pm-card .v-row.pm-sel { box-shadow: none; border-color: var(--gold); }
.pm-card .v-row.pm-playing { box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(212, 175, 55, .22); background: color-mix(in srgb, var(--gold) 7%, var(--surface-2)); border-color: var(--gold); }
.pm-card .section-header { margin-bottom: 6px; }
.pm-card .v-badge.pm-ref { padding: 0; border-radius: 0; background: none; color: var(--gold-ink); font-size: .9rem; font-weight: 600; letter-spacing: .01em; }
.pm-card .v-badge.pm-ref i { font-size: .8em; margin-right: 5px; opacity: .8; }
.pm-card .v-text-body { font-size: var(--read-size); line-height: 1.75; color: var(--text-color); display: block; }
.pm-card .point-item { margin-top: 12px; }
.pm-card .pm-core { padding: 10px 14px; border-radius: 12px; background: rgba(212, 175, 55, .08); border: 0; box-shadow: none; }
.pm-card .pm-core .v-badge.pm-core-lab { display: block; margin: 0 0 4px; padding: 0; background: none; color: var(--gold-ink); font-size: .78rem; font-weight: 600; letter-spacing: .04em; }
.pm-card .pm-core .v-badge.pm-core-lab i { margin-right: 5px; }
.pm-card .pm-core .v-text-body { font-size: calc(var(--read-size) * .92); font-style: normal; opacity: 1; color: var(--text-color); line-height: 1.65; }
.pm-tools .pm-sz.sheet-fs { flex: 0 0 auto; }
.pm-morebtn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold-ink); }
.pm-more { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.pm-more .off-btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
.pm-player { padding-top: 8px; }
.pm-prow1 { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.pm-prow1 .pm-pbtn.main { width: 48px; height: 48px; }
.pm-seekcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-times { display: flex; justify-content: space-between; }
.pm-times .pm-t { min-width: 0; text-align: left; }
.pm-times .pm-t:last-child { text-align: right; }
.pm-seek { accent-color: var(--gold); width: 100%; }
.pm-modecycle { flex: 0 0 auto; min-width: 64px; min-height: 48px; padding: 0 8px; }
.pm-mode.pm-modecycle { color: var(--gold-ink); border-color: rgba(212, 175, 55, .45); background: rgba(212, 175, 55, .1); }
.pm-chip.on { background: rgba(212, 175, 55, .16); border-color: var(--gold); color: var(--gold-ink); }
.pm-mode.on { color: var(--gold-ink); border-color: var(--gold); background: rgba(212, 175, 55, .12); }
.pm-more[hidden] { display: none; }

/* v3.14.0 คำตอบ AI / โน้ต: สรุปนำ · หัวข้อเด่น · ชิปศัพท์ต้นฉบับ */
.ai-sum { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(212, 175, 55, .1); border: 1px solid rgba(212, 175, 55, .32); line-height: 1.6; }
.ai-sum-lab { flex: none; margin-top: 3px; padding: 1px 9px; border-radius: 8px; background: var(--gold); color: #0A0F1D; font-size: .72em; font-weight: 700; letter-spacing: .05em; }
.ai-sum-t { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.ai-tagrow { margin: 0 0 10px; }
.ai-tagrow:not(:first-child) { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ai-tag { display: inline-block; padding: 1px 9px; border-radius: 8px; border: 1px solid rgba(212, 175, 55, .5); color: var(--gold-ink); font-size: .72em; font-weight: 700; letter-spacing: .06em; }
.ai-ac .ai-h { margin: 20px 0 8px; font-size: 1.03em; padding-top: 0; }
.ai-ac .ai-h:first-child, .ai-ac .ai-sum + .ai-h, .ai-ac .ai-tagrow + .ai-h, .ai-ac .ai-sum + .ai-p { margin-top: 4px; }
.ai-ac .ai-list { margin: 0 0 12px; }
.ai-ac .ai-list li { margin: 0 0 7px; line-height: 1.7; }
.ai-ac .ai-list li::before { width: 6px; height: 6px; top: .85em; box-shadow: none; opacity: .85; }
.ai-gr { color: var(--gold-ink); font-style: italic; font-weight: 600; }
.ai-sn { display: inline-block; padding: 0 7px; margin: 0 1px; border: 1px solid var(--line); border-radius: 8px; background: var(--chip-bg); color: var(--muted); font-size: .78em; font-style: normal; font-weight: 600; vertical-align: .08em; }
#sheetAI .ai-sum { font-size: calc(.98rem * var(--ai-fs)); }
.ai-ac .ai-h { color: var(--gold-ink); }

/* v3.15.0 ซิงค์ที่จำไว้ (admin) */
.sy-list { display: flex; flex-direction: column; gap: 8px; }
.sy-group { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sy-grp { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.sy-gn { flex: 1; min-width: 0; font-weight: 600; }
.sy-gc { font-style: normal; font-size: .82em; color: var(--muted); }
.sy-grp i.fa-chevron-down, .sy-grp svg { transition: transform .15s; color: var(--muted); }
.sy-grp[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }
.sy-rows { border-top: 1px solid var(--line); }
.sy-rows[hidden] { display: none; }
.sy-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 14px; }
.sy-row + .sy-row { border-top: 1px solid var(--line); }
.sy-go { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.sy-go small { color: var(--muted); font-size: .8em; }
.sy-del { flex: 0 0 auto; min-height: 36px; padding: 0 12px; font-size: .85em; color: #EF4444; }

/* v3.16.0 — แชร์คำตอบ AI */
.ais-note{font-size:calc(var(--pk-fs,1)*.86rem);opacity:.75;line-height:1.5;margin:0 0 10px}
.ais-canvas{width:100%;height:auto;border-radius:14px;margin:0 0 12px;display:block}
.ai-share{color:var(--gold,#b8932c)}

/* v3.18.0 — เกี่ยวกับ / แจ้งปัญหา */
.ab-sec h3{margin-bottom:6px}
.ab-p{font-size:calc(var(--pk-fs,1)*.92rem);line-height:1.65;margin:0 0 8px;opacity:.9}
.ab-diag{white-space:pre-wrap;word-break:break-word;font:calc(var(--pk-fs,1)*.74rem)/1.5 ui-monospace,Menlo,monospace;background:rgba(127,127,127,.12);border-radius:12px;padding:12px;margin:0 0 12px;max-height:38vh;overflow:auto}
a.off-btn{text-decoration:none;display:flex;align-items:center;justify-content:center;gap:8px}
.ni-au{margin-top:12px}.ni-au label{display:flex;gap:10px;align-items:flex-start;line-height:1.6;cursor:pointer}.ni-au input{width:22px;height:22px;flex:0 0 22px;margin-top:3px;accent-color:var(--gold,#e5b63c)}

/* v3.19.0 — ปุ่มปรับขนาดตัวอักษรในแผ่นที่เหลือ (ค่าเดียวกับหน้าเลือกหนังสือ/ตั้งค่า) */
#sheetStudy, #sheetMine, #sheetLib, #sheetPromise, #sheetXref, #sheetSnap, #sheetSync, #sheetGuide { --pk-fs: 1; }
#sheetStudy .sheet-body > *, #sheetMine .sheet-body > *, #sheetLib .sheet-body > *, #sheetPromise .sheet-body > *,
#sheetXref .sheet-body > *, #sheetSnap .sheet-body > *, #sheetSync .sheet-body > *, #sheetGuide .sheet-body > * { zoom: var(--pk-fs); }

/* v3.20.0 — คำแปลไทยของ Strong's (โดย AI) */
.vc-aitag{display:flex;gap:6px;align-items:flex-start;font-size:calc(var(--ai-fs,1)*.76rem);line-height:1.5;opacity:.78;margin:6px 0 8px;color:var(--gold,#b8932c)}
.vc-aitag i{margin-top:3px}
.vc-en{margin:4px 0 8px;font-size:calc(var(--ai-fs,1)*.86rem)}
.vc-en summary{cursor:pointer;opacity:.75;padding:4px 0}
.vc-en .vc-gl,.vc-en .vc-def{opacity:.85}
.vc-tr-btn{margin:6px 0}

/* v3.21.0 — ตัวเล่น: ย้อน/ข้าม, ความเร็ว, ท่องจำ */
body #player-bar button.pb-skip{position:relative;width:38px;height:38px;font-size:1.15rem;color:var(--text-color)}
body #player-bar button.pb-skip b{position:absolute;left:0;right:0;top:50%;transform:translateY(-44%);font-size:.5rem;font-weight:700;line-height:1;text-align:center;pointer-events:none}
body #player-bar button.pb-speed{width:auto;min-width:46px;height:28px;padding:0 9px;border-radius:14px;font-size:.78rem;font-weight:600;background:var(--chip-bg);border:1px solid var(--line);color:var(--muted);font-family:inherit}
body #player-bar button.pb-speed.on{color:var(--gold-ink);border-color:var(--gold)}
@media (max-width:600px){body #player-bar button.pb-skip{width:34px;height:34px;font-size:1.05rem}body #player-bar button.pb-speed{min-width:42px;height:26px;padding:0 7px}}
.pl-presets{display:flex;flex-wrap:wrap;gap:6px;padding:4px 14px 10px}
.pl-sp{flex:1 1 auto;min-height:36px;padding:0 10px;border-radius:18px;background:var(--chip-bg);border:1px solid var(--line);color:inherit;font:inherit;font-size:.88rem;cursor:pointer}
.pl-sp.sel{background:var(--gold);border-color:var(--gold);color:#0A0F1D;font-weight:600}
.pl-lockrow{padding:6px 14px 12px}
.pl-lab{font-size:.85rem;opacity:.75;margin-bottom:2px}
.memo-range{display:grid;grid-template-columns:auto 1fr auto 1fr;gap:8px;align-items:center;margin:0 0 12px}
.memo-range label{font-size:.9rem;opacity:.75}
.memo-sel{min-height:44px;border-radius:10px;border:1px solid var(--line);background:var(--chip-bg);color:inherit;font:inherit;padding:0 8px}
.memo-go{margin-top:12px}
.mode-chips button.memo-btn.active{background:rgba(212,175,55,.16);border-color:rgba(212,175,55,.6);color:var(--gold-ink)}
#sheetMemo{--pk-fs:1}
#sheetMemo .sheet-body > *{zoom:var(--pk-fs)}

/* v3.22.0 — โครงเรื่อง (โครงบท / ภาพรวมเล่ม) */
.ol-bar{position:relative;display:flex;align-items:center;gap:10px;width:100%;margin:0 0 10px;padding:10px 14px;border-radius:14px;background:var(--chip-bg);border:1px solid rgba(212,175,55,.45);color:var(--text-color);font:inherit;text-align:left;cursor:pointer;min-height:48px}
.ol-bar[hidden]{display:none}
.ol-bar:active{transform:scale(.99)}
.ol-bar > i:first-child{color:var(--gold-ink);font-size:1rem}
.ol-bt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.ol-k{font-size:.7rem;color:var(--muted);letter-spacing:.02em}
.ol-t{font-size:.95rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ol-r{flex:0 0 auto;font-size:.76rem;color:var(--gold-ink);background:rgba(212,175,55,.14);border-radius:999px;padding:2px 9px;white-space:nowrap}
.ol-car{color:var(--muted);font-size:.8rem}
.ol-lead{font-size:calc(.98rem*var(--pk-fs,1));font-weight:600;color:var(--gold-ink);margin:2px 0 12px;line-height:1.5}
.ol-tabs{padding:0 0 10px}
.ol-sec{border:1px solid var(--line);border-radius:14px;margin:0 0 8px;background:var(--chip-bg);overflow:hidden}
.ol-sec.cur{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold) inset}
.ol-row{display:flex;align-items:stretch}
.ol-sh{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 8px 12px 14px;background:none;border:0;color:inherit;font:inherit;text-align:left;cursor:pointer;min-height:52px}
.ol-st{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:3px}
.ol-ref{font-size:.74rem;color:var(--gold-ink);background:rgba(212,175,55,.14);border-radius:999px;padding:1px 9px;white-space:nowrap}
.ol-title{font-size:calc(1rem*var(--pk-fs,1));font-weight:600;line-height:1.4}
.ol-chev{color:var(--muted);font-size:.8rem;transition:transform .2s}
.ol-sec.open .ol-chev{transform:rotate(180deg)}
.ol-go{flex:0 0 52px;display:flex;align-items:center;justify-content:center;background:none;border:0;border-left:1px solid var(--line);color:var(--gold-ink);font-size:1rem;cursor:pointer}
.ol-go:active{background:rgba(212,175,55,.2)}
.ol-body{display:none;padding:0 14px 12px}
.ol-sec.open .ol-body{display:block}
.ol-pts{margin:0;padding-left:1.1em;font-size:calc(.92rem*var(--pk-fs,1));line-height:1.65;opacity:.92}
.ol-pts li{margin:0 0 6px}
.ol-lab{color:var(--gold-ink);font-weight:600}
.ol-ph{border:1px solid var(--line);border-radius:14px;margin:0 0 10px;padding:12px 14px;background:var(--chip-bg)}
.ol-phh{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:calc(1rem*var(--pk-fs,1))}
.ol-ins{margin:8px 0 6px;font-size:calc(.9rem*var(--pk-fs,1));line-height:1.65;opacity:.9}
.ol-chs{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.ol-ch{min-width:40px;min-height:36px;padding:0 10px;border-radius:10px;background:rgba(127,127,127,.12);border:1px solid var(--line);color:inherit;font:inherit;font-size:.88rem;cursor:pointer}
.ol-ch.done{border-color:rgba(34,197,94,.55)}
.ol-ch.cur{background:var(--gold);border-color:var(--gold);color:#0A0F1D;font-weight:600}
.ol-ch.wide{padding:0 14px}
.ol-bookbtn{display:flex;align-items:center;gap:12px;width:100%;margin:0 0 12px;padding:12px 14px;border-radius:14px;background:var(--chip-bg);border:1px solid var(--line);color:inherit;font:inherit;text-align:left;cursor:pointer;min-height:56px}
.ol-bookbtn > i:first-child{color:var(--gold-ink)}
.ol-bbt{flex:1;display:flex;flex-direction:column;gap:2px}
.ol-bbt small{color:var(--muted);font-size:.78rem}
#sheetOutline{--pk-fs:1}
#sheetOutline .sheet-body > *{zoom:var(--pk-fs)}

/* v3.23.0 */
.ol-bar.ol-pulse{animation:olPulse 1.1s ease-in-out 3;border-color:var(--gold)}
@keyframes olPulse{0%,100%{box-shadow:0 0 0 0 rgba(212,175,55,.0)}50%{box-shadow:0 0 0 6px rgba(212,175,55,.35)}}
.ol-tip{position:absolute;right:12px;top:-12px;background:var(--gold);color:#0A0F1D;font-size:.74rem;font-weight:600;padding:3px 10px;border-radius:999px;pointer-events:none;white-space:nowrap}
@media (prefers-reduced-motion:reduce){.ol-bar.ol-pulse{animation:none;box-shadow:0 0 0 3px rgba(212,175,55,.35)}}
.ol-recap{position:fixed;left:12px;right:12px;bottom:calc(var(--bar-h,72px) + var(--safe-b,0px) + 66px);z-index:10005;max-width:560px;margin:0 auto;padding:12px 14px;border-radius:16px;background:var(--surface,#151B2E);border:1px solid var(--gold);box-shadow:0 10px 28px rgba(0,0,0,.4);color:var(--text-color)}
.ol-recap[hidden]{display:none}
.ol-rh{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--gold-ink)}
.ol-x{width:36px;height:36px;border:0;border-radius:10px;background:none;color:var(--muted);font-size:1rem;cursor:pointer}
.ol-rs{font-size:.95rem;font-weight:600;margin:2px 0 6px}
.ol-rl{margin:0 0 6px;padding:0;list-style:none;font-size:.86rem;line-height:1.7;opacity:.92}
.ol-rp{font-size:.84rem;line-height:1.6;opacity:.9;margin:4px 0 6px}
.ol-ra{display:flex;gap:8px;margin-top:6px}
.ol-rb{flex:1;min-height:42px;border-radius:12px;border:1px solid var(--gold);background:var(--gold);color:#0A0F1D;font:inherit;font-weight:600;cursor:pointer}
.ol-rb.quiet{background:none;color:var(--muted);border-color:var(--line);font-weight:400;font-size:.84rem}

/* =====================================================================
   v3.25.0 — ธีมอาร์เคด: จอ CRT ตู้อาเขตสีหม่น (อ้างอิงวิดีโอเครดิต) · html[data-skin="arcade"]
   จอเทาม่วงอมถ่าน ไม่ดำสนิท · ตัวอักษรไล่สีลาเวนเดอร์→ฟ้าน้ำทะเลนวลๆ มีแสงฟุ้ง
   ไม่มีกรอบแข็ง/เงาออฟเซ็ต/สีจัด · เติมกลิ่น CRT: เส้นสแกน เกรน ขอบจอมน ขอบมืด ภาพเหลื่อมสีแวบเดียว
   ===================================================================== */
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
html[data-skin="arcade"] {
    --gold: #cfa6ea; --gold-ink: #d6b0ee; --accent: #9fe6ea;
    --surface: #2d2c37; --surface-2: #383646;
    --chip-bg: rgba(255, 255, 255, .06); --line: rgba(255, 255, 255, .09); --muted: #aaa7bf;
    --topbar-bg: rgba(38, 37, 45, .92); --bar-bg: rgba(38, 37, 45, .96);
    --bg-color: #26252d; --text-color: #ebe8f2; --card-bg: rgba(45, 44, 55, .8); --card-border: rgba(207, 166, 234, .3); --header-bg: #1f1e25;
    --arc-lilac: #d09ede; --arc-cyan: #a0ebea; --arc-glow: 0 0 10px rgba(180, 160, 235, .45);
}
html[data-skin="arcade"] body {
    background: radial-gradient(130% 80% at 50% 25%, #34323f 0%, #26252d 60%, #1d1c22 100%) !important;
    background-attachment: fixed !important;
}
/* ชั้นจอ CRT: ขอบมืดมุมมน + เงาขอบ + เส้นสแกนบาง + เกรน (ไม่รับการแตะ) */
html[data-skin="arcade"] body::before {
    content: ''; position: fixed; inset: 0; z-index: 10090; pointer-events: none; border-radius: 26px;
    box-shadow: inset 0 0 0 5px #0f0e11, inset 0 0 70px rgba(0, 0, 0, .5);
}
html[data-skin="arcade"] body::after {
    content: ''; position: fixed; inset: 0; z-index: 10089; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .55 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
/* หัวข้อ/ตัวเน้น: ตัวอักษรไล่สีลาเวนเดอร์ → ฟ้า + แสงฟุ้ง */
html[data-skin="arcade"] .sheet-title,
html[data-skin="arcade"] .ol-rh b,
html[data-skin="arcade"] .tb-book,
html[data-skin="arcade"] .set-sec h3 {
    background: linear-gradient(180deg, var(--arc-cyan) 8%, var(--arc-lilac) 92%); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent !important; filter: drop-shadow(0 0 7px rgba(170, 150, 235, .5));
}
html[data-skin="arcade"] .chapter-header { background: rgba(255, 255, 255, .045) !important; border: 0 !important; box-shadow: none !important; color: var(--arc-lilac) !important; text-shadow: 0 0 9px rgba(170, 150, 235, .55); }
html[data-skin="arcade"] .chapter-header i { color: var(--arc-cyan) !important; }
html[data-skin="arcade"] .story-sub-badge { color: var(--arc-cyan) !important; }
html[data-skin="arcade"] input[type=range]::-webkit-slider-thumb { background: var(--arc-lilac) !important; box-shadow: 0 0 8px rgba(170, 150, 235, .6); }
html[data-skin="arcade"] input[type=range]::-moz-range-thumb { background: var(--arc-lilac) !important; }
/* พื้นผิวทั่วไป: นุ่ม ไม่มีกรอบแข็ง */
html[data-skin="arcade"] .tb-title, html[data-skin="arcade"] .tb-btn, html[data-skin="arcade"] .ol-bar,
html[data-skin="arcade"] .ol-bookbtn, html[data-skin="arcade"] .set-card, html[data-skin="arcade"] .ol-sec,
html[data-skin="arcade"] .ol-ph, html[data-skin="arcade"] .ol-recap {
    border: 1px solid rgba(255, 255, 255, .09) !important; border-radius: 12px !important; box-shadow: none !important;
}
html[data-skin="arcade"] .ol-recap { background: #2d2c37; box-shadow: 0 10px 30px rgba(0, 0, 0, .45), var(--arc-glow) !important; border-color: rgba(207, 166, 234, .4) !important; }
html[data-skin="arcade"] .verse-item { border: 0 !important; background: rgba(255, 255, 255, .035) !important; border-radius: 10px !important; box-shadow: none !important; margin-bottom: 10px; }
html[data-skin="arcade"] .verse-item.active {
    background: rgba(207, 166, 234, .11) !important;
    box-shadow: 0 0 0 1px rgba(207, 166, 234, .5), 0 0 18px rgba(160, 235, 234, .16) !important;
}
html[data-skin="arcade"] .verse-item.active .verse-num, html[data-skin="arcade"] .verse-num { color: var(--arc-cyan) !important; }
html[data-skin="arcade"] #appTopbar { border-bottom: 1px solid rgba(255, 255, 255, .06) !important; box-shadow: none !important; }
html[data-skin="arcade"] .tb-btn.on { background: rgba(207, 166, 234, .2); color: var(--arc-cyan); border-color: rgba(207, 166, 234, .5) !important; }
html[data-skin="arcade"] .tb-btn:active, html[data-skin="arcade"] .ol-bar:active, html[data-skin="arcade"] .ol-bookbtn:active { transform: scale(.97); }
html[data-skin="arcade"] .seg button { border-radius: 10px !important; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text-color); }
html[data-skin="arcade"] .seg button[aria-pressed="true"] {
    background: linear-gradient(180deg, rgba(160, 235, 234, .22), rgba(208, 158, 222, .26)); color: #fff; border-color: rgba(208, 158, 222, .55); box-shadow: var(--arc-glow);
}
/* แถบเล่น: ปุ่มเล่นกลมไล่สีลาเวนเดอร์→ฟ้า เรืองแสงนุ่ม */
html[data-skin="arcade"] body #player-bar { background: rgba(38, 37, 45, .97); border-top: 1px solid rgba(255, 255, 255, .06) !important; box-shadow: 0 -10px 28px rgba(0, 0, 0, .35) !important; }
html[data-skin="arcade"] body #player-bar #playPauseBtn {
    background: linear-gradient(180deg, #a0ebea 0%, #d09ede 100%) !important; color: #2a2833 !important; border: 0 !important;
    box-shadow: 0 0 18px rgba(170, 150, 235, .55) !important;
}
html[data-skin="arcade"] body #player-bar #playPauseBtn:active { transform: scale(.94); }
html[data-skin="arcade"] body #player-bar .info .ref { color: var(--arc-cyan); text-shadow: 0 0 8px rgba(160, 235, 234, .45); }
html[data-skin="arcade"] body #player-bar .time, html[data-skin="arcade"] .ol-r, html[data-skin="arcade"] .ol-ref { font-family: ui-monospace, 'Courier New', monospace; }
html[data-skin="arcade"] body #player-bar .time { color: var(--arc-cyan); text-shadow: 0 0 6px rgba(160, 235, 234, .5); }
html[data-skin="arcade"] input[type=range] { accent-color: var(--arc-lilac); }
/* แผ่น/ป้าย */
html[data-skin="arcade"] .sheet { background: #2a2933 !important; border: 0 !important; border-radius: 18px 18px 0 0 !important; box-shadow: 0 -10px 30px rgba(0, 0, 0, .4) !important; }
html[data-skin="arcade"] .ol-ref, html[data-skin="arcade"] .ol-r { background: rgba(207, 166, 234, .18); color: var(--arc-lilac); border-radius: 6px; }
html[data-skin="arcade"] .ol-ch { border-radius: 8px; border: 1px solid rgba(255, 255, 255, .1); }
html[data-skin="arcade"] .ol-ch.cur { background: linear-gradient(180deg, var(--arc-cyan), var(--arc-lilac)); color: #2a2833; box-shadow: var(--arc-glow); }
html[data-skin="arcade"] .ol-rb { border-radius: 10px; background: linear-gradient(180deg, var(--arc-cyan), var(--arc-lilac)); border: 0; color: #2a2833; box-shadow: var(--arc-glow); }
html[data-skin="arcade"] .ol-rb.quiet { background: none; color: var(--muted); box-shadow: none; border: 1px solid rgba(255, 255, 255, .1); }
html[data-skin="arcade"] .toast { background: #2d2c37 !important; border: 1px solid rgba(207, 166, 234, .45) !important; border-radius: 12px !important; box-shadow: var(--arc-glow); }
/* ภาพเหลื่อมสี (glitch) แวบเดียวตอนหัวบทเปลี่ยน — เหมือนสัญญาณจอ CRT */
html[data-skin="arcade"] .chapter-header.active, html[data-skin="arcade"] .ol-rh b { animation: arcGlitch .5s steps(2, end) 1; }
@keyframes arcGlitch {
    0% { transform: translateX(0); filter: drop-shadow(-2px 0 rgba(160, 235, 234, .8)) drop-shadow(2px 0 rgba(208, 158, 222, .8)); }
    40% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
    100% { transform: translateX(0); filter: drop-shadow(0 0 7px rgba(170, 150, 235, .5)); }
}
@media (prefers-reduced-motion: reduce) { html[data-skin="arcade"] .chapter-header.active, html[data-skin="arcade"] .ol-rh b { animation: none; } }

/* v3.26.0 — จอแก้ว: ตัวอักษรข้อที่อ่านเรืองแบบฟอสเฟอร์ · เอฟเฟกต์เปิดจอ CRT · โหมด OSD (พระสัญญา) ในโทนเดียวกัน */
html[data-skin="arcade"] .verse-item.active .verse-text {
    color: #f6f2ff;
    text-shadow: 0 0 5px rgba(205, 190, 255, .55), 0 0 14px rgba(160, 235, 234, .28);
}
#arcPower { position: fixed; inset: 0; z-index: 10100; pointer-events: none; }
#arcPower b { position: absolute; left: 0; right: 0; background: #0b0a0e; animation-duration: .62s; animation-timing-function: cubic-bezier(.7, 0, .3, 1); animation-fill-mode: forwards; }
#arcPower b.up { top: 0; height: 50%; animation-name: arcUp; }
#arcPower b.dn { bottom: 0; height: 50%; animation-name: arcDn; }
#arcPower i { position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: #ece8ff;
    box-shadow: 0 0 16px 3px rgba(190, 170, 255, .85), 0 0 40px 8px rgba(160, 235, 234, .35); transform: scaleX(0); animation: arcLine .62s ease-out forwards; }
@keyframes arcUp { 0%, 38% { transform: translateY(0); } 100% { transform: translateY(-101%); } }
@keyframes arcDn { 0%, 38% { transform: translateY(0); } 100% { transform: translateY(101%); } }
@keyframes arcLine { 0% { transform: scaleX(0); opacity: 1; } 34% { transform: scaleX(1); opacity: 1; } 55% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
/* OSD พระสัญญา ในธีมอาร์เคด: ใช้ลาเวนเดอร์/ฟ้านวลแทนสีหมวดที่จัด */
html[data-skin="arcade"] .pm-osd { background: radial-gradient(120% 90% at 50% 30%, #34323f 0%, #26252d 65%, #1d1c22 100%); }
html[data-skin="arcade"] .pm-osd-head { border-bottom-color: rgba(255, 255, 255, .08); }
html[data-skin="arcade"] .pm-osd-t { color: var(--arc-lilac); text-shadow: 0 0 9px rgba(170, 150, 235, .5); }
html[data-skin="arcade"] .pm-osd-card { background: rgba(255, 255, 255, .045); border: 1px solid rgba(207, 166, 234, .45); border-radius: 16px; box-shadow: 0 0 26px rgba(170, 150, 235, .2); }
html[data-skin="arcade"] .pm-osd-ref { background: rgba(207, 166, 234, .18); color: var(--arc-lilac); font-family: ui-monospace, 'Courier New', monospace; }
html[data-skin="arcade"] .pm-osd-verse { color: #f6f2ff; text-shadow: 0 0 6px rgba(205, 190, 255, .55), 0 0 18px rgba(160, 235, 234, .3); }
html[data-skin="arcade"] .pm-osd-ititle { color: var(--arc-cyan); text-shadow: 0 0 9px rgba(160, 235, 234, .5); }
html[data-skin="arcade"] .pm-osd-core { border-left-color: var(--arc-cyan); background: rgba(160, 235, 234, .08); }
html[data-skin="arcade"] .pm-osd-core b { color: var(--arc-cyan); }
html[data-skin="arcade"] .pm-osd-cb { background: rgba(207, 166, 234, .12); border-color: rgba(207, 166, 234, .4); color: var(--arc-lilac); }
html[data-skin="arcade"] .pm-osd-cb.big { background: linear-gradient(180deg, var(--arc-cyan), var(--arc-lilac)); color: #2a2833; border: 0; box-shadow: var(--arc-glow); }
html[data-skin="arcade"] .pm-osd-mode.on { color: var(--arc-cyan); border-color: rgba(160, 235, 234, .5); background: rgba(160, 235, 234, .1); }
html[data-skin="arcade"] .pm-osd-bar { background: linear-gradient(90deg, var(--arc-cyan), var(--arc-lilac)); }
@media (prefers-reduced-motion: reduce) { #arcPower { display: none; } }

/* v3.26.1 — จุดที่ยังหลุดสีจาก index.html (ป้ายเบรค · ปุ่มขึ้นบน · OSD โหมดอ่านเต็มจอ · ซิงก์ค้าง) ให้เข้าโทนอาร์เคด */
html[data-skin="arcade"] .scroll-brake-pill {
    background: rgba(45, 44, 55, .96) !important; color: var(--arc-cyan) !important; border: 1px solid rgba(207, 166, 234, .5) !important;
    box-shadow: var(--arc-glow); text-shadow: 0 0 6px rgba(160, 235, 234, .45);
}
html[data-skin="arcade"] .scroll-brake-pill.calibrating { color: var(--arc-lilac) !important; border-color: var(--arc-lilac) !important; }
html[data-skin="arcade"] .scroll-top-btn { background: rgba(45, 44, 55, .9); border: 1px solid rgba(207, 166, 234, .45); color: var(--arc-lilac); box-shadow: var(--arc-glow); }
html[data-skin="arcade"] .verse-item.hold-syncing { background: rgba(160, 235, 234, .1) !important; box-shadow: 0 0 0 1px rgba(160, 235, 234, .5), 0 0 16px rgba(160, 235, 234, .2) !important; }
html[data-skin="arcade"] .verse-item.waiting-end { border-right: 0 !important; box-shadow: inset -3px 0 0 rgba(160, 235, 234, .6) !important; }
html[data-skin="arcade"] .verse-inline-story { color: var(--arc-lilac) !important; }
/* OSD โหมดอ่านเต็มจอเดิม (#osdModal) */
html[data-skin="arcade"] #osdModal { background: radial-gradient(120% 90% at 50% 30%, #34323f 0%, #26252d 65%, #1d1c22 100%); }
html[data-skin="arcade"] .osd-header { border-bottom-color: rgba(255, 255, 255, .08); }
html[data-skin="arcade"] .osd-title { color: var(--arc-lilac); text-shadow: 0 0 9px rgba(170, 150, 235, .5); }
html[data-skin="arcade"] .osd-story-divider { color: rgba(207, 166, 234, .4); }
html[data-skin="arcade"] .osd-story-subtitle { color: var(--arc-cyan); }
html[data-skin="arcade"] .osd-wait-tag { color: var(--arc-cyan); background: rgba(160, 235, 234, .1); border-color: rgba(160, 235, 234, .4); }
html[data-skin="arcade"] .osd-theme-btn, html[data-skin="arcade"] .osd-close-btn { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: var(--arc-lilac); }
html[data-skin="arcade"] .osd-verse-card { background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; box-shadow: none; }
html[data-skin="arcade"] .osd-verse-card.osd-active-card { border: 1px solid rgba(207, 166, 234, .55); box-shadow: 0 0 26px rgba(170, 150, 235, .22); }
html[data-skin="arcade"] .osd-verse-card.hold-syncing { border: 1px solid rgba(160, 235, 234, .6) !important; background: rgba(160, 235, 234, .1); box-shadow: 0 0 26px rgba(160, 235, 234, .25); }
html[data-skin="arcade"] .osd-verse-num { color: var(--arc-cyan); font-family: ui-monospace, 'Courier New', monospace; }
html[data-skin="arcade"] .osd-verse-card.osd-active-card .osd-verse-txt { color: #f6f2ff; text-shadow: 0 0 6px rgba(205, 190, 255, .55), 0 0 18px rgba(160, 235, 234, .28); }
html[data-skin="arcade"] .osd-footer-controls { border-top-color: rgba(255, 255, 255, .06); }
html[data-skin="arcade"] .osd-footer-controls button { background: rgba(207, 166, 234, .12); border: 1px solid rgba(207, 166, 234, .4); color: var(--arc-lilac); }
html[data-skin="arcade"] .osd-footer-controls button.osd-play-main { background: linear-gradient(180deg, var(--arc-cyan), var(--arc-lilac)); color: #2a2833; border: 0; box-shadow: var(--arc-glow); }
/* ชิปควบคุม (Auto Next / Loop / Auto Scroll / ล็อก ฯลฯ) — ปิด: เทาโปร่ง · เปิด: ลาเวนเดอร์+ฟ้า */
html[data-skin="arcade"] .auto-next-btn, html[data-skin="arcade"] .loop-btn, html[data-skin="arcade"] .auto-scroll-btn,
html[data-skin="arcade"] .lock-btn, html[data-skin="arcade"] .pause-btn, html[data-skin="arcade"] .osd-btn, html[data-skin="arcade"] .play-all {
    background: rgba(255, 255, 255, .05) !important; border-color: rgba(255, 255, 255, .1) !important; color: var(--text-color) !important; box-shadow: none !important;
}
html[data-skin="arcade"] .auto-next-btn.active, html[data-skin="arcade"] .loop-btn.active, html[data-skin="arcade"] .auto-scroll-btn.active,
html[data-skin="arcade"] .lock-btn.active, html[data-skin="arcade"] .pause-btn.active, html[data-skin="arcade"] #btnMemo.active, html[data-skin="arcade"] #btnMemo[aria-pressed="true"] {
    background: linear-gradient(180deg, rgba(160, 235, 234, .16), rgba(208, 158, 222, .2)) !important; border-color: rgba(208, 158, 222, .55) !important;
    color: #fff !important; box-shadow: var(--arc-glow) !important;
}

/* v3.27.0 — ชิปเสียงฝน (ใช้สไตล์เดียวกับชิป Loop/ท่องจำ) */
.rain-btn { flex: 0 0 auto; white-space: nowrap; }
.rain-btn.active { background: rgba(100, 181, 246, .22) !important; border-color: rgba(100, 181, 246, .6) !important; color: #BFE3FF !important; }
html[data-skin="arcade"] .rain-btn { background: rgba(255, 255, 255, .05) !important; border-color: rgba(255, 255, 255, .1) !important; color: var(--text-color) !important; box-shadow: none !important; }
html[data-skin="arcade"] .rain-btn.active { background: linear-gradient(180deg, rgba(160, 235, 234, .16), rgba(208, 158, 222, .2)) !important; border-color: rgba(208, 158, 222, .55) !important; color: #fff !important; box-shadow: var(--arc-glow) !important; }

/* v3.28.0 — แผนการอ่าน */
.rp-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-top: 10px; }
.rp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rp-name { font-weight: 600; }
.rp-day { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.rp-bar { height: 8px; border-radius: 6px; background: var(--chip-bg); margin: 10px 0 6px; overflow: hidden; }
.rp-bar i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--gold), var(--accent)); }
.rp-sub { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.rp-sub b.ok { color: #4ade80; } .rp-sub b.late { color: #fbbf24; }
.rp-lab { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.rp-chip { border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.rp-chip.done { opacity: .6; border-color: rgba(74, 222, 128, .5); }
.rp-manage { margin-top: 8px; background: none; border: 0; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; padding: 4px 0; }
.rp-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.rp-btn { flex: 1 1 auto; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.rp-btn.warn { color: #f87171; }
.rp-h { font-size: .95rem; margin: 18px 0 8px; color: var(--gold); }
.rp-list { display: flex; flex-direction: column; gap: 8px; }
.rp-opt { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); border-radius: 12px; padding: 12px 14px; font: inherit; cursor: pointer; }
.rp-oi { font-size: 1.4rem; }
.rp-ot { display: flex; flex-direction: column; } .rp-ot small { color: var(--muted); font-size: .78rem; }
.rp-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-custom label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); }
.rp-custom label:last-child { grid-column: 1 / -1; }
.rp-custom select, .rp-custom input { background: var(--chip-bg); color: var(--text-color); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }

/* v3.29.0 — รูปแบบคำตอบ AI: ข้อมูล | สนทนา */
.ai-modebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 8px; }
.ai-modelab { font-size: .8rem; color: var(--muted); }
.ai-modeseg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ai-mode { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--chip-bg); color: var(--muted); padding: 7px 14px; font: inherit; font-size: .85rem; cursor: pointer; }
.ai-mode[aria-pressed="true"] { background: var(--gold); color: #1a1a1a; font-weight: 600; }

/* v3.30.0 — ถามอิสระ */
.ai-scopebar { margin: 0 0 8px; }
.ai-hero-free .ai-hero-txt { font-size: .85rem; color: var(--muted); }
.ai-nolib { color: var(--warn, #e0a030); }
.ai-act[hidden], .ai-share[hidden], .ai-note[hidden] { display: none !important; }

/* v3.31.0 — สำรองข้อมูลแบบเข้ารหัส */
.bk-pwbox { display: grid; gap: 8px; margin: 6px 0 10px; }
.bk-pwbox[hidden] { display: none; }
.bk-pw { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--chip-bg); color: inherit; font: inherit; }
.bk-warn { color: var(--warn, #e0a030); }
.bk-imp .bk-pw { margin: 8px 0; }

/* v3.32.0 — ส่งแอปให้ครอบครัว */
.bk-code { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; resize: vertical; word-break: break-all; }
.bk-fam { display: grid; gap: 8px; }
.bk-fam .bk-btn + .bk-btn { margin-top: 6px; }

/* v3.32.1 — ลบโน้ตแบบแตะสองครั้ง */
.si-del { color: #EF4444; }
.si-del.armed { width: auto; min-width: 64px; padding: 0 10px; background: #EF4444; color: #fff; font: inherit; font-size: .85rem; font-weight: 700; }
.npv-del.armed { background: #EF4444; color: #fff; border-color: #EF4444; }

/* v3.33.0 — ชุดส่งครอบครัวแบบปุ่มเดียว */
.bk-passbig { font: 700 2rem ui-monospace, Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 16px 8px; margin: 8px 0; background: var(--chip-bg); border: 2px solid var(--gold); border-radius: 14px; user-select: all; -webkit-user-select: all; }
.bk-pass { font-size: 1.15rem; letter-spacing: .06em; }
.bk-kit-res { display: grid; gap: 8px; margin-top: 10px; }
.bk-okline { font-weight: 700; color: #6fd08c; }

.bk-peek.ok { color: #6fd08c; } .bk-peek.bad { color: #ffb454; }

.ai-savedbtn { margin: 6px 0 2px; } .ai-savedbtn.on, .ai-keep.done { color: #ffd54a; border-color: rgba(255,213,74,.5); }
.ai-postbtn { margin: 6px 0 2px; } .ai-postbtn.on { color: #7fe3a0; border-color: rgba(127,227,160,.5); }
.ai-savedonly .ai-postbtn { display: none !important; }
.ai-saved-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 10px; }

.fam-pill { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9000; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px); padding: 8px 8px 8px 14px; border-radius: 999px; background: rgba(30, 26, 48, .96); border: 1px solid rgba(255, 213, 74, .55); box-shadow: 0 6px 22px rgba(0, 0, 0, .45); color: #fff; font-size: .92rem; }
.fam-dot { width: 10px; height: 10px; border-radius: 50%; background: #ffd54a; box-shadow: 0 0 0 0 rgba(255, 213, 74, .7); animation: famPulse 1.4s ease-out infinite; flex: none; }
@keyframes famPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 213, 74, .7); } 70% { box-shadow: 0 0 0 10px rgba(255, 213, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 213, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .fam-dot { animation: none; } }
.fam-pill-go { border: 0; border-radius: 999px; padding: 7px 16px; background: #ffd54a; color: #1a1530; font-weight: 700; font-family: inherit; }
.fam-pill-go:disabled { opacity: .6; } .fam-pill-x { border: 0; background: transparent; color: #cfc9e8; padding: 6px 8px; font-size: 1rem; }

/* =====================================================================
   v3.35.0 — จอ CRT "เปิดทำงานอยู่": แสงฟอสเฟอร์ส่องสว่างกลางจอ · แถบสแกนไหลช้า ๆ · กะพริบเบา ๆ ·
   เส้นสแกน+ช่องสีชัดขึ้น · ตัวอักษรมีแสงฟุ้งและขอบสีเหลื่อมจาง ๆ · เปิดจอทุกครั้งที่เปิดแอป
   (ใช้เฉพาะ transform/opacity เพื่อไม่ให้เครื่องหนัก · ปิดการเคลื่อนไหวเมื่อเครื่องตั้งลดการเคลื่อนไหว)
   ===================================================================== */
html[data-skin="arcade"] body {
    background:
        radial-gradient(90% 62% at 50% 30%, rgba(170, 160, 255, .20) 0%, rgba(120, 220, 230, .07) 45%, transparent 72%),
        radial-gradient(135% 85% at 50% 28%, #47445a 0%, #34323f 52%, #25232d 100%) !important;
    background-attachment: fixed !important;
}
html[data-skin="arcade"] { --surface: #34323f; --surface-2: #403d51; }
/* ขอบจอโค้ง: ขอบมืดเบาลง + แสงเรืองด้านในสีฟ้าอ่อน (จอกำลังส่องสว่าง) */
html[data-skin="arcade"] body::before {
    border-radius: 34px;
    box-shadow: inset 0 0 0 5px #0f0e11, inset 0 0 90px rgba(0, 0, 0, .42), inset 0 0 38px rgba(140, 215, 235, .13), inset 0 0 3px 6px rgba(190, 175, 255, .12);
}
/* เส้นสแกนชัดขึ้น + ช่องสี RGB บาง ๆ */
html[data-skin="arcade"] body::after {
    opacity: .62;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, .30) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(255, 60, 90, .05) 0 1px, rgba(60, 255, 150, .04) 1px 2px, rgba(70, 120, 255, .05) 2px 3px),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .55 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
    animation: crtFlicker 5.5s steps(1, end) infinite;
}
/* แถบสแกนสว่างไหลลงช้า ๆ (เหมือนจอที่กำลังรีเฟรช) */
html[data-skin="arcade"]::before {
    content: ''; position: fixed; left: 0; right: 0; top: 0; height: 26vh; z-index: 10088; pointer-events: none; will-change: transform;
    background: linear-gradient(180deg, transparent 0%, rgba(170, 225, 240, .055) 38%, rgba(200, 190, 255, .09) 52%, rgba(170, 225, 240, .04) 70%, transparent 100%);
    transform: translateY(-30vh); animation: crtRoll 9s linear infinite;
}
@keyframes crtRoll { 0% { transform: translateY(-30vh); } 100% { transform: translateY(125vh); } }
@keyframes crtFlicker { 0%, 100% { opacity: .62; } 42% { opacity: .62; } 43% { opacity: .55; } 44% { opacity: .64; } 71% { opacity: .62; } 72% { opacity: .58; } 73% { opacity: .62; } }
/* แสงฟุ้งของตัวอักษร (ฟอสเฟอร์) + ขอบสีเหลื่อมจาง ๆ */
html[data-skin="arcade"] .verse-text, html[data-skin="arcade"] .osd-verse-txt, html[data-skin="arcade"] .pm-osd-verse {
    text-shadow: 0 0 4px rgba(195, 190, 255, .30), -.5px 0 rgba(255, 90, 130, .16), .5px 0 rgba(90, 225, 255, .16);
}
html[data-skin="arcade"] .verse-item.active .verse-text {
    color: #fbf8ff;
    text-shadow: 0 0 6px rgba(215, 200, 255, .75), 0 0 18px rgba(160, 235, 234, .42), -.6px 0 rgba(255, 90, 130, .2), .6px 0 rgba(90, 225, 255, .2);
}
html[data-skin="arcade"] .tb-btn, html[data-skin="arcade"] .tb-title { text-shadow: 0 0 6px rgba(185, 175, 255, .3); }
html[data-skin="arcade"] .verse-item { background: rgba(255, 255, 255, .05) !important; }
html[data-skin="arcade"] .verse-item.active { box-shadow: 0 0 0 1px rgba(207, 166, 234, .6), 0 0 22px rgba(160, 235, 234, .22), inset 0 0 26px rgba(207, 166, 234, .08) !important; }
/* ไฟแสดงสถานะจอ: จุดเขียวอมฟ้าเรืองเบา ๆ ที่มุมขอบจอ */
html[data-skin="arcade"] body > #crtLed {
    position: fixed; right: 16px; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; z-index: 10095; pointer-events: none;
    background: #8ff7d4; box-shadow: 0 0 6px 2px rgba(120, 255, 210, .7); animation: crtLed 3.2s ease-in-out infinite;
}
@keyframes crtLed { 0%, 100% { opacity: .95; } 50% { opacity: .45; } }
#crtLed { display: none; } html[data-skin="arcade"] #crtLed { display: block; }
@media (prefers-reduced-motion: reduce) {
    html[data-skin="arcade"]::before { animation: none; opacity: .0; }
    html[data-skin="arcade"] body::after { animation: none; }
    html[data-skin="arcade"] body > #crtLed { animation: none; }
}

/* =====================================================================
   v3.36.0 — จอ CRT ระบบ RGB: ช่องสีแดง/เขียว/น้ำเงินเห็นชัดขึ้น · ขอบสีเหลื่อม (convergence) · แสงสีที่ขอบจอ ·
   เส้นเปิดจอแยกสี · ปรับความจัดได้ 3 ระดับ (เบา/ปกติ/จัด) ที่ ตั้งค่า → การแสดงผล
   ===================================================================== */
html[data-skin="arcade"] { --cr: .45; --cm: .15; --ce: 1.3; --cg: 1.1; }
html[data-skin="arcade"][data-crt="soft"] { --cr: .22; --cm: .07; --ce: .6; --cg: .75; }
html[data-skin="arcade"][data-crt="vivid"] { --cr: .72; --cm: .26; --ce: 2.1; --cg: 1.5; }
/* ช่องสี RGB (aperture grille) + เส้นสแกน + เกรน */
html[data-skin="arcade"] body::after {
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, .30) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(255, 40, 70, var(--cm)) 0 1px, rgba(40, 255, 120, calc(var(--cm) * .8)) 1px 2px, rgba(60, 110, 255, var(--cm)) 2px 3px),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .55 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
/* แสงสีที่ขอบจอ: ซ้ายแดงอมชมพู · ขวาน้ำเงินฟ้า · ล่างเขียวอมฟ้า (สีไม่ลงตัวที่ขอบ เหมือนจอ CRT จริง) */
html[data-skin="arcade"] body::before {
    box-shadow:
        inset 0 0 0 5px #0f0e11, inset 0 0 90px rgba(0, 0, 0, .42), inset 0 0 38px rgba(140, 215, 235, .13),
        inset 34px 0 46px -22px rgba(255, 70, 110, calc(.13 * var(--ce))),
        inset -34px 0 46px -22px rgba(60, 160, 255, calc(.15 * var(--ce))),
        inset 0 -36px 56px -34px rgba(70, 255, 170, calc(.08 * var(--ce)));
}
/* ตัวอักษร: ขอบแดง/น้ำเงินเหลื่อม + แสงฟุ้งเขียวอมฟ้าตรงกลาง */
html[data-skin="arcade"] .verse-text, html[data-skin="arcade"] .osd-verse-txt, html[data-skin="arcade"] .pm-osd-verse {
    text-shadow: -.8px 0 rgba(255, 50, 90, var(--cr)), .8px 0 rgba(40, 160, 255, var(--cr)), 0 0 5px rgba(170, 215, 255, calc(.28 * var(--cg)));
}
html[data-skin="arcade"] .verse-item.active .verse-text {
    text-shadow: -.9px 0 rgba(255, 50, 90, calc(var(--cr) * 1.15)), .9px 0 rgba(40, 170, 255, calc(var(--cr) * 1.15)), 0 0 7px rgba(215, 205, 255, calc(.7 * var(--cg))), 0 0 20px rgba(120, 255, 220, calc(.38 * var(--cg)));
}
html[data-skin="arcade"] .sheet-title, html[data-skin="arcade"] .ol-rh b, html[data-skin="arcade"] .tb-book, html[data-skin="arcade"] .set-sec h3 {
    filter: drop-shadow(-1px 0 rgba(255, 60, 100, var(--cr))) drop-shadow(1px 0 rgba(60, 170, 255, var(--cr))) drop-shadow(0 0 7px rgba(170, 150, 235, .5));
}
html[data-skin="arcade"] .verse-item.active {
    box-shadow: 0 0 0 1px rgba(207, 166, 234, .55), -3px 0 14px rgba(255, 60, 110, calc(.22 * var(--cg))), 3px 0 14px rgba(60, 160, 255, calc(.26 * var(--cg))), 0 0 22px rgba(120, 255, 220, calc(.16 * var(--cg))), inset 0 0 26px rgba(207, 166, 234, .08) !important;
}
html[data-skin="arcade"] body #player-bar #playPauseBtn { box-shadow: -3px 0 12px rgba(255, 60, 110, .35), 3px 0 12px rgba(60, 160, 255, .4), 0 0 18px rgba(170, 150, 235, .5) !important; }
/* แถบสแกน: โทนชมพู→ฟ้าอมเขียว */
html[data-skin="arcade"]::before {
    background: linear-gradient(180deg, transparent 0%, rgba(255, 110, 190, .05) 30%, rgba(190, 180, 255, .09) 50%, rgba(110, 255, 220, .06) 70%, transparent 100%);
}
/* เส้นเปิดจอ: แยกสี แดง/ขาว/น้ำเงิน */
#arcPower i { background: #f4f0ff; box-shadow: 0 -3px 0 0 rgba(255, 50, 80, .85), 0 3px 0 0 rgba(50, 140, 255, .85), 0 0 16px 3px rgba(190, 170, 255, .85), 0 0 40px 8px rgba(110, 255, 220, .35); }
/* ไฟสถานะ: วนสีแดง→เขียว→น้ำเงิน ช้า ๆ */
html[data-skin="arcade"] body > #crtLed { animation: crtLed 3.2s ease-in-out infinite, crtLedHue 9s linear infinite; }
@keyframes crtLedHue { 0% { background: #ff6b8b; box-shadow: 0 0 6px 2px rgba(255, 90, 130, .7); } 33% { background: #8ff7d4; box-shadow: 0 0 6px 2px rgba(120, 255, 210, .7); } 66% { background: #7db4ff; box-shadow: 0 0 6px 2px rgba(110, 170, 255, .7); } 100% { background: #ff6b8b; box-shadow: 0 0 6px 2px rgba(255, 90, 130, .7); } }
@media (prefers-reduced-motion: reduce) { html[data-skin="arcade"] body > #crtLed { animation: none; } }
/* ตัวเลือกความจัดในตั้งค่า */
.crt-lv { margin-top: 10px; }
.crt-lv-lab { font-size: .82rem; color: var(--muted); margin-bottom: 6px; display: block; }

/* v3.36.1 — เบาคลื่นลง ไม่กวนสายตา: ทุกระดับอ่อนลง · แถบสแกนจางและช้าลง · กะพริบน้อยลง · เส้นสแกนเบาลง */
html[data-skin="arcade"] { --cr: .28; --cm: .08; --ce: .8; --cg: .9; }
html[data-skin="arcade"][data-crt="soft"] { --cr: .14; --cm: .04; --ce: .4; --cg: .6; }
html[data-skin="arcade"][data-crt="vivid"] { --cr: .45; --cm: .15; --ce: 1.3; --cg: 1.1; }
html[data-skin="arcade"] body::after {
    opacity: .5; animation: crtFlicker2 9s steps(1, end) infinite;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, .20) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(255, 40, 70, var(--cm)) 0 1px, rgba(40, 255, 120, calc(var(--cm) * .8)) 1px 2px, rgba(60, 110, 255, var(--cm)) 2px 3px),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .4 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
@keyframes crtFlicker2 { 0%, 100% { opacity: .5; } 61% { opacity: .5; } 62% { opacity: .46; } 63% { opacity: .5; } }
html[data-skin="arcade"]::before {
    height: 20vh; animation-duration: 14s;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 110, 190, .025) 32%, rgba(190, 180, 255, .045) 50%, rgba(110, 255, 220, .03) 68%, transparent 100%);
}
html[data-skin="arcade"] .verse-item.active .verse-text {
    text-shadow: -.8px 0 rgba(255, 50, 90, calc(var(--cr) * 1.1)), .8px 0 rgba(40, 170, 255, calc(var(--cr) * 1.1)), 0 0 6px rgba(215, 205, 255, calc(.55 * var(--cg))), 0 0 16px rgba(120, 255, 220, calc(.28 * var(--cg)));
}
html[data-skin="arcade"] .verse-text, html[data-skin="arcade"] .osd-verse-txt, html[data-skin="arcade"] .pm-osd-verse {
    text-shadow: -.7px 0 rgba(255, 50, 90, var(--cr)), .7px 0 rgba(40, 160, 255, var(--cr)), 0 0 4px rgba(170, 215, 255, calc(.2 * var(--cg)));
}
@media (prefers-reduced-motion: reduce) { html[data-skin="arcade"] body::after { animation: none; } }

/* =====================================================================
   v3.38.0 — ธีม "ตะเกียง" (แทนกลางคืนเดิม): หินน้ำตาลอุ่น · ตัวอักษรครีม · ทองเปลวตะเกียง
   ใช้กับโหมดมืดที่ไม่ใช่อาร์เคด (ไม่มี data-theme และไม่มี data-skin) — ค่า bibleTheme='dark' เดิมจึงใช้ต่อได้ทันที
   ===================================================================== */
html:not([data-theme="light"]):not([data-skin="arcade"]) {
    --gold: #e8b23a; --gold-ink: #efc25a; --accent: #ffb25c;
    --surface: #2a1b10; --surface-2: #38251a;
    --chip-bg: rgba(255, 226, 170, .07); --line: rgba(255, 214, 150, .13); --muted: #bfa98a;
    --topbar-bg: rgba(22, 14, 8, .86); --bar-bg: rgba(22, 14, 8, .95);
    --bg-color: #1a110a; --text-color: #f6ecd3; --card-bg: rgba(48, 32, 20, .78); --card-border: rgba(232, 178, 58, .32); --header-bg: #120b06;
    --lamp: #ff9a3c;
}
html:not([data-theme="light"]):not([data-skin="arcade"]) body {
    background:
        radial-gradient(90% 55% at 100% 0%, rgba(255, 154, 60, .20) 0%, rgba(255, 154, 60, 0) 60%),
        radial-gradient(120% 70% at 50% 110%, rgba(120, 70, 30, .22) 0%, rgba(0, 0, 0, 0) 60%),
        #1a110a !important;
    background-attachment: fixed !important;
}
html:not([data-theme="light"]):not([data-skin="arcade"]) .verse-item { background: rgba(255, 226, 170, .04); }
html:not([data-theme="light"]):not([data-skin="arcade"]) .verse-item.active {
    background: linear-gradient(90deg, rgba(255, 154, 60, .18), rgba(232, 178, 58, .08));
    border-left-color: var(--lamp);
    box-shadow: 0 0 22px rgba(255, 154, 60, .16), inset 0 0 30px rgba(255, 154, 60, .06);
    animation: lampFlame 3.4s ease-in-out infinite;
}
@keyframes lampFlame { 0%, 100% { box-shadow: 0 0 20px rgba(255, 154, 60, .14), inset 0 0 28px rgba(255, 154, 60, .05); } 45% { box-shadow: 0 0 28px rgba(255, 154, 60, .24), inset 0 0 34px rgba(255, 154, 60, .09); } 70% { box-shadow: 0 0 22px rgba(255, 154, 60, .17), inset 0 0 30px rgba(255, 154, 60, .06); } }
@media (prefers-reduced-motion: reduce) { html:not([data-theme="light"]):not([data-skin="arcade"]) .verse-item.active { animation: none; } }
html:not([data-theme="light"]):not([data-skin="arcade"]) #bootSplash { background: radial-gradient(120% 80% at 80% 15%, #3b2412 0%, #150d07 64%); color: #f6ecd3; }
html:not([data-theme="light"]):not([data-skin="arcade"]) .toast { background: #2a1b10; color: #f6ecd3; border-color: rgba(232, 178, 58, .5); }
html:not([data-theme="light"]):not([data-skin="arcade"]) #player-bar #playPauseBtn { box-shadow: 0 0 16px rgba(255, 154, 60, .35); }

/* v3.38.1 — แถวปุ่มในรายละเอียดคำศัพท์: ถาม AI · แชร์ · เก็บ */
.vc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vc-acts .off-btn { margin-top: 0; }
.vc-keep.done { background: var(--gold); border-color: var(--gold); color: #0A0F1D; }

/* v3.38.2 — ปุ่มฟังคำขณะกำลังอ่าน */
.vc-speak.on { background: var(--gold); border-color: var(--gold); color: #0A0F1D; }

/* v3.38.3 — หน้า "⭐ ที่เก็บไว้" เปิดจากแถบบน: ซ่อนส่วนถามอิสระที่ไม่เกี่ยว */
.ai-savedonly .ai-scopebar, .ai-savedonly .ai-hero, .ai-savedonly .ai-err, .ai-savedonly .ai-composer, .ai-savedonly .ai-savedbtn, .ai-savedonly .ai-modebar, .ai-savedonly .ai-lensbar, .ai-savedonly .ai-vocab, .ai-savedonly .ai-sugg { display: none !important; }
#tbSaved.on { color: var(--gold); }

/* v3.39.0 — ตัวเลือกการเล่น: ซ่อนชิปเหนือเนื้อหา (ยกเว้นฝน) + ปุ่มที่ตัวเล่น + แผ่นตัวเลือก */
html[data-chips="min"] #modeChips > button:not(#btnRain):not(#btnAskFree):not(#btnPostCheck):not(#btnPar):not(#btnSub) { display: none; }
html[data-chips="min"] body.has-chapter #modeChips:not(:has(#btnRain)) { display: none; }
.pb-opts { position: relative; flex: 0 0 auto; width: 44px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text-color); font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pb-opts .po-dot { position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.pb-opts .po-dot[hidden] { display: none; }
.po-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; margin-bottom: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font: inherit; text-align: left; cursor: pointer; }
.po-row > i.fa-solid, .po-row > .fa-solid { width: 26px; text-align: center; font-size: 1.2rem; color: var(--muted); }
.po-row.on { border-color: var(--gold); background: linear-gradient(90deg, rgba(232, 178, 58, .16), var(--surface-2)); }
.po-row.on > .fa-solid { color: var(--gold-ink); }
.po-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.po-tx b { font-size: 1.02rem; font-weight: 600; } .po-tx i { font-style: normal; font-size: .82rem; color: var(--muted); }
.po-st { font-size: .9rem; font-weight: 600; color: var(--muted); white-space: nowrap; } .po-row.on .po-st { color: var(--gold-ink); }

/* v3.40.0 ตรวจอ้างอิงคำตอบ AI */
.ai-chk.good { color: var(--muted); }
.ai-chk.good svg, .ai-chk.good i { color: #4ade80; }
.ai-chk.warn { color: var(--warn, #e0a030); }

/* v3.41.0 อีกฉบับใต้ข้อ (คู่ขนาน) */
.verse-par { display: none; margin: 2px 42px 8px 48px; padding: 6px 12px; border-left: 2px solid var(--gold, #d4af37); font-size: .82em; line-height: 1.5; opacity: .88; cursor: default; }
.verse-item.active > .verse-par, body.par-all .verse-par { display: block; }
.verse-par .vp-tag { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 6px; font-size: .78em; font-weight: 700; letter-spacing: .04em; color: var(--gold, #d4af37); border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 50%, transparent); vertical-align: 1px; }
body.par-th .v-trans, body.par-th .v-trans-out { display: none !important; }   /* v3.41.1 มีฉบับไทยใต้ข้ออยู่แล้ว ไม่ต้องแปลด้วย AI */
/* v3.41.2 แชร์: สลับคู่ขนาน */
.sh-par { margin: 8px 0; }
.sh-par .sh-parlab { font-size: .85em; opacity: .8; margin-bottom: 6px; }
/* v3.41.3 แปลฉบับที่สอง (AMP) เป็นไทย */
.verse-par .vp-tr { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; font: inherit; font-size: .9em; color: var(--gold, #d4af37); background: transparent; border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 45%, transparent); border-radius: 999px; cursor: pointer; }
.verse-par.has-th .vp-tr { display: none; }
.verse-par .vp-th { margin-top: 8px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--gold, #d4af37) 35%, transparent); }
body.par-repl .verse-par.has-th .vp-text { display: none; }
/* v3.41.4 อีกฉบับแบบเคียงข้าง (จอกว้าง ≥ 700px) */
@media (min-width: 700px) {
  body.par-side .verse-item:has(> .verse-par) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  body.par-side .verse-item:has(> .verse-par) > * { grid-column: 1 / -1; }
  body.par-side .verse-item:has(> .verse-par) > .verse-row-body { grid-column: 1; grid-row: 1; }
  body.par-side .verse-item:has(> .verse-par) > .verse-par { grid-column: 2; grid-row: 1; display: block; margin: 0 42px 0 0; padding: 6px 0 6px 14px; font-size: .95em; opacity: .95; }
}
/* v3.41.5 แถบเล่นแบบแถวเดียวบนจอกว้าง (iPad แนวนอน/เดสก์ท็อป) — เหลือพื้นที่อ่านมากขึ้น */
@media (min-width: 900px) {
  body #player-bar { grid-template-columns: minmax(90px, 130px) auto minmax(0, 1fr) auto; grid-template-areas: "info ctrl prog vol"; gap: 6px 14px; padding-top: 6px; padding-bottom: calc(6px + var(--safe-b)); padding-left: max(28px, calc((100vw - 1100px) / 2 + 14px)); padding-right: max(28px, calc((100vw - 1100px) / 2 + 14px)); }
  body #player-bar .progress-wrap { min-width: 0; }
  body #player-bar .progress-wrap input[type="range"] { min-width: 60px; }
  body #player-bar .play-pause-btn { width: 44px; height: 44px; font-size: 1.1rem; }
  body #player-bar button.pb-stop { width: 34px; height: 34px; }
  body #player-bar .info .ref { font-size: .95rem; }
}
/* v3.42.0 สลับหลัก/รอง + เปลี่ยนฉบับรองจากป้าย */
.verse-par button.vp-tag { font: inherit; font-size: .78em; font-weight: 700; background: transparent; cursor: pointer; line-height: 1.5; }
.verse-par button.vp-tag::after { content: ' ▾'; opacity: .7; }
.tb-swap { flex-shrink: 0; }
.tb-swap[hidden] { display: none !important; }
@media (max-width: 600px) { #appTopbar .tb-swap { display: none !important; } }   /* จอแคบ: ใช้ทางลัดในรายชื่อฉบับรองแทน เพื่อไม่บีบชื่อหนังสือ */
.par-btn.active { background: rgba(212, 175, 55, .2) !important; border-color: rgba(212, 175, 55, .6) !important; color: var(--gold-ink, #e8c766) !important; }

/* v3.43.6 — ข้อสังเกต/ประเด็น ในคำตอบตรวจโพสต์: กรอบเด่น แยกจากเนื้อหา */
.ai-ac .ai-callout { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; padding: 10px 14px; border-radius: 12px; background: rgba(100, 181, 246, .12); border: 1px solid rgba(100, 181, 246, .38); border-left: 4px solid #64B5F6; }
.ai-ac .ai-callout > i, .ai-ac .ai-callout > svg { flex: none; margin-top: 4px; color: #64B5F6; }
.ai-ac .ai-callout-t { min-width: 0; overflow-wrap: anywhere; }

/* v3.43.7 — กรอบสรุปใจความ (โหมดตรวจโพสต์) + เนื้อหาใต้หัวข้อข้อสังเกต */
.ai-ac .ai-sum-post { flex-direction: column; gap: 6px; margin: 0 0 16px; background: rgba(212, 175, 55, .16); border-color: rgba(212, 175, 55, .5); border-left: 4px solid var(--gold, #d4af37); }
.ai-ac .ai-sum-post .ai-sum-lab { align-self: flex-start; margin-top: 0; }
.ai-ac .ai-callout-t .ai-box-b { margin-top: 4px; }

/* v3.43.8 — กรอบสรุปรวม (ปิดคำตอบตรวจโพสต์) พื้นเขียว ต่างจากสรุปใจความที่เป็นพื้นทอง */
.ai-ac .ai-sum-final { margin: 18px 0 14px; background: rgba(127, 227, 160, .13); border-color: rgba(127, 227, 160, .45); border-left: 4px solid #7FE3A0; }
.ai-ac .ai-sum-final .ai-sum-lab { background: #7FE3A0; color: #0A0F1D; }

/* v3.43.9 — คำถามยาวพับได้ */
.ai-qb-fold { white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-qb-fold .ai-qb-more { display: block; margin: 6px 0 0 auto; padding: 2px 10px; border-radius: 10px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: .82em; opacity: .85; cursor: pointer; }

/* v3.44.0 — แนบรูปในโหมดตรวจโพสต์ */
.ai-imgrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 2px; }
.ai-imgrow[hidden] { display: none !important; }
.ai-imgbtn { margin: 0; } .ai-imgbtn:disabled { opacity: .45; }
.ai-imgths { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.ai-imgth { position: relative; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(212, 175, 55, .45); }
.ai-imgth img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-imgx { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: .7em; line-height: 22px; cursor: pointer; }
.ai-qimgs { display: flex; flex-direction: column; gap: 8px; margin: 0 0 8px; }
.ai-qimgs img { width: 100%; max-width: 480px; border-radius: 10px; display: block; background: #fff; }

/* v3.44.1 ดูรูปเต็มจอ */
.ai-zoomable { cursor: zoom-in; }
.ai-imgview { position: fixed; inset: 0; z-index: 10010; background: rgba(0, 0, 0, .94); display: flex; }
.aiv-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.aiv-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; -webkit-user-drag: none; background: #fff; }
.aiv-x { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.2em; }
.aiv-hint { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); text-align: center; color: #fff; font-size: .9em; opacity: .9; transition: opacity .6s; pointer-events: none; text-shadow: 0 1px 3px #000; }

/* v3.44.2 ถอดข้อความจากรูป */
.ai-ocrrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.ai-ocrlang { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(212, 175, 55, .45); background: transparent; color: inherit; }
.ai-ocrnote { width: 100%; font-size: .85em; opacity: .85; }
.ai-ocrst { width: 100%; font-size: .85em; opacity: .9; min-height: 0; }
.ai-ocrst:empty { display: none; }
.ai-ocrrow [hidden], .ai-ocrnote[hidden], .ai-ocrrow button[hidden] { display: none !important; }

/* v3.44.7 แก้รูปของคำตอบที่เก็บไว้ */
.ai-sv-imged { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin: 0 0 10px; border: 1px dashed rgba(212, 175, 55, .55); border-radius: 12px; }
.ai-sv-img.on { background: rgba(212, 175, 55, .22); }
.ai-img-edited { display: flex; align-items: center; gap: 8px; font-size: .85em; opacity: .85; margin: 0 0 8px; }

/* v3.45.0 ⭐ ชั้นหนังสือ */
.ai-sv-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ai-sv-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .18); color: inherit; font: inherit; font-size: .9em; opacity: .8; }
.ai-sv-tab[aria-selected="true"] { background: var(--accent, #D4AF37); color: #0A0F1D; border-color: transparent; font-weight: 600; opacity: 1; }
.ai-sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 22px 16px; padding: 2px 2px 12px; }
.ai-sv-book { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ai-sv-cover { position: relative; aspect-ratio: 3 / 4; border-radius: 4px 10px 10px 4px; overflow: hidden; background: #151B2E; box-shadow: 0 10px 22px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .3); transition: transform .2s ease; }
.ai-sv-book:active .ai-sv-cover { transform: scale(.97); }
.ai-sv-cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 8%; background: linear-gradient(90deg, rgba(0, 0, 0, .4), rgba(255, 255, 255, .12) 55%, rgba(0, 0, 0, 0)); pointer-events: none; }
.ai-sv-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; background: #fff; }
.ai-sv-fb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 14px 10px 14px 16px; text-align: center; background: linear-gradient(150deg, hsl(var(--h, 40) 38% 26%), hsl(var(--h, 40) 45% 10%)); color: #F1DC93; font-weight: 600; font-size: .92em; line-height: 1.4; }
.ai-sv-fb span { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.ai-sv-badge, .ai-sv-sh { position: absolute; top: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(10, 15, 29, .8); color: #F1DC93; display: flex; align-items: center; justify-content: center; font-size: .75em; z-index: 1; }
.ai-sv-badge { left: 8px; } .ai-sv-sh { right: 6px; color: #9be7c4; }
.ai-sv-n { position: absolute; right: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(10, 15, 29, .82); color: #fff; font-size: .72em; z-index: 1; }
.ai-sv-title { font-size: .9em; line-height: 1.35; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-sv-date { font-size: .75em; opacity: .65; margin-top: -4px; }
.ai-sv-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.ai-sv-back { font-size: 1em; padding: 10px 16px; }
.ai-sv-kind { font-size: .85em; opacity: .7; }
html[data-theme="light"] .ai-sv-tab { background: #fff; border-color: #ddd; }
.ai-sv-fb { padding-top: 42px; }
.ai-saved-item .ai-qimgs { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.ai-saved-item .ai-qimgs img { width: auto; height: 200px; max-width: none; flex: 0 0 auto; object-fit: contain; }

/* v3.46.0: แชร์โน้ตเป็นรูป */
.ni-pages{display:flex;flex-direction:column;gap:12px;margin:0 0 12px}
.ni-canvas{margin:0}
.ai-sv-share{border-color:rgba(212,175,55,.55)}

/* v3.47.0: แชร์เป็นบทความ + ลิงก์ต้นทาง */
.ni-lbl{margin:2px 0 4px;font-weight:600;color:var(--gold,#e5b63c);font-size:.9em}
.ni-link{width:100%;padding:12px 14px;border-radius:12px;border:1px solid rgba(212,175,55,.45);background:rgba(0,0,0,.25);color:inherit;font:inherit;font-size:1em}
.ni-hint{margin:6px 0 12px;opacity:.7;font-size:.85em;line-height:1.5}
.off-btn.primary{background:rgba(212,175,55,.22);border-color:var(--gold,#e5b63c);font-weight:700}

/* v3.47.2: ป้าย "ข้ออ้างที่ N" แยกจากเนื้อหา */
.ai-ac .ai-list li.ai-claim { margin: 0 0 12px; padding-left: 0; }
.ai-ac .ai-list li.ai-claim::before { display: none; }
.ai-claim-no { display: inline-block; margin: 0 0 3px; padding: 1px 12px; border-radius: 999px; background: color-mix(in srgb, var(--gold, #d4af37) 20%, transparent); border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 60%, transparent); color: var(--gold-ink, #d4af37); font-weight: 700; font-size: .78em; line-height: 1.6; letter-spacing: .01em; }
.ai-claim-b { padding-left: 2px; }
/* v3.47.5: ปุ่มฟังคำตอบ */
.ai-act.ai-listen.on { background: color-mix(in srgb, var(--gold, #d4af37) 28%, transparent); border-color: var(--gold, #d4af37); }

/* v3.49.0 แท็บหน้าตั้งค่า */
.set-tabs { position: sticky; top: 0; z-index: 3; display: flex; gap: 5px; overflow-x: auto; padding: 4px 0 10px; margin: 0 0 6px; background: var(--surface); scrollbar-width: none; }
.set-tabs::-webkit-scrollbar { display: none; }
.set-tab { flex: 1 0 auto; min-height: 44px; padding: 0 9px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font-size: calc(.95rem * var(--pk-fs, 1)); font-weight: 600; white-space: nowrap; cursor: pointer; }
.set-tab.on { background: #D4AF37; color: #1a1408; border-color: #D4AF37; }
.set-tab[hidden] { display: none; }
#sheetSettings .set-sec.st-off { display: none !important; }

/* v3.50.0 เสียงอ่านคำตอบหลายผู้ให้บริการ */
.tts-blk[hidden] { display: none; }

/* v3.52.0 ถาม AI เป็นช่วงข้อ */
.ai-rangebar { flex-wrap: wrap; margin: 0 0 8px; row-gap: 6px; }
.ai-rangebar .ai-rg-sel { display: inline-flex; align-items: center; gap: 6px; font-size: calc(.95rem * var(--pk-fs, 1)); color: var(--text-color); }
.ai-rangebar select { min-height: 44px; min-width: 64px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font-size: calc(1rem * var(--pk-fs, 1)); }
.ai-rangebar .ai-rg-hint { flex: 1 0 100%; font-size: calc(.82rem * var(--pk-fs, 1)); color: var(--muted); }
.ai-rangebar .ai-rg-hint:empty { display: none; }
.ai-hero-range .ai-hero-txt { max-height: 11em; overflow-y: auto; white-space: pre-line; }
.ai-savedonly .ai-rangebar { display: none; }

/* v3.54.0 เลือกโน้ต/คำตอบในแพ็กอัปเดต */
.bk-pickers{margin:6px 0 10px}
.bk-pickwrap{margin:6px 0;border:1px solid rgba(255,255,255,.14);border-radius:10px;padding:2px 8px}
.bk-pickwrap>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:600}
.bk-pick{max-height:260px;overflow-y:auto;margin:4px 0}
.bk-prow{align-items:flex-start;padding:6px 0;border-bottom:1px solid rgba(255,255,255,.08)}
.bk-prow span{flex:1;min-width:0;overflow-wrap:anywhere}
.bk-new,.bk-old{font-style:normal;font-size:.72em;padding:1px 7px;border-radius:9px;margin-left:6px;white-space:nowrap}
.bk-new{background:#4ADE80;color:#052e16}.bk-old{background:#38BDF8;color:#082f49}
.bk-selbar{display:flex;gap:8px;margin:4px 0}
.bk-mini{min-height:44px;padding:0 12px}
.bk-diff{color:#f5b14a}
/* v3.63.0 ซับไตเติ้ล: ฉบับที่ 2 ใต้ข้อหลัก (เล็ก/จาง) — แสดงทุกข้อ · โหมดเคียงข้าง: อยู่คอลัมน์ซ้ายใต้ข้อหลัก คอลัมน์ขวา (อีกฉบับ) กินสองแถว */
.verse-sub { margin: 0 42px 8px 30px; padding: 0 12px; font-size: .78em; line-height: 1.5; opacity: .72; cursor: default; }
.verse-sub .vs-tag { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 6px; font-size: .8em; font-weight: 700; letter-spacing: .04em; border: 1px solid currentColor; opacity: .85; }
.set-sub-lab { margin: 10px 0 4px; font-size: .86em; opacity: .8; }
@media (min-width: 700px) {
  body.par-side .verse-item:has(> .verse-par) > .verse-sub { grid-column: 1; grid-row: 2; margin-right: 0; }
  body.par-side .verse-item:has(> .verse-par) > .verse-par { grid-row: 1 / span 2; }
}
/* v3.64.0 จอแคบ (iPhone ≤430px): ย่อชิปโหมดให้ปุ่มที่เพิ่ม (ซับ) อยู่ในจอโดยไม่ต้องปัด · ปุ่มซับ/คู่ขนานเหลือแต่ตัวอักษรบนจอแคบ */
@media (max-width: 430px) {
  .mode-chips { gap: 4px; }
  .mode-chips button { padding: 0 8px; gap: 4px; font-size: .8rem; }
  .mode-chips button i { font-size: .85rem; }
  .mode-chips #btnSub i, .mode-chips #btnPar i { display: none; }
}
/* v3.65.0 เครดิตพระคัมภีร์ */
.set-credits { padding: 10px 14px; }
.set-credit { margin: 6px 0; font-size: .88rem; line-height: 1.55; color: var(--muted); }
.set-credit b { color: var(--text, inherit); }
.set-sec#secCredit a { color: var(--gold-ink, #e8c766); text-decoration: underline; }

/* v3.71.0: หน้า Beta */
.beta-gate { position: fixed; inset: 0; z-index: 10200; overflow: auto; display: flex; padding: calc(20px + env(safe-area-inset-top, 0px)) 18px calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--bg-color, #0A0F1D); color: var(--text-color, #EAEAEA); }
.beta-box { margin: auto; width: 100%; max-width: 420px; text-align: center; }
.beta-box h2 { margin: 12px 0 4px; color: var(--gold-ink, #D4AF37); font-size: 1.35rem; }
.beta-box > p { margin: 8px 0 16px; }
.beta-fam { margin-top: 18px; text-align: left; }
.beta-fam summary { cursor: pointer; text-align: center; padding: 10px; }
.acc-new { margin: 12px 0; }
.acc-new summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.acc-new .acc-input { margin-bottom: 8px; }
.ni-pick{margin:0 0 12px;padding:10px 12px;border:1px solid rgba(229,181,60,.35);border-radius:12px}
.ni-pick-head{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between}
.ni-pick-row{display:flex;gap:10px;align-items:flex-start;padding:8px 0;line-height:1.5;cursor:pointer;border-top:1px solid rgba(255,255,255,.08)}
.ni-pick-row input{width:22px;height:22px;flex:0 0 22px;margin-top:2px;accent-color:var(--gold,#e5b63c)}
.ni-pick-row span{min-width:0;overflow-wrap:anywhere}.ni-pick-row b{display:block;font-weight:600}.ni-pick-row small{opacity:.7}
.ni-pick .ni-hint{margin:6px 0 0}.ni-au-miss{margin-bottom:0}
.ni-pick-head .ai-act{border:1px solid rgba(229,181,60,.55);border-radius:999px;background:transparent;color:inherit;font:inherit;font-size:.9em;min-height:40px;padding:6px 14px;cursor:pointer}
.ni-lock{margin:0 0 12px;padding:10px 12px;border:1px solid rgba(229,181,60,.55);border-radius:12px;line-height:1.6}.ni-lock .off-btn{margin-top:8px;width:100%}
.ni-au .ni-au-q{margin-top:10px}.ni-au input:disabled+span{opacity:.55}
.acc-guest-off{display:flex;gap:10px;align-items:flex-start;margin:8px 0;line-height:1.5;cursor:pointer}.acc-guest-off input{width:22px;height:22px;flex:0 0 22px}
