:root {
  --page-left-inset: 18px;
  --bg-page: #ebe6d7;
  --bg-panel: #f5f2ea;
  --bg-card: #fff;
  --bg-chip: rgba(15, 20, 18, 0.04);
  --text-main: #0f1412;
  --text-secondary: rgba(15, 20, 18, 0.55);
  --text-muted: rgba(15, 20, 18, 0.45);
  --border: rgba(15, 20, 18, 0.06);
  --accent: #0f3d2e;
  --accent-bright: #83f5c6;
  --accent-soft: rgba(15, 61, 46, 0.08);
  --accent-warm: #b85c2c;
  --accent-gold: #f5b544;
  --accent-danger: #d4384a;
  --serif: 'Instrument Serif', georgia, serif;
  --mono: 'Geist Mono', ui-monospace, sfmono-regular, menlo, monospace;
  --shadow-soft: 0 1px 0 rgba(15, 20, 18, 0.03), 0 6px 18px rgba(15, 20, 18, 0.05);
  --shadow-lift: 0 1px 0 rgba(15, 20, 18, 0.04), 0 4px 18px rgba(15, 20, 18, 0.06);
  --radius-xl: 22px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --homepage-stack-gap: 18px;
  --for-you-heading-gap: 0;
  --widget-card-body-padding: 12px 14px 14px;
  --search-section-padding-y: 6px;
  --search-section-padding-top: 0;
  --safe-area-inset-top: env(safe-area-inset-top, 0);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family:
    'Inter',
    'Noto Sans Arabic',
    'Geeza Pro',
    Tahoma,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  color: var(--text-main);
  background: transparent;
  overflow-x: hidden;
  font-weight: 430;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: none;
}

html[dir='rtl'] body {
  text-align: right;
}

body[data-language='ar'] {
  font-family:
    'Inter',
    'Noto Sans Arabic',
    'Geeza Pro',
    Tahoma,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
}

* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

button,
a,
[role='button'],
.autocomplete-item,
.dropdown-item,
.favorite-item,
.dailystar-rss-card {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.background {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  z-index: -2;
}

.background-overlay {
  position: absolute;
  inset: 0;
  background: none;
}

.build-stamp {
  position: fixed;
  right: max(10px, env(safe-area-inset-right, 0));
  bottom: calc(10px + var(--safe-area-inset-bottom));
  z-index: 5;
  max-width: min(72vw, 280px);
  padding: 6px 9px;
  border-radius: 999px;
  background: rgb(249 249 251 / 88%);
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-align: right;
  box-shadow: 0 8px 24px rgb(27 36 54 / 8%);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.app-container {
  width: min(430px, 100% - 10px);
  margin: 8px auto calc(14px + var(--safe-area-inset-bottom));
  padding: calc(var(--safe-area-inset-top) + 14px) 14px 20px;
  border-radius: 0;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: var(--homepage-stack-gap);
}

.top-stack {
  display: flex;
  flex-direction: column;
  gap: var(--homepage-stack-gap);
}

.home-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 2px;
}

.home-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #0f3d2e;
  color: #83f5c6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.theme-dark .home-logo-icon {
  background: #83f5c6;
  color: #0f3d2e;
}

.home-logo-name {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1;
  color: var(--text-main);
}

.home-title-actions {
  display: flex;
  gap: 5px;
}

.home-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 8px rgba(15, 61, 46, 0.08);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}

.home-icon-btn:hover,
.home-icon-btn:active {
  opacity: 0.8;
}

body.theme-dark .home-icon-btn {
  border-color: rgba(245, 242, 234, 0.1);
  background: rgba(20, 28, 25, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f5f2ea;
}

.surface-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: visible;
  isolation: isolate;
  box-shadow: var(--shadow-soft);
}

.surface-card > [id^='widget-'] {
  padding: 12px 14px;
}

.content-stack > .surface-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.content-stack > .surface-card > [id^='widget-'] {
  padding: 0;
}

#section-protection > [id^='widget-'] {
  padding: 0;
}

#section-protection {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.quick-links-surface {
  padding: 12px 14px;
}

.quick-links-surface > [id^='widget-'] {
  padding-left: 0;
  padding-right: 0;
}

.for-you-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  margin-top: var(--for-you-heading-gap);
  margin-bottom: 0;
}

.for-you-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 5vw, 1.9rem);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.for-you-customize {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 540;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: var(--homepage-stack-gap);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-header h2 {
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.section-header .section-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}

.protection-section {
  margin: 0;
}

.protection-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.protection-pill-view {
  display: flex;
  align-items: center;
  gap: 12px;
}

.protection-panel-view {
  display: none;
}

body.layout-glass .protection-pill-view {
  display: none;
}

body.layout-glass .protection-panel-view {
  display: block;
}

.protection-panel-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 10px;
}

.protection-panel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2d9a6f;
  box-shadow: 0 0 8px #2d9a6f;
  flex-shrink: 0;
}

