/* Ruang Warga · Pekanbaru Network — Mini App Telegram */
:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #efede6;
  --text: #16201d;
  --muted: #66716d;
  --line: rgba(22, 32, 29, .09);
  --brand: #0b5d4f;
  --brand-2: #12806c;
  --brand-ink: #ffffff;
  --gold: #f5b83d;
  --danger: #d4462f;
  --shadow: 0 1px 2px rgba(16, 24, 22, .05), 0 6px 18px rgba(16, 24, 22, .06);
  --shadow-lg: 0 -8px 40px rgba(16, 24, 22, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --c-jobs: #c96f05; --c-news: #2563eb; --c-events: #7c3aed; --c-deals: #15803d; --c-public: #d4462f;
  --c-market: #a16207; --c-food: #db2777; --c-reports: #ea580c; --c-questions: #0d9488;
  --c-directory: #4f46e5; --c-offer: #4f46e5; --c-need: #4f46e5;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1513;
  --surface: #172220;
  --surface-2: #1e2b28;
  --text: #ecf1ef;
  --muted: #93a19c;
  --line: rgba(236, 241, 239, .09);
  --brand: #37b39a;
  --brand-2: #4fd1b4;
  --brand-ink: #06221c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --shadow-lg: 0 -8px 40px rgba(0, 0, 0, .5);
  --c-jobs: #f0a43a; --c-news: #6ea0ff; --c-events: #b28bff; --c-deals: #4ccf7c; --c-public: #ff7a64;
  --c-market: #e3b341; --c-food: #ff7ab8; --c-reports: #ff9a52; --c-questions: #3fd1bf;
  --c-directory: #9a9cff; --c-offer: #9a9cff; --c-need: #9a9cff;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Jangan beri overflow pada html/body: body akan jadi area gulir sendiri dan gestur sentuh terjebak.
   Cegah lebar berlebih dengan overflow-x: clip pada .app (tidak membuat area gulir). */
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { overscroll-behavior-y: none; }
body {
  font: 15px/1.45 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2.5px solid var(--brand-2); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; }

.app { max-width: 640px; margin: 0 auto; min-height: 100vh; overflow-x: clip; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 14px; letter-spacing: -.02em;
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.brand-text { display: grid; line-height: 1.15; }
.brand-text b { font-size: 16px; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pull to refresh */
.ptr { height: 0; overflow: hidden; display: grid; place-items: center; transition: height .25s var(--ease); }
.ptr span { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); }
.ptr.active span { animation: spin .7s linear infinite; }

/* Views */
main { outline: none; }
.view { padding: 4px 16px 8px; animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.greet { padding: 8px 2px 14px; }
.greet h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
.greet p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.search-pill {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted);
  text-align: left; font-size: 15px;
}
.search-pill:active { transform: scale(.99); }

.alert {
  margin-top: 14px; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-public) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-public) 30%, transparent);
  text-align: left; width: 100%;
}
.alert svg { color: var(--c-public); margin-top: 1px; }
.alert b { display: block; font-size: 13px; color: var(--c-public); }
.alert span { font-size: 14px; }

