/* Awan Larat: blue header with curling batik cloud lines, teal accent. Light and dark. */
:root {
  --bg: #F3F6FA; --surface: #FFFFFF; --ink: #12263F; --muted: #4F6379; --border: #D5DFEA;
  --header: #17406F; --header-ink: #FFFFFF; --pattern: rgba(255,255,255,0.28); --pattern-soft: rgba(23,64,111,0.18);
  --primary: #17406F; --accent: #0A6A72; --accent-ink: #FFFFFF; --tg: #187BB8; --tg-ink: #FFFFFF; --tag-bg: #E6EEF8; --tag-ink: #1F4F82;
  --now-bg: #FDE8EF; --now-ink: #8A1F44; --soon-bg: #E6EEF8; --soon-ink: #1F4F82;
  --end-bg: #ECEFF3; --end-ink: #44546A; --odd-bg: #FFF3D6; --odd-ink: #6B4A00;
  --edge: #5B7088; --sel-bg: #E3F3F4;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Inter', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="cerah"]) {
    --bg: #0E1B2C; --surface: #152A42; --ink: #E8EFF7; --muted: #A7B8CC; --border: #27415F;
    --header: #0B2A4A; --header-ink: #EAF2FB; --pattern: rgba(143,182,222,0.30); --pattern-soft: rgba(143,182,222,0.22);
    --primary: #8FB6DE; --accent: #6FD3CF; --accent-ink: #0E1B2C; --tg: #2AABEE; --tg-ink: #0E1B2C; --tag-bg: #27415F; --tag-ink: #E8EFF7;
    --now-bg: #4A2233; --now-ink: #FFD3E0; --soon-bg: #27415F; --soon-ink: #CFE2F6;
    --end-bg: #22344A; --end-ink: #B9C8DA; --odd-bg: #4A3A12; --odd-ink: #FFE3A3;
    --edge: #7F95AD; --sel-bg: #1B4046;
    color-scheme: dark;
  }
}
:root[data-tema="gelap"] {
  --bg: #0E1B2C; --surface: #152A42; --ink: #E8EFF7; --muted: #A7B8CC; --border: #27415F;
  --header: #0B2A4A; --header-ink: #EAF2FB; --pattern: rgba(143,182,222,0.30); --pattern-soft: rgba(143,182,222,0.22);
  --primary: #8FB6DE; --accent: #6FD3CF; --accent-ink: #0E1B2C; --tg: #2AABEE; --tg-ink: #0E1B2C; --tag-bg: #27415F; --tag-ink: #E8EFF7;
  --now-bg: #4A2233; --now-ink: #FFD3E0; --soon-bg: #27415F; --soon-ink: #CFE2F6;
  --end-bg: #22344A; --end-ink: #B9C8DA; --odd-bg: #4A3A12; --odd-ink: #FFE3A3;
  --edge: #7F95AD; --sel-bg: #1B4046;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.4; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); color: var(--ink); padding: 10px 14px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* header */
.hdr { position: relative; height: 150px; background: var(--header); color: var(--header-ink); overflow: hidden; }
.pat { color: var(--pattern); }
.pat-soft { color: var(--pattern-soft); }
.hdr-pat { position: absolute; left: 0; top: 0; }
.hdr-in { position: relative; display: flex; align-items: center; gap: 12px; padding-top: calc(28px + env(safe-area-inset-top)); }
.logo { flex: none; width: 44px; height: 44px; border-radius: 22px; background: #0A6A72; border: 2px solid var(--header-ink); display: flex; align-items: center; justify-content: center; }
.hdr-text { flex: 1; min-width: 0; }
.hdr-home { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; border-radius: 12px; }
.hdr-home:focus-visible { outline-color: var(--header-ink); }
.brand { font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.1; }
.tagline { font-size: 13px; margin-top: 4px; opacity: .92; }
.hdr-wave { position: absolute; left: 0; bottom: -1px; color: var(--bg); display: block; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: var(--header-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; }
.icon-btn.dark { border-color: var(--border); color: var(--ink); }

/* layout */
.main { padding-top: 6px; }
.view { display: flex; flex-direction: column; gap: 14px; }
.page-title { font-family: var(--serif); font-size: 24px; margin: 10px 0 0; }
.sub { font-family: var(--serif); font-size: 18px; margin: 0 0 8px; }
.para { margin: 0 0 12px; font-size: 15px; line-height: 1.55; }
.muted { color: var(--muted); }
.card { border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.pad { padding: 18px; }

/* status chips: one choice at a time, each at least 44px tall with 8px between them; they wrap instead of scrolling so none is hidden */
.filter-label { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--edge); background: var(--surface); color: var(--ink); font-size: 15px; cursor: pointer; }
.fchip-n { color: var(--muted); }
.fchip.is-zero { color: var(--muted); }
.fchip-tick { display: none; font-weight: 700; }
.fchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.fchip[aria-pressed="true"] .fchip-n { color: inherit; font-weight: 400; }
.fchip[aria-pressed="true"] .fchip-tick { display: inline; }

/* jajahan selector: calm once a jajahan is chosen, the one emphasised control on a first visit */
.picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 8px 16px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--edge); font-size: 16px; cursor: pointer; text-align: left; }
.picker-text { display: flex; flex-direction: column; min-width: 0; }
.picker-label { font-size: 14px; color: var(--muted); }
.picker-value { font-weight: 600; font-size: 20px; line-height: 1.25; }
.picker-sub { font-size: 14px; color: var(--muted); }
.picker-sub:empty { display: none; }
.picker-meta { flex: none; display: flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 600; color: var(--accent); }
.picker-chev { flex: none; width: 36px; height: 36px; border-radius: 18px; }
.picker.is-first { min-height: 76px; padding: 8px 14px; border: 3px solid var(--accent); }
.picker.is-first .picker-label { color: var(--accent); font-weight: 600; }
.picker.is-first .picker-value { font-size: 22px; }
.picker.is-first .picker-chev { width: 44px; height: 44px; border-radius: 22px; background: var(--accent); color: var(--accent-ink); }

.chip { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 16px; background: var(--tag-bg); color: var(--tag-ink); font-size: 13px; }
.chip-x { min-width: 28px; min-height: 28px; border: 0; border-radius: 14px; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }

.hero { position: relative; overflow: hidden; padding: 20px 18px 18px; }
.hero.is-next { border: 3px solid var(--accent); }
.hero.hero-quiet { background: transparent; border: 0; padding: 0; }
.hero.hero-quiet .hero-pat, .hero.hero-quiet .hero-icon, .hero.hero-quiet .hero-title { display: none; }
.hero.hero-quiet .hero-body { margin: 0; }
.hero-pat { position: absolute; right: 0; top: 0; }
.hero-in { position: relative; }
.hero-icon { color: var(--primary); }
.hero-title { margin: 10px 0 6px; font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.2; }
.hero-body { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.hero-body:empty { display: none; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; }
.btn { min-height: 48px; border-radius: 12px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 0 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-accent { border: 0; background: var(--accent); color: var(--accent-ink); }
/* Telegram-blue button (colour only; no Telegram logo). Contrast: white on #187BB8 4.6:1, dark ink on #2AABEE 6.7:1. */
.btn-telegram { border: 0; background: var(--tg); color: var(--tg-ink); }
.btn-outline { border: 1.5px solid var(--primary); background: transparent; color: var(--primary); }
.soon { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.soon.err { color: var(--now-ink); font-weight: 600; font-size: 13px; }
a.link { display: inline-block; margin-top: 4px; }
.link { display: inline-block; margin-top: 0; padding: 13px 0; line-height: 18px; border: 0; background: none; font-size: 13px; color: var(--primary); text-decoration: underline; cursor: pointer; }  /* about 44px tall to tap */

.list-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; gap: 8px; }
.list-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 17px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 10px; background: var(--tag-bg); color: var(--tag-ink); white-space: nowrap; }
.status { font-size: 14px; color: var(--muted); }
.status:empty { display: none; }
.list { display: flex; flex-direction: column; gap: 14px; }
.retry { display: flex; }

.notice { border-radius: 14px; background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 10px; }
.badge.now { background: var(--now-bg); color: var(--now-ink); }
.badge.soon { background: var(--soon-bg); color: var(--soon-ink); }
.badge.ended { background: var(--end-bg); color: var(--end-ink); }
.badge.odd { background: var(--odd-bg); color: var(--odd-ink); }
.n-title { margin: 8px 0 0; font-weight: 600; font-size: 15px; }
.n-areas { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.n-time { margin: 6px 0 0; font-size: 13px; }
.n-more { margin-top: 8px; font-size: 13px; }
.n-more summary { cursor: pointer; color: var(--primary); padding: 4px 0; }
.n-more p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }

.foot { max-width: 720px; margin: 14px auto 0; padding: 6px 20px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.foot p { margin: 0 0 4px; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.nav-in { max-width: 720px; margin: 0 auto; height: 64px; display: flex; }
.nav-a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--muted); }
.nav-a[aria-current="page"] { color: var(--primary); font-weight: 600; }

/* dialogs */
dialog { width: min(92vw, 520px); max-height: 80vh; padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--ink); overflow: auto; }
dialog::backdrop { background: rgba(8, 20, 36, .55); }
.dlg-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dlg-title { margin: 0; font-family: var(--serif); font-size: 19px; }
.search { display: block; width: calc(100% - 32px); margin: 12px 16px 4px; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--ink); font-size: 16px; }
.dialog-pad { padding: 12px 16px; }
#dlg-kawasan .status { padding: 4px 16px; }
.pick-list { list-style: none; margin: 0; padding: 6px 8px 12px; }
.pick-list button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 16px; text-align: left; cursor: pointer; }
.pick-list button:hover { background: var(--bg); }
.pick-list button[aria-pressed="true"] { font-weight: 600; color: var(--primary); }
.tick { font-weight: 700; }
/* jajahan list: bigger rows, a count at the right, chosen row tinted with the tick at the left */
#jajahan-list button { min-height: 56px; font-size: 18px; justify-content: flex-start; gap: 8px; }
#jajahan-list li + li { border-top: 1px solid var(--border); }
#jajahan-list button[aria-pressed="true"] { background: var(--sel-bg); font-weight: 600; color: var(--ink); }
.tick-slot { flex: none; width: 24px; color: var(--accent); font-weight: 700; }
.pick-label { flex: 1; min-width: 0; }
.pick-meta { flex: none; font-size: 14px; font-weight: 400; color: var(--muted); }