.protection-panel-stats {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.protection-panel-stat {
  flex: 1;
  min-width: 0;
}

.protection-panel-stat-big {
  flex: 1.6;
}

.protection-panel-value {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.protection-panel-stat-big .protection-panel-value {
  font-size: 34px;
}

.protection-panel-stat-ads .protection-panel-value {
  color: var(--accent-warm);
}

.protection-panel-stat-scams .protection-panel-value {
  color: var(--accent-danger);
}

.protection-panel-label-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 5px;
}

.protection-panel-divider {
  width: 1px;
  background: rgb(15 61 46 / 12%);
}

body.layout-glass.theme-dark .protection-panel-divider {
  background: rgb(245 242 234 / 12%);
}

body.layout-glass.theme-dark .protection-panel-value {
  color: var(--accent-bright);
}

body.layout-glass.theme-dark .protection-panel-stat-ads .protection-panel-value {
  color: var(--accent-gold);
}

.protection-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  flex-shrink: 0;
  box-shadow: none;
}

.protection-icon svg {
  width: 20px;
  height: 20px;
}

.protection-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.protection-status {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: nowrap;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--accent);
  white-space: nowrap;
}

.protection-subtitle {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-secondary);
  opacity: 0.65;
  white-space: nowrap;
}

.protection-counters {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 11px;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 100px;
  background: rgba(15, 20, 18, 0.04);
  white-space: nowrap;
}

.counter:last-child {
  background: rgba(212, 56, 74, 0.08);
  color: var(--accent-danger);
  font-weight: 600;
}

.counter-value {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: inherit;
  line-height: 1;
}

.counter-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: inherit;
  opacity: 0.7;
}

.favorites-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.favorites-tabs {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}

.favorites-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 8px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.favorites-tab svg {
  width: 14px;
  height: 14px;
}

.favorites-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.favorites-edit-btn {
  display: none;
}

.favorites-grid {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  padding: 0 var(--page-left-inset) 0 max(var(--page-left-inset), calc(50vw - 201px));
  scrollbar-width: none;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
  direction: ltr;
}

.favorites-grid::-webkit-scrollbar {
  display: none;
}

.favorites-grid.is-switching {
  opacity: 0;
  transform: translateX(-50%) translateY(6px) scale(0.985);
}

.favorites-grid.is-entering {
  animation: favoritesEnter 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes favoritesEnter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.favorite-item {
  flex: 0 0 auto;
  text-decoration: none;
}

.favorite-icon,
.favorite-add-tile {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
  overflow: hidden;
}

.favorite-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.favorite-name {
  display: block;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.01em;
  text-align: center;
  margin-top: 8px;
}

.favorite-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.favorite-add-tile {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  background: transparent;
  border: 1.5px dashed rgba(15, 20, 18, 0.25);
  box-shadow: none;
  color: rgba(15, 20, 18, 0.45);
  opacity: 0.6;
}

.favorite-add-tile svg {
  width: 20px;
  height: 20px;
}

.favorites-empty {
  width: 100%;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.search-section {
  position: relative;
  z-index: 260;
  padding: var(--search-section-padding-top, 0) 0 var(--search-section-padding-y);
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-lift);
  padding: 14px 18px;
}

.search-engine-btn,
.voice-search-btn {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  cursor: pointer;
}

.search-engine-btn svg {
  width: 20px;
  height: 20px;
}

.voice-search-btn svg {
  width: 19px;
  height: 19px;
}

.qr-scan-btn {
  margin-left: 4px;
}

.qr-scan-btn.is-scanning {
  opacity: 1;
  color: var(--accent-primary, #0f3d2e);
  animation: qr-scan-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes qr-scan-pulse {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  font-weight: 430;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.deen-ai-section {
  padding: 0;
}

.deen-ai-header {
  margin-bottom: 12px;
}

.deen-ai-title-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.deen-ai-sparkle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-bright, #83f5c6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.deen-ai-sparkle svg {
  width: 14px;
  height: 14px;
}

.deen-ai-header h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text-main);
}

.deen-ai-beta {
  font-family: var(--mono, 'Geist Mono'), monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(242, 140, 40, 0.14);
  color: #d97a1e;
  line-height: 1;
}

.deen-ai-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: inherit;
}

.deen-ai-launcher-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--border);
  outline: none;
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 0 14px;
  cursor: text;
  box-shadow: var(--shadow-lift);
}

.deen-ai-launcher-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.deen-ai-launcher-send {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: var(--bg-panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  box-shadow: none;
}

.deen-ai-launcher-send svg {
  width: 18px;
  height: 18px;
}

.deen-ai-launcher-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.deen-ai-launcher-example {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  flex: 1;
}

.deen-ai-launcher-hint {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(202, 207, 219, 0.72);
  color: #71798b;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.autocomplete-dropdown {
  position: fixed;
  left: 0;
  top: 0;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 340;
}

@media (max-width: 767px) {
  body.search-focus-mode {
    overflow: hidden;
  }

  body.search-focus-mode .app-container {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    gap: 0;
    background: transparent;
  }

  body.search-focus-mode .top-stack,
  body.search-focus-mode .for-you-header,
  body.search-focus-mode .content-stack,
  body.search-focus-mode .scroll-to-top,
  body.search-focus-mode .build-stamp {
    display: none !important;
  }

  body.search-focus-mode #section-search {
    position: fixed;
    inset: 0 0 auto;
    z-index: 360;
    padding: calc(var(--safe-area-inset-top) + var(--search-section-padding-y)) 9px
      var(--search-section-padding-y);
    background: var(--bg-panel);
  }

  body.search-focus-mode #section-search .search-section {
    padding: 0;
  }
}

