/* Saff — accent ladder with the lime-wash masjid face.
   One hue (door green) at full strength only on small marks: the walk bar, the jamaat ring,
   the active tab icon and the one primary button. Its pale tints carry every area.
   Shell: phone = 56px top bar + bottom bar of five; >= 960px = ruled T-frame, 230px sidebar + 64px top bar.
   Desktop canvas: 230 sidebar + 29 gutter + content (max 1100) + 29 gutter. Now grid: 1fr + 24 gap + 320 rail. */
:root {
  --ground: #f4f7f4;
  --surface: #ffffff;
  --raised: #edf2ee;
  --border: #e1e7e3;
  --rule: #edf1ee;
  --control: #c5cfc8;
  --text: #13261f;
  --muted: #536159;
  --accent: #0e6b4f;
  --accent-soft: #e9f4ee;
  --accent-track: #cfe6da;
  --accent-ink: #0a3d2e;
  --on-accent: #ffffff;
  --primary: #13261f;
  --on-primary: #ffffff;
  --warning: #8a3d0c;
  --pill-warning-bg: #fff4e0;
  --negative: #c4242a;
  --pill-neutral-bg: #edf2ee;
  --pill-neutral-ink: #34443c;
  --selection: #cfe6da;
  --shadow-float: 0 8px 24px rgb(19 38 31 / .14);

  --font: "Anek Tamil", "Noto Sans Tamil", system-ui, sans-serif;
  --fs-title: 24px;
  --fs-section: 18px;
  --fs-kpi: 24px;
  --fs-body: 15px;
  --fs-small: 13px;
  --radius-card: 8px;
  --radius-control: 6px;
  --gap: 16px;
  --pad: 16px;
  --control-height: 40px;
  --row-pitch: 64px;
  --name-col: 124px;
  --top-h: 56px;
  --tabs-h: 64px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101412; --surface: #171c19; --raised: #1f2521; --border: #29312c; --rule: #222925; --control: #3d4741;
    --text: #edf2ee; --muted: #a7b3ac; --accent: #58c393; --accent-soft: #15241d; --accent-track: #1f3a2d; --accent-ink: #bfe8d3;
    --on-accent: #0b1f17; --primary: #edf2ee; --on-primary: #101412;
    --warning: #f0b36a; --pill-warning-bg: #2c2112; --pill-neutral-bg: #222925; --pill-neutral-ink: #c9d3cd;
    --selection: #1f3a2d; --shadow-float: 0 8px 24px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #101412; --surface: #171c19; --raised: #1f2521; --border: #29312c; --rule: #222925; --control: #3d4741;
  --text: #edf2ee; --muted: #a7b3ac; --accent: #58c393; --accent-soft: #15241d; --accent-track: #1f3a2d; --accent-ink: #bfe8d3;
  --on-accent: #0b1f17; --primary: #edf2ee; --on-primary: #101412;
  --warning: #f0b36a; --pill-warning-bg: #2c2112; --pill-neutral-bg: #222925; --pill-neutral-ink: #c9d3cd;
  --selection: #1f3a2d; --shadow-float: 0 8px 24px rgb(0 0 0 / .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; overscroll-behavior-y: none; }
html { scroll-padding-top: calc(var(--top-h) + 16px); scroll-padding-bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom, 0px)); }
body {
  font: 400 var(--fs-body)/1.5 var(--font);
  background: var(--ground); color: var(--text);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--selection); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
button, a, label, select { -webkit-tap-highlight-color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); line-height: 1.4; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ta { font-weight: 500; color: var(--muted); }

/* ---- Shell ---- */
.top {
  position: sticky; top: 0; z-index: 1000;
  height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ground); border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mark { width: 22px; height: 26px; color: var(--accent); stroke: none; align-self: center; }
