/* Shared ZikrMine palette. Defaults to LIGHT, regardless of operating system.
   Manual dark always wins; system only follows OS when specifically selected.
   src/design/tokens.ts is the reference for brand color roles. */
:root,
:root[data-theme='light'] {
  color-scheme: light;
  --navy: #111827;
  --jade: #2f8f78;
  --jade-text: #247a68;
  --ivory: #f7f4ed;
  --surface: #fffcf7;
  --surface-high: #ffffff;
  --muted: #5f6772;
  --arabic-ink: #514b43;
  --line: #e4e0d6;
  --track: #e5e2da;
  --gold: #c6a96b;
  --dark: #06131f;
  --dark-surface: #0d1f2b;
  --dark-accent: #48c5a7;
  --tabs-bg: #eeece6;
  --on-accent: #ffffff;
  --accent-hover: #1f6f60;
  --hero-halo: radial-gradient(circle, #ddebe3 0%, #f7f4ed 69%);
  --how-background: #eaf0ea;
  --background: var(--ivory);
  --text: var(--navy);
  --accent: var(--jade-text);
  --border: var(--line);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --navy: #f7f4ed;
  --jade: #48c5a7;
  --jade-text: #48c5a7;
  --ivory: #06131f;
  --surface: #0d1f2b;
  --surface-high: #122833;
  --muted: #b8c4ce;
  --arabic-ink: #f7f4ed;
  --line: #304653;
  --track: #16333b;
  --tabs-bg: #16333b;
  --on-accent: #06131f;
  --accent-hover: #70d6c0;
  --hero-halo: radial-gradient(circle, #174138 0%, #06131f 69%);
  --how-background: #0d1f2b;
  --background: var(--ivory);
  --text: var(--navy);
  --accent: var(--jade-text);
  --border: var(--line);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    color-scheme: dark;
    --navy: #f7f4ed;
    --jade: #48c5a7;
    --jade-text: #48c5a7;
    --ivory: #06131f;
    --surface: #0d1f2b;
    --surface-high: #122833;
    --muted: #b8c4ce;
    --arabic-ink: #f7f4ed;
    --line: #304653;
    --track: #16333b;
    --tabs-bg: #16333b;
    --on-accent: #06131f;
    --accent-hover: #70d6c0;
    --hero-halo: radial-gradient(circle, #174138 0%, #06131f 69%);
    --how-background: #0d1f2b;
    --background: var(--ivory);
    --text: var(--navy);
    --accent: var(--jade-text);
    --border: var(--line);
  }
}
/* The real app mark's light/dark variants must follow the selected WEBSITE
   theme, not OS picture sources that ignore manual preference. */
.theme-logo-dark {
  display: none !important;
}
:root[data-theme='dark'] .theme-logo-light {
  display: none !important;
}
:root[data-theme='dark'] .theme-logo-dark {
  display: block !important;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] .theme-logo-light {
    display: none !important;
  }
  :root[data-theme='system'] .theme-logo-dark {
    display: block !important;
  }
}
/* One shared header system for marketing, privacy and support.
   Keep logo and controls aligned across all ten pages and RTL layouts. */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.header-inner {
  width: min(1170px, calc(100% - 48px));
  min-height: 88px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(14px, 2vw, 28px);
}
.brand {
  grid-column: 1;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  flex: none;
  font-size: inherit;
  text-decoration: none;
  letter-spacing: normal;
  color: var(--navy);
}
.theme-brand-assets {
  display: inline-flex;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle;
}
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.48rem;
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-accent {
  color: var(--jade-text);
}
.desktop-nav {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  direction: ltr;
}
.site-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 132px;
  flex: 0 1 132px;
  direction: ltr;
}
.site-control-language {
  width: 144px;
  flex-basis: 144px;
}
.site-control-appearance {
  width: 130px;
  flex-basis: 130px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}
.control-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--jade-text);
  pointer-events: none;
}
.control-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 9px 32px 9px 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
  background-color: var(--surface-high);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.4;
  direction: ltr;
  text-align: start;
  cursor: pointer;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 1px 4px #1118270a;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.site-select:hover {
  border-color: var(--jade-text);
}
.site-select:focus-visible {
  outline: 3px solid var(--jade-text);
  outline-offset: 2px;
}
.site-select option {
  background: var(--surface-high);
  color: var(--navy);
}

/* The same chevron in every browser: remove native select arrows. */
.site-control::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-72%) rotate(45deg);
  pointer-events: none;
}
.site-select::-ms-expand {
  display: none;
}
.mobile-menu-toggle,
.mobile-nav {
  display: none;
}
@media (max-width: 1100px) {
  .desktop-nav {
    display: none;
  }
  /* Collapsed mobile header = one visual row: app logo + hamburger. */
  .header-inner {
    width: calc(100% - 32px);
    min-height: 74px;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 0;
    padding-block: 11px;
  }
  .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
  }
  .brand-wordmark {
    font-size: clamp(1.23rem, 5vw, 1.48rem);
  }
  .mobile-menu-toggle {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--navy);
    background: var(--surface-high);
    font: inherit;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    touch-action: manipulation;
  }
  .mobile-menu-toggle:hover {
    border-color: var(--jade-text);
  }
  .mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--jade-text);
    outline-offset: 3px;
  }
  .menu-icon {
    display: grid;
    gap: 4px;
    width: 19px;
  }
  .menu-icon span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 3px;
    background: currentColor;
    transition:
      transform 0.18s ease,
      opacity 0.18s ease;
  }
  .header-inner.is-menu-open .menu-icon span:first-child {
    transform: translateY(6px) rotate(45deg);
  }
  .header-inner.is-menu-open .menu-icon span:nth-child(2) {
    opacity: 0;
  }
  .header-inner.is-menu-open .menu-icon span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }
  .header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    width: 100%;
    padding-top: 18px;
    padding-bottom: 16px;
    direction: ltr;
    justify-self: stretch;
  }
  .header-inner.is-menu-open .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .site-control,
  .site-control-language,
  .site-control-appearance {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions label.visually-hidden {
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    overflow: visible !important;
    margin: 0 0 7px !important;
    white-space: normal !important;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
  }
  .control-icon {
    top: auto;
    bottom: 15px;
    transform: none;
  }
  .site-control::after {
    top: auto;
    bottom: 21px;
    transform: rotate(45deg);
  }
  .site-select {
    min-height: 50px;
    font-size: 0.9rem;
  }
  .mobile-nav {
    grid-column: 1 / -1;
    grid-row: 3;
    display: none;
    border-top: 1px solid var(--line);
    padding-block: 12px 4px;
  }
  .header-inner.is-menu-open .mobile-nav {
    display: block;
  }
  .mobile-nav-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .mobile-nav a {
    min-width: 0;
    min-height: 48px;
    padding: 9px 12px;
    text-decoration: none;
    border-radius: 10px;
    color: var(--navy);
    font-size: 0.88rem;
    line-height: 1.35;
    text-align: start;
    white-space: normal;
  }
  .mobile-nav a:hover,
  .mobile-nav a:focus-visible,
  .mobile-nav a[aria-current='page'] {
    background: var(--how-background);
  }
  .mobile-nav a:focus-visible {
    outline: 3px solid var(--jade-text);
    outline-offset: -3px;
  }
}
@media (max-width: 400px) {
  .menu-text {
    display: none;
  }
  .mobile-menu-toggle {
    width: 48px;
    padding-inline: 12px;
  }
  .header-inner.is-menu-open .header-actions {
    gap: 9px;
  }
  .site-select {
    font-size: 0.82rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-select,
  .menu-icon span {
    transition: none;
  }
}
