/* Quran Fonts */
@font-face {
  font-family: 'Amiri Quran';
  src: url('fonts/AmiriQuran.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LPMQ Isep Misbah';
  src: url('fonts/LPMQ.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Hafalan Qur'an — unified reading-first interface */
:root {
  color-scheme: dark;
  --ui-bg: #151618;
  --ui-bg-soft: #191b1e;
  --ui-surface: #1e2023;
  --ui-surface-raised: #24272b;
  --ui-surface-muted: #292c30;
  --ui-text: #f1eee8;
  --ui-text-soft: #b9b5ad;
  --ui-text-faint: #8e8b85;
  --ui-border: #383b40;
  --ui-border-strong: #50545a;
  --ui-primary: #9fc4df;
  --ui-primary-strong: #c4dff1;
  --ui-primary-ink: #172631;
  --ui-accent: #d7b56d;
  --ui-accent-soft: rgba(215, 181, 109, 0.13);
  --ui-danger: #f2a4a4;
  --ui-success: #9bc7a5;
  --ui-focus: #f3ca72;
  --ui-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  --ui-radius-xl: 24px;
  --ui-radius-lg: 18px;
  --ui-radius-md: 13px;
}

html.ui-theme-light {
  color-scheme: light;
  --ui-bg: #f4f1e9;
  --ui-bg-soft: #ebe7de;
  --ui-surface: #fffdf8;
  --ui-surface-raised: #ffffff;
  --ui-surface-muted: #f0ece3;
  --ui-text: #272622;
  --ui-text-soft: #625f57;
  --ui-text-faint: #817d73;
  --ui-border: #d8d3c8;
  --ui-border-strong: #bbb5a9;
  --ui-primary: #355f7a;
  --ui-primary-strong: #274b62;
  --ui-primary-ink: #ffffff;
  --ui-accent: #8a652b;
  --ui-accent-soft: rgba(138, 101, 43, 0.1);
  --ui-danger: #a13f3f;
  --ui-success: #347148;
  --ui-focus: #9a6518;
  --ui-shadow: 0 16px 42px rgba(47, 44, 37, 0.09);
}

html.ui-theme-sepia {
  color-scheme: light;
  --ui-bg: #e9ddc7;
  --ui-bg-soft: #dfd0b7;
  --ui-surface: #f8efdd;
  --ui-surface-raised: #fff7e8;
  --ui-surface-muted: #eadcc3;
  --ui-text: #3b3128;
  --ui-text-soft: #6e5d4e;
  --ui-text-faint: #8a7561;
  --ui-border: #cdbb9d;
  --ui-border-strong: #aa9270;
  --ui-primary: #76583d;
  --ui-primary-strong: #5e432f;
  --ui-primary-ink: #fffaf0;
  --ui-accent: #876b35;
  --ui-accent-soft: rgba(118, 88, 61, 0.11);
  --ui-danger: #983f38;
  --ui-success: #496d4b;
  --ui-focus: #815b1c;
  --ui-shadow: 0 16px 40px rgba(76, 58, 36, 0.12);
}

html.ui-theme-light body,
html.ui-theme-sepia body,
body {
  margin: 0;
  min-height: 100vh;
  display: block;
  background: var(--ui-bg) !important;
  color: var(--ui-text) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

html {
  scroll-padding-top: 80px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--ui-primary-strong);
  color: var(--ui-primary-ink) !important;
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.app {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--ui-bg) !important;
  box-shadow: none;
}

.site-header {
  position: static;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px 36px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 0;
  background: var(--ui-bg) !important;
}

.brand-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 16px;
  background: #ffffff;
  padding: 5px;
  overflow: hidden;
  box-shadow: var(--ui-shadow);
}

.brand-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.eyebrow,
.section-kicker {
  margin: 0 0 3px;
  color: var(--ui-accent) !important;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ui-text) !important;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-transform: none;
}

.site-header h1 .badge {
  padding: 4px 9px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: var(--ui-surface);
  color: var(--ui-text-soft) !important;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0;
  white-space: nowrap;
}

.site-header .tagline {
  margin: 4px 0 0;
  color: var(--ui-text-soft) !important;
  font-size: 0.84rem;
}

.header-right {
  position: static !important;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-utilities {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: nowrap;
}

.text-size-control,
.theme-control {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
}

.auth-controls {
  display: inline-flex;
  align-items: center;
  border: 0 !important;
  background: transparent !important;
}

.text-size-control {
  gap: 3px;
  padding: 3px;
  flex: 0 0 auto;
  min-width: max-content;
}

.text-size-control button {
  min-width: 32px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-text-soft) !important;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.text-size-control button.active {
  background: var(--ui-primary) !important;
  color: var(--ui-primary-ink, #ffffff) !important;
}

.theme-control {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  width: auto;
  gap: 8px;
  padding: 0 10px;
  color: var(--ui-text-soft) !important;
}

.theme-control select {
  width: 100%;
  flex: 1 1 auto;
  height: 36px;
  padding: 4px 8px 4px 6px;
  border: 0;
  background: transparent;
  color: var(--ui-text) !important;
  font-size: 0.82rem;
  font-weight: 700;
}

#googleLoginBtn {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
  color: var(--ui-text) !important;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
  box-shadow: none;
}

#googleLoginBtn:hover {
  border-color: var(--ui-primary, #10b981);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary, #10b981) 18%, transparent);
}

#openSupportBtn {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
  color: var(--ui-text) !important;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  box-shadow: none;
}

#openSupportBtn:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
}

