/* ==========================================================================
   MITIGASI.COM — Lapisan desain (dimuat setelah global.css)
   Karakter: papan informasi publik — tenang, tepercaya, cepat dibaca.
   Warna mencolok hanya untuk tingkat bahaya. Warna utama tetap dari tema admin (--primary).
   ========================================================================== */

:root {
    --ink: #10283d;
    --ink-2: #183a57;
    --text: #1d3246;
    --muted: #5b7083;
    --line: #dfe5ec;
    --surface: #f3f6f9;
    --card: #ffffff;

    --lv-normal: #2e7d32;
    --lv-waspada: #f2a900;
    --lv-siaga: #e8710a;
    --lv-awas: #c62828;

    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --radius-lg: 16px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 40, 61, .06);
    --shadow: 0 1px 2px rgba(16, 40, 61, .05), 0 6px 20px rgba(16, 40, 61, .06);

    /* Garis kontur topografi (motif tunggal di area biru tinta) */
    --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='320' viewBox='0 0 640 320'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M-20 60 C80 20 160 100 260 70 S440 10 540 60 S660 90 680 70'/%3E%3Cpath d='M-20 90 C90 50 170 130 270 100 S450 40 550 90 S660 120 680 100'/%3E%3Cpath d='M-20 120 C100 80 180 160 280 130 S460 70 560 120 S660 150 680 130'/%3E%3Cpath d='M-20 175 C70 140 150 205 250 185 S420 120 520 170 S640 210 680 190'/%3E%3Cpath d='M-20 205 C80 170 160 235 260 215 S430 150 530 200 S650 240 680 220'/%3E%3Cpath d='M-20 260 C110 230 200 290 300 265 S470 215 570 255 S660 280 680 270'/%3E%3Cpath d='M-20 290 C120 260 210 320 310 295 S480 245 580 285 S665 305 680 300'/%3E%3Cellipse cx='470' cy='150' rx='38' ry='16'/%3E%3Cellipse cx='470' cy='150' rx='70' ry='34'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Dasar ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.35rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); }
h3 { font-size: 1.08rem; }
p { max-width: 75ch; }
img, svg, video { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 70%, white); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font-family: inherit; }
.container { padding-left: 20px; padding-right: 20px; }
main { display: block; min-height: 50vh; }
.leaflet-container { font-family: var(--font-sans); }
.leaflet-popup-content { line-height: 1.5; }

