:root {
  --bg: #f3f5f2;
  --fg: #141816;
  --card: #fbfcf9;
  --muted: #5d6862;
  --muted-bg: #e8ece8;
  --secondary: #e7ece7;
  --primary: #1f6f52;
  --primary-fg: #f4fbf7;
  --accent: #dce8e1;
  --danger: #b42318;
  --border: rgba(20, 24, 22, 0.1);
  --ring: #1f6f52;
  --shadow: 0 0 0 1px rgba(20, 24, 22, 0.06), 0 1px 2px -1px rgba(20, 24, 22, 0.06), 0 8px 24px -16px rgba(20, 24, 22, 0.12);
  --radius: 12px;
  --sans: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --display: "Fraunces", ui-serif, Georgia, serif;
  --arabic: "Noto Sans Arabic", "Outfit", sans-serif;
}
html.dark {
  --bg: #0a0c0b;
  --fg: #eef3ef;
  --card: #131615;
  --muted: #8d958f;
  --muted-bg: #1b201d;
  --secondary: #1b201d;
  --primary: #7dba9a;
  --primary-fg: #0a0c0b;
  --accent: #1e2a24;
  --danger: #f97066;
  --border: rgba(238, 243, 239, 0.12);
  --ring: #7dba9a;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--fg); }
html[dir="rtl"] body { font-family: var(--arabic); }
body {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; text-wrap: balance; margin: 0; }
button, [role="button"] { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 32rem; margin: 0 auto; padding: 0 1.25rem; }
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: max(1rem, env(safe-area-inset-top)); padding-bottom: 0.25rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.brand img { width: 36px; height: 36px; }
.hero { padding-top: 1.5rem; }
.hero h1 { font-size: 2.1rem; line-height: 1.15; font-weight: 600; max-width: 20rem; }
.hero p { margin: 0.75rem 0 0; color: var(--muted); line-height: 1.6; }
.panel { margin-top: 1.5rem; background: var(--card); border-radius: 16px; padding: 0.75rem; box-shadow: var(--shadow); }
.field {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--secondary); border-radius: 10px; padding: 0 0.85rem;
}
.field input {
  flex: 1; height: 3.5rem; border: 0; background: transparent; color: var(--fg);
  font: inherit; outline: none; min-width: 0;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 0; border-radius: 10px; font: inherit; font-weight: 600; min-height: 2.75rem; padding: 0 1rem;
}
.btn-lg { min-height: 3.15rem; width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-secondary { background: var(--secondary); color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-danger { background: color-mix(in oklab, var(--danger) 12%, transparent); color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.stack { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.linkish {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 0.5rem;
  background: none; border: 0; color: var(--muted); font: inherit; padding: 0.5rem 0;
}
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav ul { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 32rem; margin: 0 auto; padding: 0; list-style: none; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.7rem 0.2rem 0.55rem; color: var(--muted); font-size: 0.72rem;
}
.nav a.active { color: var(--primary); font-weight: 600; }
.nav svg { width: 22px; height: 22px; }
.page { padding-bottom: 7rem; }
.page.full { padding-bottom: 2rem; }
.card {
  display: block; background: var(--card); border-radius: 14px; padding: 0.9rem 1rem;
  box-shadow: var(--shadow); margin-top: 0.7rem;
}
.card h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; }
.card p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.85rem; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; }
.sep { height: 1px; background: var(--border); border: 0; margin: 0; }
select, textarea, input[type="text"], input[type="search"] {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.45rem 0.6rem;
}
textarea { width: 100%; min-height: 12rem; line-height: 1.55; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.toast {
  position: fixed; top: max(0.8rem, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 80; background: var(--card); color: var(--fg); box-shadow: var(--shadow);
  border-radius: 999px; padding: 0.55rem 1rem; font-size: 0.9rem; display: none;
}
.toast.show { display: block; }
.modal {
  position: fixed; inset: 0; z-index: 70; background: rgba(10,12,11,0.45);
  display: none; align-items: flex-end; justify-content: center;
}
.modal.open { display: flex; }
.sheet {
  width: min(32rem, 100%); background: var(--card); border-radius: 20px 20px 0 0;
  padding: 1rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom));
}
.sheet h2 { font-size: 1.15rem; margin-bottom: 0.7rem; }
.seg { display: flex; gap: 0.55rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.seg time { flex: 0 0 3.4rem; color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.alert { background: color-mix(in oklab, var(--danger) 12%, transparent); color: var(--danger); border-radius: 10px; padding: 0.7rem 0.85rem; }
.warn { background: #9a670015; border-radius: 12px; padding: 0.8rem 1rem; font-size: 0.9rem; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.icon-btn { width: 2.5rem; height: 2.5rem; border: 0; background: transparent; border-radius: 8px; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.topbar { display: flex; align-items: center; gap: 0.4rem; padding-top: max(0.75rem, env(safe-area-inset-top)); }
.grow { min-width: 0; flex: 1; text-align: start; }
.grow h1 { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small { font-size: 0.75rem; color: var(--muted); }
.star.filled { color: var(--primary); }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--muted-bg); border: 0; position: relative; }
.switch.on { background: var(--primary); }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: left 0.15s; }
.switch.on i { left: 21px; }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }
#app { position: relative; z-index: 2; min-height: 80dvh; }
.ad-slot { min-height: 90px; max-height: 110px; margin: 1rem 0; overflow: hidden; border-radius: 12px; }
.legal { font-size: 0.92rem; line-height: 1.65; color: var(--muted); }
.legal h1 { color: var(--fg); margin-bottom: 0.8rem; }
.legal p { margin: 0.7rem 0; }
.processing { text-align: center; padding: 2.2rem 1rem 1.4rem; }
.bar {
  height: 8px;
  background: var(--muted-bg);
  border-radius: 99px;
  overflow: hidden;
  margin: 1.1rem auto 0.4rem;
  max-width: 280px;
}
.bar > span {
  display: block;
  height: 100%;
  width: 8%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .25s ease;
}
body.is-busy .ad-slot,
body.is-busy ins.adsbygoogle,
body.is-busy .google-auto-placed,
body.is-busy iframe[id^="google_ads"],
body.is-busy iframe[id^="aswift"] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
}
.processing .wave { width: 72px; height: 72px; margin: 0 auto 1rem; }
@media (min-width: 720px) {
  .modal { align-items: center; }
  .sheet { border-radius: 16px; }
}