.support-btn-icon {
  font-size: 1rem;
  line-height: 1;
}

/* User Profile Dropdown */
.user-dropdown-container {
  position: relative;
  display: inline-block;
}

.user-profile-trigger {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 3px 10px 3px 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
  color: var(--ui-text) !important;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
  user-select: none;
}

.user-profile-trigger:hover,
.user-dropdown-container.open .user-profile-trigger {
  border-color: var(--ui-primary, #10b981);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary, #10b981) 18%, transparent);
}

/* Header Reciter Control (Qari Selector) */
.header-reciter-control {
  position: relative;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
  color: var(--ui-text) !important;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
  user-select: none;
}

.header-reciter-control:hover,
.header-reciter-control:focus-within {
  border-color: var(--ui-primary, #10b981);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary, #10b981) 18%, transparent);
}

.header-reciter-control .reciter-icon {
  color: var(--ui-primary, #10b981);
  flex-shrink: 0;
}

.header-reciter-control .custom-select-container {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.header-reciter-control .custom-select-trigger {
  width: 100%;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 650;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-reciter-control select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: var(--ui-text) !important;
  font-size: 0.85rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  width: 100%;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.auth-name {
  max-width: 125px;
  color: var(--ui-text) !important;
  font-size: 0.82rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-arrow {
  flex: 0 0 auto;
  color: var(--ui-text-soft);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-container.open .user-dropdown-arrow {
  transform: rotate(180deg);
  color: var(--ui-primary, #10b981);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  min-width: 210px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--ui-border-strong);
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
  color: var(--ui-text) !important;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
}

.user-dropdown-container.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.user-dropdown-header {
  padding: 6px 10px 8px;
}

.user-dropdown-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ui-text) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-email {
  font-size: 0.78rem;
  color: var(--ui-text-soft) !important;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-divider {
  height: 1px;
  margin: 6px 0;
  background: var(--ui-border-strong, rgba(255, 255, 255, 0.12));
}

.user-dropdown-item {
  width: 100%;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  box-sizing: border-box;
}

.user-dropdown-item.logout-item {
  color: #ef4444 !important;
}

.user-dropdown-item.logout-item:hover {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #f87171 !important;
}

html.ui-theme-light .user-dropdown-menu,
html.theme-light .user-dropdown-menu {
  background: #ffffff !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

html.ui-theme-sepia .user-dropdown-menu,
html.theme-sepia .user-dropdown-menu {
  background: #fbf0d9 !important;
  border-color: #d1c0a5 !important;
  box-shadow: 0 12px 32px rgba(92, 64, 51, 0.15);
}

/* ==================== Custom Select Dropdowns ==================== */
select[data-custom-select-initialized="true"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
}

.custom-select-container {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-select-trigger {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  height: auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: var(--ui-radius-md, 12px);
  border: 1px solid var(--ui-border-strong);
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
  color: var(--ui-text) !important;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
  box-sizing: border-box;
  overflow: hidden;
}

.theme-control .custom-select-container {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
}

.theme-control .custom-select-trigger {
  width: 100%;
  min-height: 36px;
  height: 36px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 4px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-select-trigger:hover,
.custom-select-container.open .custom-select-trigger {
  border-color: var(--ui-primary, #10b981);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary, #10b981) 18%, transparent);
}

.theme-control .custom-select-trigger:hover,
.custom-select-container.open .custom-select-trigger {
  box-shadow: none;
}

.custom-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0%;
  min-width: 0;
  text-align: left;
}

.custom-select-arrow {
  flex: 0 0 auto;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--ui-text-soft);
}

.custom-select-container.open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--ui-primary, #10b981);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--ui-border-strong);
  background: var(--ui-surface-raised, var(--ui-surface)) !important;
  color: var(--ui-text) !important;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
}

.theme-control .custom-select-menu {
  min-width: 145px;
  right: 0;
  left: auto;
}

.custom-select-container.open .custom-select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.custom-select-menu::-webkit-scrollbar {
  width: 6px;
}
.custom-select-menu::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-menu::-webkit-scrollbar-thumb {
  background: var(--ui-border-strong, rgba(255, 255, 255, 0.15));
  border-radius: 4px;
}
.custom-select-menu::-webkit-scrollbar-thumb:hover {
  background: var(--ui-primary, #10b981);
}

.custom-select-option {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ui-text-soft);
  font-size: 0.86rem;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-select-option:hover {
  background: color-mix(in srgb, var(--ui-primary, #10b981) 12%, var(--ui-surface-raised, #1e293b));
  color: var(--ui-text) !important;
}

.custom-select-option.selected {
  background: var(--ui-primary, #10b981) !important;
  color: var(--ui-primary-ink, #ffffff) !important;
  font-weight: 700;
}

/* Day Mode & Sepia Styling for Custom Select */
html.ui-theme-light .custom-select-menu,
html.theme-light .custom-select-menu {
  background: #ffffff !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

html.ui-theme-sepia .custom-select-menu,
html.theme-sepia .custom-select-menu {
  background: #fbf0d9 !important;
  border-color: #d1c0a5 !important;
  box-shadow: 0 12px 32px rgba(92, 64, 51, 0.15);
}

html.ui-theme-light .custom-select-option,
html.theme-light .custom-select-option {
  color: #334155;
}

html.ui-theme-sepia .custom-select-option,
html.theme-sepia .custom-select-option {
  color: #5c4033;
}

html.ui-theme-light .custom-select-option:hover,
html.theme-light .custom-select-option:hover {
  background: #f1f5f9;
  color: #0f172a !important;
}

html.ui-theme-sepia .custom-select-option:hover,
html.theme-sepia .custom-select-option:hover {
  background: #f4e3c1;
  color: #3e2723 !important;
}

html.ui-theme-light .custom-select-option.selected,
html.theme-light .custom-select-option.selected {
  background: #059669 !important;
  color: #ffffff !important;
}

html.ui-theme-sepia .custom-select-option.selected,
html.theme-sepia .custom-select-option.selected {
  background: #8d5b40 !important;
  color: #ffffff !important;
}

.app-nav {
  position: sticky;
  z-index: 50;
  top: 0;
  width: 100%;
  min-height: 58px;
  padding: 8px max(24px, calc((100% - 1368px) / 2));
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--ui-border);
  border-bottom: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-bg) 92%, transparent) !important;
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 40px;
  padding: 8px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent !important;
  color: var(--ui-text-soft) !important;
  font-size: 0.88rem;
  font-weight: 750;
}

.nav-item:hover { background: var(--ui-surface) !important; color: var(--ui-text) !important; }
.nav-item.active {
  background: var(--ui-surface-raised) !important;
  color: var(--ui-primary-strong) !important;
  box-shadow: inset 0 0 0 1px var(--ui-border);
}

.app-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 34px 36px 0;
  display: block;
  flex: 1;
  background: var(--ui-bg) !important;
}

footer {
  position: sticky;
  bottom: 0;
  z-index: 40;
  width: 100%;
  margin: 32px auto 0;
  padding: 14px max(24px, calc((100% - 1368px) / 2));
  border-top: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-bg-soft) 94%, transparent) !important;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ui-text-faint) !important;
  font-size: 0.8rem;
}

.app-view { width: 100%; }

.dashboard-heading,
.view-heading,
.section-heading-row,
.juz-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-heading h2,
.view-heading h2 {
  margin: 0;
  max-width: 760px;
  color: var(--ui-text) !important;
  font-size: clamp(1.75rem, 4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.dashboard-heading > div:first-child > p:last-child,
.view-heading > div > p:last-child {
  margin: 10px 0 0;
  max-width: 700px;
  color: var(--ui-text-soft) !important;
  font-size: 1rem;
}

.active-reciter-summary {
  width: min(330px, 100%);
  padding: 14px 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
}

.active-reciter-summary span,
.active-reciter-summary strong { display: block; }
.active-reciter-summary span { color: var(--ui-text-faint) !important; font-size: 0.72rem; }
.active-reciter-summary strong {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ui-text) !important;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 30px;
}

.stat-card {
  min-height: 126px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

.stat-icon,
.practice-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent) !important;
  font-size: 1.25rem;
}

.stat-label { display: block; color: var(--ui-text-soft) !important; font-size: 0.82rem; font-weight: 700; }
.stat-value { display: block; margin: 2px 0; color: var(--ui-text) !important; font-size: 2rem; line-height: 1; }
.stat-card small { color: var(--ui-text-faint) !important; font-size: 0.76rem; }

.practice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.practice-card {
  position: relative;
  min-height: 280px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-xl);
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  text-align: left;
  box-shadow: var(--ui-shadow);
}

.practice-card:hover {
  transform: translateY(-2px);
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-raised) !important;
}

.practice-number {
  position: absolute;
  top: 18px;
  right: 22px;
  color: var(--ui-text-faint) !important;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.practice-card strong { color: var(--ui-text) !important; font-size: 1.35rem; }
.practice-card > span:not(.practice-number):not(.practice-icon):not(.practice-action) {
  max-width: 520px;
  color: var(--ui-text-soft) !important;
  font-size: 0.9rem;
  font-weight: 500;
}

.practice-action {
  margin-top: 8px;
  color: var(--ui-primary-strong) !important;
  font-size: 0.86rem;
  font-weight: 850;
}

.dashboard-bookmarks {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-xl);
  background: var(--ui-surface);
}

.section-heading-row { align-items: center; }
.section-heading-row h3,
.juz-player-card h3,
.juz-overview-card h3 { margin: 0; color: var(--ui-text) !important; font-size: 1.15rem; }

.text-button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: transparent !important;
  color: var(--ui-text-soft) !important;
  font-size: 0.82rem;
  font-weight: 750;
}

.text-button:hover { border-color: var(--ui-border-strong); color: var(--ui-text) !important; }

.dashboard-empty {
  margin-top: 16px;
  padding: 24px;
  display: grid;
  gap: 4px;
  border: 1px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text-soft) !important;
  text-align: center;
}
.dashboard-empty strong { color: var(--ui-text) !important; }
.dashboard-empty span { color: var(--ui-text-soft) !important; font-size: 0.86rem; }

.dashboard-bookmark-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.dashboard-bookmark-item {
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-bg-soft);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.dashboard-bookmark-open {
  width: 100%;
  min-width: 0;
  min-height: 88px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 10px;
  background: transparent !important;
  color: var(--ui-text) !important;
  text-align: left;
}

.dashboard-bookmark-item:hover,
.dashboard-bookmark-item:focus-within {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-muted);
}

.dashboard-bookmark-copy { min-width: 0; display: grid; gap: 3px; }
.dashboard-bookmark-open strong,
.dashboard-bookmark-open small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-bookmark-open strong { color: var(--ui-text) !important; font-size: 0.98rem; line-height: 1.35; }
.dashboard-bookmark-open small { color: var(--ui-text) !important; font-size: 0.8rem; font-weight: 600; }

.dashboard-bookmark-action {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 50%;
  background: var(--ui-surface-raised, var(--ui-surface));
  color: var(--ui-text-soft) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-bookmark-item:hover .dashboard-bookmark-action,
.dashboard-bookmark-item:focus-within .dashboard-bookmark-action {
  background: var(--ui-primary);
  color: #ffffff !important;
  border-color: var(--ui-primary);
  transform: translateX(3px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-primary) 30%, transparent);
}

/* Per-surah & per-juz workspace layout */
.surah-layout,
.juz-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 48px;
}

.sidebar,
.content {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
}

.sidebar { display: flex; flex-direction: column; gap: 12px; }
.setup-intro { padding: 2px 2px 8px; }
.setup-intro h2 { margin: 0; color: var(--ui-text) !important; font-size: 1.45rem; }
.setup-intro p { margin: 4px 0 0; color: var(--ui-text-soft) !important; font-size: 0.86rem; }

.setup-card,
.verses-header,
.verse-item,
.juz-player-card,
.juz-overview-card {
  border: 1px solid var(--ui-border) !important;
  background: var(--ui-surface) !important;
  box-shadow: var(--ui-shadow) !important;
}

.setup-card {
  padding: 18px;
  border-radius: var(--ui-radius-lg);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.setup-section + .setup-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--ui-border-strong);
}
.step-heading,
.player-card-heading {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ui-text) !important;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}
.step-number {
  display: none !important;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 11px;
  background-color: var(--ui-bg-soft) !important;
  color: var(--ui-text) !important;
  font-size: 0.9rem;
}

