/* Antique Arabic Manuscript Styling & Multi-Page Aesthetics (Abaq Adabi True Identity) */

:root {
  --ink-primary: #141E2E;
  --ink-secondary: #26354A;
  --parchment-bg: #F8F5EE;
  --parchment-card: #F4EEDD;
  --gold-accent: #C5A059;
  --gold-light: #DFC07D;
  --gold-dark: #8C6D2D;
  --emerald-accent: #214320;
}

body {
  background-color: var(--parchment-bg);
  background-image: 
    radial-gradient(#DECFA8 0.8px, transparent 0.8px), 
    radial-gradient(#DECFA8 0.8px, #F8F5EE 0.8px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  -webkit-font-smoothing: antialiased;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #EBE3CF;
}
::-webkit-scrollbar-thumb {
  background: #C5A059;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #8C6D2D;
}

/* Utility to hide scrollbars */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn {
  animation: fadeIn 0.25s ease-out forwards;
}

/* Studio Canvas Aspect Ratio & Smooth Responsive Wrap */
#canvasWrapper {
  transition: aspect-ratio 0.25s ease, max-width 0.25s ease;
}

/* Extended Typography Utilities for Card Studio & Readers */
.font-\[\'Cairo\'\] {
  font-family: 'Cairo', 'Noto Kufi Arabic', sans-serif;
}
.font-\[\'Tajawal\'\] {
  font-family: 'Tajawal', 'Noto Kufi Arabic', sans-serif;
}
.font-\[\'Almarai\'\] {
  font-family: 'Almarai', 'Noto Kufi Arabic', sans-serif;
}
.font-\[\'Scheherazade_New\'\] {
  font-family: 'Scheherazade New', 'Amiri', serif;
}

/* Arabic Poetry Classical Two-Hemistich (الصدر والعجز) Layout */
.verse-bayt {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1.15rem;
  border-radius: 0.9rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #FFFFFF;
}

.verse-bayt:hover {
  background-color: #FAF6ED;
  border-color: var(--gold-accent);
}

.verse-active {
  background-color: #FAF4E4 !important;
  border-right: 4px solid var(--gold-accent) !important;
  box-shadow: 0 2px 8px rgba(197, 160, 89, 0.2);
}

/* Authentic Poetic Divider */
.bayt-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--gold-dark);
  font-size: 0.85rem;
  user-select: none;
}
.bayt-divider::before,
.bayt-divider::after {
  content: "";
  height: 1px;
  width: 28px;
  background: linear-gradient(to right, transparent, var(--gold-accent));
}
.bayt-divider::after {
  background: linear-gradient(to left, transparent, var(--gold-accent));
}

/* Nav Tab Active State */
.nav-tab {
  color: #5C677D;
}
.nav-tab:hover {
  background-color: #EBE3CF;
  color: #1B263B;
}
.nav-tab.active {
  background-color: #1B263B;
  color: #F4EEDD;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Mobile Bottom Nav Bar Active State */
.mobile-nav-btn {
  transition: all 0.15s ease;
  user-select: none;
  min-width: 44px;
}
.mobile-nav-btn.active {
  color: #C5A059;
  border-top: 2px solid #C5A059;
  font-weight: 700;
}

/* Parchment Glow Effect */
.parchment-glow {
  box-shadow: 0 10px 30px -10px rgba(27, 38, 59, 0.25), 0 0 0 1px rgba(197, 160, 89, 0.3);
}

/* Site-Wide Custom Background Engine from Studio */
#siteCustomBgLayer {
  position: fixed;
  inset: 0;
  background-image: url('assets/site-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -2;
  transition: opacity 0.3s ease, filter 0.3s ease;
  pointer-events: none;
}

#siteCustomBgOverlay {
  position: fixed;
  inset: 0;
  background-color: rgba(248, 245, 238, 0.88);
  backdrop-filter: blur(2px);
  z-index: -1;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
  pointer-events: none;
}

/* Dark mode / Low-transparency overlay options */
body.site-bg-dark #siteCustomBgOverlay {
  background-color: rgba(18, 27, 42, 0.88);
}
body.site-bg-subtle #siteCustomBgOverlay {
  background-color: rgba(248, 245, 238, 0.72);
}
body.site-bg-intense #siteCustomBgOverlay {
  background-color: rgba(248, 245, 238, 0.94);
}

/* Hero Custom Cover Styling from Studio */
.hero-cover-layer {
  position: absolute;
  inset: 0;
  background-image: url('assets/hero-cover.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.4s ease, background-image 0.3s ease;
  z-index: 1;
}

.hero-cover-overlay {
  position: absolute;
  inset: 0;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  z-index: 2;
}

/* Three distinct cover clarity & reading modes */
.hero-cover-overlay.cover-clear,
#modalCoverPreviewOverlay.cover-clear {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.42) 0%, rgba(27, 38, 59, 0.50) 50%, rgba(37, 55, 78, 0.62) 100%);
  backdrop-filter: blur(0px);
}