/* basket of picks (multi-select) */
.basket { margin: 0 0 12px; }
.basket-title { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.basket-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.basket-list .chip { align-self: auto; min-height: 44px; padding: 0 2px 0 12px; border-radius: 22px; }
.basket-list .chip-x { min-width: 44px; min-height: 44px; border-radius: 22px; }
.basket-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.dlg-foot { position: sticky; bottom: 0; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.dlg-foot .btn { width: 100%; }

@media (min-width: 700px) {
  .main { padding-top: 14px; }
  .hdr-in { padding-top: 34px; }
}
@media (prefers-reduced-motion: no-preference) {
  .picker, .btn, .fchip, .pick-list button { transition: background-color .15s ease; }
}

.hero-actions .link { align-self: flex-start; }

/* Slice 8A: Langganan list, recovery banner, links on separate lines */
.hero-in > .link { display: block; }
.mine { list-style: none; margin: 8px 0 4px; padding: 0; }
.mine-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.mine-row:first-child { border-top: 0; }
.mine-label { font-size: 15px; overflow-wrap: anywhere; }
.mine-x { margin: 0; flex: none; min-height: 44px; padding: 6px 4px; }
.recover { border: 1.5px solid var(--primary); }
.recover .btn { width: 100%; margin-top: 8px; }

/* Slice 8B: links inside text and footer, privacy page, 404 */
.para a, .foot a, .doc a, .aksb-line a { color: var(--primary); text-decoration: underline; }
.foot a, .aksb-line a { display: inline-block; padding: 10px 4px; }
.aksb-line { margin: 0; font-size: 14px; }
.page-pad { padding-top: 48px; }

.doc { display: flex; flex-direction: column; gap: 14px; }
.doc h1 { font-family: var(--serif); font-size: 26px; line-height: 1.2; margin: 10px 0 0; }
.doc h2 { font-family: var(--serif); font-size: 22px; line-height: 1.25; margin: 0 0 6px; }
.doc h3 { font-family: var(--serif); font-size: 17px; line-height: 1.3; margin: 18px 0 6px; }
.doc p, .doc li { font-size: 15px; line-height: 1.6; }
.doc p { margin: 0 0 10px; }
.doc ul { margin: 0 0 10px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc section[id] { scroll-margin-top: 12px; }
.doc .stamp { font-size: 13px; color: var(--muted); margin: 0; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); text-decoration: underline; font-size: 15px; }
.lang-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.lang-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--primary); color: var(--primary); font-weight: 600; font-size: 15px; }
.callout { border-radius: 14px; background: var(--tag-bg); color: var(--tag-ink); padding: 14px 16px; }
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout a { color: inherit; text-decoration: underline; }
.doc { overflow-wrap: anywhere; }  /* long addresses must wrap on very narrow screens */