select {
  min-height: 50px;
  padding: 10px 58px 10px 14px;
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ui-text-soft) 50%),
    linear-gradient(135deg, var(--ui-text-soft) 50%, transparent 50%) !important;
  background-position:
    calc(100% - 30px) calc(50% - 2px),
    calc(100% - 24px) calc(50% - 2px) !important;
  background-repeat: no-repeat !important;
  background-size: 6px 6px, 6px 6px !important;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

select:hover { border-color: var(--ui-primary) !important; }
select option { background: var(--ui-surface); color: var(--ui-text); }

.input-group small,
.field-label > span { color: var(--ui-text-faint) !important; font-size: 0.8rem; font-weight: 600; }
.selector-grid { gap: 9px; }
.surah-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ui-border);
  color: var(--ui-text-soft) !important;
  font-size: 0.76rem;
}
.surah-meta span { color: inherit !important; }

.preset-chip {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--ui-border-strong) !important;
  background: var(--ui-bg-soft) !important;
  color: var(--ui-text-soft) !important;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 140ms ease;
}
.preset-chip:hover {
  border-color: var(--ui-primary) !important;
  color: var(--ui-primary-strong) !important;
  background: var(--ui-surface-muted) !important;
}

.speed-controls {
  padding: 4px;
  border: 1px solid var(--ui-border) !important;
  border-radius: 11px;
  background: var(--ui-bg-soft) !important;
}
.speed-btn {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--ui-surface-muted) !important;
  color: var(--ui-text) !important;
  box-shadow: none;
}
#speedInput { min-height: 42px; border: 0 !important; background: transparent !important; }

