:root {
  --font-ui: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Amiri', 'Scheherazade New', 'Traditional Arabic', 'Noto Naskh Arabic', serif;
  --arabic-size: 28px;
  --translation-size: 16px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --nav-height: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --max-width: 720px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3faf5;
  --surface: #ffffff;
  --surface-alt: #ebf6ef;
  --text: #11261a;
  --text-soft: #4a6656;
  --text-faint: #7f9a8b;
  --primary: #178a49;
  --primary-strong: #0f6b37;
  --primary-soft: rgba(23, 138, 73, 0.12);
  --on-primary: #ffffff;
  --border: rgba(17, 38, 26, 0.1);
  --shadow: 0 8px 24px rgba(15, 80, 45, 0.1);
  --hero-from: #1d9d56;
  --hero-to: #0e6636;
  --overlay: rgba(8, 24, 15, 0.5);
  --danger: #c0392b;
  --danger-soft: rgba(192, 57, 43, 0.1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1810;
  --surface: #122419;
  --surface-alt: #183221;
  --text: #e7f4ec;
  --text-soft: #a7c3b3;
  --text-faint: #6d8c7a;
  --primary: #3fd07e;
  --primary-strong: #2fb86a;
  --primary-soft: rgba(63, 208, 126, 0.14);
  --on-primary: #06210f;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --hero-from: #155c37;
  --hero-to: #0a2b1a;
  --overlay: rgba(0, 0, 0, 0.65);
  --danger: #ff7b6b;
  --danger-soft: rgba(255, 123, 107, 0.12);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon {
  flex-shrink: 0;
  display: block;
}

.muted {
  color: var(--text-soft);
}

.small-text {
  font-size: 12px;
}

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