.search-engine-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  z-index: 280;
}

.autocomplete-section {
  border-bottom: 1px solid #eef0f5;
}

.autocomplete-section:last-child {
  border-bottom: 0;
}

.autocomplete-item,
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}

html[dir='rtl'] .autocomplete-item,
html[dir='rtl'] .dropdown-item {
  text-align: right;
}

.autocomplete-item.selected,
.dropdown-item.active {
  background: var(--accent-soft);
}

.autocomplete-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f3f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.autocomplete-icon img {
  width: 18px;
  height: 18px;
}

.autocomplete-text {
  font-size: 14px;
  color: var(--text-main);
}

.autocomplete-text mark {
  background: transparent;
  color: var(--accent);
  font-weight: 640;
}

.autocomplete-subtitle,
.autocomplete-entity-description {
  font-size: 12px;
  color: var(--text-secondary);
}

.autocomplete-content {
  flex: 1;
  min-width: 0;
}

.autocomplete-entity-image {
  width: 60px;
  max-width: 60px;
  height: 60px;
  max-height: 60px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.autocomplete-entity-image img {
  width: 100%;
  max-width: 60px;
  height: 100%;
  max-height: 60px;
  object-fit: cover;
  display: block;
}

.autocomplete-entity-title {
  font-size: 14px;
  font-weight: 560;
}

.autocomplete-action {
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.dailystar-rss-section,
.kahf-ad-section,
.youtube-feed-section,
.mahfil-horizontal-feed-section,
.mahfil-feed-section {
  padding: 8px 10px;
}

.kahf-ad-section {
  padding-left: 0;
  padding-right: 0;
}

.islamic-carousel-section {
  padding: 10px;
}

.islamic-carousel-wrapper {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
}

.islamic-carousel-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow: auto hidden;
  padding: 0 12px 28px 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  direction: ltr;
}

.islamic-carousel-track.dragging {
  cursor: grabbing;
}

.islamic-widget-card {
  flex: 0 0 240px;
  border-radius: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 220ms ease;
}

.islamic-widget-card:hover {
  box-shadow: 0 8px 16px rgba(24, 28, 46, 0.1);
}

.islamic-widget-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--icon-color) 20%, white);
  color: var(--icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.islamic-widget-icon svg {
  width: 20px;
  height: 20px;
}

.islamic-widget-text h3 {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.islamic-widget-text p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary);
  opacity: 0.65;
}

.dailystar-rss-carousel-wrapper {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
}

.dailystar-rss-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 var(--page-left-inset) 20px var(--page-left-inset);
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  direction: ltr;
}

.dailystar-rss-carousel::-webkit-scrollbar {
  display: none;
}

.dailystar-rss-carousel.dragging {
  cursor: grabbing;
}

.dailystar-rss-card {
  flex: 0 0 280px;
  color: inherit;
  text-decoration: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.dailystar-rss-card-content {
  border-radius: 18px;
  background: var(--bg-card);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.dailystar-rss-card:hover .dailystar-rss-card-content {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(24, 28, 46, 0.11);
}

.dailystar-rss-card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.dailystar-rss-card-text {
  padding: var(--widget-card-body-padding);
}

.dailystar-rss-card-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dailystar-rss-card-description,
.dailystar-rss-card-time {
  display: none;
}

.carousel-scroll-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-main);
  box-shadow: 0 10px 24px rgba(24, 28, 46, 0.18);
  transform: translateY(-50%);
  cursor: pointer;
}

.carousel-scroll-btn:hover {
  background: #fff;
}

.carousel-scroll-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.carousel-scroll-btn svg {
  width: 18px;
  height: 18px;
}

.dailystar-rss-loader,
.mahfil-feed-loader {
  display: flex;
  justify-content: center;
  padding: 16px;
}