.bookmark-panel { padding: 0; border: 0; background: transparent !important; }
.bookmark-guest,
.bookmark-empty,
.bookmark-status { color: var(--ui-text-soft) !important; font-size: 0.8rem; }
.bookmark-list { max-height: 240px; display: grid; gap: 8px; }
.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--ui-border) !important;
  border-radius: 12px;
  background: var(--ui-bg-soft) !important;
  gap: 12px;
  transition: all 160ms ease;
}
.bookmark-item:hover {
  border-color: var(--ui-border-strong) !important;
  background: var(--ui-surface) !important;
  box-shadow: none !important;
}
.bookmark-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
  text-align: left;
  border: 0 !important;
  background: transparent !important;
  padding: 0;
  cursor: pointer;
}
.bookmark-open strong { color: var(--ui-text) !important; font-size: 0.88rem; font-weight: 750; }
.bookmark-open small {
  color: var(--ui-primary-strong) !important;
  font-size: 0.76rem;
  font-weight: 650;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.bookmark-delete {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--ui-border) !important;
  background: var(--ui-surface) !important;
  color: var(--ui-text-soft) !important;
  cursor: pointer;
  transition: all 160ms ease;
  padding: 0;
  flex-shrink: 0;
}
.bookmark-delete:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ui-danger) 15%, var(--ui-surface)) !important;
  color: var(--ui-danger) !important;
  border-color: color-mix(in srgb, var(--ui-danger) 40%, transparent) !important;
  transform: scale(1.05);
}

