:root {
  --bg: #faf6ef; --surface: #ffffff; --ink: #1e2b28; --muted: #6b7773; --line: #e7dfd0;
  --brand: #0f5c4d; --brand-ink: #ffffff; --accent: #e8a33d; --yes: #1b8a5a; --maybe: #c98a12; --no: #b4493d;
  --soft: #f1ece0; --shadow: 0 1px 2px rgba(30, 43, 40, .06), 0 6px 18px rgba(30, 43, 40, .06);
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a18; --surface: #1d2523; --ink: #eef2f0; --muted: #9aa8a3; --line: #2c3633;
    --brand: #35b394; --brand-ink: #08201a; --accent: #f0b556; --soft: #232d2a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.55;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .4rem; font-weight: 800; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; font-weight: 700; }
h3 { font-size: .95rem; margin: .9rem 0 .35rem; font-weight: 700; color: var(--muted); }
p { margin: .3rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink); font-size: 1.2rem;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 16px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.hero { padding: 18px 2px 4px; }
.hero h1 { font-size: 2rem; }
.hero p { color: var(--muted); margin-bottom: 16px; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700;
  padding: 10px 16px; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; transition: transform .06s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.wa { background: #25d366; border-color: #25d366; color: #06371c; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--no); border-color: var(--no); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn.big { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; }
.danger-t { color: var(--no); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.x { appearance: none; border: 0; background: var(--soft); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row input { flex: 1; min-width: 0; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { resize: vertical; }
label, .lbl { display: grid; gap: 6px; font-weight: 700; font-size: .92rem; }
.form { display: grid; gap: 12px; }
.form.sub { padding: 12px; background: var(--soft); border-radius: 12px; margin: 10px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--no); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { appearance: none; font: inherit; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 40px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.glist { display: grid; gap: 10px; }
.gcard { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.gi { font-size: 1.6rem; }
.gt { display: grid; }
.evhead { position: relative; }
.evtype { font-size: 2rem; }
.when { font-weight: 700; }
.note { background: var(--soft); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; }
.sharebox { margin-top: 12px; padding: 12px; background: var(--soft); border-radius: 12px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#r-kind-seg { grid-template-columns: 1fr 1fr; }
.seg button { appearance: none; font: inherit; font-weight: 700; padding: 12px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; min-height: 48px; }
.seg button.on { color: #fff; border-color: transparent; }
.seg button.on.yes { background: var(--yes); }
.seg button.on.maybe { background: var(--maybe); }
.seg button.on.no { background: var(--no); }
.plus { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { appearance: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1.3rem; cursor: pointer; }
.stepper b { min-width: 1.5ch; text-align: center; font-size: 1.1rem; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--soft); padding: 4px; border-radius: 14px; }
.tabs button { appearance: none; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--muted); padding: 10px 2px; border-radius: 11px; cursor: pointer; min-height: 44px; }
.tabs button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
#tabbody { display: grid; gap: 14px; }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 8px; }
.counts div { background: var(--soft); border-radius: 12px; padding: 10px 4px; display: grid; }
.counts b { font-size: 1.25rem; }
.counts span { font-size: .8rem; color: var(--muted); }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.people li { display: flex; gap: 10px; align-items: center; }
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: #3b2800; font-weight: 800; flex: none; }
.badge { font-style: normal; font-size: .72rem; background: var(--soft); color: var(--muted); border-radius: 999px; padding: 2px 8px; margin-inline-start: 6px; }
.badge.you { background: var(--brand); color: var(--brand-ink); }
.poll { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.poll:first-of-type { border-top: 0; }
.opt { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; appearance: none; font: inherit; text-align: start; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); cursor: pointer; min-height: 44px; }
.opt .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: color-mix(in srgb, var(--brand) 18%, transparent); transition: width .3s; }
.opt .ol, .opt .oc { position: relative; }
.opt.on { border-color: var(--brand); font-weight: 700; }
.names { margin-top: -2px; }
.items { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.item small { grid-column: 1; }
.item .row { grid-row: 1 / span 2; grid-column: 2; }
.il.done { text-decoration: line-through; color: var(--muted); }
.ride { padding: 12px 0; border-top: 1px solid var(--line); }
.ride:first-of-type { border-top: 0; }
.seats { font-weight: 700; color: var(--brand); }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(92vw, 380px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dlg { display: grid; gap: 12px; padding: 20px; }
.dlg h3 { margin: 0; color: var(--ink); font-size: 1.1rem; }
#toast { position: fixed; inset-inline: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); margin: auto; max-width: 420px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; text-align: center; opacity: 0; transform: translateY(12px); transition: .25s; pointer-events: none; z-index: 20; }
#toast.show { opacity: 1; transform: none; }
button.kick { margin-inline-start: auto; }
.people li .kick { min-height: 32px; padding: 2px 10px; font-size: .78rem; }
.foot { text-align: center; padding: 8px 0 16px; }
.foot a, .linkbtn { color: var(--muted); }
.linkbtn { appearance: none; background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; padding: 4px; }
.legal { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }
.legal h1 { font-size: 1.5rem; } .legal h2 { margin-top: 1.4rem; }
.legal section { margin-bottom: 1.6rem; }
.prayer-warn { background: color-mix(in srgb, var(--accent) 22%, var(--soft)); }
details summary { cursor: pointer; }
.plus-list { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: 4px; }
.ai-box { border: 1.5px dashed var(--brand); }
input.bad, select.bad, textarea.bad { border-color: var(--no); box-shadow: 0 0 0 3px color-mix(in srgb, var(--no) 25%, transparent); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