.wordmark { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.tagline { font-size: var(--fs-small); color: var(--muted); white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.switcher {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 52vw;
  height: 36px; padding: 0 12px; border-radius: 999px;
  font: 500 var(--fs-small)/1 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.switcher svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.switcher span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notice { font-size: var(--fs-small); padding: 8px 16px; text-align: center; }
.offline-bar { display: none; background: var(--pill-warning-bg); color: var(--warning); }
body.offline .offline-bar { display: block; }
.update-bar { background: var(--accent-soft); color: var(--accent-ink); display: flex; gap: 12px; justify-content: center; align-items: center; }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 1000;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabs button {
  font: 500 12px/1 var(--font); color: var(--muted); background: none; border: 0; cursor: pointer;
  display: grid; justify-items: center; align-content: center; gap: 5px; position: relative;
}
.tabs svg { width: 22px; height: 22px; }
.tabs button.on { color: var(--accent-ink); font-weight: 600; }
.tabs button.on svg { color: var(--accent); }
.tabs button.on::before { content: ""; position: absolute; top: 8px; width: 52px; height: 30px; border-radius: 999px; background: var(--accent-soft); z-index: -1; }

main { max-width: 1100px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.view { display: none; }
.view.active { display: block; animation: view-in 180ms var(--ease-out); }
@keyframes view-in { from { opacity: 0; } }

/* ---- Title rows ---- */
.title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-block: 20px 4px; }
.title-row.compact { align-items: center; padding-block: 20px 12px; }
.title-text { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
h1, .title { font-size: var(--fs-title); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.title-text .ta { font-size: 20px; }
.title-meta { text-align: right; flex: none; }
.clock { font-size: var(--fs-kpi); font-weight: 600; line-height: 1.1; font-variation-settings: "wdth" 90; }
.section-title { font-size: var(--fs-section); font-weight: 600; line-height: 1.3; }

.finding { display: flex; gap: 10px; align-items: baseline; min-height: 24px; margin-top: 4px; font-size: var(--fs-body); }
.finding b { font-weight: 600; }
.finding.janaza { color: var(--accent-ink); }
.finding .dot { flex: none; transform: translateY(-1px); }

/* ---- Filters and chips ---- */
.filters, .tabbar {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 14px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 14px; padding: 2px max(16px, env(safe-area-inset-left, 0px));
}
.filters::-webkit-scrollbar, .tabbar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  font: 500 14px/1 var(--font); color: var(--text); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.chip.on, .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-track); color: var(--accent-ink); }
.select-chip { position: relative; padding: 0; }
.select-chip select { appearance: none; border: 0; background: transparent; font: inherit; color: inherit; height: 100%; padding: 0 34px 0 14px; cursor: pointer; border-radius: 999px; }
.select-chip svg { position: absolute; right: 12px; width: 15px; height: 15px; pointer-events: none; color: var(--muted); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.finding .dot, .srow.janaza .ring { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgb(14 107 79 / .4); } 50% { box-shadow: 0 0 0 7px rgb(14 107 79 / 0); } } /* taste-skill-ignore: floats (pin, popup, toast, sheet) or janaza state halo */

/* ---- Panels, buttons, fields ---- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-height); padding: 0 16px; border-radius: var(--radius-control);
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--control); }
.btn.danger { background: transparent; color: var(--negative); border-color: currentColor; }
.btn.danger.confirming { background: var(--negative); border-color: var(--negative); color: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:active, .chip:active, .go:active, .switcher:active { transform: scale(.97); }
@media (hover: hover) {
  .btn.secondary:hover, .chip:hover, .switcher:hover { border-color: var(--muted); }
  .btn.primary:hover { filter: brightness(1.08); }
  .tabs button:hover { color: var(--text); }
}
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.field { display: block; font-size: 14px; font-weight: 500; margin: 16px 0 8px; }
input, select, textarea {
  font: 400 15px/1.4 var(--font); color: var(--text); width: 100%;
  background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-control);
  padding: 9px 12px; min-height: var(--control-height);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; margin: 16px 0 0; font-size: 15px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.row.end { justify-content: flex-end; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.warn { margin: 8px 0 0; padding-left: 18px; color: var(--warning); font-size: var(--fs-small); }
.warn:empty, #u-ocr:empty { display: none; }
.ok-msg { color: var(--accent-ink); font-weight: 500; margin-right: auto; }
pre { margin: 0; background: var(--raised); border-radius: var(--radius-control); padding: 12px; font: 400 14px/1.5 var(--font); white-space: pre-wrap; }

/* ---- Daily / Jumu'ah ---- */
.seg { display: inline-flex; gap: 2px; margin-top: 14px; padding: 3px; background: var(--raised); border-radius: 999px; }
.seg button { height: 34px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font: 600 14px/1 var(--font); cursor: pointer; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.seg button.on { background: var(--surface); color: var(--accent-ink); border-color: var(--border); }
.filters.langs { margin-top: -6px; }
.khutbah-band { position: absolute; top: 25px; height: 4px; border-radius: 2px; background: var(--accent-track); }
.k-khutbah { width: 18px; height: 4px; border-radius: 2px; background: var(--accent-track); }
.langs-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.check.inline { margin: 0; }
.badge.verified { background: var(--accent); color: var(--on-accent); }
.item .verify { margin-top: 6px; color: var(--text); }
.item.halal .row { margin-top: 10px; }
.visit { padding: 16px; margin-bottom: 8px; }
.halal-scope { margin: -4px 0 12px; max-width: 60ch; }

/* ---- Places ---- */
.places { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 14px max(16px, env(safe-area-inset-left, 0px)) 2px; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); }
.places::-webkit-scrollbar { display: none; }
.chip.place { height: 44px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 0 14px; border-radius: var(--radius-card); }
.chip.place b { font-weight: 600; font-size: 14px; line-height: 1.1; }
.chip.place span { font-size: 12px; color: var(--muted); line-height: 1.1; }
.chip.place.on span { color: var(--accent-ink); }
.chip.ghost { height: 44px; border-style: dashed; color: var(--muted); border-radius: var(--radius-card); }
.chip.ghost svg { width: 15px; height: 15px; }
.place-form { padding: 16px; margin-top: 12px; }
.place-form .two { margin-top: -4px; }

/* ---- Now: the saff rows ---- */
.now-grid { display: grid; gap: 24px; }
.saff { overflow: hidden; }
.axis { display: grid; grid-template-columns: var(--name-col) 1fr 48px; height: 34px; align-items: end; border-bottom: 1px solid var(--rule); }
.ticks { position: relative; height: 100%; }
.ticks span { position: absolute; bottom: 8px; transform: translateX(-50%); font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ticks span.now-tick { transform: none; color: var(--accent-ink); font-weight: 600; }
.srows { position: relative; }
.srow {
  display: grid; grid-template-columns: var(--name-col) 1fr 48px; align-items: center;
  min-height: var(--row-pitch); border-bottom: 1px solid var(--rule);
}
.srow:last-child { border-bottom: 0; }
.srow.janaza { background: var(--accent-soft); }
.sname { padding: 10px 8px 10px 14px; min-width: 0; }
.sname b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
.sname .leave { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--accent-ink); line-height: 1.35; margin-top: 2px; }
.sname .leave.late { color: var(--warning); }
.sname .meta { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.track { position: relative; height: 44px; }
.grid-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--rule); }
.wait { position: absolute; top: 27px; height: 0; border-top: 2px dotted var(--control); }
.walk { position: absolute; top: 23px; height: 8px; border-radius: 4px; background: var(--accent); }
.ring {
  position: absolute; top: 19px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tlabel { position: absolute; top: 1px; transform: translateX(-50%); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tlabel.edge-r { transform: translateX(-100%); }
.tlabel.edge-l { transform: translateX(7px); }
.srow.late .walk { background: var(--warning); }
.srow.late .ring { border-color: var(--warning); }
.srow.late .tlabel { color: var(--warning); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
.pill.janaza { background: var(--surface); color: var(--accent-ink); border: 1px solid var(--accent-track); }
.srow .pill { margin-top: 4px; }
.now-line { position: absolute; top: 0; bottom: 0; left: var(--name-col); width: 2px; background: var(--accent); opacity: .55; pointer-events: none; }
.go {
  justify-self: center; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--text); border: 1px solid var(--border); background: var(--surface); transition: transform 160ms var(--ease-out);
}
.go svg { width: 18px; height: 18px; }
.saff-empty { padding: 28px 16px; color: var(--muted); }
.more { display: inline-block; margin-top: 4px; padding: 4px 0; border: 0; background: none; font: 600 13px/1.2 var(--font); color: var(--accent-ink); cursor: pointer; text-align: left; }
.more:hover { text-decoration: underline; }
.others { grid-column: 1 / -1; padding: 0 0 6px 14px; background: var(--raised); border-top: 1px solid var(--rule); }
.srow.janaza .others { background: var(--accent-soft); }
.orow { display: grid; grid-template-columns: 1fr auto 48px; gap: 8px; align-items: center; min-height: 56px; border-bottom: 1px solid var(--rule); }
.orow:last-child { border-bottom: 0; }
.orow b { display: block; font-weight: 600; font-size: 14px; line-height: 1.2; }
.orow .meta { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.pin-btn { height: 32px; padding: 0 10px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); color: var(--text); font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap; }
.pin-btn.on { background: var(--accent-soft); border-color: var(--accent-track); color: var(--accent-ink); }
.linkish { border: 0; background: none; padding: 0; font: 600 12px/1.4 var(--font); color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.saff-foot .key { margin-left: auto; }
.saff-foot .key i { margin: 0 4px 0 8px; }
.item .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.proposal .meta b { color: var(--text); font-weight: 600; }
#p-list .item { padding-inline: 0; }
#p-list:not(:empty) { margin-top: 4px; }
.saff-foot { padding: 10px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.saff-foot i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.k-wait { width: 18px; border-top: 2px dotted var(--control); }
.k-walk { width: 18px; height: 6px; border-radius: 3px; background: var(--accent); }
.k-ring { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--accent); }

.later .section-title { margin-bottom: 8px; }
.later .later-title { margin-top: 24px; }
.today { padding: 4px 14px; }
.trow { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.trow:last-child { border-bottom: 0; }
.trow .p { font-weight: 500; }
.trow .p .ta { font-size: 13px; margin-left: 6px; }
.trow .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.trow.past { color: var(--muted); }
.trow.past .t { font-weight: 500; }
.trow.next { margin: 0 -14px; padding-inline: 14px; background: var(--accent-soft); color: var(--accent-ink); border-bottom-color: transparent; }
.today-foot { font-size: 12px; color: var(--muted); padding: 8px 0 6px; border-top: 1px solid var(--rule); }
.lrow { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.lrow:last-child { border-bottom: 0; }
.lrow .t { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.lrow .t small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.lrow b { display: block; font-weight: 600; line-height: 1.25; }
.lrow .meta { display: block; font-size: var(--fs-small); color: var(--muted); }

/* ---- Lists: zakat, halal, janaza ---- */
.rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.item:last-child { border-bottom: 0; }
.item .title { font-weight: 600; font-size: 16px; line-height: 1.25; }
.item .meta { display: block; font-size: var(--fs-small); color: var(--muted); line-height: 1.4; }
.item .lead { display: flex; gap: 14px; align-items: center; min-width: 0; }
.item .count { min-width: 44px; text-align: center; font-size: var(--fs-kpi); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.item .count small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.badge.certified { background: var(--accent-soft); color: var(--accent-ink); }
.badge.muslim-owned { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.badge.self-declared { background: var(--pill-warning-bg); color: var(--warning); }
.empty { padding: 24px 16px; color: var(--muted); }
#j-list:not(:empty) { margin-top: 20px; border-top: 1px solid var(--rule); }
#j-list .item { padding-inline: 0; }

.calc { padding: 16px; margin-bottom: 8px; }
.calc .two { margin-top: -16px; }
.figure { font-size: var(--fs-kpi); font-weight: 600; margin: 16px 0 4px; }
#n-form, #h-form { padding: 16px; margin-bottom: 8px; }
#n-form .field:first-of-type, #h-form h2 + .field { margin-top: 8px; }

/* ---- Update: settings rows ---- */
.set { display: grid; gap: 12px; padding-block: 20px; border-top: 1px solid var(--rule); }
.title-row + .set { border-top: 0; padding-top: 4px; }
.set-head h2 { font-size: var(--fs-section); font-weight: 600; line-height: 1.3; }
.set-head p { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 46ch; }
.set-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 0 16px 16px; }
.set-panel > .field:first-child { margin-top: 16px; }
.set-panel > pre:first-child, .set-panel > .row:first-child { margin-top: 16px; }
.times-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.tfield { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.tfield .off { display: flex; gap: 6px; align-items: center; font-weight: 400; color: var(--muted); font-size: 13px; }
.tfield .off input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.tfield .off input[type=number] { width: 56px; padding: 4px 6px; min-height: 30px; }
.mini-map { height: 220px; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--border); margin-top: 12px; }
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); display: grid; gap: 10px; justify-items: start; }

/* ---- Map ---- */
.legend { display: flex; gap: 14px; font-size: var(--fs-small); color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.lg-m { background: var(--accent); border: 2px solid var(--surface); outline: 1px solid var(--accent); }
.lg-j { background: var(--accent); outline: 3px solid var(--accent-track); }
.lg-h { background: var(--primary); border-radius: 3px; }
#map { height: calc(100dvh - var(--top-h) - var(--tabs-h) - 96px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 360px; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--border); }
.leaflet-container { font: inherit; background: var(--raised); }
.pin { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / .3); } /* taste-skill-ignore: floats (pin, popup, toast, sheet) or janaza state halo */
.pin.janaza { /* taste-skill-ignore: janaza halo is a state mark, not depth */ box-shadow: 0 0 0 5px var(--accent-track), 0 1px 4px rgb(0 0 0 / .3); animation: breathe 2.4s ease-in-out infinite; }
.pin.halal { background: var(--primary); border-radius: 6px; width: 18px; height: 18px; }
.pin.here { background: var(--primary); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); } /* taste-skill-ignore: floats (pin, popup, toast, sheet) or janaza state halo */
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 14px 16px; font-size: 14px; line-height: 1.45; }
.pop { min-width: 210px; }
.pop .title { font-size: 16px; font-weight: 600; display: block; }
.pop table { width: 100%; border-collapse: collapse; margin: 8px 0; font-variant-numeric: tabular-nums; }
.pop td { padding: 3px 0; border-bottom: 1px solid var(--rule); }
.pop td:last-child { text-align: right; }
.pop .next { margin-top: 6px; color: var(--accent-ink); font-weight: 500; }
.pop .row { margin-top: 10px; }
.pop .btn { height: 34px; font-size: 14px; }
.pop .btn.primary { color: var(--on-accent); }
.pop .btn.secondary { color: var(--text); }

/* ---- Toast, sheet ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 2000;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--primary); color: var(--on-primary); padding: 11px 16px; border-radius: var(--radius-card);
  font-size: 14px; max-width: min(90vw, 420px); box-shadow: var(--shadow-float); /* taste-skill-ignore: floats (pin, popup, toast, sheet) or janaza state halo */
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet { position: fixed; inset: 0; z-index: 3000; background: rgb(0 0 0 / .45); display: flex; align-items: flex-end; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.sheet .panel { width: 100%; max-width: 480px; margin: 0 auto; padding: 16px; box-shadow: var(--shadow-float); } /* taste-skill-ignore: floats (pin, popup, toast, sheet) or janaza state halo */
.sheet ol { padding-left: 20px; line-height: 1.8; margin: 8px 0 16px; }

@media (min-width: 600px) { :root { --name-col: 160px; } }

/* ---- Wide screens: ruled T-frame ---- */
@media (min-width: 960px) {
  :root { --top-h: 64px; --tabs-h: 0px; --name-col: 168px; --row-pitch: 60px; --fs-title: 32px; }
  body { padding-bottom: 0; padding-left: 230px; }
  .top { margin-left: -230px; padding-left: 29px; }
  .brand { width: 201px; }
  .tabs {
    inset: calc(var(--top-h) + 1px) auto 0 0; width: 230px; height: auto;
    grid-template-columns: 1fr; grid-auto-rows: 40px; align-content: start; gap: 2px;
    padding: 16px 12px; border-top: 0; border-right: 1px solid var(--rule); background: var(--ground);
  }
  .tabs button { display: flex; justify-content: flex-start; gap: 10px; padding: 0 12px; font-size: 15px; border-radius: 8px; }
  .tabs svg { width: 18px; height: 18px; }
  .tabs button.on { background: var(--accent-soft); }
  .tabs button.on::before { display: none; }
  main { padding: 0 29px 40px; }
  .filters, .tabbar { margin-inline: 0; padding-inline: 0; overflow: visible; flex-wrap: wrap; }
  .now-grid { grid-template-columns: 1fr 320px; align-items: start; }
  .set { grid-template-columns: 340px 1fr; gap: 32px; padding-block: 28px; }
  .set-head { padding-top: 16px; }
  .toast { bottom: 24px; }
  #map { height: calc(100dvh - var(--top-h) - 120px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
