/* =============================================================
   QUR'AN BERJAMA'AH — SUPER APP
   Combined design system (Khataman + Tadabbur)
   ============================================================= */

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
  --emerald-950: #052e16;
  --emerald-900: #14532d;
  --emerald-800: #166534;
  --emerald-700: #15803d;
  --emerald-600: #16a34a;
  --emerald-500: #22c55e;
  --emerald-100: #dcfce7;
  --amber-500:   #f59e0b;
  --amber-400:   #fbbf24;
  --gold:        #D4AC4C;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --white:       #ffffff;
  --nav-height:  64px;
}

[data-theme="dark"] {
  --bg:          #0B1628;
  --bg-card:     #112240;
  --bg-elevated: #1a3a5c;
  --border:      rgba(255,255,255,0.08);
  --ink:         #e2e8f0;
  --ink-muted:   #94a3b8;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
}

[data-theme="light"] {
  --bg:          #F7F1E3;
  --bg-card:     #FFFDF5;
  --bg-elevated: #EDE8D8;
  --border:      rgba(0,0,0,0.08);
  --ink:         #1a202c;
  --ink-muted:   #718096;
  --shadow:      0 4px 24px rgba(0,0,0,0.12);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); overflow: hidden; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Global hidden utility ───────────────────────────────────── */
.hidden { display: none !important; }

/* ── Layout ──────────────────────────────────────────────────── */
.tab-panel {
  position: fixed;
  inset: 0;
  bottom: var(--nav-height);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: 16px;
}
.tab-panel.hidden { display: none !important; }

/* ── Bottom Navigation ───────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-tab {
  flex: 1; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-muted);
  transition: color 0.2s;
}
.nav-tab.active { color: var(--emerald-500); }
.nav-icon  { font-size: 22px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }

/* ── Offline Banner ──────────────────────────────────────────── */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: #ef4444; color: #fff;
  text-align: center; padding: 6px; font-size: 13px; font-weight: 600;
}

/* ── Panel Headers ───────────────────────────────────────────── */
.panel-header { padding: 20px 16px 8px; }
.panel-title  { font-size: 22px; font-weight: 700; color: var(--ink); }
.panel-subtitle { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }

/* ── Shared Form Elements ────────────────────────────────────── */
.input-group  { display: flex; flex-direction: column; gap: 6px; }
.input-label  { font-size: 12px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.input-row    { display: flex; gap: 8px; }
.text-input   { width: 100%; padding: 12px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--bg-elevated); color: var(--ink); font-size: 15px; outline: none; transition: border-color 0.2s; }
.text-input:focus { border-color: var(--emerald-600); }
.text-select  { width: 100%; padding: 11px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--bg-elevated); color: var(--ink); font-size: 15px; outline: none; }
.primary-btn  { width: 100%; padding: 14px; border-radius: var(--radius-md); background: var(--emerald-700); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 0.3px; transition: background 0.2s, transform 0.1s; }
.primary-btn:active { background: var(--emerald-800); transform: scale(0.98); }
.primary-btn:disabled { background: #334155; color: #64748b; cursor: not-allowed; transform: none; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--ink); font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn-sm { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--ink); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.help-link { font-size: 12px; color: var(--emerald-500); text-decoration: none; margin-top: 4px; }
.text-btn-danger { background: none; color: #ef4444; font-size: 13px; font-weight: 600; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast { position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%; transform: translateX(-50%); background: var(--bg-card); color: var(--ink); padding: 10px 20px; border-radius: 99px; font-size: 14px; font-weight: 600; white-space: nowrap; z-index: 500; box-shadow: var(--shadow); border: 1px solid var(--border); }
.toast.hidden { display: none !important; }
.toast-success { border-color: var(--emerald-600); }
.toast-warning { border-color: var(--amber-400); }
.toast-error   { border-color: #ef4444; }
.toast-info    { border-color: var(--border); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; justify-content: center; z-index: 300; padding: 16px 16px calc(var(--nav-height) + 16px); }
.modal-overlay.hidden { display: none !important; }
.modal-card   { background: var(--bg-card); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md); padding: 24px; width: 100%; max-width: 480px; position: relative; display: flex; flex-direction: column; gap: 14px; max-height: 80vh; overflow-y: auto; }
.modal-close  { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-elevated); color: var(--ink); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.modal-title  { font-size: 18px; font-weight: 700; color: var(--ink); }
.modal-avatar { font-size: 40px; text-align: center; }
.modal-user-name { font-size: 18px; font-weight: 700; text-align: center; color: var(--ink); }
.modal-room-name { font-size: 13px; text-align: center; color: var(--ink-muted); }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-btn { padding: 12px; border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--ink); font-size: 15px; font-weight: 600; text-align: center; }
.modal-btn-danger { color: #ef4444; }
.modal-btn-logout { color: var(--ink-muted); }

/* ═══════════════════════════════════════════
   KHATAMAN PANEL
   ═══════════════════════════════════════════ */
.login-screen { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card   { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 24px; }
.login-logo   { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-icon   { font-size: 48px; }
.login-title  { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.login-subtitle { font-size: 14px; color: var(--ink-muted); }
.login-form   { display: flex; flex-direction: column; gap: 16px; }

.app-screen   { display: flex; flex-direction: column; padding-bottom: 16px; }
.app-header   { display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 12px; }
.room-title   { font-size: 17px; font-weight: 700; color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-summary { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.stat-done    { color: var(--emerald-500); font-weight: 700; }
.user-chip    { display: flex; align-items: center; gap: 6px; background: var(--bg-elevated); border-radius: 99px; padding: 6px 10px 6px 6px; flex-shrink: 0; }
.user-avatar  { font-size: 18px; }
.user-name-chip { font-size: 13px; font-weight: 600; color: var(--ink); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress-bar-track { height: 4px; background: var(--bg-elevated); margin: 0 16px; border-radius: 2px; }
.progress-bar       { height: 100%; border-radius: 2px; background: var(--bg-elevated); transition: width 0.6s ease, background 0.4s; }
.progress-bar.has-progress { background: linear-gradient(90deg, var(--emerald-700), var(--emerald-500)); }

.stats-row  { display: flex; gap: 8px; padding: 10px 16px; }
.stat-chip  { flex: 1; background: var(--bg-card); border-radius: var(--radius-md); padding: 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); }
.stat-chip span:first-child { font-size: 18px; font-weight: 800; }
.stat-chip span:last-child  { font-size: 10px; color: var(--ink-muted); font-weight: 600; text-transform: uppercase; }
.stat-available span:first-child { color: var(--ink-muted); }
.stat-reading span:first-child   { color: var(--amber-400); }
.stat-done-chip span:first-child { color: var(--emerald-500); }

.completion-banner { margin: 0 16px 8px; padding: 14px; background: linear-gradient(135deg,var(--emerald-900),var(--emerald-800)); border-radius: var(--radius-md); text-align: center; font-size: 16px; font-weight: 700; color: #fff; border: 1px solid var(--emerald-700); }

/* ── Juz Grid ────────────────────────────────────────────────── */
.juz-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0 16px; }
.juz-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 10px 8px; display: flex; flex-direction: column; gap: 4px; border: 1.5px solid var(--border); cursor: pointer; animation: cardFadeIn 0.4s ease both; transition: transform 0.15s; min-height: 100px; }
.juz-card:active { transform: scale(0.96); }
.status-available { border-color: var(--border); }
.status-reading   { border-color: var(--amber-500); background: rgba(245,158,11,0.08); }
.status-done      { border-color: var(--emerald-700); background: rgba(21,128,61,0.1); }
.is-mine          { border-color: var(--emerald-600); background: rgba(22,163,74,0.12); }
.card-top    { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.juz-number  { font-size: 11px; font-weight: 700; color: var(--ink-muted); }
.status-badge { font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 4px; text-transform: uppercase; }
.badge-available { background: var(--bg-elevated); color: var(--ink-muted); }
.badge-reading   { background: rgba(245,158,11,0.15); color: var(--amber-400); }
.badge-done      { background: rgba(21,128,61,0.15); color: var(--emerald-500); }
.juz-arabic { font-size: 15px; color: var(--ink); text-align: right; font-family: 'Amiri','Traditional Arabic',serif; line-height: 1.5; }
.juz-latin  { font-size: 10px; color: var(--ink-muted); }
.card-bottom { margin-top: auto; }
.action-hint { font-size: 10px; color: var(--ink-muted); }
.mine-hint   { color: var(--emerald-500); font-weight: 600; }
.reader-name { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-muted); }
.reader-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70px; }
@keyframes cardFadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ── Action Sheet ────────────────────────────────────────────── */
.action-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end; z-index: 200; }
.action-sheet-overlay.hidden { display: none !important; }
.action-sheet { background: var(--bg-card); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 0 16px calc(var(--nav-height) + 16px + env(safe-area-inset-bottom)); width: 100%; }
.action-sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 12px auto; }
.action-sheet-title  { font-size: 17px; font-weight: 700; color: var(--ink); padding: 8px 0; }
.action-sheet-info   { font-size: 13px; color: var(--ink-muted); margin-bottom: 8px; }
.action-sheet-buttons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.action-btn  { width: 100%; padding: 13px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; text-align: left; background: var(--bg-elevated); color: var(--ink); }
.action-read     { border: 1px solid var(--emerald-700); color: var(--emerald-500); }
.action-claim    { border: 1px solid var(--emerald-700); }
.action-complete { border: 1px solid var(--emerald-700); }
.action-cancel   { border: 1px solid #dc2626; color: #ef4444; }
.action-close-btn { width: 100%; padding: 13px; border-radius: var(--radius-md); font-size: 15px; color: var(--ink-muted); background: var(--bg-elevated); text-align: center; }

/* ═══════════════════════════════════════════
   MUSHAF TAB — Juz Picker
   ═══════════════════════════════════════════ */
.mushaf-juz-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0 16px; }
.mushaf-juz-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1.5px solid var(--border); cursor: pointer; transition: transform 0.15s, border-color 0.2s; }
.mushaf-juz-card:active { transform: scale(0.95); border-color: var(--emerald-600); }
.mj-num    { font-size: 11px; font-weight: 700; color: var(--emerald-500); }
.mj-arabic { font-size: 16px; color: var(--ink); font-family: 'Amiri','Traditional Arabic',serif; text-align: center; }
.mj-latin  { font-size: 10px; color: var(--ink-muted); text-align: center; }

/* ═══════════════════════════════════════════
   TADABBUR PANEL
   ═══════════════════════════════════════════ */
.tadabbur-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.tadabbur-title  { font-size: 22px; font-weight: 800; color: var(--ink); }
.tadabbur-header-actions { display: flex; gap: 8px; }

.tadabbur-input-section { padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }

.mood-section { background: var(--bg-card); border-radius: var(--radius-md); padding: 14px; border: 1px solid var(--border); }
.mood-label   { font-size: 13px; color: var(--ink-muted); margin-bottom: 10px; font-weight: 600; }
.mood-chips   { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-chip    { padding: 7px 13px; border-radius: 99px; background: var(--bg-elevated); color: var(--ink); font-size: 13px; font-weight: 600; border: 1.5px solid var(--border); transition: background 0.2s, border-color 0.2s; }
.mood-chip:active { background: var(--emerald-900); border-color: var(--emerald-600); }

.ayah-selector { display: flex; flex-direction: column; gap: 10px; }

.notes-group  { }
.notes-wrap   { position: relative; }
.notes-input  { width: 100%; padding: 12px 42px 12px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--bg-elevated); color: var(--ink); font-size: 15px; resize: none; outline: none; font-family: inherit; transition: border-color 0.2s; }
.notes-input:focus { border-color: var(--emerald-600); }
.mic-btn { position: absolute; bottom: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-card); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.mic-btn.recording { background: #ef4444; }

.tadabbur-generate-btn { margin-top: 0; }

/* History */
.history-section { padding: 0 16px; }
.history-header  { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.history-header h3 { font-size: 15px; font-weight: 700; color: var(--ink); }
.history-list    { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history-list li { background: var(--bg-card); border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; border: 1px solid var(--border); }
.history-title   { font-size: 14px; font-weight: 600; color: var(--ink); }
.history-date    { font-size: 12px; color: var(--ink-muted); margin-top: 3px; }

/* Output */
.output-section { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.ayah-block     { background: var(--bg-card); border-radius: var(--radius-md); padding: 18px; border: 1px solid var(--border); }
.ayah-arabic    { font-size: 22px; line-height: 1.9; text-align: right; color: var(--ink); font-family: 'Amiri','Traditional Arabic',serif; margin-bottom: 10px; }
.ayah-translation { font-size: 14px; color: var(--ink-muted); font-style: italic; line-height: 1.6; }
.ayah-meta      { font-size: 12px; color: var(--emerald-500); font-weight: 700; margin-top: 8px; }
.essay-block    { font-size: 15px; line-height: 1.8; color: var(--ink); }
.essay-block p  { margin-bottom: 14px; }
.essay-block h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 20px 0 8px; }
.essay-block hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.sandaran       { background: var(--bg-card); border-radius: var(--radius-md); padding: 14px; border: 1px solid var(--border); margin-top: 16px; font-size: 13px; color: var(--ink-muted); }
.essay-error    { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius-md); padding: 14px; font-size: 14px; color: #ef4444; }
.stream-cursor  { display: inline-block; width: 2px; height: 16px; background: var(--emerald-500); animation: blink 1s step-end infinite; vertical-align: text-bottom; margin-left: 2px; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.essay-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.action-pill   { padding: 9px 14px; border-radius: 99px; background: var(--bg-elevated); color: var(--ink); font-size: 13px; font-weight: 600; border: 1px solid var(--border); }
.action-pill.active { background: var(--emerald-900); border-color: var(--emerald-600); color: var(--emerald-500); }
.action-pill-primary { background: var(--emerald-800); color: #fff; border-color: var(--emerald-700); }

/* IG Card */
.ig-story-card { width: 375px; height: 667px; background: linear-gradient(135deg,#0B1628,#112240); display: flex; align-items: center; justify-content: center; padding: 32px; }
.ig-card-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.ig-arabic     { font-family: 'Amiri','Traditional Arabic',serif; font-size: 26px; color: #fff; line-height: 1.8; }
.ig-meta       { font-size: 14px; color: var(--emerald-500); font-weight: 700; }
.ig-divider    { width: 40px; height: 2px; background: var(--gold); border-radius: 1px; }
.ig-quote      { font-size: 17px; color: var(--gold); font-style: italic; line-height: 1.6; }
.ig-brand      { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 8px; }

/* ═══════════════════════════════════════════
   MUSHAF READER (full-screen overlay)
   ═══════════════════════════════════════════ */
.reader-screen {
  position: fixed; inset: 0; z-index: 400;
  background: #111;
  display: flex; flex-direction: column;
}
.reader-screen.hidden { display: none !important; }

.reader-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--emerald-950); border-bottom: 1px solid rgba(255,255,255,0.06); gap: 8px; flex-shrink: 0; z-index: 410; }
.reader-close-btn { width:40px;height:40px;border-radius:var(--radius-md);background:rgba(255,255,255,0.08);color:#fff;display:flex;align-items:center;justify-content:center; }
.reader-topbar-info { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.reader-topbar-row  { display: flex; align-items: center; justify-content: center; gap: 8px; }
.reader-juz-label   { font-size: 15px; font-weight: 700; color: #fff; }
.reader-mode-badge  { font-size: 11px; background: var(--emerald-800); color: var(--emerald-100); padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.reader-page-info   { font-size: 11px; color: rgba(255,255,255,0.5); }
.reader-fs-btn { width:38px;height:38px;border-radius:var(--radius-sm);background:rgba(255,255,255,0.08);color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }

/* Image wrap */
.reader-image-wrap { flex:1;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;background:#222;display:flex;flex-direction:column;align-items:center;position:relative; }
.reader-image-wrap.zoomed { overflow:hidden; }
.reader-img { width:100%;height:auto;display:block;background:#fff; }
.reader-img-loader { position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.3); }
.reader-img-error  { padding:32px;text-align:center;color:#fff;display:flex;flex-direction:column;gap:12px;align-items:center; }

/* Text mode */
.reader-content { flex:1;overflow-y:auto;background:var(--bg);padding:16px;-webkit-overflow-scrolling:touch; }
.reader-text-loader { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px;color:var(--ink-muted);font-size:14px; }
.reader-text-error  { display:flex;flex-direction:column;align-items:center;gap:12px;padding:40px;text-align:center; }
.reader-error-icon  { font-size:40px; }
.reader-error-title { font-size:16px;font-weight:700;color:var(--ink); }
.reader-error-desc  { font-size:13px;color:var(--ink-muted); }
.text-ayah { padding:16px 0;border-bottom:1px solid var(--border); }
.text-ayah-meta        { font-size:11px;color:var(--emerald-500);font-weight:700;margin-bottom:8px; }
.text-ayah-arabic      { font-size:20px;line-height:2;text-align:right;font-family:'Amiri','Traditional Arabic',serif;color:var(--ink);margin-bottom:8px; }
.text-ayah-translation { font-size:13px;color:var(--ink-muted);line-height:1.6; }

/* Bottom bar */
.reader-bottombar { display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--emerald-950);border-top:1px solid rgba(255,255,255,0.06);flex-shrink:0; }
.reader-bottombar.hidden { display:none!important; }
.reader-nav-btn { display:flex;align-items:center;gap:4px;background:rgba(255,255,255,0.08);color:#fff;border-radius:var(--radius-md);padding:8px 12px;font-size:13px;font-weight:600;white-space:nowrap;flex-shrink:0; }
.reader-slider-wrap { flex:1; }
.reader-slider { width:100%;accent-color:var(--emerald-500);height:4px; }
.reader-retry-btn { padding:8px 16px;background:var(--emerald-800);color:#fff;border-radius:var(--radius-md);font-size:13px;font-weight:600; }

/* Spinner */
.reader-spinner { width:32px;height:32px;border-radius:50%;border:3px solid rgba(255,255,255,0.15);border-top-color:#fff;animation:spin 0.8s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }

/* Toast */
.reader-toast { position:absolute;bottom:80px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,0.75);color:#fff;padding:8px 16px;border-radius:99px;font-size:13px;font-weight:600;white-space:nowrap;pointer-events:none; }
.reader-toast.hidden { display:none!important; }

/* Immersive toolbar */
.reader-imm-toolbar { position:fixed;top:12px;right:12px;z-index:9999;display:flex;gap:6px; }
.reader-imm-toolbar.hidden { display:none!important; }
.reader-imm-btn { width:44px;height:44px;border-radius:12px;background:rgba(0,0,0,0.65);color:#fff;font-size:20px;display:flex;align-items:center;justify-content:center;border:1.5px solid rgba(255,255,255,0.25);cursor:pointer;-webkit-tap-highlight-color:transparent; }
.reader-imm-btn.active { background:rgba(212,168,83,0.5);border-color:rgba(212,168,83,0.8); }
.reader-fs-exit { position:fixed;top:14px;right:14px;z-index:9999;width:44px;height:44px;border-radius:12px;background:rgba(0,0,0,0.7);color:#fff;font-size:22px;font-weight:600;display:flex;align-items:center;justify-content:center;border:2px solid rgba(255,255,255,0.3); }
.reader-fs-exit.hidden { display:none!important; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 480px) {
  .juz-grid, .mushaf-juz-grid { grid-template-columns: repeat(5,1fr); }
}
@media (min-width: 768px) {
  .tab-panel { max-width: 640px; margin: 0 auto; left: 0; right: 0; }
  .bottom-nav { max-width: 640px; margin: 0 auto; left: 0; right: 0; }
  .juz-grid, .mushaf-juz-grid { grid-template-columns: repeat(6,1fr); }
}

/* ── Tombol Tadabbur per ayat (mode baris) ───────────────────── */
.tadabbur-ayat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(21,128,61,0.12);
  color: var(--emerald-500);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(21,128,61,0.25);
  transition: background 0.2s;
}
.tadabbur-ayat-btn:active {
  background: rgba(21,128,61,0.25);
}