button.primary,
button.secondary,
button.danger {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: none !important;
  cursor: pointer;
  transition: all 160ms ease;
}
button.primary {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: #059669 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #10b981 !important;
  box-shadow: none !important;
  filter: none !important;
}
button.primary:active:not(:disabled) {
  transform: translateY(0);
}
button.primary:active:not(:disabled) {
  transform: translateY(0);
}
button.secondary {
  border: 1px solid var(--ui-border-strong) !important;
  background: var(--ui-bg-soft) !important;
  color: var(--ui-text) !important;
}
button.secondary:hover:not(:disabled) {
  border-color: var(--ui-primary) !important;
  background: var(--ui-surface-muted) !important;
  color: var(--ui-primary-strong) !important;
}
button.danger {
  border: 1px solid color-mix(in srgb, var(--ui-danger) 45%, var(--ui-border)) !important;
  background: transparent !important;
  color: var(--ui-danger) !important;
}

.status {
  min-height: 0;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--ui-bg-soft) !important;
  color: var(--ui-text-soft) !important;
  font-size: 0.78rem;
}
.status.error,
.bookmark-status.error { color: var(--ui-danger) !important; }

.content { display: flex; flex-direction: column; gap: 14px; }
.verses-header {
  padding: 20px;
  border-radius: var(--ui-radius-lg);
}
.reader-title h2 { margin: 0; color: var(--ui-text) !important; font-size: 1.3rem; }
#currentSurahTitle { margin-top: 4px; color: var(--ui-primary-strong) !important; font-size: 0.92rem; }
.reader-title p { color: var(--ui-text-soft) !important; }
.reader-tip {
  background: var(--ui-accent-soft) !important;
  color: var(--ui-accent) !important;
}