.hero-cover-overlay.cover-balanced,
#modalCoverPreviewOverlay.cover-balanced {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.66) 0%, rgba(27, 38, 59, 0.72) 50%, rgba(37, 55, 78, 0.80) 100%);
  backdrop-filter: blur(1px);
}

.hero-cover-overlay.cover-focused,
#modalCoverPreviewOverlay.cover-focused {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(27, 38, 59, 0.86) 50%, rgba(37, 55, 78, 0.92) 100%);
  backdrop-filter: blur(1.5px);
}

/* Portal Cards */
.portal-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.portal-card:hover {
  transform: translateY(-2px);
}
.portal-card:active {
  transform: scale(0.98);
}

/* Story Card Enhancements */
.story-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.story-card:hover {
  transform: translateY(-3px);
  border-color: #C5A059;
  box-shadow: 0 8px 20px -4px rgba(140, 109, 45, 0.15);
}

/* Meter Card Rhythm Box */
.meter-card {
  transition: all 0.18s ease;
}
.meter-card:hover {
  border-color: #C5A059;
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.15);
}

/* Button & interactive feedback */
button:active {
  transform: scale(0.98);
}

/* Membership Card Canvas Crisp Render */
#memberCardCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

/* Instagram Story & Quote Template Chips & Cards */
.story-template-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.story-template-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-accent);
  box-shadow: 0 6px 16px -2px rgba(140, 109, 45, 0.18);
}
.story-template-card.active {
  border-color: var(--gold-dark) !important;
  background-color: #FFFDF9 !important;
  box-shadow: 0 0 0 2px var(--gold-accent);
}
.story-template-card.active::after {
  content: "✓ مفعل";
  position: absolute;
  top: 4px;
  left: 6px;
  background: var(--gold-dark);
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
}

/* Category Filter Pills Active State */
.template-cat-btn {
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}
.template-cat-btn:hover {
  border-color: var(--gold-accent);
}
.template-cat-btn.active {
  background-color: #1B263B !important;
  color: #FFFFFF !important;
  border-color: #1B263B !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Motif Buttons Active State */
.motif-btn {
  transition: all 0.15s ease;
  cursor: pointer;
}
.motif-btn.active {
  border-color: var(--gold-accent) !important;
  background-color: #F4EEDD !important;
  border-width: 2px !important;
  box-shadow: 0 1px 2px rgba(197, 160, 89, 0.25);
}

/* Safe Zone Indicator Glow */
#canvasWrapper.safe-zones-active {
  outline: 2px solid #C5A059;
}

/* Reciter Persona Selection Pills & Buttons */
.reciter-pill {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(197, 160, 89, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #D9CEB4;
}
.reciter-pill:hover {
  background: rgba(197, 160, 89, 0.2);
  color: #FFFFFF;
  border-color: #C5A059;
}
.reciter-pill.active {
  background: #C5A059 !important;
  color: #121B2A !important;
  font-weight: 700;
  border-color: #DFC07D !important;
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.4);
}