.mahfil-feed-loader.is-idle {
  padding: 0;
  min-height: 32px;
  opacity: 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(15, 61, 46, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.kahf-ad-container {
  width: 100%;
  min-height: 140px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.mahfil-feed-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mahfil-horizontal-feed-carousel-wrapper {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
}

.wafilife-books-section {
  padding: 6px;
}

.wafilife-books-carousel-wrapper {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
}

.youtube-feed-carousel-wrapper {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
}

.youtube-feed-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 var(--page-left-inset) 20px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  direction: ltr;
}

.youtube-feed-loader.mahfil-feed-loader.is-idle {
  display: none;
  min-height: 0;
}

#mahfilFeedLoader.mahfil-feed-loader.is-idle,
#mahfilHorizontalFeedLoader.mahfil-feed-loader.is-idle,
.wafilife-books-loader.mahfil-feed-loader.is-idle {
  display: none;
  min-height: 0;
}

.youtube-feed-container.dragging {
  cursor: grabbing;
}

.youtube-video-card {
  flex: 0 0 280px;
  height: auto;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-user-drag: none;
  user-drag: none;
}

.youtube-video-content {
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.youtube-video-card:hover .youtube-video-content {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(24, 28, 46, 0.11);
}

.youtube-video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
}

.youtube-video-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.youtube-video-play-btn {
  display: none !important;
}

.youtube-video-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
}

.youtube-video-text {
  flex: 1;
  padding: var(--widget-card-body-padding);
}

.youtube-video-title {
  font-size: 14px;
  line-height: 1.16;
  font-weight: 570;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.youtube-video-date {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.mahfil-horizontal-feed-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 var(--page-left-inset) 20px var(--page-left-inset);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  direction: ltr;
}

.mahfil-horizontal-feed-container.dragging {
  cursor: grabbing;
}

.mahfil-horizontal-video-card {
  flex: 0 0 280px;
  text-decoration: none;
  color: inherit;
  -webkit-user-drag: none;
  user-drag: none;
}

.mahfil-horizontal-video-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.mahfil-horizontal-video-card:hover .mahfil-horizontal-video-content {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(24, 28, 46, 0.11);
}

.wafilife-books-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 var(--page-left-inset) 20px var(--page-left-inset);
  direction: ltr;
}

.wafilife-book-card {
  flex: 0 0 180px;
  text-decoration: none;
  color: inherit;
}

.wafilife-book-card-inner {
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.wafilife-book-card:hover .wafilife-book-card-inner {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(24, 28, 46, 0.11);
}

.wafilife-book-cover-wrap {
  position: relative;
  height: 189px;
  overflow: hidden;
  background: linear-gradient(180deg, #f6efe4 0%, #efe3d0 100%);
}

.wafilife-book-cover {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.wafilife-book-cover-fallback {
  background:
    linear-gradient(135deg, rgba(182, 139, 76, 0.18), rgba(126, 85, 33, 0.1)),
    linear-gradient(180deg, #f8f1e8, #eadcc5);
}

.wafilife-book-discount {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(130, 60, 24, 0.92);
  color: #fff8f1;
  font-size: 10px;
  font-weight: 600;
}

.wafilife-book-content {
  padding: 8px 10px 10px;
}

.wafilife-book-title {
  min-height: 2em;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 650;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wafilife-book-author {
  min-height: 1rem;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wafilife-book-author-empty {
  visibility: hidden;
}

.wafilife-book-price-row {
  display: flex;
  gap: 4px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 4px;
}

.wafilife-book-price {
  font-size: 13px;
  font-weight: 700;
  color: #8c3b14;
}

.wafilife-book-original-price {
  font-size: 12px;
  color: var(--text-secondary);
}

.mahfil-horizontal-video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
}

.mahfil-horizontal-video-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.mahfil-horizontal-video-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
}

.mahfil-horizontal-video-text {
  padding: var(--widget-card-body-padding);
}

.mahfil-horizontal-video-title {
  font-size: 14px;
  line-height: 1.16;
  font-weight: 570;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mahfil-horizontal-video-meta {
  display: none;
}

.mahfil-video-item {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.mahfil-video-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(24, 28, 46, 0.1);
}

.mahfil-video-thumbnail-wrapper {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #111;
}

.mahfil-video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mahfil-video-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
}

.mahfil-video-play-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #1c2238;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mahfil-video-info {
  padding: var(--widget-card-body-padding);
}

.mahfil-video-title {
  font-size: 11px;
  line-height: 1.25;
  font-weight: 560;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mahfil-video-meta {
  margin-top: 4px;
  display: flex;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 9px;
}

.mahfil-feed-error,
.dailystar-rss-error {
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.top-stack,
.search-section,
.for-you-header,
.surface-card,
.mahfil-feed-section {
  animation: pageFadeIn 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.search-section {
  animation-delay: 40ms;
}

.for-you-header {
  animation-delay: 70ms;
}

.content-stack .surface-card:nth-child(1) {
  animation-delay: 110ms;
}

.content-stack .surface-card:nth-child(2) {
  animation-delay: 150ms;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-to-top {
  position: fixed;
  right: 22px;
  bottom: calc(18px + var(--safe-area-inset-bottom));
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  z-index: 50;
}

html[dir='rtl'] .scroll-to-top {
  right: auto;
  left: 22px;
}

.scroll-to-top.visible {
  display: inline-flex;
}

.scroll-to-top svg {
  width: 22px;
  height: 22px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: flex-end;
}

.customize-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.customize-modal .modal-backdrop {
  opacity: 0;
  transition: opacity 220ms ease;
}

.customize-modal .customize-content {
  transform: translateY(18px) scale(0.985);
  opacity: 0;
  transition:
    transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 220ms ease;
}

.customize-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.customize-modal.is-open .modal-backdrop {
  opacity: 1;
}

.customize-modal.is-open .customize-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 26, 0.5);
}

.modal-content {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 20px;
}

.modal-content h3 {
  font-size: 20px;
  margin-bottom: 14px;
}

html[dir='rtl'] .modal-content,
html[dir='rtl'] .customize-content,
html[dir='rtl'] .favorites-empty,
html[dir='rtl'] .dailystar-rss-error,
html[dir='rtl'] .mahfil-feed-error {
  text-align: right;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  font-size: 13px;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-family: inherit;
}

html[dir='rtl'] .form-group input,
html[dir='rtl'] .search-input,
html[dir='rtl'] .deen-ai-launcher-input {
  text-align: right;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

html[dir='rtl'] .form-actions {
  flex-direction: row-reverse;
}

.btn-cancel,
.btn-primary {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 620;
}

.btn-cancel {
  background: #eff1f6;
  color: var(--text-main);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.context-menu {
  position: fixed;
  min-width: 148px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  z-index: 240;
}

.context-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: var(--text-main);
}

html[dir='rtl'] .context-menu-item {
  text-align: right;
}

html[dir='rtl'] .dailystar-rss-card-text,
html[dir='rtl'] .youtube-video-text,
html[dir='rtl'] .mahfil-horizontal-video-text,
html[dir='rtl'] .mahfil-video-info,
html[dir='rtl'] .islamic-widget-text,
html[dir='rtl'] .section-header,
html[dir='rtl'] .customize-row,
html[dir='rtl'] .customize-text {
  text-align: right;
}

html[dir='rtl'] .deen-ai-launcher-send svg {
  transform: scaleX(-1);
}

.context-menu-item.delete {
  color: #d7263d;
}

@media (max-width: 840px) {
  .app-container {
    width: min(410px, 100% - 8px);
    border-radius: 0;
    margin-left: auto;
    margin-right: auto;
  }

  .app-container {
    margin-top: 6px;
    padding-top: calc(var(--safe-area-inset-top) + 8px);
  }

  .protection-status {
    font-size: clamp(18px, 5vw, 24px);
  }

  .counter-value {
    font-size: clamp(16px, 5vw, 20px);
  }

  .favorites-tab {
    font-size: clamp(12px, 3.2vw, 13px);
  }

  .section-header h2 {
    font-size: clamp(14px, 4.3vw, 16px);
  }

  .mahfil-feed-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --page-left-inset: 9px;
  }

  .app-container {
    width: calc(100% - 6px);
  }

  .app-container {
    margin-top: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

.homepage-section-hidden {
  display: none !important;
}

.islamic-widget-section {
  padding: 10px;
}

.islamic-widget-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.islamic-widget-standalone {
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: box-shadow 220ms ease;
}

.islamic-widget-standalone:hover {
  box-shadow: 0 8px 16px rgba(24, 28, 46, 0.1);
}

.customize-content {
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-card);
  color: var(--text-main);
}

.customize-group {
  background: rgba(255, 255, 255, 0.42);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 12px;
}

.customize-group h4 {
  font-size: 12px;
  font-weight: 620;
  margin-bottom: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.customize-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.customize-row + .customize-row {
  border-top: 1px solid rgba(136, 144, 168, 0.15);
}

.customize-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.customize-label {
  font-size: 13px;
  font-weight: 560;
  color: var(--text-main);
}

.customize-subtext {
  font-size: 11px;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c7cede;
  transition: background 180ms ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease;
}

.switch input:checked + .switch-slider {
  background: var(--accent);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

body.theme-dark {
  --bg-page: #0b0e0d;
  --bg-panel: #0b0e0d;
  --bg-card: #1a211e;
  --bg-chip: rgba(245, 242, 234, 0.06);
  --text-main: #f5f2ea;
  --text-secondary: rgba(245, 242, 234, 0.55);
  --text-muted: rgba(245, 242, 234, 0.45);
  --border: rgba(245, 242, 234, 0.08);
  --accent: #83f5c6;
  --accent-soft: rgba(131, 245, 198, 0.14);
  --shadow-soft: none;
  --shadow-lift: none;
}

body.theme-dark .surface-card,
body.theme-dark .search-container,
body.theme-dark .favorite-add-tile,
body.theme-dark .dailystar-rss-card-content,
body.theme-dark .youtube-video-content,
body.theme-dark .mahfil-horizontal-video-content,
body.theme-dark .mahfil-video-item,
body.theme-dark .islamic-widget-standalone,
body.theme-dark .modal-content,
body.theme-dark .context-menu,
body.theme-dark .customize-group,
body.theme-dark .protection-card,
body.theme-dark .kahf-ad-container,
body.theme-dark .islamic-widget-card,
body.theme-dark .deen-ai-launcher-input {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border);
}

body.theme-dark .surface-card {
  box-shadow: none;
}

body.theme-dark .favorite-add-tile {
  border-color: var(--border);
}

body.theme-dark .protection-icon {
  background: rgba(131, 245, 198, 0.14);
  color: var(--accent-bright);
}

body.theme-dark .protection-status {
  color: var(--accent-bright);
}

body.theme-dark .counter:last-child {
  background: rgba(212, 56, 74, 0.12);
  color: var(--accent-danger);
}

body.theme-dark .search-input,
body.theme-dark .search-input::placeholder,
body.theme-dark .for-you-customize,
body.theme-dark .section-header .section-link,
body.theme-dark .counter-label,
body.theme-dark .protection-subtitle,
body.theme-dark .mahfil-video-meta,
body.theme-dark .islamic-widget-text p,
body.theme-dark .deen-ai-launcher-example {
  color: var(--text-secondary);
}

body.theme-dark .deen-ai-launcher {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.theme-dark .deen-ai-launcher-input {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-main);
  box-shadow: none;
}

body.theme-dark .deen-ai-launcher-send {
  background: #1a3830;
  color: var(--accent-bright);
  box-shadow: none;
}

body.theme-dark .deen-ai-launcher-hint {
  background: rgba(37, 43, 54, 0.92);
  border-color: rgba(79, 87, 106, 0.7);
  color: #adb6ca;
}

/* Islamic horizontal tall cards override */
.islamic-widget-section {
  --islamic-carousel-max-height: 190px;

  padding: 4px 0;
}

.islamic-carousel-wrapper {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-height: calc(var(--islamic-carousel-max-height) + 30px);
}

.islamic-carousel-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow: auto hidden;
  padding: 2px max(var(--page-left-inset), calc(50vw - 201px)) 28px;
  max-height: calc(var(--islamic-carousel-max-height) + 10px);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.islamic-carousel-track.dragging {
  cursor: grabbing;
}

.islamic-widget-tall {
  flex: 0 0 auto;
  width: 210px;
  height: 190px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 20px rgba(20, 40, 30, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-decoration: none;
  color: var(--text-main);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow 220ms ease;
}

.islamic-widget-tall:hover {
  box-shadow:
    0 8px 24px rgba(20, 40, 30, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.islamic-widget-featured {
  position: relative;
  overflow: hidden;
}

.islamic-widget-featured::before {
  content: none;
}

.islamic-widget-featured::after {
  content: none;
}

.islamic-widget-featured > * {
  position: relative;
  z-index: 1;
}

.islamic-widget-featured .islamic-widget-icon {
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.islamic-widget-featured .islamic-widget-text h3,
.islamic-widget-featured .islamic-widget-text p {
  color: var(--text-main);
  text-shadow: none;
}

.islamic-widget-featured .islamic-widget-text p {
  color: var(--text-secondary);
}

.islamic-widget-quran {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.18)),
    rgba(176, 140, 60, 0.18);
}

.islamic-widget-hadith {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.18)),
    rgba(63, 122, 240, 0.16);
}

.islamic-widget-tall .islamic-widget-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.islamic-widget-tall .islamic-widget-text h3 {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.islamic-widget-tall .islamic-widget-text p {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
  margin-top: 4px;
  opacity: 0.6;
}

.switch input:disabled + .switch-slider {
  background: #b9bfd0;
  opacity: 0.7;
}

.switch input:disabled + .switch-slider::before {
  box-shadow: none;
}

@media (max-width: 840px) {
  .islamic-widget-tall {
    width: 210px;
    height: 190px;
  }
}

body.theme-dark .islamic-widget-tall:not(.islamic-widget-prayer) {
  background: #2b3141;
  color: var(--text-main);
}

/* Prayer widget — tinted-glass */
.islamic-widget-prayer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.15)),
    rgba(46, 139, 127, 0.22);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  position: relative;
}

.islamic-widget-prayer::before {
  content: none;
}

.islamic-widget-prayer::after {
  content: none;
}

.islamic-widget-prayer[data-prayer='Maghrib'] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.15)),
    rgba(184, 92, 74, 0.2);
}

.islamic-widget-prayer[data-prayer='Isha'],
.islamic-widget-prayer[data-prayer='Dawn'] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.15)),
    rgba(107, 74, 138, 0.18);
}

