/* Masjid Bridge: the website's look (v5, 21 Nov 2026). An app, quiet and light.
   The posters bring the colour; the app is a calm frame round them. A soft teal-grey page (not beige),
   teal for anything you tap, and the sunrise orange only where the logo uses it: a thin line of light
   for "now" (Today, the open tab). Square-ish corners that suit printed posters, thin lines instead of
   boxes and shadows, no glass, no glow, no icon tiles. Brand: Teal and sand, Outfit + Inter. */
@font-face { font-family: "Outfit"; src: url("/fonts/outfit-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #EEF2F0;              /* the page: grey with a breath of teal */
  --bg-glass: rgba(238, 242, 240, .92);
  --raised: #F8FAF9;          /* lists, fields, sheets */
  --field: #FCFDFD;
  --tint: #DCE8E5;            /* teal, very soft: chosen things */
  --frame: #DDE5E2;           /* behind a poster while it loads */
  --ink: #0C3236;
  --muted: #566E70;
  --line: rgba(12, 50, 54, .12);
  --line-strong: rgba(12, 50, 54, .22);
  --teal: #0F5257;
  --teal-deep: #0B3A3E;
  --fold: #2B7F80;
  --sun: #EC8C5E;
  --sun-text: #A84E27;
  --sand: #F7F1E6;
  --mist: #A9D0CB;
  --danger: #B5352B;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --lift: 0 12px 32px -12px rgba(12, 50, 54, .28), 0 0 0 1px var(--line);
  --display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tabbar-h: 62px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; width: 100%; }
body.has-tabs main { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 720px) { .wrap { padding-left: 32px; padding-right: 32px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--raised); padding: 8px 12px; z-index: 60; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; color: var(--muted); }
@media (max-width: 719px) { .hide-sm { display: none !important; } }
@media (min-width: 720px) { .show-sm { display: none !important; } }

/* ---------- round icon buttons (back, share, settings, close) ---------- */
.icon-btn, .round-btn {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; padding: 0;
  border: 0; background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
}
.icon-btn .ic, .round-btn .ic { width: 20px; height: 20px; }
.icon-btn:hover, .round-btn:hover { background: #fff; }
.icon-btn:disabled, .round-btn:disabled { opacity: .3; cursor: default; }

/* ---------- the top of each screen (light, part of the page) ---------- */
.apphead { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 14px; }
.apphead-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.lockup { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--ink); }
.lockup img { height: 30px; width: auto; flex: none; }
.lockup-words { display: grid; min-width: 0; }
.lockup-words strong { font: 600 1.28rem/1.1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.lockup-words span { font: 400 .86rem/1.3 var(--display); color: var(--muted); white-space: nowrap; }
@media (min-width: 720px) { .lockup img { height: 36px; } .lockup-words strong { font-size: 1.4rem; } .lockup-words span { font-size: .92rem; } }
.mini-brand img { height: 24px; width: auto; }
.large-title { margin-top: 8px; font-size: clamp(1.9rem, 7vw, 2.6rem); line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; max-width: 22ch; }
.page-sub { margin-top: 6px; font-size: 1rem; color: var(--muted); max-width: 56ch; }
.apphead .ev-actions { margin-top: 18px; }
.apphead-tab .large-title { margin-top: 0; }
.apphead-tab { padding-bottom: 10px; }

/* search and Filter: their own row under the header, staying at the top as you scroll */
.searchrow { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 2px 0 12px; transition: box-shadow .2s ease; }
.searchrow { padding-top: max(2px, env(safe-area-inset-top)); }
.searchrow.is-stuck { box-shadow: 0 1px 0 var(--line); }
.searchbar { display: flex; gap: 8px; }
@media (min-width: 720px) { .searchbar > .search-field { max-width: 520px; } }
.search-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  border-radius: var(--r); background: var(--raised); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line);
}
.search-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--teal); }
.search-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 400 1rem var(--text); color: var(--ink); padding: 0; }
.search-field input::placeholder { color: var(--muted); }
.search-field input::-webkit-search-cancel-button { display: none; }
.filter-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border: 0;
  border-radius: var(--r); background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  font: 600 .95rem var(--text); cursor: pointer;
}
.filter-btn:hover { background: #fff; }
.filter-btn b { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--teal); color: #fff; font-size: .75rem; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 2px; padding-bottom: 4px; }
.result-count { font-weight: 600; font-size: .9rem; margin-right: 6px; }
.active-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 11px; border-radius: var(--r-sm);
  background: var(--tint); color: var(--teal); font-size: .86rem; font-weight: 500;
}
.active-pill .ic { width: 15px; height: 15px; }
.clear-all { font-size: .86rem; font-weight: 600; padding: 0 6px; }