/* Subtle texture pattern for readers */
.bg-pattern-parchment {
  background-color: #FDFBF7;
  background-image: radial-gradient(#E5DBC5 0.5px, transparent 0.5px);
  background-size: 16px 16px;
}

/* Official Abaq Logo image enhancement */
.abaq-logo-img {
  image-rendering: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

/* Classical Literary Book Feature Artwork */
.hero-book-img {
  image-rendering: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-book-img:hover {
  transform: translateY(-3px) scale(1.04);
}

/* User Identity Avatar Styling & Medallion Glow */
.user-avatar-img {
  image-rendering: auto;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.user-avatar-img:hover {
  transform: scale(1.04);
}

/* Header External App Icon Custom Styling */
#headerAppBrandIcon {
  image-rendering: auto;
  transition: transform 0.2s ease, filter 0.2s ease;
}
#headerAppBrandIcon:hover {
  transform: scale(1.05);
}

.external-app-icon-preview {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Islamic Geometric decorative corners */
.islamic-box-border {
  border: 1px solid #D9CEB4;
  position: relative;
}
.islamic-box-border::before {
  content: "❖";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  color: #C5A059;
}

/* Member Page & Reading Progress Utilities */
.member-sub-tab {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.member-sub-tab.active {
  box-shadow: 0 2px 8px rgba(27, 38, 59, 0.2);
}

.schedule-filter-btn {
  transition: all 0.15s ease;
  user-select: none;
}
.schedule-filter-btn.active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* PWA App Platform Tabs Active Styling */
.install-platform-tab {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.install-platform-tab.active {
  box-shadow: 0 2px 6px rgba(197, 160, 89, 0.25);
}

/* Biographies and Poet Category Filter Pills */
.poet-filter-btn {
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.poet-filter-btn:hover {
  border-color: var(--gold-accent);
}
.poet-filter-btn.active {
  background-color: #1B263B !important;
  color: #FFFFFF !important;
  border-color: #1B263B !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Event proposal cards */
.event-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -4px rgba(27, 38, 59, 0.12);
  border-color: var(--gold-accent);
}

/* ===== Novel Reader (قارئ النص الكامل) ===== */
#novelReader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  background: #FBF7EC;
  color: #141E2E;
}
#novelReader.open { display: flex; }
#novelReader.reader-night { background: #0F1622; color: #E9E3D4; }

.reader-progress-track { height: 4px; background: #E3D8BF; flex: 0 0 auto; }
#novelReader.reader-night .reader-progress-track { background: #1E2A3B; }
.reader-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to left, #C5A059, #DFC07D);
  transition: width 0.12s linear;
}

.reader-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem;
  background: #F4EEDD;
  border-bottom: 1px solid #D9CEB4;
}
#novelReader.reader-night .reader-header { background: #131C2A; border-bottom-color: #243149; }

.reader-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid #D9CEB4;
  color: #1B263B;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
  transition: transform 0.15s ease, background 0.15s ease;
}
.reader-icon-btn:active { transform: scale(0.94); }
#novelReader.reader-night .reader-icon-btn { background: #1B263B; border-color: #2B3B52; color: #DFC07D; }

.reader-titles { flex: 1 1 auto; min-width: 0; text-align: center; }
.reader-titles h3 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-titles p { font-family: 'Aref Ruqaa', serif; font-size: 11px; font-weight: 700; color: #8C6D2D; }
#novelReader.reader-night .reader-titles p { color: #C7A96A; }

.reader-tools { display: flex; align-items: center; gap: 0.25rem; flex: 0 0 auto; }

.reader-chips {
  flex: 0 0 auto;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem 0.7rem;
  background: #FAF6EE;
  border-bottom: 1px solid #E3D8BF;
  scrollbar-width: none;
}
.reader-chips::-webkit-scrollbar { display: none; }
#novelReader.reader-night .reader-chips { background: #101928; border-bottom-color: #243149; }

.reader-chip {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid #D9CEB4;
  color: #5C677D;
}
.reader-chip.active { background: #1B263B; border-color: #1B263B; color: #DFC07D; }
#novelReader.reader-night .reader-chip { background: #1B263B; border-color: #2B3B52; color: #A4B1C6; }
#novelReader.reader-night .reader-chip.active { background: #C5A059; border-color: #C5A059; color: #121B2A; }

#readerScroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.1rem 1rem 2.5rem;
}
.reader-paper { max-width: 44rem; margin: 0 auto; }
.reader-chapter-title {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #8C6D2D;
  border-inline-start: 4px solid #C5A059;
  padding-inline-start: 0.6rem;
  margin-bottom: 1rem;
}
#novelReader.reader-night .reader-chapter-title { color: #DFC07D; }
.reader-paragraph {
  font-family: 'Amiri', serif;
  font-size: var(--reader-fs, 19px);
  line-height: 2.05;
  margin-bottom: 1rem;
  text-align: justify;
}
.reader-end-note {
  text-align: center;
  font-family: 'Aref Ruqaa', serif;
  font-size: 12px;
  color: #8C6D2D;
  margin: 1.4rem 0 0.8rem;
}
#novelReader.reader-night .reader-end-note { color: #C7A96A; }
.reader-site-link {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #1B263B;
  background: #F4EEDD;
  border: 1px solid #D9CEB4;
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
}
#novelReader.reader-night .reader-site-link { background: #16202F; border-color: #243149; color: #DFC07D; }

.reader-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem;
  background: #F4EEDD;
  border-top: 1px solid #D9CEB4;
}
#novelReader.reader-night .reader-footer { background: #131C2A; border-top-color: #243149; }

.reader-nav-btn {
  flex: 1 1 0;
  min-height: 44px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: #FFFFFF;
  border: 1px solid #D9CEB4;
  color: #1B263B;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.reader-nav-btn:disabled { opacity: 0.4; }
.reader-nav-btn:active { transform: scale(0.97); }
.reader-nav-primary { background: #1B263B; border-color: #1B263B; color: #DFC07D; }
#novelReader.reader-night .reader-nav-btn { background: #1B263B; border-color: #2B3B52; color: #E9E3D4; }
#novelReader.reader-night .reader-nav-primary { background: #C5A059; border-color: #C5A059; color: #121B2A; }

/* Panels used by the portal tab */
.scroll-panel { max-height: 420px; overflow-y: auto; padding-inline-end: 0.25rem; }

/* ============================================================
   STANDALONE APP SHELL — شاشة افتتاحية + تثبيت + إحساس تطبيقي
   ============================================================ */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; }

/* 1) زر التثبيت في الترويسة */
.install-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.375rem 0.7rem;
  border-radius: 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  color: #1B263B;
  background: linear-gradient(135deg, #DFC07D 0%, #C5A059 100%);
  border: 1px solid #8C6D2D;
  box-shadow: 0 2px 6px -2px rgba(140, 109, 45, 0.6);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.install-header-btn:active { transform: scale(0.96); filter: brightness(0.97); }
.install-header-btn.hidden { display: none; }

/* 2) الشاشة الافتتاحية */
#appSplash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(197, 160, 89, 0.22) 0%, rgba(197, 160, 89, 0) 60%),
    linear-gradient(160deg, #0B1220 0%, #121B2A 45%, #1B263B 100%);
  color: #F4EEDD;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#appSplash.splash-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 2rem;
  text-align: center;
}

.splash-logo-wrap {
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02));
  border: 2px solid rgba(197, 160, 89, 0.8);
  box-shadow: 0 0 0 8px rgba(197, 160, 89, 0.10), 0 18px 40px -14px rgba(0, 0, 0, 0.75);
  animation: splashPop 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
  padding: 6px;
}
.splash-logo-wrap::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 42px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  animation: splashRing 2.6s ease-out infinite;
}
.splash-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  background: #0F172A;
}

.splash-title {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #FAF6EE;
  line-height: 1.4;
}
.splash-sub {
  font-family: 'Aref Ruqaa', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #DFC07D;
  direction: ltr;
}
.splash-tag {
  font-family: 'Amiri', serif;
  font-size: 0.8rem;
  color: #A4B1C6;
  line-height: 1.9;
  max-width: 17rem;
}
.splash-bar {
  width: 140px;
  height: 3px;
  margin-top: 0.4rem;
  border-radius: 9999px;
  background: rgba(244, 238, 221, 0.18);
  overflow: hidden;
}
.splash-bar span {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: 9999px;
  background: linear-gradient(to left, #C5A059, #DFC07D);
  animation: splashSlide 1.15s ease-in-out infinite;
}

@keyframes splashPop {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes splashRing {
  0% { opacity: 0.9; transform: scale(0.94); }
  70% { opacity: 0; transform: scale(1.14); }
  100% { opacity: 0; transform: scale(1.14); }
}
@keyframes splashSlide {
  0% { transform: translateX(140%); }
  100% { transform: translateX(-140%); }
}

/* 3) بطاقة التثبيت في الرئيسية */
.install-banner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.15rem 1.25rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #FFFDF7 0%, #F6EFDF 100%);
  border: 1px solid #D9CEB4;
  border-inline-start: 5px solid #C5A059;
  box-shadow: 0 8px 22px -14px rgba(27, 38, 59, 0.5);
}
@media (min-width: 640px) {
  .install-banner { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.5rem; }
}
.install-banner h3 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1B263B;
  margin-top: 0.35rem;
}
.install-banner p {
  font-size: 0.78rem;
  color: #5C677D;
  line-height: 1.75;
  margin-top: 0.3rem;
  max-width: 36rem;
}
.install-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  color: #8C6D2D;
  background: rgba(197, 160, 89, 0.18);
  border: 1px solid rgba(197, 160, 89, 0.45);
}
.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.install-btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.6rem 1.15rem;
  border-radius: 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #DFC07D;
  background: #1B263B;
  border: 1px solid #C5A059;
  transition: transform 0.15s ease, background 0.15s ease;
}
.install-btn-solid:active { transform: scale(0.97); }
.install-state {
  font-size: 0.68rem;
  font-weight: 700;
  color: #5C677D;
}
.install-banner.installed { display: none; }