.islamic-widget-prayer .prayer-gold-label {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.islamic-widget-prayer .prayer-gold-bar {
  display: none;
}

.islamic-widget-prayer .prayer-name-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #0d3b33;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.islamic-widget-prayer .prayer-name-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8a84b;
  box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.25);
}

.islamic-widget-prayer .prayer-contextual-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  opacity: 0.35;
  color: #0d3b33;
  z-index: 1;
  pointer-events: none;
}

.islamic-widget-prayer .islamic-widget-text {
  position: relative;
  z-index: 1;
  width: 100%;
}

.islamic-widget-prayer .islamic-widget-text h3 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #0d3b33;
}

.islamic-widget-prayer .islamic-widget-text p {
  font-size: 12px;
  margin-top: 4px;
  color: rgba(13, 59, 51, 0.7);
}

.widget-prayer-waqt {
  margin-top: 10px;
  width: 100%;
}

.widget-prayer-waqt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.widget-prayer-waqt-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(13, 59, 51, 0.55);
}

.widget-prayer-waqt-time {
  font-size: 11px;
  font-weight: 700;
  color: #0d3b33;
  font-variant-numeric: tabular-nums;
}

.widget-prayer-waqt-track {
  height: 3px;
  background: rgba(13, 59, 51, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.widget-prayer-waqt-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c8a84b, #e8c86a);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(200, 168, 75, 0.5);
  transition: width 1000ms linear;
}

.islamic-widget-prayer.waqt-active .widget-prayer-waqt-fill {
  animation: widgetGoldShimmer 2s ease-in-out infinite;
}

@keyframes widgetGoldShimmer {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.65;
  }
}