.verse-list { margin: 0; padding: 0; background: transparent !important; border: 0; box-shadow: none; max-height: none !important; overflow: visible !important; }
.verse-item {
  margin-bottom: 10px;
  padding: 20px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px;
  border-radius: var(--ui-radius-lg);
  scroll-margin-top: 80px;
}
.verse-item:hover { background: var(--ui-surface-raised) !important; }
.verse-item.active {
  border-color: var(--ui-primary) !important;
  background: color-mix(in srgb, var(--ui-primary) 9%, var(--ui-surface)) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-primary) 20%, transparent) !important;
}
.ayah-number {
  width: 40px;
  height: 40px;
  border: 1px solid var(--ui-border-strong) !important;
  background: var(--ui-bg-soft) !important;
  color: var(--ui-text-soft) !important;
}
.verse-arabic {
  font-family: "Amiri Quran", "Scheherazade New", "LPMQ Isep Misbah", serif !important;
  color: var(--ui-text) !important;
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  line-height: 2.3;
  font-feature-settings: "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  text-align: right;
}

/* Word-by-word recited word highlighting */
.quran-word {
  display: inline-block;
  transition: color 0.15s ease, text-shadow 0.15s ease, transform 0.15s ease;
  padding: 0 2px;
  border-radius: 4px;
}

/* Words that have been recited in active verse */
.verse-item.active .quran-word.word-spoken,
.juz-verse-item.active .quran-word.word-spoken {
  color: var(--ui-primary, #10b981) !important;
}

/* Currently active word being recited */
.verse-item.active .quran-word.word-active,
.juz-verse-item.active .quran-word.word-active {
  color: #f59e0b !important;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
  transform: scale(1.06);
  font-weight: 700;
}
.verse-translation { color: var(--ui-text-soft) !important; font-size: 0.96rem; line-height: 1.7; }
.play-chip {
  width: 84px;
  min-width: 84px;
  min-height: 42px;
  justify-content: center;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 10px;
  background: transparent !important;
  color: var(--ui-primary-strong) !important;
  white-space: nowrap;
}

/* Full-juz player */
.view-heading { align-items: flex-end; margin-bottom: 26px; }
.view-heading h2 { font-size: clamp(1.65rem, 3.2vw, 2.6rem); }
.surah-view,
.juz-view {
  padding-bottom: 54px;
}
.juz-player-card,
.juz-overview-card {
  padding: 24px;
  border-radius: var(--ui-radius-xl);
}
.juz-overview-card {
  margin-bottom: 32px;
}
.juz-section-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding-bottom: 16px;
}

/* Juz Surah Group & Verses */
.juz-surah-group {
  margin-bottom: 20px;
  border-radius: var(--ui-radius-lg, 16px);
  border: 1px solid var(--ui-border-strong);
  background: var(--ui-surface-raised, var(--ui-surface));
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.juz-surah-group:last-child {
  margin-bottom: 0;
}

.juz-surah-group.active {
  border-color: var(--ui-primary, #10b981);
  box-shadow: 0 0 0 1px var(--ui-primary, #10b981), 0 8px 24px rgba(16, 185, 129, 0.12);
}

.juz-surah-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ui-surface-muted, rgba(255, 255, 255, 0.03));
  border-bottom: 1px solid var(--ui-border-strong);
}

.juz-surah-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  color: var(--ui-text) !important;
}

.juz-surah-badge {
  font-size: 0.78rem;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ui-surface-raised, rgba(255, 255, 255, 0.08));
  color: var(--ui-primary-strong, #10b981) !important;
  border: 1px solid var(--ui-border-strong);
}

.juz-verse-list {
  display: grid;
  gap: 0;
}

.juz-verse-list .verse-item {
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--ui-border, rgba(255, 255, 255, 0.06));
}