/* 4) نافذة التثبيت */
#installModal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
}
#installModal.hidden { display: none !important; }

.install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 15, 25, 0.64);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.install-sheet {
  position: relative;
  width: 100%;
  max-width: 33rem;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #FDFBF7;
  border: 2px solid #C5A059;
  border-radius: 1.5rem;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.install-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #E3D8BF;
}
.install-brand { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.install-brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #0F172A;
  border: 2px solid #C5A059;
}
.install-brand h3 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1B263B;
}
.install-brand p {
  font-size: 0.68rem;
  color: #5C677D;
  line-height: 1.7;
  margin-top: 0.2rem;
}
.install-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: #F4EEDD;
  border: 1px solid #D9CEB4;
  color: #1B263B;
  font-weight: 700;
  font-size: 0.82rem;
}
.install-close:active { transform: scale(0.94); }

.install-body { display: flex; flex-direction: column; gap: 0.85rem; }

.install-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  border-radius: 0.9rem;
  background: #1B263B;
  color: #DFC07D;
  border: 1px solid #C5A059;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 10px 22px -14px rgba(27, 38, 59, 0.9);
}
.install-primary-btn:active { transform: scale(0.98); }

.install-hint { font-size: 0.74rem; color: #5C677D; line-height: 1.8; }

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem;
  border-radius: 1rem;
  background: #FAF6EE;
  border: 1px solid #E3D8BF;
}
.install-steps h4 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8C6D2D;
  margin-top: 0.45rem;
}
.install-steps h4:first-child { margin-top: 0; }
.install-steps ol {
  list-style: decimal;
  padding-inline-start: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.install-steps li { font-size: 0.75rem; color: #1B263B; line-height: 1.8; }

.install-perks { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.install-perks span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #2D5A27;
  background: #E8F3E6;
  border: 1px solid #BFD8B8;
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
}

.install-dev {
  padding: 0.7rem 0.85rem;
  border-radius: 1rem;
  background: #FFFDF7;
  border: 1px dashed #D9CEB4;
}
.install-dev summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1B263B;
  list-style: none;
}
.install-dev summary::-webkit-details-marker { display: none; }
.install-dev[open] summary { margin-bottom: 0.5rem; }
.install-dev summary::before { content: "▸ "; color: #C5A059; }
.install-dev[open] summary::before { content: "▾ "; }
.install-dev p { font-size: 0.72rem; color: #5C677D; line-height: 1.9; }
.install-dev ol {
  list-style: decimal;
  padding-inline-start: 1.2rem;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.install-dev li { font-size: 0.72rem; color: #1B263B; line-height: 1.85; }
.install-dev code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  background: #F4EEDD;
  border: 1px solid #E3D8BF;
  border-radius: 0.35rem;
  padding: 0.05rem 0.28rem;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* 5) احترام تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  .splash-logo-wrap,
  .splash-logo-wrap::after,
  .splash-bar span {
    animation: none !important;
  }
  #appSplash { transition: opacity 0.2s linear; }
}

/* ===== شريط "المزيد" ===== */
#moreNavSheet .mobile-nav-btn { min-width: 44px; }

/* ===== وضع المؤسس للتعديل ===== */
.founder-edit-hot { cursor: text; }
.founder-edit-hot:hover { outline: 1px dashed #C5A059; outline-offset: 2px; }
.founder-edit-img { cursor: pointer; }
.founder-edit-img:hover { outline: 2px dashed #C5A059; outline-offset: 2px; }
.founder-selected {
  outline: 2px solid #2D5A27 !important;
  outline-offset: 2px;
  background-color: rgba(197, 160, 89, 0.12) !important;
}
body.founder-edit-mode main { padding-bottom: 168px; }

#founderEditBar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 90;
  background: #121B2A;
  border-top: 2px solid #C5A059;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 -12px 30px -14px rgba(0, 0, 0, 0.75);
}
.feb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feb-title { font-size: 11px; font-weight: 700; color: #DFC07D; white-space: nowrap; }
.feb-target {
  flex: 1 1 auto;
  min-width: 100px;
  font-size: 11px;
  color: #A4B1C6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feb-exit {
  flex: 0 0 auto;
  background: #C5A059;
  color: #121B2A;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 8px;
  min-height: 32px;
}
.feb-actions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.feb-actions::-webkit-scrollbar { display: none; }
.feb-actions button {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: #F4EEDD;
  border: 1px solid rgba(197, 160, 89, 0.5);
  min-height: 34px;
  white-space: nowrap;
}
.feb-actions button:active { transform: scale(0.96); background: rgba(197, 160, 89, 0.35); }

/* نجوم مراجعة القارئ */
.star-btn { transition: transform 0.12s ease; line-height: 1; }
.star-btn:active { transform: scale(0.9); }

/* ===== ميزان العروض الرقمي ===== */
.proso-sample-btn {
  padding: 0.15rem 0.6rem;
  border-radius: 0.5rem;
  background: #FAF6EE;
  border: 1px solid #D9CEB4;
  color: #1B263B;
  font-weight: 700;
  font-size: 11px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.proso-sample-btn:hover { background: #EBE3CF; border-color: #C5A059; }
.proso-sample-btn:active { transform: scale(0.96); }
.proso-sample-nabati {
  background: #E8F3E6;
  border-color: #BFD8B8;
  color: #2D5A27;
}
.proso-sample-nabati:hover { background: #D8EBD4; }

.proso-numeric {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  direction: ltr;
  text-align: left;
  word-break: break-all;
  line-height: 1.9;
  letter-spacing: 0.06em;
}

.proso-slash {
  font-family: 'Amiri', serif;
  direction: ltr;
  text-align: left;
  word-break: break-all;
  line-height: 1.9;
  letter-spacing: 0.14em;
}

#metersGuideList button { cursor: pointer; }
#metersGuideList button:active { transform: scale(0.985); }

/* ===== نافذة تجهيز ملف PDF ===== */
.pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(9, 15, 25, 0.64);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.pdf-overlay.open { display: flex; }
.pdf-overlay > div { animation: fadeIn 0.2s ease-out both; }

/* خفة الأداء: تقليل عمليات الرسم للبطاقات الطويلة */
#storiesGrid, #booksGrid, #poemsGrid, #poetsGrid {
  contain: layout style;
}

/* أزرار PDF داخل البطاقات */
.story-pdf-btn, .book-pdf-btn, .book-share-btn {
  min-height: 30px;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.story-pdf-btn:active, .book-pdf-btn:active, .book-share-btn:active {
  transform: scale(0.95);
  filter: brightness(0.95);
}

#readerPdfBtn { font-size: 15px; }

/* ============================================================
   بوابة العضوية (تسجيل ثم دخول)
   ============================================================ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 16%, rgba(197, 160, 89, 0.24) 0%, rgba(197, 160, 89, 0) 58%),
    linear-gradient(165deg, #080D16 0%, #121B2A 50%, #1B263B 100%);
}
.auth-gate.hidden { display: none !important; }

.auth-shell {
  width: 100%;
  max-width: 25rem;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #FDFBF7;
  border: 2px solid #C5A059;
  border-radius: 1.5rem;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.9);
}

.auth-brand { display: flex; align-items: center; gap: 0.65rem; }
.auth-brand img {
  width: 52px; height: 52px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid #C5A059;
  background: #0F172A;
  flex: 0 0 auto;
}
.auth-brand h2 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #1B263B;
  line-height: 1.45;
}
.auth-brand p {
  font-family: 'Aref Ruqaa', 'Amiri', serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8C6D2D;
  direction: ltr;
  text-align: right;
  margin-top: 0.1rem;
}
.auth-theme-btn {
  margin-inline-start: auto;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: #F4EEDD;
  border: 1px solid #D9CEB4;
  font-size: 16px;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
}
.auth-theme-btn:active { transform: scale(0.94); }

.auth-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 0.9rem;
  background: #F4EEDD;
  border: 1px solid #E3D8BF;
}
.auth-tab {
  flex: 1 1 0;
  min-height: 40px;
  border-radius: 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #6B7280;
  transition: background 0.18s ease, color 0.18s ease;
}
.auth-tab.active {
  background: #1B263B;
  color: #DFC07D;
  box-shadow: 0 2px 8px -2px rgba(27, 38, 59, 0.5);
}

.auth-form { display: flex; flex-direction: column; gap: 0.62rem; }
.auth-lead { font-size: 0.75rem; line-height: 1.85; color: #5C677D; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1B263B;
}
.auth-form label span { color: #C0392B; }
.auth-form input {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: 0.8rem;
  background: #FFFFFF;
  border: 1px solid #D9CEB4;
  color: #1B263B;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: 'Noto Kufi Arabic', 'Tajawal', sans-serif;
}
.auth-form input:focus { border-color: #C5A059; box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.22); }

.auth-submit {
  min-height: 48px;
  margin-top: 0.2rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #DFC07D, #C5A059);
  color: #12202F;
  font-weight: 800;
  font-size: 0.86rem;
  border: 1px solid #8C6D2D;
  box-shadow: 0 10px 22px -14px rgba(140, 109, 45, 0.9);
}
.auth-submit:active { transform: scale(0.98); }

.auth-msg {
  display: none;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.75;
  padding: 0.5rem 0.7rem;
  border-radius: 0.7rem;
}
.auth-msg-error { display: block; background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.auth-msg-ok { display: block; background: #E8F3E6; color: #2D5A27; border: 1px solid #BFD8B8; }

.auth-note { font-size: 0.68rem; color: #7C8798; line-height: 1.85; text-align: center; }

/* أزرار الترويسة: الوضع الليلي وحساب العضو */
.theme-toggle-btn {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #D9CEB4;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex: 0 0 auto;
  transition: transform 0.15s ease, background 0.15s ease;
}
.theme-toggle-btn:active { transform: scale(0.94); }

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 36px;
  padding: 0 0.6rem;
  border-radius: 12px;
  background: #1B263B;
  color: #DFC07D;
  border: 1px solid #C5A059;
  font-size: 11px;
  font-weight: 700;
  max-width: 9rem;
}
.account-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip:active { transform: scale(0.96); }

/* ============================================================
   الوضع الليلي
   ============================================================ */
body.dark-mode {
  color-scheme: dark;
  --ink-primary: #ECE6D8;
  --parchment-bg: #0E141E;
  background-color: #0E141E;
  background-image:
    radial-gradient(rgba(197, 160, 89, 0.09) 0.8px, transparent 0.8px),
    radial-gradient(rgba(197, 160, 89, 0.09) 0.8px, #0E141E 0.8px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  color: #ECE6D8;
}

body.dark-mode header,
body.dark-mode .bg-\[\#F4EEDD\]\/95 {
  background-color: rgba(15, 21, 31, 0.95) !important;
  border-bottom-color: #2C3849 !important;
}
body.dark-mode #desktopNavTabs {
  background-color: transparent !important;
}
body.dark-mode .bg-\[\#F8F5EE\]\/90 { background-color: rgba(15, 21, 31, 0.9) !important; }

body.dark-mode .bg-\[\#F8F5EE\],
body.dark-mode .bg-\[\#F4EEDD\],
body.dark-mode .bg-\[\#FAF6EE\],
body.dark-mode .bg-\[\#FDFBF7\],
body.dark-mode .bg-\[\#FFFDF7\],
body.dark-mode .bg-white,
body.dark-mode .bg-gray-100,
body.dark-mode .bg-\[\#EBE3CF\] {
  background-color: #171F2C !important;
  color: #ECE6D8;
}

body.dark-mode .hover\:bg-\[\#FAF6EE\]:hover,
body.dark-mode .hover\:bg-\[\#F4EEDD\]:hover,
body.dark-mode .hover\:bg-\[\#EBE3CF\]:hover,
body.dark-mode .hover\:bg-white:hover { background-color: #202B3B !important; }

body.dark-mode .border-\[\#D9CEB4\],
body.dark-mode .border-\[\#E3D8BF\],
body.dark-mode .border-\[\#E3D8BF\]\/60,
body.dark-mode .border-\[\#EBE3CF\] { border-color: #2C3849 !important; }

body.dark-mode .text-\[\#1B263B\] { color: #ECE6D8 !important; }
body.dark-mode .text-\[\#5C677D\] { color: #A6B2C4 !important; }
body.dark-mode .text-\[\#8C6D2D\] { color: #DFC07D !important; }
body.dark-mode .text-\[\#A4B1C6\] { color: #8C9AB0 !important; }
body.dark-mode .text-\[\#B7A98A\] { color: #8A8676 !important; }
body.dark-mode .text-\[\#D9CEB4\] { color: #C4BDAB !important; }
body.dark-mode .text-\[\#2D5A27\] { color: #9FD08F !important; }
body.dark-mode .text-red-700 { color: #FCA5A5 !important; }
body.dark-mode .text-amber-800 { color: #F0CE87 !important; }

body.dark-mode .bg-\[\#E8F3E6\] { background-color: #1C3524 !important; color: #BFE0B4 !important; }
body.dark-mode .bg-amber-100 { background-color: #3A2E12 !important; color: #F0CE87 !important; }
body.dark-mode .bg-red-100 { background-color: #3A1B1B !important; color: #FCA5A5 !important; }
body.dark-mode .bg-red-50 { background-color: #2E1717 !important; color: #FCA5A5 !important; }

/* أزرار ذهبية: يبقى نصها داكناً ليبقى التباين واضحاً */
body.dark-mode .bg-\[\#C5A059\].text-\[\#1B263B\],
body.dark-mode .bg-\[\#DFC07D\].text-\[\#1B263B\],
body.dark-mode .bg-\[\#C5A059\] .text-\[\#1B263B\] { color: #12202F !important; }

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background-color: #1C2635 !important;
  color: #ECE6D8 !important;
  border-color: #2C3849 !important;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder { color: #7C8798 !important; }

body.dark-mode .nav-tab { color: #A6B2C4; }
body.dark-mode .nav-tab:hover { background-color: #1C2635; color: #ECE6D8; }
body.dark-mode .nav-tab.active { background-color: #C5A059; color: #12202F; }

body.dark-mode #mobileBottomNav {
  background-color: #121A26 !important;
  border-top-color: #2C3849 !important;
}
body.dark-mode .mobile-nav-btn { color: #A6B2C4; }
body.dark-mode .mobile-nav-btn.active { color: #DFC07D; border-top-color: #DFC07D; }

body.dark-mode .verse-bayt { background-color: #1C2635; border-color: #2C3849; }
body.dark-mode .verse-bayt:hover { background-color: #232F41; }

body.dark-mode .proso-sample-btn { background: #1C2635; border-color: #2C3849; color: #ECE6D8; }
body.dark-mode .proso-sample-nabati { background: #1C3524; border-color: #2F5A38; color: #9FD08F; }

body.dark-mode .install-banner {
  background: linear-gradient(135deg, #171F2C 0%, #1C2635 100%);
  border-color: #2C3849;
  border-inline-start-color: #C5A059;
}
body.dark-mode .install-banner h3 { color: #ECE6D8; }
body.dark-mode .install-banner p { color: #A6B2C4; }
body.dark-mode .install-state { color: #A6B2C4; }
body.dark-mode .install-sheet { background: #111927; border-color: #C5A059; }
body.dark-mode .install-brand h3 { color: #ECE6D8; }
body.dark-mode .install-brand p,
body.dark-mode .install-hint { color: #A6B2C4; }
body.dark-mode .install-close { background: #1C2635; border-color: #2C3849; color: #ECE6D8; }
body.dark-mode .install-steps { background: #171F2C; border-color: #2C3849; }
body.dark-mode .install-steps li { color: #ECE6D8; }
body.dark-mode .install-steps h4 { color: #DFC07D; }
body.dark-mode .install-dev { background: #171F2C; border-color: #2C3849; }
body.dark-mode .install-dev summary,
body.dark-mode .install-dev li { color: #ECE6D8; }
body.dark-mode .install-dev p { color: #A6B2C4; }
body.dark-mode .install-dev code { background: #1C2635; border-color: #2C3849; color: #DFC07D; }

/* بوابة العضوية في الوضع الليلي */
body.dark-mode .auth-shell { background: #131B28; border-color: #C5A059; }
body.dark-mode .auth-brand h2 { color: #ECE6D8; }
body.dark-mode .auth-brand p { color: #DFC07D; }
body.dark-mode .auth-theme-btn { background: #1C2635; border-color: #2C3849; color: #ECE6D8; }
body.dark-mode .auth-tabs { background: #1C2635; border-color: #2C3849; }
body.dark-mode .auth-tab { color: #A6B2C4; }
body.dark-mode .auth-tab.active { background: #C5A059; color: #12202F; }
body.dark-mode .auth-lead { color: #A6B2C4; }
body.dark-mode .auth-form label { color: #E6E0D2; }
body.dark-mode .auth-form input { background: #1C2635; border-color: #2C3849; color: #ECE6D8; }
body.dark-mode .auth-note { color: #8592A6; }
body.dark-mode .auth-msg-error { background: rgba(185, 28, 28, 0.18); color: #FCA5A5; border-color: rgba(248, 113, 113, 0.4); }
body.dark-mode .theme-toggle-btn { background: #1C2635; border-color: #2C3849; color: #ECE6D8; }
body.dark-mode .account-chip { background: #1C2635; }

@media (max-width: 400px) {
  .account-chip { padding: 0 0.45rem; }
  .auth-shell { padding: 1rem; border-radius: 1.25rem; }
}

/* ============================================================
   تنبيهات الجديد + التأكيد الدوري + تحسينات الوصول
   ============================================================ */
.skip-link {
  position: fixed;
  top: -120px;
  inset-inline-start: 0.75rem;
  z-index: 99999;
  padding: 0.6rem 1rem;
  border-radius: 0 0 0.9rem 0.9rem;
  background: #1B263B;
  color: #DFC07D;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #C5A059;
  transition: top 0.18s ease;
}
.skip-link:focus { top: 0; }

/* حلقة تركيز واضحة لكل عنصر تفاعلي */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid #C5A059;
  outline-offset: 2px;
}
body.dark-mode a:focus-visible,
body.dark-mode button:focus-visible,
body.dark-mode input:focus-visible,
body.dark-mode textarea:focus-visible,
body.dark-mode select:focus-visible,
body.dark-mode [tabindex]:focus-visible {
  outline-color: #DFC07D;
}

/* زر جرس التنبيهات */
.notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #D9CEB4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: 0 0 auto;
  transition: transform 0.15s ease, background 0.15s ease;
}
.notif-btn:active { transform: scale(0.94); }

.notif-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #B91C1C;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #FDFBF7;
  line-height: 1;
}
.notif-badge[hidden] { display: none !important; }

/* بطاقة الحساب في بوابة التأكيد الدوري */
.renew-account-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.9rem;
  background: #F4EEDD;
  border: 1px solid #E3D8BF;
}
.renew-account-box span:first-child {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #1B263B;
  color: #DFC07D;
  font-size: 18px;
  flex: 0 0 auto;
}
.renew-account-box strong {
  display: block;
  font-size: 0.82rem;
  color: #1B263B;
  line-height: 1.5;
}
.renew-account-box small {
  display: block;
  font-size: 0.68rem;
  color: #8C6D2D;
  word-break: break-all;
  margin-top: 0.15rem;
}

.auth-switch-link {
  min-height: 42px;
  border-radius: 0.8rem;
  background: transparent;
  border: 1px dashed #D9CEB4;
  color: #5C677D;
  font-size: 0.72rem;
  font-weight: 700;
}
.auth-switch-link:active { transform: scale(0.98); }

/* قائمة تنبيهات الجديد */
#notifList > button {
  width: 100%;
  text-align: start;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border-radius: 1rem;
  background: #FFFFFF;
  border: 1px solid #D9CEB4;
  min-height: 58px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
#notifList > button:hover { border-color: #C5A059; }
#notifList > button:active { transform: scale(0.985); }

/* الوضع الليلي */
body.dark-mode .notif-btn { background: #1C2635; border-color: #2C3849; color: #ECE6D8; }
body.dark-mode .notif-badge { border-color: #131B28; }
body.dark-mode .renew-account-box { background: #171F2C; border-color: #2C3849; }
body.dark-mode .renew-account-box strong { color: #ECE6D8; }
body.dark-mode .renew-account-box span:first-child { background: #C5A059; color: #12202F; }
body.dark-mode .renew-account-box small { color: #DFC07D; }
body.dark-mode .auth-switch-link { border-color: #2C3849; color: #A6B2C4; }
body.dark-mode #notifList > button { background: #171F2C; border-color: #2C3849; color: #ECE6D8; }
body.dark-mode #notifList > button:hover { border-color: #C5A059; }