/* Hari ini */
.today {
  margin-top: 12px; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0;
  border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); text-align: left; overflow: hidden;
}
.today .tcell { min-width: 0; padding: 11px 10px 10px; display: grid; gap: 1px; border-left: 1px solid var(--line); }
.today .tcell:first-child { border-left: 0; }
.today i { font-style: normal; font-size: 17px; line-height: 1.1; }
.today b, .today small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today b { font-size: 13.5px; font-weight: 700; }
.today small { font-size: 12px; color: var(--muted); }
.today.warn { box-shadow: 0 0 0 1.5px #e8892b inset, var(--shadow); }
.today:active { transform: scale(.99); }
.sheet .th { margin: 18px 0 8px; font-size: 15px; }
.sheet .src { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.prayers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.prayers span, .wparts span { min-width: 0; display: grid; justify-items: center; gap: 2px; padding: 9px 2px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.prayers small, .wparts small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.prayers b { font-size: 14px; }
.prayers .on { background: var(--brand, #0b5d4f); color: #fff; }
.prayers .on small { color: rgba(255,255,255,.85); }
.wparts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.wparts i { font-style: normal; font-size: 20px; }
.wparts b { font-size: 13px; }
.airbox { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.airbox i { font-style: normal; font-size: 22px; }
.airbox b { display: block; font-size: 14px; }
.airbox small { font-size: 13px; color: var(--muted); }
.airbox.lvl2 { background: color-mix(in srgb, #e8892b 16%, var(--surface)); }
.airbox.lvl3, .airbox.lvl4 { background: color-mix(in srgb, #d23c3c 16%, var(--surface)); }
@media (max-width: 360px) { .prayers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Quick actions */
.quick { margin: 18px 0 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px; }
.quick button {
  display: grid; justify-items: center; gap: 6px; padding: 4px 2px; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2;
}
.quick .qi {
  width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; font-size: 24px;
  background: color-mix(in srgb, var(--qc, var(--brand)) 13%, var(--surface)); box-shadow: var(--shadow);
  transition: transform .15s var(--ease);
}
.quick button:active .qi { transform: scale(.92); }

/* Sections */
.section { margin-top: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; font-weight: 750; }
.section-head button { color: var(--brand); font-weight: 650; font-size: 13.5px; padding: 4px 0; }
.rail {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 16px;
  margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* Cards */
.card {
  flex: 0 0 76%; max-width: 300px; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column;
  transition: transform .18s var(--ease);
}
.card:active { transform: scale(.98); }
.card .cover { aspect-ratio: 1.91 / 1; background: var(--surface-2); position: relative; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.cover.art {
  aspect-ratio: 2.3 / 1; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 26%, var(--surface)) 0%, color-mix(in srgb, var(--cc) 9%, var(--surface)) 100%);
}
.cover.art.big { aspect-ratio: 3 / 1; height: 100%; width: 100%; }
.art-emoji { font-size: 40px; position: relative; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); }
.cover.art.big .art-emoji { font-size: 56px; }
.art-bg { position: absolute; right: -14px; bottom: -26px; font-size: 110px; opacity: .14; transform: rotate(-12deg); }
.art-source { position: absolute; right: 10px; bottom: 8px; max-width: 60%; font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--cc) 75%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cover img.loaded { opacity: 1; }
.card .body { padding: 11px 13px 13px; display: grid; gap: 5px; min-width: 0; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 2px 10px; min-width: 0; }
.meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chip {
  justify-self: start; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  padding: 3px 8px; border-radius: 999px; color: var(--cc, var(--brand)); background: color-mix(in srgb, var(--cc, var(--brand)) 13%, transparent);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cover .chip { position: absolute; left: 10px; top: 10px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); }
.when { font-size: 12.5px; font-weight: 650; color: var(--text); }
.when.soon { color: var(--danger); }

.empty-card {
  flex: 0 0 76%; max-width: 300px; border-radius: var(--radius); border: 1.5px dashed var(--line); padding: 18px;
  display: grid; gap: 8px; align-content: center; text-align: left; color: var(--muted); background: transparent;
}
.empty-card b { color: var(--text); font-size: 15px; }
.empty-card span.go { color: var(--brand); font-weight: 700; font-size: 14px; }

/* List rows */
.list { display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow); text-align: left; width: 100%;
  transition: transform .15s var(--ease);
}
.row:active { transform: scale(.985); }
.row .thumb { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .thumb.icon { display: grid; place-items: center; font-size: 34px; background: color-mix(in srgb, var(--cc, var(--brand)) 14%, var(--surface)); }
.row .body { min-width: 0; display: grid; gap: 4px; }
.row h3 { margin: 0; font-size: 14.5px; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Guides */
.guides { display: grid; gap: 8px; }
.guide {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); text-align: left; width: 100%;
}
.guide .gi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 19px; flex: none; }
.guide b { display: block; font-size: 14px; }
.guide small { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.guide svg { margin-left: auto; color: var(--muted); width: 18px; height: 18px; }

.join {
  margin-top: 26px; padding: 18px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #1b8c74 0%, #0b5d4f 45%, #08423a 100%);
  display: grid; gap: 10px; box-shadow: var(--shadow);
}
.join h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.join p { margin: 0; opacity: .85; font-size: 14px; }
.join .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px;
  font-weight: 700; font-size: 15px; background: var(--surface-2); color: var(--text); transition: transform .12s var(--ease), filter .12s;
}
.btn:active { transform: scale(.97); filter: brightness(.96); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.light { background: rgba(255, 255, 255, .16); color: #fff; }
.btn.white { background: #fff; color: #0b5d4f; }
.btn.block { width: 100%; }
.btn svg { width: 19px; height: 19px; }

/* Search view */
.search-head { position: sticky; top: 60px; z-index: 10; background: var(--bg); padding: 4px 0 8px; margin: 0 -16px; padding-inline: 16px; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.search-field svg { color: var(--muted); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; -webkit-appearance: none; appearance: none; }
.search-field input::-webkit-search-cancel-button, .search-field input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-field input::placeholder { color: var(--muted); }
.search-field .clear { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 650; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.chips button[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.result-info { color: var(--muted); font-size: 13px; margin: 6px 2px 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.result-info button { color: var(--brand); font-weight: 650; font-size: 13px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.suggest button { padding: 8px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 13.5px; }

.state { text-align: center; padding: 36px 20px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.state .big { font-size: 40px; }
.state b { color: var(--text); font-size: 16px; }

/* Skeleton */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 10px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { flex: 0 0 76%; max-width: 300px; height: 230px; border-radius: var(--radius); }
.sk-line { height: 14px; margin: 8px 0; }

/* Me view */
.profile { display: flex; align-items: center; gap: 14px; padding: 14px 2px 18px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 22px; font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.profile p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.group { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.group h2 { margin: 0; padding: 14px 16px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 16px; text-align: left; font-weight: 600; }
.item + .item { border-top: 1px solid var(--line); }
.item:active { background: var(--surface-2); }
.item .ii { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--surface-2); flex: none; }
.item small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.item .chev { margin-left: auto; color: var(--muted); width: 18px; height: 18px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 4px; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; max-width: 640px; margin: 0 auto;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar button { position: relative; height: 100%; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
.tabbar button[aria-current="page"] { color: var(--brand); }
.tabbar button[aria-current="page"] svg { stroke-width: 2.3; }
.tabbar button:active svg { transform: scale(.9); }
.tabbar svg { transition: transform .15s var(--ease); }
.post-circle {
  width: 46px; height: 46px; margin-top: -18px; border-radius: 16px; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 45%, transparent);
  transition: transform .15s var(--ease);
}
.post-circle svg { stroke-width: 2.6; }
.tab-post:active .post-circle { transform: scale(.92) rotate(45deg); }
.tab-post { color: var(--text) !important; }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; display: grid; place-items: center; }

/* Sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(5, 12, 10, .45); opacity: 0; transition: opacity .25s; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-width: 640px; margin: 0 auto;
  max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg); transform: translateY(105%); transition: transform .34s var(--ease); will-change: transform;
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grip { padding: 9px 0 5px; display: grid; place-items: center; cursor: grab; touch-action: none; flex: none; }
.sheet-grip span { width: 40px; height: 5px; border-radius: 3px; background: var(--line); background: color-mix(in srgb, var(--muted) 40%, transparent); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 20px; }
.sheet h2 { margin: 6px 0 4px; font-size: 21px; line-height: 1.25; letter-spacing: -.015em; }
.sheet .lead { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.detail-cover { margin: 4px -18px 14px; aspect-ratio: 1.91 / 1; background: var(--surface-2); overflow: hidden; }
.detail-cover:has(.art) { aspect-ratio: 3 / 1; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; gap: 10px; margin: 14px 0; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.fact { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.fact .fi { width: 22px; text-align: center; flex: none; }
.fact small { display: block; color: var(--muted); font-size: 12px; }
.summary { white-space: pre-line; font-size: 14.5px; line-height: 1.6; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.summary.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.more { color: var(--brand); font-weight: 700; font-size: 14px; margin-top: 4px; }
.origin { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.actions { display: grid; gap: 8px; margin-top: 18px; }
.actions .two { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.actions .two .btn { padding: 0 8px; font-size: 13.5px; flex-direction: column; gap: 2px; min-height: 58px; }
.actions .two .btn.on { color: var(--brand); }
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.post-grid button { align-content: start;
  display: grid; gap: 4px; text-align: left; padding: 14px; border-radius: 16px; background: var(--surface-2);
  transition: transform .12s var(--ease);
}
.post-grid button:active { transform: scale(.97); }
.post-grid .pi { font-size: 24px; }
.post-grid b { font-size: 14.5px; }
.post-grid small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.post-grid .wide { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.rules { padding-left: 20px; margin: 8px 0 0; display: grid; gap: 10px; font-size: 14.5px; }
.rules b { display: block; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 60; transform: translate(-50%, 10px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: opacity .2s, transform .2s var(--ease); max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar { background: var(--surface); }
  .topbar { background: var(--bg); }
}
@media (min-width: 560px) {
  .card, .empty-card, .sk-card { flex-basis: 260px; }
  .quick { grid-template-columns: repeat(8, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Peta warga */
.mapview { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg);
  opacity: 0; transform: translateY(12px); transition: opacity .22s var(--ease), transform .22s var(--ease); }
.mapview.open { opacity: 1; transform: none; }
.map-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; }
.map-title { display: grid; min-width: 0; }
.map-title b { font-size: 17px; }
.map-title small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 10px; scrollbar-width: none; flex: none; }
.map-chips::-webkit-scrollbar { display: none; }
.mchip { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.mchip.on { background: var(--brand); color: var(--brand-ink); }
.map-canvas { flex: 1; min-height: 0; background: var(--surface-2); }
.map-card { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 500; max-width: 560px; margin: 0 auto;
  display: grid; gap: 6px; padding: 14px 44px 14px 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.map-card b { font-size: 15px; line-height: 1.3; }
.map-card small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.map-card .chip { justify-self: start; }
.map-card .btn { margin-top: 6px; }
.map-card-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.map-card-x svg { width: 18px; height: 18px; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-control-attribution { font-size: 10px; }
.alert.outage { background: color-mix(in srgb, #f2a900 14%, var(--surface)); border-color: color-mix(in srgb, #f2a900 40%, transparent); }
.alert.outage b { color: #b07a00; }
:root[data-theme="dark"] .alert.outage b { color: #f2c14e; }
.alert .oi { font-size: 18px; line-height: 1.2; }
:root[data-theme="dark"] .map-canvas .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }

/* Darurat, pantau */
.sos-btn { width: auto; padding: 0 10px; height: 32px; margin-left: auto; margin-right: 4px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em;
  color: #fff; background: #d23c3c; border-radius: 10px; }
.sos-btn:active { background: #b22f2f; }
.sos { display: grid; gap: 8px; }
.sos-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.sos-row:active { transform: scale(.99); }
.sos-num { min-width: 64px; text-align: center; font-size: 22px; font-weight: 800; color: #d23c3c; }
.sos-row span { display: grid; min-width: 0; }
.sos-row small { color: var(--muted); font-size: 12.5px; }
.watch { width: 100%; display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--brand) 45%, transparent); }
.watch > span:first-child { font-size: 20px; }
.watch span:last-child { display: grid; min-width: 0; }
.watch b { font-size: 14px; color: var(--brand); }
:root[data-theme="dark"] .watch b { color: #5fd3b8; }
.watch small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pelacak laporan */
.tlist { display: grid; gap: 8px; }
.trow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.sheet .trow { background: var(--surface-2); box-shadow: none; }
.tday { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-content: center; text-align: center;
  background: color-mix(in srgb, var(--tc) 16%, transparent); color: var(--tc); }
.tday b { font-size: 19px; line-height: 1; font-weight: 800; }
.tday small { font-size: 10.5px; font-weight: 700; }
.tbody { display: grid; min-width: 0; gap: 2px; }
.tbody b { font-size: 14.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tbody small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-head .mchip { flex: none; }

.alert.rain { background: color-mix(in srgb, #1e88e5 12%, var(--surface)); border-color: color-mix(in srgb, #1e88e5 35%, transparent); }
.alert.rain b { color: #1565c0; }
:root[data-theme="dark"] .alert.rain b { color: #64b5f6; }
.alert small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Kartu pemberitahuan ringkas */
.notices { margin-top: 12px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.notice { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; text-align: left; border-top: 1px solid var(--line); }
.notice:first-child { border-top: 0; }
.notice .ni { flex: none; font-size: 17px; }
.notice .nt { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notice small { flex: none; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.notice svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.notice.rain small { background: color-mix(in srgb, #1e88e5 14%, transparent); color: #1e78d0; }
.notice.warn small { background: color-mix(in srgb, var(--c-public) 14%, transparent); color: var(--c-public); }
.notice.outage small { background: color-mix(in srgb, #f2a900 18%, transparent); color: #a87500; }
:root[data-theme="dark"] .notice.outage small { color: #f2c14e; }
:root[data-theme="dark"] .notice.rain small { color: #64b5f6; }

.collections { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 6px; padding: 2px 16px 8px; scrollbar-width: none; }
.collections::-webkit-scrollbar { display: none; }
.collections .mchip { color: var(--text); }

/* PWA: ajakan pasang ke layar utama */
.notice.install { padding: 0; gap: 0; }
.notice.install .install-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 4px 11px 12px; text-align: left; }
.notice.install small { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.notice.install .install-close { flex: none; width: 40px; align-self: stretch; font-size: 20px; line-height: 1; color: var(--muted); }
@media (display-mode: standalone) { .topbar { padding-top: max(env(safe-area-inset-top), 10px); } }

/* PWA: pilihan notifikasi */
.push-topics { display: grid; gap: 8px; margin: 14px 0 16px; }
.push-topic { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; cursor: pointer; }
.push-topic input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.push-stop { margin-top: 8px; color: var(--muted); }