.juz-verse-list .verse-item:last-child {
  border-bottom: 0;
}
.juz-player-card { position: sticky; top: 78px; }
.player-card-heading { display: flex; align-items: flex-start; gap: 11px; }
.player-card-heading h3 { margin: 0; }
.player-card-heading p { margin: 3px 0 0; color: var(--ui-text-soft) !important; font-size: 0.82rem; }
.juz-form-grid { display: grid; gap: 14px; margin-top: 22px; }
.field-label { display: grid; gap: 6px; }
.field-label > span { font-size: 0.76rem; font-weight: 750; }
.juz-player-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.juz-summary { align-items: center; }
.juz-summary h3 { font-size: 1.4rem; }
.juz-summary > strong { color: var(--ui-primary-strong) !important; font-size: 0.9rem; }
.juz-progress {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ui-surface-muted);
}
#fullJuzProgressBar { width: 0; height: 100%; border-radius: inherit; background: var(--ui-primary); transition: width 220ms ease; }
.juz-now-playing {
  margin: 10px 0 18px;
  color: var(--ui-text-soft) !important;
  font-size: 0.82rem;
}
.juz-section-list { display: grid; gap: 7px; }
.juz-section-item {
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--ui-border);
  border-radius: 11px;
  background: var(--ui-bg-soft);
}
.juz-section-item strong { color: var(--ui-text) !important; font-size: 0.86rem; }
.juz-section-item span { color: var(--ui-text-faint) !important; font-size: 0.74rem; }
.juz-section-item.active {
  border-color: var(--ui-primary);
  background: color-mix(in srgb, var(--ui-primary) 9%, var(--ui-bg-soft));
}

footer span { color: inherit !important; }

:where(a, button, select, input, [role="button"]):focus-visible {
  outline: 3px solid var(--ui-focus) !important;
  outline-offset: 3px;
}

button { transition: transform 120ms ease, background 140ms ease, border-color 140ms ease; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.48; cursor: not-allowed; }