/* the Sort and filter sheet */
.opt-group { border: 0; padding: 0; margin: 20px 0 0; }
.opt-group legend { font: 600 .85rem var(--text); color: var(--muted); margin-bottom: 8px; padding: 0; }
.opt-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-pill { position: relative; cursor: pointer; }
.opt-pill input { position: absolute; opacity: 0; pointer-events: none; }
.opt-pill span {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; font-size: .92rem;
}
.opt-pill input:checked + span { background: var(--teal); color: #fff; box-shadow: none; }
.opt-pill input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 26px; }
.sheet form { margin: 0; }

/* the filter sheet: a fixed top and bottom, the choices scroll between them */
.sheet.sheet-filters { padding: 0; max-height: 90vh; max-height: 90dvh; overflow: hidden; }
.sheet-filters[open] { display: flex; flex-direction: column; }
.sheet-filters form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sheet-top { padding: 10px 20px 4px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 20px; overscroll-behavior: contain; }
.sheet-foot {
  display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--raised);
}
.sheet-foot .btn-primary:disabled { opacity: .45; cursor: default; }
@media (min-width: 720px) { .sheet.sheet-filters { max-width: 520px; padding: 0; } .sheet-top { padding: 22px 24px 4px; } .sheet-body { padding: 0 24px 20px; } .sheet-foot { padding: 14px 24px; } }
.sheet-filters .opt-group:first-child, .sheet-filters .sheet-sub + .opt-group { margin-top: 12px; }
.opt-n { font-style: normal; font-weight: 500; font-size: .8rem; color: var(--muted); margin-left: 7px; font-variant-numeric: tabular-nums; }
.opt-pill input:checked + span .opt-n { color: rgba(255, 255, 255, .75); }
.opt-pill.is-zero span, .pick-row.is-zero, .switch-row.is-zero { opacity: .45; }
/* a three-way switch (Who it's for, Sort) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 11px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: grid; place-items: center; height: 38px; border-radius: 8px; font-weight: 500; font-size: .92rem; color: var(--muted); }
.seg-opt input:checked + span { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(12, 50, 54, .16), 0 0 0 1px var(--line); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 1px; }
/* Choose masjids */
.masjid-pick { margin-top: 10px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); }
.masjid-pick summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: .92rem; list-style: none; }
.masjid-pick summary::-webkit-details-marker { display: none; }
.masjid-pick summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); }
.masjid-pick[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.masjid-pick summary b { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--teal); color: #fff; font-size: .75rem; }
.pick-list { border-top: 1px solid var(--line); }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; }
.pick-row + .pick-row { border-top: 1px solid var(--line); }
.pick-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--teal); flex: none; }
.pick-text { flex: 1; min-width: 0; display: grid; }
.pick-text strong { font-weight: 600; font-size: .95rem; }
.pick-text span { font-size: .8rem; color: var(--muted); }
.opt-group .hint { margin-top: 8px; font-size: .82rem; color: var(--muted); }
/* on/off switches */
.switches { border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-text { flex: 1; min-width: 0; display: grid; }
.switch-text strong { font-weight: 600; font-size: .95rem; }
.switch-text span { font-size: .8rem; color: var(--muted); }
.switch-row .opt-n { margin: 0 4px 0 0; }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0;
  border-radius: 14px; background: rgba(12, 50, 54, .2); cursor: pointer; transition: background-color .15s ease;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.switch:checked { background: var(--teal); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

.feed { padding-top: 6px; }
.feed-tight { padding-top: 0; }
.section-label { font: 600 1.08rem/1.2 var(--display); color: var(--ink); letter-spacing: -0.01em; margin: 26px 0 12px; }
.feed > .section-label:first-child, .feed-tight > .section-label:first-child { margin-top: 6px; }

/* ---------- poster cards: the poster, then the words on the page (no box round them) ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { min-width: 0; }
.card-link { display: block; color: inherit; }
.card-link:active .poster { opacity: .85; }
.card-media { position: relative; }
.poster { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-sm); overflow: hidden; background: var(--frame); }
.poster::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(12, 50, 54, .1); pointer-events: none; }
.poster img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.poster-none { display: flex; align-items: flex-end; padding: 14px; background: var(--teal); }
.poster-none span { font: 600 1.2rem/1.1 var(--display); color: var(--sand); letter-spacing: -0.02em; }
.poster-none.tall { aspect-ratio: 4 / 5; border-radius: 10px; }
.flag {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: 6px; font: 600 .74rem/1 var(--text); background: var(--teal); color: #fff;
}
.flag .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.flag-cancelled { background: var(--danger); }
/* the day on the poster's top-left corner: Today in the sunrise, the rest in sand */
.day {
  position: absolute; top: 8px; left: 8px; padding: 5px 8px; border-radius: 6px;
  font: 650 .76rem/1 var(--text); background: var(--sand); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
}
.day-today { background: var(--sun); color: var(--teal-deep); }
@media (min-width: 720px) { .day { top: 10px; left: 10px; font-size: .8rem; padding: 6px 9px; } }
.card-when { margin-top: 10px; font-size: .82rem; line-height: 1.35; font-weight: 500; color: var(--fold); }
.card-title {
  margin-top: 3px; font-size: 1.04rem; line-height: 1.25; letter-spacing: -0.012em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (min-width: 720px) { .card-title { font-size: 1.14rem; } .card-when, .card-place { font-size: .86rem; } }
.card-place { margin-top: 3px; font-size: .82rem; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.card-tags span { font-size: .72rem; font-weight: 500; line-height: 1; padding: 4px 6px; border-radius: 5px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.is-cancelled .poster img { filter: grayscale(1); opacity: .5; }
.is-cancelled .card-title { text-decoration: line-through; text-decoration-thickness: 1.5px; }

.empty { text-align: center; padding: 56px 16px; max-width: 420px; margin: 0 auto; }
.empty > .ic { width: 36px; height: 36px; color: var(--fold); margin: 0 auto 14px; }
.empty h2 { font-size: 1.35rem; }
.empty p { color: var(--muted); margin: 6px 0 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 16px; border-radius: var(--r); border: 0;
  background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  font: 600 .95rem/1.2 var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #fff; }
.btn:active { opacity: .85; }
.btn .ic { width: 19px; height: 19px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-light { background: var(--sand); color: var(--teal-deep); box-shadow: none; }
.btn-light:hover { background: #fff; }
.btn-on-dark { background: transparent; color: var(--sand); box-shadow: inset 0 0 0 1px rgba(247, 241, 230, .4); }
.btn-on-dark:hover { background: rgba(247, 241, 230, .1); }
.btn-ghost, .btn-quiet { background: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover, .btn-quiet:hover { background: var(--tint); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-square { width: 50px; min-height: 50px; padding: 0; flex: none; }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.btn[hidden] { display: none; }
.going-open.is-going { background: var(--tint); color: var(--teal); }

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font: 500 .7rem/1 var(--text);
}
.tab .ic { width: 24px; height: 24px; }
.tab[aria-current] { color: var(--teal); font-weight: 650; }
/* the light: a thin sunrise line over the open tab, like the one in the logo */
.tab[aria-current]::before { content: ""; position: absolute; top: -1px; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--sun); }
@media (min-width: 1024px) {
  body.has-tabs main { padding-bottom: 72px; }
  .tabbar {
    position: absolute; top: 10px; left: 50%; right: auto; bottom: auto; transform: translateX(-50%);
    display: flex; gap: 4px; height: 56px; padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .tab { flex-direction: row; gap: 8px; padding: 0 14px; font-size: .95rem; font-weight: 500; }
  .tab .ic { width: 20px; height: 20px; }
  .tab:hover { color: var(--ink); }
  .tab[aria-current]::before { top: auto; bottom: 6px; width: 20px; margin-left: -10px; border-radius: 3px; }
}

/* ---------- event screen ---------- */
.ev-top { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding-top: calc(10px + env(safe-area-inset-top)); }
.ev-layout { display: grid; gap: 22px; padding-top: 8px; }
.ev-poster a { display: block; }
.ev-poster img, .ev-poster .poster-none { margin: 0 auto; border-radius: 10px; box-shadow: var(--lift); }
.ev-poster img { width: auto; max-width: 100%; max-height: 74vh; }
@media (min-width: 900px) {
  .ev-layout { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 12px; }
  .ev-poster { position: sticky; top: 24px; }
  .ev-poster img { max-height: calc(100vh - 48px); }
}
.ev-status { font-weight: 650; font-size: .9rem; color: var(--teal); margin-bottom: 6px; }
.ev-status.is-today { color: var(--sun-text); }
.ev-status-cancelled { color: var(--danger); }
.ev-main { min-width: 0; }
.ev-main h1 { font-size: clamp(1.9rem, 6.5vw, 2.8rem); line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
.ev-meta { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.ev-meta li { display: flex; gap: 12px; align-items: flex-start; }
.ev-meta li > .ic { color: var(--fold); margin-top: 1px; }
.ev-meta strong { display: block; font-weight: 500; font-size: 1rem; line-height: 1.4; }
.ev-meta strong a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.ev-meta span { display: block; color: var(--muted); font-size: .92rem; }
.ev-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.ev-actions .btn { padding: 8px; font-size: .88rem; gap: 6px; width: 100%; }
.ev-actions .btn .ic { width: 18px; height: 18px; }
@media (min-width: 720px) { .ev-actions { display: flex; flex-wrap: wrap; } .ev-actions .btn { width: auto; padding: 10px 16px; font-size: .92rem; } }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; min-width: 240px;
  background: var(--raised); color: var(--ink); border-radius: var(--r); padding: 4px; box-shadow: var(--lift);
}
.menu-list a { display: block; padding: 12px 14px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.menu-list a:hover { background: var(--tint); }

/* details: label and value on thin lines, no boxes or icon tiles */
.details { margin: 28px 0 0; border-top: 1px solid var(--line); }
.detail { padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail dt { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.detail dd { margin: 0; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.detail dd .line { display: block; }
.detail dd p + p { margin-top: 10px; }
.detail dd a { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 560px) { .detail { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; } .detail dt { margin: 2px 0 0; font-size: .875rem; } }
.details-masjid { margin-top: 6px; max-width: 760px; }
.report-link { margin-top: 22px; margin-bottom: 8px; font-size: .86rem; }
.report-link a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.report-link .ic { width: 15px; height: 15px; }
.more { margin-top: 48px; padding-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: clamp(1.25rem, 4vw, 1.55rem); letter-spacing: -0.02em; }
.section-head a { font-weight: 600; font-size: .92rem; }

/* the bar at the bottom of an event: WhatsApp + I'm going */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 8px; align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg-glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.action-bar .btn-block { min-height: 50px; font-size: 1rem; }
@media (max-width: 719px) { body.has-action-bar main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* sheets (I'm going, Sort and filter) */
.sheet {
  border: 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 100%;
  margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--raised); color: var(--ink);
}
.sheet[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: rgba(11, 58, 62, .45); }
@media (min-width: 720px) { .sheet { margin: auto; max-width: 440px; border-radius: var(--r-lg); padding: 24px; } .sheet-grip { display: none; } }
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } .searchrow { transition: none; } }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h2 { font-size: 1.35rem; letter-spacing: -0.02em; padding-top: 6px; }
.sheet-sub { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.steppers { display: grid; gap: 8px; margin: 20px 0 14px; }
.stepper { display: grid; grid-template-columns: 1fr 44px 44px 44px; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; border-radius: var(--r); background: var(--bg); }
.stepper-label { font-weight: 600; }
.stepper button {
  width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--raised); color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--line); font: 500 1.4rem/1 var(--text); cursor: pointer;
}
.stepper output { text-align: center; font: 600 1.3rem var(--display); }
.sheet-note { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.sheet .btn-block + .btn-block { margin-top: 8px; }
.going-status { margin-top: 10px; text-align: center; font-weight: 600; color: var(--teal); min-height: 1.3em; }

/* ---------- lists (masjids, settings, calendar rows): one panel, thin lines between ---------- */
.masjid-list, .set-card, .rows {
  background: var(--raised); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
}
.masjid-list { max-width: 760px; }
.masjid-card { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; color: var(--ink); }
.masjid-card + .masjid-card { border-top: 1px solid var(--line); }
.masjid-card:hover { background: #fff; }
.masjid-text { flex: 1; min-width: 0; }
.masjid-text strong { display: block; font: 600 1.04rem/1.25 var(--display); letter-spacing: -0.01em; }
.masjid-text span { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.masjid-count { flex: none; font-size: .8rem; font-weight: 600; color: var(--teal); }
.masjid-count.is-none { color: var(--muted); font-weight: 400; }
.masjid-go { display: flex; color: var(--muted); }
.masjid-go .ic { width: 18px; height: 18px; }

/* ---------- settings ---------- */
.settings { max-width: 640px; }
.set-group .section-label { font: 600 .85rem var(--text); color: var(--muted); margin: 22px 4px 8px; letter-spacing: 0; }
.set-group:first-child .section-label { margin-top: 4px; }
.set-item, .set-row { display: flex; align-items: center; gap: 14px; padding: 13px 14px 13px 16px; color: var(--ink); width: 100%; text-align: left; }
.set-item + .set-item { border-top: 1px solid var(--line); }
.set-button { border: 0; background: none; cursor: pointer; }
.set-item:hover, .set-button:hover { background: #fff; }
.set-ic { flex: none; display: flex; color: var(--fold); }
.set-ic .ic { width: 21px; height: 21px; }
.set-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-text strong { font-weight: 600; }
.set-text span { font-size: .84rem; color: var(--muted); }
.set-go { color: var(--muted); width: 18px; height: 18px; }
.set-note { margin: 8px 4px 0; font-size: .875rem; color: var(--teal); font-weight: 600; }
.set-note:empty { margin: 0; }
.set-foot { margin: 28px 4px 0; font-size: .82rem; color: var(--muted); line-height: 1.6; }

/* ---------- calendar ---------- */
@media (min-width: 960px) {
  .cal-wrap { display: grid; grid-template-columns: 360px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "cal agenda" "plans agenda"; gap: 0 48px; align-items: start; }
  .cal-card { grid-area: cal; position: sticky; top: 20px; }
  .plans { grid-area: plans; }
  .agenda { grid-area: agenda; }
  .agenda > .section-label:first-child { margin-top: 0; }
}
.cal-card { background: var(--raised); border-radius: var(--r); padding: 10px 10px 8px; box-shadow: inset 0 0 0 1px var(--line); }
.cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-top h2 { font-size: 1.08rem; }
.cal-top .icon-btn { width: 36px; height: 36px; box-shadow: none; background: transparent; }
.cal-top .icon-btn:hover { background: var(--tint); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 42px; border-radius: 10px; color: var(--ink); font-size: .95rem; font-variant-numeric: tabular-nums;
}
.cal-cell.is-empty { visibility: hidden; }
.cal-cell.is-past { color: var(--muted); opacity: .45; }
.cal-cell.has-events { font-weight: 650; }
.cal-cell.has-events:hover { background: var(--tint); }
.cal-cell i { position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--sun); }
.cal-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--teal); }
.cal-cell.has-going { background: var(--tint); color: var(--teal); }
.cal-cell.is-picked { background: var(--teal); color: #fff; }
.cal-cell.is-picked i { background: #fff; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; color: var(--ink); }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: #fff; }
.row-thumb { flex: none; width: 46px; height: 58px; border-radius: 6px; overflow: hidden; background: var(--frame); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-text strong { font: 600 1rem/1.25 var(--display); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text span { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text span:first-of-type { color: var(--fold); }
.row-going { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; }
.row-going .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.row.is-cancelled strong { text-decoration: line-through; }
.agenda-day { scroll-margin-top: 16px; }
.agenda-day h3 { font: 400 .92rem var(--text); color: var(--muted); margin: 20px 0 8px; letter-spacing: 0; }
.agenda-day h3 span { font: 600 1.02rem var(--display); color: var(--ink); margin-right: 4px; }
.agenda-day.is-flash .rows { animation: flash 1.2s ease; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 2px var(--teal); } 100% { box-shadow: inset 0 0 0 1px var(--line); } }
@media (prefers-reduced-motion: reduce) { .agenda-day.is-flash .rows { animation: none; } }

/* ---------- for masjids ---------- */
.step-cards { list-style: none; padding: 0; margin: 10px 0 0; display: grid; }
.step-cards li { padding: 18px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; }
.step-cards li:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .step-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; } .step-cards li:last-child { border-bottom: 0; } .step-cards li { border-bottom: 0; } }
.step-n { grid-row: span 2; font: 600 1.6rem/1 var(--display); color: var(--teal); }
.step-cards h3 { font-size: 1.12rem; margin-bottom: 4px; }
.step-cards p { color: var(--muted); }
.split { display: grid; gap: 12px; margin-top: 24px; }
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; gap: 16px; } }
.panel { background: var(--raised); border-radius: var(--r); padding: 20px; box-shadow: inset 0 0 0 1px var(--line); }
.panel-soft { background: transparent; }
.panel h2 { font-size: 1.2rem; margin-bottom: 14px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.ticks .ic { width: 20px; height: 20px; color: var(--teal); stroke-width: 2.2; margin-top: 1px; }
.ticks-soon .ic { color: var(--muted); }
.cta-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  margin-top: 24px; padding: 22px; border-radius: var(--r); background: var(--teal); color: var(--sand);
}
.cta-card h2 { font-size: 1.35rem; }
.cta-card p { color: rgba(247, 241, 230, .82); margin-top: 4px; }
.cta-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- text pages and forms ---------- */
.prose { max-width: 760px; padding-top: 8px; padding-bottom: 40px; }
.prose h2 { font-size: 1.3rem; margin: 30px 0 10px; }
.prose p, .prose li { font-size: 1.04rem; line-height: 1.7; max-width: 66ch; }
.prose p + p { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 10px 0; }
.prose li { margin-bottom: 6px; }
.prose a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; }
.prose .lede { font-size: 1.15rem; color: var(--muted); }
.draft-note { margin-top: 32px !important; padding: 14px 16px; border-radius: var(--r); background: var(--tint); font-size: .9rem !important; color: var(--ink); }
.narrow { max-width: 460px; }
.form { display: grid; gap: 6px; margin-top: 4px; background: var(--raised); padding: 20px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.form label { font-weight: 600; margin-top: 14px; font-size: .95rem; }
.form > label:first-child, .form > input[type="hidden"] + label { margin-top: 0; }
.form .opt { font-weight: 400; color: var(--muted); }
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form textarea, .form select {
  width: 100%; min-height: 48px; padding: 11px 13px; border: 0; border-radius: 10px;
  background: var(--field); color: var(--ink); font: 400 1rem var(--text); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.form input[type="file"] { padding: 12px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font: inherit; width: 100%; color: var(--ink); }
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--teal); }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form legend { font-weight: 600; margin-bottom: 4px; }
.form .radio, .form .check { display: flex; align-items: center; gap: 12px; font-weight: 400; margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--bg); cursor: pointer; }
.form .radio input, .form .check input { width: 20px; height: 20px; accent-color: var(--teal); margin: 0; flex: none; }
.form button[type="submit"] { justify-self: start; margin-top: 20px; }
.form .small { margin-top: 10px; }
.form .hint { margin: 0; font-size: .85rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- admin and the masjid pages (/portal) ---------- */
.admin-head { background: var(--raised); border-bottom: 1px solid var(--line); }
.head-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.admin-head .brand img { width: 150px; }
.admin-nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.admin-nav a { color: var(--ink); font: 500 .9rem var(--text); padding: 8px 10px; border-radius: 8px; }
.admin-nav a:hover { background: var(--tint); }
.admin-nav a[aria-current] { background: var(--tint); color: var(--teal); font-weight: 600; }
.admin-nav-link { font-weight: 600; font-size: .9rem; }
.main-admin { max-width: 1200px; margin: 0 auto; padding: 20px 16px 64px; }
@media (min-width: 720px) { .main-admin { padding: 28px 32px 64px; } .head-inner { padding: 10px 32px; } }
.main-admin .prose { padding-top: 12px; }
.main-admin .prose h1 { font-size: 2.1rem; margin-bottom: 18px; }
.admin h1 { font-size: 2.1rem; letter-spacing: -0.03em; }
.admin h2 { font-size: 1.2rem; margin: 30px 0 12px; }
.crumb { margin-bottom: 10px; font-size: .9rem; }
.crumb a { color: var(--muted); }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.banner { padding: 13px 16px; border-radius: var(--r); background: var(--tint); margin: 0 0 16px; }
.banner-cancelled { background: #F6DEDB; color: #7A1712; }
.banner-ok { background: #DDEFE3; color: #134A2A; }
.banner-todo { background: #F6E2D6; }
.banner-todo a { color: var(--sun-text); font-weight: 600; }
.table-wrap { overflow-x: auto; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--raised); }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .95rem; }
.admin-table th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.admin-table .thumb { width: 64px; }
.admin-table .thumb img { border-radius: 6px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: var(--tint); color: var(--teal); }
.tag-cancelled { background: var(--danger); color: #fff; }
.tag-wait { background: #F6E2D6; color: #7A3412; }
.going-total { display: block; font-size: .875rem; margin-top: 4px; }
.past { margin-top: 30px; }
.past summary { cursor: pointer; font: 600 1.1rem var(--display); margin-bottom: 12px; }
.signout { margin-top: 44px; }
.form-cols { display: grid; gap: 24px; }
@media (min-width: 900px) { .form-cols { grid-template-columns: 300px 1fr; gap: 40px; } .form-poster { position: sticky; top: 20px; align-self: start; } }
.event-form { background: transparent; padding: 0; box-shadow: none; }
.form-main { background: var(--raised); padding: 22px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 6px; }
.form-main h2 { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 1.12rem; }
.field { display: grid; gap: 4px; }
.field label { margin-top: 12px; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.poster-preview { border-radius: var(--r-sm); background: var(--frame); min-height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 4px 0 8px; color: var(--muted); }
.poster-preview img { width: 100%; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.form-status { font-weight: 600; color: var(--teal); }
.narrow-form { max-width: 580px; }
.danger { margin-top: 36px; }
.inbox-grid { display: grid; gap: 12px; }
.inbox-item { display: grid; grid-template-columns: 110px 1fr; gap: 16px; background: var(--raised); padding: 16px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.inbox-item img { border-radius: 6px; }
.inbox-item p { margin: 0 0 8px; }
.inbox-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inbox-actions form { margin: 0; }
.note { white-space: pre-wrap; background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.reports { list-style: none; padding: 0; display: grid; gap: 12px; }
.reports li { background: var(--raised); padding: 16px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); border-left: 4px solid transparent; }
.reports li.is-concern { border-left-color: var(--danger); }
.reports p { margin: 0 0 8px; }
.is-done { opacity: .6; }
.portal-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.portal-brand img { height: 26px; width: auto; }
.portal-brand > span { display: grid; line-height: 1.15; }
.portal-brand strong { font: 600 1.05rem var(--display); white-space: nowrap; }
.portal-brand span span { font-size: .78rem; color: var(--muted); }
@media (max-width: 420px) { .portal-brand img { height: 22px; } .portal-head .admin-nav a { padding: 8px 7px; } }
.portal-narrow { max-width: 460px; margin: 0 auto; padding-top: 12px; }
.portal-narrow h1 { font-size: clamp(1.8rem, 6vw, 2.3rem); letter-spacing: -0.03em; }
.portal-narrow .lede { color: var(--muted); margin: 10px 0 18px; font-size: 1.05rem; }
.p-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.p-hero h1 { font-size: clamp(1.9rem, 6vw, 2.5rem); letter-spacing: -0.03em; }
.p-hero p { margin-top: 6px; }
.portal-home h2 { font-size: 1.15rem; margin: 28px 0 12px; }
.p-list { display: grid; background: var(--raised); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.p-event { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; color: var(--ink); }
.p-event + .p-event { border-top: 1px solid var(--line); }
.p-event:hover { background: #fff; }
.p-event-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.p-event-text strong { font: 600 1rem/1.25 var(--display); }
.p-event-text span { font-size: .86rem; color: var(--muted); }
.p-event-text .tag { justify-self: start; }
.p-going { flex: none; text-align: right; display: grid; max-width: 40%; }
.p-going strong { font: 600 1.5rem/1 var(--display); color: var(--ink); }
.p-going span { font-size: .75rem; color: var(--muted); }
.p-going.is-none strong { color: var(--muted); opacity: .6; }
.p-members { margin-bottom: 18px; }
.p-member { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 13px 16px; }
.p-member + .p-member { border-top: 1px solid var(--line); }
.p-member-text { flex: 1; min-width: 180px; display: grid; gap: 1px; }
.p-member-text span { font-size: .85rem; color: var(--muted); }
.p-member-actions { display: flex; gap: 6px; }
.p-member-actions form { margin: 0; }
.link-box { background: var(--raised); border-radius: var(--r); padding: 18px; margin: 0 0 20px; box-shadow: inset 0 0 0 2px var(--teal); }
.link-input { width: 100%; margin: 12px 0; padding: 12px 14px; border: 0; border-radius: 10px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line-strong); font: 400 .9rem var(--text); color: var(--ink); }
.link-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.link-actions .btn { white-space: normal; text-align: left; }
.req-item { grid-template-columns: 1fr; }
.req-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 14px; font-size: .92rem; }
.req-dl dt { color: var(--muted); }
.req-dl dd { margin: 0; overflow-wrap: anywhere; }
.req-approve { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.req-approve select { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 0; background: var(--field); box-shadow: inset 0 0 0 1px var(--line-strong); font: inherit; max-width: 100%; }
.req-approve label { font-weight: 600; font-size: .9rem; }
.req-decline { margin-top: 12px; }
.req-decline summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.req-decline form { margin-top: 10px; display: grid; gap: 8px; }
.req-decline textarea { width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line-strong); font: inherit; }
.form-h { font-size: 1.12rem; margin: 18px 0 2px !important; }
.form-h:first-child { margin-top: 0 !important; }