/* Match customize sheet width to app container */
.customize-modal .customize-content {
  width: min(430px, 100% - 18px);
  margin: 0 auto;
}

@media (max-width: 840px) {
  .customize-modal .customize-content {
    width: min(410px, 100% - 14px);
  }
}

@media (max-width: 480px) {
  .customize-modal .customize-content {
    width: calc(100% - 12px);
  }
}

.islamic-widget-dua {
  position: relative;
  overflow: hidden;
  padding: 0;
  width: 210px;
  justify-content: stretch;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.18)),
    rgba(123, 93, 246, 0.16);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.islamic-widget-dua::after {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 70px;
  height: 70px;
  pointer-events: none;
  opacity: 0.3;
  background: radial-gradient(circle, rgba(123, 93, 246, 0.35), transparent 65%);
}

.islamic-widget-dua .islamic-widget-dua-preview {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
}

.islamic-widget-dua #duaPreviewArabic {
  margin: 0;
  padding: 10px 12px 6px;
  align-self: end;
  color: #2a1f5a;
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  font-size: 13pt;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.islamic-widget-dua-translation {
  margin: 0;
  padding: 6px 12px 10px;
  align-self: start;
  color: rgba(42, 31, 90, 0.72);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.islamic-widget-dua .islamic-widget-dua-label {
  display: none;
}

.dua-read-more {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: rgba(42, 31, 90, 0.55);
  letter-spacing: 0.03em;
  z-index: 2;
}

.islamic-widget-quran {
  padding: 0;
  flex-direction: column;
  justify-content: stretch;
  gap: 0;
}

.quran-verse-arabic {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 12px 6px;
  font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', 'Noto Naskh Arabic', serif;
  font-size: 28px;
  line-height: 1.65;
  color: #5a4310;
  direction: rtl;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.quran-verse-footer {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 12px 10px;
  box-sizing: border-box;
  justify-content: flex-end;
}

.quran-verse-divider {
  width: 100%;
  height: 1px;
  background: rgba(90, 67, 16, 0.18);
  margin-bottom: 5px;
}

.quran-verse-translation {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(90, 67, 16, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quran-verse-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quran-verse-ref {
  font-size: 10px;
  color: rgba(90, 67, 16, 0.55);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.quran-read-more {
  font-size: 10px;
  color: rgba(90, 67, 16, 0.65);
  letter-spacing: 0.03em;
}

.islamic-widget-tall {
  cursor: pointer;
}

.islamic-widget-tall:hover {
  cursor: pointer;
}

body {
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

body.page-transition-out {
  opacity: 0;
  transform: translateY(8px);
}

/* ═══ LAYOUT: Glass Minimal ═══════════════════════════════════ */
body.layout-glass .app-container {
  background: transparent;
}

body.layout-glass .background {
  background:
    radial-gradient(55% 45% at 88% -8%, #83f5c6 0%, transparent 65%),
    radial-gradient(50% 40% at 0% 18%, #f5b544 0%, transparent 70%),
    radial-gradient(65% 45% at 50% 105%, #6bc5a3 0%, transparent 60%),
    radial-gradient(35% 28% at 105% 55%, #f08c6b 0%, transparent 65%), #ebe6d7;
}

body.layout-glass .background-overlay {
  background:
    radial-gradient(180px 180px at calc(100% - 40px) 140px, rgb(245 181 68 / 55%), transparent 60%),
    radial-gradient(220px 220px at -60px 360px, rgb(240 140 107 / 55%), transparent 60%);
  filter: blur(40px);
  opacity: 0.9;
}

body.layout-glass::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.28 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.12;
  mix-blend-mode: overlay;
}

body.layout-glass.theme-dark .background {
  background:
    radial-gradient(60% 50% at 85% -5%, #2d8a68 0%, transparent 65%),
    radial-gradient(55% 45% at 5% 20%, #6b4a8a 0%, transparent 70%),
    radial-gradient(70% 50% at 50% 110%, #1a6b4e 0%, transparent 60%),
    radial-gradient(40% 30% at 100% 60%, #b85c4a 0%, transparent 60%), #0b0e0d;
}

body.layout-glass.theme-dark .background-overlay {
  background:
    radial-gradient(180px 180px at calc(100% - 40px) 140px, rgb(61 168 127 / 55%), transparent 60%),
    radial-gradient(220px 220px at -60px 360px, rgb(107 74 138 / 55%), transparent 60%);
}

body.layout-glass.theme-dark::after {
  opacity: 0.18;
}

/* Frosted-glass surfaces — protection panel only */
body.layout-glass .protection-card {
  background: rgb(255 255 255 / 38%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgb(255 255 255 / 70%);
  box-shadow:
    0 14px 40px rgb(15 61 46 / 12%),
    0 2px 6px rgb(15 61 46 / 6%),
    inset 0 1px 0 rgb(255 255 255 / 85%);
}

body.layout-glass .deen-ai-launcher-send {
  background: rgb(15 61 46 / 85%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

body.layout-glass .favorite-icon {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 35%),
    0 6px 14px rgb(15 61 46 / 15%);
  position: relative;
  overflow: hidden;
}

body.layout-glass .favorite-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgb(255 255 255 / 22%) 0%, rgb(255 255 255 / 0%) 45%);
  pointer-events: none;
}

body.layout-glass .protection-icon {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 20%),
    0 4px 12px rgb(15 61 46 / 25%);
}

body.layout-glass .for-you-header h1,
body.layout-glass .for-you-header .for-you-customize {
  text-shadow: 0 1px 2px rgb(255 255 255 / 40%);
}

/* Dark-mode frosted surfaces — protection panel only */
body.layout-glass.theme-dark .protection-card {
  background: rgb(20 28 25 / 42%);
  border: 1px solid rgb(245 242 234 / 14%);
  box-shadow:
    0 14px 40px rgb(0 0 0 / 40%),
    0 2px 6px rgb(0 0 0 / 25%),
    inset 0 1px 0 rgb(255 255 255 / 8%);
}

body.layout-glass.theme-dark .for-you-header h1,
body.layout-glass.theme-dark .for-you-header .for-you-customize {
  text-shadow: 0 1px 2px rgb(0 0 0 / 40%);
}

/* Glass: favorites as "Your sites" shortcut row without card */
body.layout-glass #section-favorites {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

body.layout-glass .quick-links-surface {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

body.layout-glass .favorites-section::before {
  content: 'Your sites';
  display: block;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  opacity: 1;
  color: var(--text-main);
  padding: 0 2px;
}

body.layout-glass[data-language='bn'] .favorites-section::before {
  content: 'আপনার সাইট';
}

body.layout-glass[data-language='ar'] .favorites-section::before {
  content: 'مواقعك';
}

body.layout-glass .favorites-tabs {
  display: none;
}

body.layout-glass .for-you-header {
  display: none;
}

body.layout-glass .app-container {
  gap: 18px;
}

body.layout-glass .content-stack,
body.layout-glass .top-stack {
  gap: 18px;
}

body.layout-glass .section-header {
  margin-bottom: 8px;
}

body.layout-glass .section-header h2 {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.012em;
  text-transform: none;
  color: var(--text-main);
}

body.layout-glass .deen-ai-header h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

body.layout-glass {
  --page-left-inset: 25px;
}

body.layout-glass .favorites-grid {
  gap: 14px;
  justify-content: flex-start;
}

/* Glass: islamic carousel → horizontal scroll (matches design) */
body.layout-glass .islamic-carousel-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  cursor: grab;
}

body.layout-glass .islamic-carousel-track > * {
  flex: 0 0 auto;
  min-width: 0;
}

body.layout-glass .islamic-carousel-track > *:nth-child(n + 3) {
  display: flex;
}

body.layout-glass .islamic-carousel-wrapper .horizontal-carousel__arrow {
  display: none;
}

/* Glass: search bar — frosted glass */
body.layout-glass .search-container {
  background: rgb(255 255 255 / 50%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgb(255 255 255 / 75%);
  box-shadow:
    0 14px 40px rgb(15 61 46 / 14%),
    0 2px 6px rgb(15 61 46 / 6%),
    inset 0 1px 0 rgb(255 255 255 / 85%);
}

body.layout-glass.theme-dark .search-container {
  background: rgb(20 28 25 / 45%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgb(245 242 234 / 14%);
  box-shadow:
    0 14px 40px rgb(0 0 0 / 40%),
    0 2px 6px rgb(0 0 0 / 25%),
    inset 0 1px 0 rgb(255 255 255 / 8%);
}

/* Glass: section labels — match design's 13px/600 SectionLabel */
body.layout-glass .favorites-section::before {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.012em;
  padding-bottom: 0;
}

/* Glass: app container — slightly wider padding matches design's 20px */
body.layout-glass .app-container {
  padding-left: 20px;
  padding-right: 20px;
}

/* Glass: floating orb overlays for wallpaper depth */
body.layout-glass .background-overlay {
  background:
    radial-gradient(180px 180px at calc(100% - 40px) 140px, rgb(245 181 68 / 55%), transparent 60%),
    radial-gradient(220px 220px at -60px 360px, rgb(240 140 107 / 55%), transparent 60%),
    radial-gradient(160px 160px at 30% 70%, rgb(131 245 198 / 35%), transparent 60%);
  filter: blur(40px);
  opacity: 0.9;
}

/* Glass: use Geist UI font (matches design) */
body.layout-glass {
  font-family:
    'Geist',
    'Inter',
    'Noto Sans Arabic',
    'Geeza Pro',
    Tahoma,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

/* Glass: islamic carousel cards — fixed width */
body.layout-glass .islamic-widget-card {
  flex: 0 0 200px;
}

/* Glass: islamic carousel inner items height matches design (180px) */
body.layout-glass .islamic-carousel-track {
  align-items: stretch;
}

/* Glass: protection card panel value sizes match design exactly */
body.layout-glass .protection-panel-stat-big .protection-panel-value {
  font-size: 34px;
}

body.layout-glass .protection-panel-stat:not(.protection-panel-stat-big) .protection-panel-value {
  font-size: 24px;
}

/* Glass: tighter gaps to match design's spacing rhythm */
body.layout-glass .top-stack {
  gap: 14px;
}

body.layout-glass .content-stack {
  gap: 20px;
}

/* Glass: islamic carousel wrapper — inherits full-bleed from base */

/* Glass: deen-ai (Islamic AI) section inner padding matches design */
body.layout-glass .deen-ai-section {
  padding: 0;
}

/* Glass: dark mode orb overlays */
body.layout-glass.theme-dark .background-overlay {
  background:
    radial-gradient(180px 180px at calc(100% - 40px) 140px, rgb(61 168 127 / 55%), transparent 60%),
    radial-gradient(220px 220px at -60px 360px, rgb(107 74 138 / 55%), transparent 60%),
    radial-gradient(160px 160px at 40% 65%, rgb(184 92 74 / 40%), transparent 60%);
  filter: blur(40px);
  opacity: 0.85;
}