@media (max-width: 1040px) {
  .site-header { align-items: flex-start; }
  .header-right { flex-basis: 420px; }
  .dashboard-bookmark-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .surah-layout,
  .juz-layout { grid-template-columns: 310px minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 768px) {
  .site-header { padding: 18px 22px; flex-direction: column; gap: 14px; }
  .header-right {
    width: 100%;
    min-height: 0;
    flex: 0 0 auto;
    justify-content: flex-start;
  }
  .header-utilities { width: 100%; justify-content: flex-start; }
  .app-nav { padding-inline: 18px; }
  .app-main { padding: 28px 22px 48px; }
  .dashboard-heading,
  .view-heading { display: grid; }
  .active-reciter-summary { width: 100%; }
  .surah-layout,
  .juz-layout { grid-template-columns: minmax(0, 1fr); }
  .juz-player-card { position: static; }
}

@media (max-width: 620px) {
  .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
  .site-header h1 { display: block; font-size: 1.35rem; }
  .site-header h1 .badge { width: fit-content; margin-top: 6px; display: block; }
  .header-utilities {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }
  .text-size-control {
    flex: 0 0 auto;
    min-width: max-content;
    justify-content: center;
  }
  .theme-control {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
  }
  .text-size-control { justify-content: center; }
  .theme-control select { width: 100%; }
  #openSupportBtn { flex: 0 0 auto; }
  #authGuest,
  #googleLoginBtn,
  #authUser,
  .user-dropdown-container,
  .user-profile-trigger,
  .header-reciter-control {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .user-profile-trigger {
    justify-content: flex-start;
  }
  .auth-name {
    max-width: none;
    flex: 1;
    text-align: left;
  }
  .user-dropdown-menu {
    width: 100%;
    left: 0;
    right: 0;
  }
  #googleLoginBtn { justify-content: center; }
  .juz-range-grid { grid-template-columns: 1fr !important; }
  .app-nav { justify-content: space-between; gap: 2px; overflow-x: auto; }
  .nav-item { flex: 1 0 auto; padding-inline: 10px; }
  .app-main { padding: 24px 16px 0; }
  .dashboard-heading h2 { font-size: 2rem; }
  .dashboard-stats,
  .practice-grid,
  .dashboard-bookmark-list { grid-template-columns: 1fr; }
  .practice-card { min-height: 245px; }
  .section-heading-row { display: grid; }
  .selector-grid,
  .inputs-row { grid-template-columns: 1fr; }
  .verse-item { grid-template-columns: 38px minmax(0, 1fr); padding: 16px; gap: 12px; }
  .ayah-number { width: 38px; height: 38px; }
  .play-chip { grid-column: 1 / -1; width: 100%; }
  .verses-header { display: block; }
  .reader-tip { max-width: none; margin-top: 12px; }
  .juz-player-actions { grid-template-columns: 1fr; }
  .footer-attribution { display: none !important; }
  footer { display: flex; justify-content: center; text-align: center; padding: 10px 16px; margin-top: 16px; font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Scroll Navigation FABs */
.scroll-fab-group {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.scroll-fab-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--ui-accent, #10b981);
  background: var(--ui-surface-raised, rgba(15, 23, 42, 0.92));
  color: var(--ui-accent, #10b981) !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 0 14px rgba(16, 185, 129, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.scroll-fab-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-fab-btn:hover {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  transform: translateY(-2px) scale(1.05);
}

.scroll-fab-btn:active {
  transform: translateY(0) scale(0.95);
}

/* Day Mode styling */
html.theme-light .scroll-fab-btn {
  background: #ffffff !important;
  color: #059669 !important;
  border-color: rgba(5, 150, 105, 0.35) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(5, 150, 105, 0.2);
}

html.theme-light .scroll-fab-btn:hover {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
}

@media (max-width: 640px) {
  .scroll-fab-group {
    bottom: 20px;
    right: 18px;
    gap: 8px;
  }
  .scroll-fab-btn {
    padding: 9px 14px;
    font-size: 0.82rem;
  }
}

/* Custom Delete Confirmation Modal */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.18s ease-out;
}

.confirm-modal-card {
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border-radius: var(--ui-radius-lg, 16px);
  background: var(--ui-surface, #ffffff) !important;
  border: 1px solid var(--ui-border, #e5e7eb) !important;
  box-shadow: var(--ui-shadow), 0 20px 25px -5px rgba(0, 0, 0, 0.2) !important;
  text-align: center;
  box-sizing: border-box;
  animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fef2f2;
  color: #ef4444;
}

.ui-theme-dark .confirm-modal-icon {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.confirm-modal-title {
  margin: 0 0 8px;
  color: var(--ui-text) !important;
  font-size: 1.12rem;
  font-weight: 750;
}

.confirm-modal-message {
  margin: 0 0 20px;
  color: var(--ui-text-soft) !important;
  font-size: 0.88rem;
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
}

.confirm-modal-actions button {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--ui-radius-md, 10px);
}

button.danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: none !important;
}

button.danger:hover {
  background: #b91c1c !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Support Developer Modal */
.support-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modalFadeIn 0.2s ease-out;
}

.support-modal-card {
  position: relative;
  width: min(510px, 92vw);
  max-width: 510px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--ui-radius-lg, 18px);
  background: var(--ui-surface, #ffffff) !important;
  border: 1px solid var(--ui-border-strong, #e5e7eb) !important;
  box-shadow: var(--ui-shadow), 0 25px 50px -12px rgba(0, 0, 0, 0.35) !important;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.support-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 24px 14px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.support-modal-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 12px 24px 16px;
  background: var(--ui-surface, #ffffff);
  border-top: 1px solid var(--ui-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.support-modal-title {
  margin: 0 0 10px;
  color: var(--ui-text) !important;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.35;
}

.support-modal-desc {
  margin: 0 0 12px;
  color: var(--ui-text-soft) !important;
  font-size: 0.88rem;
  line-height: 1.55;
}

.support-qris-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.support-qris-img {
  width: 100%;
  max-width: 175px;
  height: auto;
  border-radius: 6px;
  display: block;
}

.support-qris-merchant {
  margin-top: 10px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.02em;
}

.support-qris-nmid {
  font-size: 0.76rem;
  color: #4b5563;
  margin-top: 2px;
  font-family: monospace;
  font-weight: 600;
}

.support-qris-note {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
}

.support-qris-download-btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #1f2937;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid #d1d5db;
  transition: all 0.15s ease;
}

.support-qris-download-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.support-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0 12px;
  color: var(--ui-text-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.support-divider::before,
.support-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--ui-border);
}

.support-divider span {
  padding: 0 10px;
}

.support-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}

.support-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.support-social-link:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.support-social-link.yt {
  background: #dc2626;
  color: #ffffff;
}

.support-social-link.tt {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ui-theme-light .support-social-link.tt {
  background: #111827;
}

.support-skip-btn {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ui-primary, #10b981) !important;
  color: #ffffff !important;
  border: none !important;
  font-size: 0.92rem;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--ui-primary, #10b981) 30%, transparent);
}

.support-skip-btn:hover {
  background: var(--ui-primary-strong, #059669) !important;
  transform: translateY(-1px);
}

.support-footer-blessing {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--ui-text-soft);
  line-height: 1.45;
}