/* Slice 8B2: feedback form */
.fb { display: flex; flex-direction: column; }
.fb fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fb legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 8px; }
.fb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-cats legend { flex: 0 0 100%; }
.fb-cat { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--muted); border-radius: 12px; cursor: pointer; font-size: 15px; }
.fb-cat:has(input:checked) { border-color: var(--primary); background: var(--tag-bg); font-weight: 600; }
.fb-cat input, .fb-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--primary); flex: none; }
.fb-field { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.fb-field > label { font-weight: 600; font-size: 15px; }
.fb textarea, .fb input[type="email"] { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--muted); border-radius: 12px; padding: 12px; }
.fb textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.fb input[type="email"] { min-height: 48px; }
.fb-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.doc .fb-help { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0; }
.doc .fb-err { font-size: 14px; font-weight: 600; color: var(--now-ink); margin: 6px 0 0; }
.doc .fb-err:empty { display: none; }
.fb-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; font-weight: 600; font-size: 15px; cursor: pointer; padding-top: 10px; }
.fb-detail { margin-top: 2px; }
.fb-detail summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--primary); text-decoration: underline; font-size: 15px; }
.fb-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 8px; font-size: 14px; }
.fb-dl dt { color: var(--muted); }
.fb-dl dd { margin: 0; overflow-wrap: anywhere; }
.fb-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.fb .btn { margin-top: 20px; width: 100%; }
.doc .fb-status { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.doc .fb-status:empty { display: none; }
.doc .fb-status.fb-bad { color: var(--now-ink); font-weight: 600; }
.fb > .fb-help { margin-top: 12px; }
.fb-ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 28px; font-weight: 700; letter-spacing: .06em; user-select: all; margin: 0 0 10px; }
.fb-done:focus { outline: none; }


/* Slice 12: key and restore page (/pulih) */
.fb textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 90px; word-break: break-all; }
.fb .fb-field .btn { margin-top: 8px; }