/* ---------- Header halaman ---------- */
.page-header,
.page-header.teal, .page-header.blue, .page-header.orange {
    --hdr-accent: var(--primary);
    position: relative;
    background: var(--ink) var(--topo) center / 640px 320px repeat;
    color: #fff;
    text-align: left;
    padding: 34px 0 40px;
}
/* Ruang ekstra hanya bila kartu statistik menumpuk di bawah header */
.page-header:has(+ .container > .stats-row:first-child) { padding-bottom: 72px; }
.page-header.teal { --hdr-accent: #00897b; }
.page-header.blue { --hdr-accent: #1e88e5; }
.page-header.orange { --hdr-accent: #f57c00; }
.page-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: var(--hdr-accent);
}
.page-header .breadcrumb { font-size: .85rem; opacity: .75; margin-bottom: 14px; }
.page-header .breadcrumb a { color: #fff; }
.page-header h1 { color: #fff; margin: 0 0 8px; }
.page-header p { color: rgba(255, 255, 255, .78); font-size: 1.02rem; margin: 0; max-width: 62ch; }

/* ---------- Kartu statistik (menumpuk di bawah header halaman) ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: -44px 0 26px;
    position: relative;
    z-index: 10;
}
.stats-row .stat-card,
main .stats-grid .stat-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    text-align: left;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    transform: none;
}
.stats-row .stat-card:hover, main .stats-grid .stat-card:hover { transform: none; box-shadow: var(--shadow); }
.stats-row .stat-card .icon, main .stats-grid .stat-card .icon {
    grid-row: 1 / span 2;
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; margin: 0;
    background: color-mix(in srgb, var(--primary) 10%, white);
}
.stats-row .stat-card .value, main .stats-grid .stat-card .value {
    font-size: 1.55rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums; color: var(--ink);
}
.stats-row .stat-card .label, main .stats-grid .stat-card .label {
    font-size: .8rem; line-height: 1.35; color: var(--muted); margin: 2px 0 0;
}
.stat-card .delta { grid-column: 2; }

/* ---------- Tombol ---------- */
.btn { border-radius: 10px; font-weight: 700; letter-spacing: -0.005em; transition: background-color .15s, box-shadow .15s, color .15s; }
.btn:hover { transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { transform: none; background: #eef3f7; }
.btn-outline-white { border: 1.5px solid rgba(255, 255, 255, .55); color: #fff; background: transparent; }
.btn-outline-white:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Kartu & panel ---------- */
.card { border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.card-header { background: var(--ink); }
main :is(.k-section, .b-section, .v-section, .marine-section, .marine-detail, .l-box, .eq-section, .side-box,
         .eq-list, .eq-list-home, .weather-legend, .map-container, .port-search) {
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
}
main :is(.news-item, .art-card, .v-card, .air-card, .bnpb-card, .report, .r-card, .river, .warn-card, .alert-item, .vessel-card) {
    box-shadow: none;
    border: 1px solid var(--line);
}
main :is(.news-item, .art-card, .v-card):hover { transform: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
main :is(.k-section, .b-section, .v-section, .marine-section, .marine-detail, .l-box, .eq-section) h2 { font-size: 1.22rem; }

/* Kartu peringatan cuaca: garis atas sesuai tingkat, tanpa kepala berwarna tebal */
main .alert-card {
    border: 1px solid var(--line);
    border-top: 4px solid var(--muted);
    border-left: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
}
main .alert-card:hover { transform: none; box-shadow: var(--shadow); }
main .alert-card:has(.alert-header.info) { border-top-color: #1e88e5; }
main .alert-card:has(.alert-header.warning), main .alert-card:has(.badge.WASPADA) { border-top-color: var(--lv-waspada); }
main .alert-card:has(.alert-header.danger), main .alert-card:has(.badge.SIAGA) { border-top-color: var(--lv-siaga); }
main .alert-card:has(.alert-header.critical), main .alert-card:has(.badge.AWAS) { border-top-color: var(--lv-awas); }
main .alert-card .alert-header,
main .alert-card .alert-header.info, main .alert-card .alert-header.warning,
main .alert-card .alert-header.danger, main .alert-card .alert-header.critical {
    background: none; color: var(--ink); padding: 16px 18px 0; font-size: 1rem; line-height: 1.4;
}
main .alert-card .alert-body { padding: 8px 18px 14px; flex: 1; }
main .alert-card .alert-footer { background: transparent; border-top: 1px solid var(--line); padding: 10px 18px; }
main .alert-type { background: var(--surface); color: var(--muted); border-radius: 6px; }

/* Halaman Peringatan: global.css lama mewarnai seluruh kartu (.waspada/.siaga/.awas !important).
   Kartu dikembalikan putih; level ditunjukkan garis atas + badge. */
main .alert-card:is(.waspada, .siaga, .awas, .alert-waspada, .alert-siaga, .alert-awas, .expired),
main .alert-card-header:is(.waspada, .siaga, .awas, .alert-waspada, .alert-siaga, .alert-awas, .expired) {
    background: var(--card) !important;
    color: var(--text) !important;
}
main .alert-card.waspada, main .alert-card.alert-waspada { border-top-color: var(--lv-waspada); }
main .alert-card.siaga, main .alert-card.alert-siaga { border-top-color: var(--lv-siaga); }
main .alert-card.awas, main .alert-card.alert-awas { border-top-color: var(--lv-awas); }
main .alert-card .alert-card-header { color: var(--ink) !important; }
main .alert-card :is(.alert-card-body, .alert-card-body *) { color: var(--text) !important; }
main .alert-card .alert-card-footer { background: transparent !important; border-top: 1px solid var(--line); }
main .severity-badge.waspada, main .severity-badge.alert-waspada { background: var(--lv-waspada) !important; color: #2b1d00 !important; }
main .severity-badge.siaga, main .severity-badge.alert-siaga { background: var(--lv-siaga) !important; color: #fff !important; }
main .severity-badge.awas, main .severity-badge.alert-awas { background: var(--lv-awas) !important; color: #fff !important; }

/* Badge tingkat */
.badge { border-radius: 6px; letter-spacing: .01em; }
.badge.WASPADA { background: var(--lv-waspada); color: #2b1d00; }
.badge.SIAGA { background: var(--lv-siaga); color: #fff; }
.badge.AWAS { background: var(--lv-awas); color: #fff; }

/* Tabel */
.data-table { box-shadow: none; border: 1px solid var(--line); }
.data-table thead { background: var(--surface); color: var(--ink); }
.data-table th { font-size: .82rem; font-weight: 700; color: var(--muted); }

/* Banner sumber data */
main .data-source-banner {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    font-size: .9rem; color: var(--muted);
}

/* Kondisi kosong: arahkan, jangan muram */
.empty-state { border: 1px dashed var(--line); background: var(--card); padding: 40px 20px; }
.empty-state .icon { font-size: 2.4rem; opacity: .8; }
.empty-state h3 { color: var(--ink); }

/* Ajakan (CTA) */
.cta-box, main .cta-section {
    background: var(--ink) var(--topo) center / 640px 320px repeat !important;
    border-radius: var(--radius-lg);
}

/* Formulir */
.form-control { border-color: var(--line); border-radius: 10px; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

/* ---------- Responsif ---------- */
@media (max-width: 992px) {
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -40px; }
}
@media (max-width: 576px) {
    .container { padding-left: 16px; padding-right: 16px; }
    .page-header { padding: 24px 0 30px; }
    .page-header:has(+ .container > .stats-row:first-child) { padding-bottom: 64px; }
    .page-header p { font-size: .95rem; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: -44px 0 20px; }
    .stats-row .stat-card, main .stats-grid .stat-card { grid-template-columns: 1fr; padding: 13px 14px; row-gap: 2px; }
    .stats-row .stat-card .icon, main .stats-grid .stat-card .icon { grid-row: auto; width: 34px; height: 34px; font-size: 1.05rem; border-radius: 9px; margin-bottom: 6px; }
    .stats-row .stat-card .value, main .stats-grid .stat-card .value { font-size: 1.3rem; }
    .stat-card .delta { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Ikon (sprite SVG, lihat includes/icons.php) ---------- */
svg[class^="ic"] { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.ic-lg { width: 1.5em; height: 1.5em; vertical-align: -0.35em; }
svg.ic-xl { width: 2.2em; height: 2.2em; }
svg.ic-muted { opacity: .6; }
.ic-dot { display: inline-block; width: .72em; height: .72em; border-radius: 50%; vertical-align: .02em; box-shadow: 0 0 0 2px rgba(255,255,255,.85); flex-shrink: 0; }
svg[class^="ic"], .ic-dot { margin-inline-end: .35em; }
svg[class^="ic"]:only-child, .ic-dot:only-child, .icon > svg, .sb-title > svg { margin-inline-end: 0; }

/* ---------- Bagikan ---------- */
.share-bar { margin: 36px 0 0; }
.share-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 22px; box-shadow: var(--shadow-sm); }
.share-bar.pulse .share-inner { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); transition: box-shadow .3s; }
.share-copy strong { display: block; color: var(--ink); font-size: 1.02rem; }
.share-copy span { color: var(--muted); font-size: .9rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sh { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; font: inherit; font-size: .9rem; font-weight: 700;
      border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; line-height: 1.2; min-height: 42px; }
.sh svg { margin: 0; width: 1.15em; height: 1.15em; }
.sh:hover { border-color: currentColor; }
.sh-whatsapp { color: #128c4b; } .sh-facebook { color: #1565c0; } .sh-x { color: #111; } .sh-telegram { color: #1b8acb; }
.sh-copy, .sh-more { color: var(--ink); }
.hdr-share { position: absolute; top: 28px; right: 16px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.hdr-share:hover { background: rgba(255,255,255,.18); }
.hdr-share svg { margin: 0; }
.page-header .container { position: relative; }
.mt-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 9999; background: var(--ink); color: #fff;
    padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .25s, transform .25s; pointer-events: none; }
.mt-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 640px) {
    .share-inner { padding: 16px; }
    .share-btns { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sh { justify-content: center; }
    .hdr-share { position: static; margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .mt-toast { transition: none; } }

/* Atribut hidden selalu menang atas display komponen */
[hidden] { display: none !important; }

/* Elemen formulir & media tidak boleh melebihi wadahnya (mencegah geser kanan-kiri di HP) */
input, select, textarea, button { max-width: 100%; }
img, video, canvas, iframe { max-width: 100%; }
/* Kecuali peta Leaflet: kanvas & ubin sengaja lebih lebar dari panelnya (tanpa ini penanda peta hilang) */
.leaflet-container canvas, .leaflet-container img, .leaflet-container svg { max-width: none !important; }
input[type="file"] { width: 100%; font-size: .9rem; }

/* Pengaman terakhir: konten dinamis yang terlalu lebar tidak membuat halaman bisa digeser ke samping */
body { overflow-x: clip; }

/* ---------- Pilihan zona waktu (js/site.js) ---------- */
.tz-sheet { position: fixed; left: 16px; bottom: 16px; z-index: 10000; width: min(400px, calc(100vw - 32px)); background: #fff; color: var(--text);
    border-radius: 16px; box-shadow: 0 18px 50px rgba(16,40,61,.28); border: 1px solid var(--line); padding: 18px 18px 14px; animation: tzIn .25s ease-out; }
@keyframes tzIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.tz-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.tz-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 22px; }
.tz-head > svg { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: color-mix(in srgb, var(--primary) 12%, white); color: var(--primary); flex-shrink: 0; margin: 0; }
.tz-head strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 2px; }
.tz-head span { font-size: .88rem; color: var(--muted); line-height: 1.45; }
.tz-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 10px; }
.tz-actions button { min-height: 44px; border-radius: 10px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tz-ok { background: var(--ink); color: #fff; border: 0; }
.tz-gps { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tz-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.tz-pick button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; font-size: .82rem; color: var(--ink); cursor: pointer; }
.tz-pick button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tz-msg { margin: 8px 0 0; font-size: .84rem; color: var(--muted); min-height: 1em; }
@media (max-width: 640px) { .tz-sheet { left: 0; right: 0; bottom: 0; width: auto; border-radius: 18px 18px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .tz-sheet { animation: none; } }

/* =====================================================================
   Tampilan aplikasi Android (html.in-app)
   Kelas dipasang di <head> bila UA berisi "MitigasiApp". Browser biasa tidak terpengaruh.
   ===================================================================== */
.t-short { display: none; }
.app-tabbar { display: none; }

html.in-app { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
html.in-app body { padding-bottom: calc(64px + var(--sab)); }

/* Header ringkas */
html.in-app .header-container { height: 54px; padding: 0 16px; }
html.in-app .site-logo { font-size: 1.02rem; gap: 9px; }
html.in-app .site-logo img { height: 30px; }
html.in-app .mobile-menu-btn { display: none; }
html.in-app .main-nav { display: none !important; }

/* Bilah navigasi bawah */
html.in-app .app-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
    height: calc(64px + var(--sab)); padding-bottom: var(--sab);
    background: var(--ink); border-top: 1px solid rgba(255,255,255,.08);
}
.app-tabbar a, .app-tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: rgba(255,255,255,.6); text-decoration: none; font: inherit; font-size: .7rem; font-weight: 600;
    background: none; border: 0; padding: 0; cursor: pointer; position: relative; min-width: 0;
}
.app-tabbar .ic { width: 22px; height: 22px; }
.app-tabbar a.on, .app-tabbar button[aria-expanded="true"], html.in-app body.nav-open .tb-menu { color: #fff; }
.app-tabbar a.on::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px;
    border-radius: 0 0 3px 3px; background: var(--accent);
}
.app-tabbar a:active, .app-tabbar button:active { background: rgba(255,255,255,.05); }
.tb-live-ic { position: relative; display: inline-flex; }
.tb-live-ic::after {
    content: ""; position: absolute; top: -1px; right: -3px; width: 7px; height: 7px; border-radius: 50%;
    background: #ef5350; box-shadow: 0 0 0 2px var(--ink); animation: navLive 2s infinite;
}
@media (prefers-reduced-motion: reduce) { .tb-live-ic::after { animation: none; } }

/* Beranda: hero ringkas + aksi sebagai ikon-tile */
html.in-app .home-hero { padding: 20px 0 22px; }
html.in-app .hero-grid { gap: 18px; }
html.in-app .hero-date { font-size: .78rem; margin-bottom: 6px; }
html.in-app .home-hero h1 { font-size: 1.6rem; line-height: 1.15; margin-bottom: 8px; max-width: none; }
html.in-app .hero-lead { font-size: .88rem; line-height: 1.55; margin-bottom: 18px; color: rgba(255,255,255,.72); }
html.in-app .hero-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
html.in-app .hero-actions .btn {
    flex-direction: column; gap: 6px; padding: 12px 4px 10px; min-height: 0; border-radius: 14px;
    font-size: .74rem; font-weight: 600; line-height: 1.2; letter-spacing: 0;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #fff;
}
html.in-app .hero-actions .btn .ic { width: 22px; height: 22px; margin: 0; }
html.in-app .hero-actions .btn-accent { background: var(--accent); border-color: var(--accent); }
html.in-app .t-long { display: none; }
html.in-app .t-short { display: inline; }
html.in-app .hero-note { font-size: .78rem; margin-top: 14px; }

/* Bagian lain lebih rapat */
html.in-app .home-section { padding-top: 24px; }
html.in-app .page-header { padding-top: 22px; padding-bottom: 20px; }
html.in-app .page-header h1 { font-size: 1.45rem; }

/* Footer: cukup kontak darurat & keterangan; menu lengkap ada di tab Menu */
html.in-app .site-footer { margin-top: 32px; }
html.in-app .footer-grid, html.in-app .cta-install { display: none !important; }
html.in-app .footer-emergency .container { padding-top: 14px; padding-bottom: 14px; font-size: .86rem; }
html.in-app .footer-bottom { padding: 16px 0 18px; }

/* Notifikasi kecil tidak tertutup tab bar */
html.in-app .mt-toast { bottom: calc(80px + var(--sab)); }

/* ---------- Aplikasi: bingkai navy (status bar, header, tab bar), isi terang ----------
   Header & tab bar tetap navy; semua isi di bawahnya terang agar tidak menyatu dengan header. */
html.in-app body { background: var(--surface); }
html.in-app .site-header { border-bottom: 0; box-shadow: 0 2px 10px rgba(16,40,61,.22); }

/* Hero beranda menjadi kartu terang */
html.in-app .home-hero { background: transparent; color: var(--ink); padding: 18px 0 4px; }
html.in-app .home-hero .container { padding-left: 16px; padding-right: 16px; }
html.in-app .hero-date { color: var(--muted); font-weight: 600; }
html.in-app .home-hero h1 { color: var(--ink); }
html.in-app .hero-lead { color: var(--muted); }
html.in-app .hero-actions .btn {
    background: #fff; border: 1px solid var(--line); color: var(--ink);
    box-shadow: 0 1px 2px rgba(16,40,61,.06);
}
html.in-app .hero-actions .btn .ic { color: var(--primary, #1565c0); }
html.in-app .hero-actions .btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
html.in-app .hero-actions .btn-accent .ic { color: #fff; }
html.in-app .hero-note { color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
html.in-app .hero-note a { color: var(--lv-awas); }

/* Papan situasi: kartu putih dengan garis warna status */
html.in-app .sb-tile {
    background: #fff; border: 1px solid var(--line); color: var(--ink);
    box-shadow: 0 1px 2px rgba(16,40,61,.05);
}
html.in-app .sb-tile:hover, html.in-app .sb-tile:active { background: #fff; border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
html.in-app .sb-title { color: var(--muted); }
html.in-app .sb-note { color: var(--muted); }

/* Header halaman lain: terang, dengan garis aksen tipis */
html.in-app .page-header { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
html.in-app .page-header::after { height: 3px; }
html.in-app .page-header .breadcrumb, html.in-app .page-header .breadcrumb a { color: var(--muted); opacity: 1; }
html.in-app .page-header h1 { color: var(--ink); }
html.in-app .page-header p { color: var(--muted); }
html.in-app .page-header .btn-outline-white, html.in-app .hdr-share { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }

/* Halaman Live: bilah atas terang */
html.in-app .live-top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); padding: 14px 0; }
html.in-app .lt-left h1 { color: var(--ink); }
html.in-app .lt-left p { color: var(--muted); }
html.in-app .lt-btn { color: var(--ink); border-color: var(--line); background: var(--surface); }
html.in-app .lt-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
/* Kartu statistik tidak lagi menumpuk di header (header terang di aplikasi) */
html.in-app .page-header:has(+ .container > .stats-row:first-child) { padding-bottom: 20px; }
html.in-app .stats-row { margin-top: 16px; }

/* ---------- Aplikasi v1.2: status bar, header, menu, daftar ringkas ---------- */
html.in-app { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); }

/* Header navy memanjang di belakang jam & baterai; logo tepat di bawahnya */
html.in-app .site-header { padding-top: var(--sat); }
html.in-app .header-container { height: 58px; gap: 12px; }
html.in-app .site-logo { gap: 10px; line-height: 1.15; }
html.in-app .site-logo img { height: 34px; }
html.in-app .site-logo small { display: block; font-size: .7rem; font-weight: 500; opacity: .62; margin-top: 1px; letter-spacing: .01em; }
.app-hdr-btn { display: none; }
html.in-app .app-hdr-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: -6px;
    border-radius: 12px; border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
}
html.in-app .app-hdr-btn .ic { width: 20px; height: 20px; }
html.in-app .app-hdr-btn:active { background: rgba(255,255,255,.16); }
/* Tombol bagikan di judul halaman & bilah bagikan diganti tombol di header (halaman lebih pendek) */
html.in-app .hdr-share, html.in-app .share-bar { display: none !important; }
html.in-app .page-sources { margin-top: 24px; }

/* Menu aplikasi */
.app-menu { display: none; }
html.in-app .app-menu:not([hidden]) {
    display: block; position: fixed; z-index: 999; left: 0; right: 0;
    top: calc(58px + var(--sat)); bottom: calc(64px + var(--sab));
    background: var(--surface); overflow-y: auto; overscroll-behavior: contain;
    animation: amIn .18s ease-out;
}
@keyframes amIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html.in-app .app-menu:not([hidden]) { animation: none; } }
html.in-app body.am-open { overflow: hidden; }
.am-in { max-width: 640px; margin: 0 auto; padding: 16px 16px 28px; }
.am-h { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 22px 4px 8px; letter-spacing: .01em; }
.am-group { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,40,61,.05); }
.am-row {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; align-items: center; gap: 14px;
    width: 100%; padding: 12px 14px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
    color: var(--ink); text-decoration: none; position: relative;
}
.am-row + .am-row::before { content: ""; position: absolute; top: 0; right: 0; left: 68px; height: 1px; background: var(--line); }
.am-row:active { background: var(--surface); }
.am-row.on { background: color-mix(in srgb, var(--primary, #1565c0) 6%, #fff); }
.am-ic {
    position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c);
}
.am-ic .ic { width: 21px; height: 21px; margin: 0; }
.am-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #e53935;
          box-shadow: 0 0 0 2px #fff; animation: navLive 2s infinite; }
@media (prefers-reduced-motion: reduce) { .am-dot { animation: none; } }
.am-t { display: flex; flex-direction: column; min-width: 0; }
.am-t b { font-size: .95rem; font-weight: 700; line-height: 1.3; }
.am-t small { font-size: .78rem; color: var(--muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-am-go { width: 18px; height: 18px; color: #a9b6c3; }
.am-sos {
    display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 14px 16px; border-radius: 16px;
    background: var(--lv-awas, #c62828); color: #fff; text-decoration: none;
}
.am-sos .ic { width: 24px; height: 24px; margin: 0; }
.am-sos span { display: flex; flex-direction: column; }
.am-sos b { font-size: .98rem; } .am-sos small { opacity: .85; font-size: .8rem; }
.am-foot { font-size: .76rem; color: var(--muted); text-align: center; margin: 18px 0 0; line-height: 1.6; }

/* Daftar panjang dipendekkan (public/js/site.js) */
.mt-cut { display: none !important; }
.mt-more {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 12px 0 4px; padding: 12px 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
    font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
.mt-more small { color: var(--muted); font-weight: 600; }
.mt-more .ic { width: 18px; height: 18px; margin: 0; color: var(--primary, #1565c0); }
.mt-more:active { background: var(--surface); }

/* Menu web (HP): titik merah Live tetap di kiri bersama teksnya */
@media (max-width: 900px) { .main-nav > a.nav-live { justify-content: flex-start; gap: 10px; } }

/* Kartu lipat untuk bagian halaman (public/js/site.js) */
.mt-fold:not(.open) > :not(.mt-fold-head) { display: none !important; }
.mt-fold:not(.open) { padding-top: 0 !important; padding-bottom: 0 !important; min-height: 0 !important; }
.mt-fold-head { cursor: pointer; display: flex !important; align-items: center; gap: 10px; -webkit-user-select: none; user-select: none; }
.mt-fold:not(.open) .mt-fold-head { padding: 16px 0; margin: 0 !important; }
.mt-fold:not(.open) .mt-fold-head h2, .mt-fold:not(.open) h2.mt-fold-head { margin: 0 !important; }
.mt-fold-head { justify-content: flex-start; text-align: left; }
.mt-chev { flex: 0 0 auto; width: 20px !important; height: 20px !important; margin: 0 0 0 auto !important; color: var(--muted); transition: transform .2s; }
html.in-app .mt-fold:not(.open) .mt-fold-head, html.in-app .mt-fold:not(.open) .mt-fold-head h2 { font-size: 1.02rem; line-height: 1.35; }
html.in-app .mt-fold-head .ic:not(.mt-chev) { flex: 0 0 auto; }
html.in-app .mt-fold-head p { display: none; }
.mt-fold.open .mt-chev { transform: rotate(90deg); }
html.in-app .mt-fold { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding-left: 16px; padding-right: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16,40,61,.05); }
html.in-app .mt-fold.open { padding-bottom: 16px; }

/* ---------- Lembar "Bagikan" (public/js/site.js) ---------- */
.ss-wrap { position: fixed; inset: 0; z-index: 10050; }
.ss-back { position: absolute; inset: 0; background: rgba(16,40,61,.45); animation: ssFade .15s ease-out; }
.ss { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(480px, 100%); background: #fff; color: var(--ink);
      border-radius: 20px 20px 0 0; padding: 14px 18px calc(20px + var(--sab, 0px)); box-shadow: 0 -8px 30px rgba(16,40,61,.2); animation: ssUp .2s ease-out; }
.ss-head { display: flex; justify-content: space-between; align-items: center; }
.ss-head strong { font-size: 1.05rem; }
.ss-x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.ss-x .ic { margin: 0; }
.ss-title { margin: 4px 0 14px; font-size: .84rem; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ss-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ss-btn { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 2px; border: 0; background: none; font: inherit;
          font-size: .74rem; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; text-align: center; }
.ss-btn span { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); }
.ss-btn span .ic { width: 24px; height: 24px; margin: 0; }
.ss-btn.sh-whatsapp span { background: #e7f7ee; color: #128c4b; }
.ss-btn.sh-telegram span { background: #e6f3fb; color: #1b8acb; }
.ss-btn.sh-facebook span { background: #e8f0fc; color: #1565c0; }
.ss-btn.sh-x span { background: #eceff1; color: #111; }
.ss-btn:active span { filter: brightness(.95); }
@media (min-width: 700px) { .ss { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 20px; padding-bottom: 20px; } }
@keyframes ssUp { from { transform: translate(-50%, 30px); opacity: 0; } }
@keyframes ssFade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ss, .ss-back { animation: none; } }
