/* ==========================================================================
   Gaya toko (customer) + komponen bersama
   Ide visual: "kartu saldo" untuk saldo, "struk konter" untuk detail order,
   daftar harga ala konter pulsa untuk produk. Sisanya tenang & rapi.
   ========================================================================== */

:root {
  --primary: #6d4aff;
  --primary-2: #a855f7;
  --accent: #f5b83d;
  --bg-tint: #f5f3ff;
  --hero: linear-gradient(135deg, #2e1065, #7c3aed);

  --ink: #1b1530;
  --ink-2: #4a4462;
  --ink-3: #7c7694;
  --line: #e7e4f0;
  --surface: #ffffff;
  --bg: color-mix(in srgb, var(--bg-tint) 70%, #fff);
  --ok: #0f9d58;
  --ok-bg: #e6f6ee;
  --warn: #b7791f;
  --warn-bg: #fdf3dc;
  --danger: #d93a3f;
  --danger-bg: #fdecec;
  --info: #2563eb;
  --info-bg: #e8effd;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow-soft: 0 1px 2px rgba(27, 21, 48, .06), 0 6px 18px -10px rgba(27, 21, 48, .18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1eefb;
    --ink-2: #c7c1dc;
    --ink-3: #9790b2;
    --line: #2d2645;
    --surface: #1b1630;
    --bg: #120e22;
    --ok-bg: #12301f;
    --warn-bg: #33270e;
    --danger-bg: #3a1618;
    --info-bg: #142449;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px -12px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.i { width: 20px; height: 20px; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.txt-danger { color: var(--danger); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 0; font: 600 15px/1.2 var(--font); cursor: pointer; text-decoration: none !important; transition: transform .08s ease, filter .15s ease; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px var(--primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-soft { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
.btn-gold { background: var(--accent); color: #2a1c00; }
.btn-ghost-light { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-link { background: none; border: 0; color: var(--primary); font: 600 14px var(--font); cursor: pointer; padding: 6px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 15px 20px; font-size: 16px; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn .i { width: 18px; height: 18px; }

/* ---------- form ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input, select, textarea { width: 100%; font: 500 15px var(--font); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
input[type="color"] { padding: 4px; height: 44px; }
input[type="file"] { padding: 9px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }
.field-warn { color: var(--warn); background: var(--warn-bg); padding: 9px 12px; border-radius: 10px; font-size: 13px; margin: -4px 0 12px; }
.otp-input { font-size: 26px; letter-spacing: .35em; text-align: center; }

/* ---------- badge & catatan ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: color-mix(in srgb, var(--ink-3) 14%, transparent); color: var(--ink-2); }
.badge-gold { background: color-mix(in srgb, var(--accent) 25%, transparent); color: #8a5a00; }
.note { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.note-ok { background: var(--ok-bg); color: var(--ok); }
.note-warn { background: var(--warn-bg); color: var(--warn); }
.note-danger { background: var(--danger-bg); color: var(--danger); }
.stock { font-size: 12px; font-weight: 600; }
.stock-ok { color: var(--ok); }
.stock-warn { color: var(--warn); }
.stock-danger { color: var(--danger); }
.amt-in { color: var(--ok); }
.amt-out { color: var(--ink); }

.flash-stack { display: grid; gap: 8px; margin: 0 0 14px; }
.flash { padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-info { background: var(--info-bg); color: var(--info); }

/* ---------- kartu umum ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); margin-bottom: 16px; }
.card-pad { padding: 18px; }
.card-title { font-size: 16px; }
details.card > summary { cursor: pointer; font-weight: 700; }
details.card[open] > summary { margin-bottom: 14px; }

/* ==========================================================================
   SHELL CUSTOMER (satu kolom, nyaman di HP & sama persis di dalam APK)
   ========================================================================== */
.c-body { background: var(--bg); }
.c-shell { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); position: relative; }
@media (min-width: 700px) {
  .c-body { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 10%, var(--bg)) 0, var(--bg) 420px); }
  .c-shell { box-shadow: 0 0 0 1px var(--line); background: var(--bg); }
}
.c-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.c-top-hero { background: transparent; backdrop-filter: none; color: #fff; position: absolute; left: 0; right: 0; }
.c-top-title { font-size: 17px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-brand { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 800; font-size: 17px; flex: 1; min-width: 0; text-decoration: none !important; }
.c-brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-brand-logo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.c-brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #3b2500; flex: none; }
.c-brand-mark .i { width: 18px; height: 18px; }
.c-top-right { margin-left: auto; }
.c-balance-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); font-weight: 700; font-size: 14px; text-decoration: none !important; }
.c-top-hero .c-balance-chip { background: rgba(255, 255, 255, .16); color: #fff; }
.c-balance-chip .i { width: 16px; height: 16px; }
.c-icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; color: inherit; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.c-icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.c-announce { margin: 0 16px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); font-size: 13px; font-weight: 600; }
.c-main { padding: 6px 16px 0; }
.c-footer { padding: 24px 16px 8px; text-align: center; font-size: 13px; color: var(--ink-3); }
.c-footer-links { display: flex; gap: 16px; justify-content: center; }

/* tab bar bawah (selalu dipakai di semua ukuran layar) */
.c-tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 30; }
.c-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); text-decoration: none !important; }
.c-tabbar a.on { color: var(--primary); }
.c-tabbar .i { width: 22px; height: 22px; }
.c-tab-fab { width: 46px; height: 46px; margin-top: -22px; border-radius: 16px; display: grid; place-items: center; background: var(--hero); color: #fff; box-shadow: 0 8px 18px -6px var(--primary); border: 3px solid var(--surface); }

/* ---------- HERO: kartu saldo (satu-satunya elemen "mewah") ---------- */
.hero { margin: -6px -16px 18px; padding: calc(68px + env(safe-area-inset-top)) 16px 54px; background: var(--hero); border-radius: 0 0 28px 28px; }
/* Bila ada pengumuman, header beranda kembali solid supaya teks putih tetap terbaca */
.c-shell:has(.c-announce) .c-top-hero { position: sticky; background: var(--hero); }
.c-shell:has(.c-announce) .c-announce { margin-top: 10px; }
.c-shell:has(.c-announce) .hero { margin-top: 10px; padding-top: 16px; border-radius: 28px; }
.brand-card { position: relative; border-radius: 22px; padding: 18px 18px 16px; color: #fff; background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .22) 0, transparent 46%),
    linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); margin-bottom: -40px; overflow: hidden; }
.sc-row { display: flex; justify-content: space-between; align-items: center; }
.sc-hello { font-weight: 600; font-size: 14px; opacity: .9; }
.sc-crest { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #ffe7a3, var(--accent) 55%, #b97b0f); color: #4a2f00; box-shadow: 0 4px 10px -2px rgba(0, 0, 0, .35); }
.sc-crest .i { width: 18px; height: 18px; }
.sc-label { display: block; margin-top: 10px; font-size: 13px; opacity: .8; }
.sc-balance { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.sc-foil { height: 2px; margin: 14px 0 12px; background: linear-gradient(90deg, transparent, var(--accent) 20%, #fff3c4 50%, var(--accent) 80%, transparent); opacity: .85; }
.sc-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sc-act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border-radius: 14px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; font-weight: 600; text-decoration: none !important; }
.sc-act:hover { background: rgba(255, 255, 255, .2); }
.brand-card-guest .sc-crest { margin-bottom: 12px; }
.sc-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.sc-sub { font-size: 14px; opacity: .85; }
.sc-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hero + .searchbar { margin-top: 0; }

/* ---------- pencarian & chip ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 0 14px; margin: 0 0 18px; position: relative; z-index: 2; box-shadow: var(--shadow-soft); }
.searchbar .i { color: var(--ink-3); }
.searchbar input { border: 0; box-shadow: none !important; padding: 13px 0; background: transparent; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips-wrap { flex-wrap: wrap; overflow: visible; }
.chips-sm .chip { padding: 5px 11px; font-size: 12px; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2); font: 600 13px var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.chip.on, .chip:hover { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }

/* ---------- blok & kategori ---------- */
.block { margin-bottom: 22px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.block-head h2 { font-size: 17px; margin: 0; }
.block-head a { font-size: 13px; font-weight: 600; }
.page-title { font-size: 22px; font-weight: 800; margin: 6px 0 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: none !important; }
.cat-ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-soft); transition: transform .12s; }
.cat-tile:hover .cat-ico { transform: translateY(-2px); }
.cat-ico .i { width: 24px; height: 24px; }
.cat-name { line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- daftar harga (gaya konter) ---------- */
.pricelist { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); overflow: hidden; margin-bottom: 16px; }
.pl-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: var(--ink); text-decoration: none !important; border-bottom: 1px dashed var(--line); }
.pl-row:last-child { border-bottom: 0; }
.pl-row:hover { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.pl-row.is-off { opacity: .55; }
.pl-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary); flex: none; }
.pl-body { flex: 1; min-width: 0; }
.pl-name { display: block; font-weight: 700; font-size: 14px; line-height: 1.3; }
.pl-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.pl-star { display: inline-flex; align-items: center; gap: 2px; color: #b8860b; font-weight: 700; font-size: 12px; }
.pl-star .i { width: 13px; height: 13px; }
.pl-price { font-weight: 800; font-size: 15px; white-space: nowrap; color: var(--ink); }
.list-count { margin: 0 0 8px; }

/* ---------- list umum ---------- */
.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); overflow: hidden; margin-bottom: 16px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.lr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-title { font-weight: 700; font-size: 14px; }
.lr-sub { font-size: 12px; color: var(--ink-3); }
.lr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.pager { display: flex; justify-content: center; gap: 10px; margin: 6px 0 18px; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); }
.empty .i { width: 40px; height: 40px; color: color-mix(in srgb, var(--primary) 45%, var(--ink-3)); margin-bottom: 8px; }

/* ---------- ticker transaksi ---------- */
.ticker { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 9px 14px; margin-bottom: 20px; overflow: hidden; font-size: 13px; box-shadow: var(--shadow-soft); }
.ticker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); flex: none; }
.ticker-track { position: relative; height: 20px; flex: 1; overflow: hidden; }
.ticker-track span { position: absolute; inset: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; }
.ticker-track span.on { opacity: 1; transform: none; }

/* ---------- halaman produk ---------- */
.prod-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 16px; }
.prod-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--hero); color: #fff; flex: none; overflow: hidden; }
.prod-ico img { width: 100%; height: 100%; object-fit: cover; }
.prod-ico .i { width: 28px; height: 28px; }
.prod-cat { font-size: 13px; color: var(--ink-3); margin: 0; }
.prod-name { font-size: 19px; font-weight: 800; margin: 2px 0; }
.prod-price { font-size: 22px; font-weight: 800; color: var(--primary); margin: 0; }
.prod-desc { color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.fact { background: var(--surface); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-soft); }
.fact span { display: block; font-size: 11px; color: var(--ink-3); }
.fact b { font-size: 14px; }
.fav-pick { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.fav-pick .chip { padding: 6px 12px; font-size: 12px; }
.stars { color: #e0a100; letter-spacing: 1px; }
.stars-off { color: var(--line); }

/* lembar konfirmasi (bottom sheet) */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 10, 30, .5); animation: fade .2s ease; }
.sheet-panel { position: relative; width: 100%; max-width: 560px; background: var(--surface); border-radius: 26px 26px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: rise .22s ease; }
.sheet-panel h3 { font-size: 18px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 8px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.kv { margin: 0 0 14px; display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-3); flex: none; }
.kv dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }

/* ---------- STRUK ORDER (gaya struk printer thermal) ---------- */
.receipt { position: relative; background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 20px 26px; margin: 8px 0 30px; box-shadow: var(--shadow-soft); }
.rc-edge { position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--surface) 0) 0 0 / 16px 12px repeat-x, linear-gradient(45deg, transparent 8px, var(--surface) 0) 0 0 / 16px 12px repeat-x;
  filter: drop-shadow(0 3px 2px rgba(27, 21, 48, .06)); }
.rc-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 2px dashed var(--line); margin-bottom: 14px; }
.rc-store { font-weight: 800; font-size: 13px; color: var(--ink-2); }
.rc-product { font-size: 18px; font-weight: 800; margin: 0; }
.rc-price { font-size: 26px; font-weight: 800; margin: 2px 0 10px; }
.rc-lines { margin: 0 0 14px; }
.rc-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px dotted var(--line); }
.rc-lines dt { color: var(--ink-3); }
.rc-lines dd { margin: 0; font-weight: 600; text-align: right; }
.rc-sn { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); border: 1.5px dashed color-mix(in srgb, var(--ok) 45%, transparent); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; }
.rc-sn > span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.rc-sn-row { display: flex; align-items: center; gap: 8px; }
.rc-sn-row code { flex: 1; font-size: 15px; font-weight: 700; word-break: break-all; }
.rc-msg { font-size: 13px; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 5%, transparent); border-radius: 10px; padding: 9px 12px; }
.actions-row { display: flex; gap: 10px; margin-bottom: 18px; }
.actions-row .btn { flex: 1; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.tl-success .tl-dot, .tl-refunded .tl-dot, .tl-sn .tl-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.tl-failed .tl-dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
.tl-preorder .tl-dot, .tl-waiting .tl-dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }
.tl-live .tl-dot { background: transparent; border: 2px solid var(--primary); animation: pulse 1.4s ease-in-out infinite; }
.tl-body { display: flex; flex-direction: column; font-size: 14px; }
.tl-body span { color: var(--ink-2); font-size: 13px; word-break: break-word; }
.tl-body time { color: var(--ink-3); font-size: 12px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 12%, transparent); } }

.rate-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin-bottom: 12px; }
.rate-input input { position: absolute; opacity: 0; pointer-events: none; }
.rate-input label { font-size: 32px; color: var(--line); cursor: pointer; line-height: 1; }
.rate-input input:checked ~ label, .rate-input label:hover, .rate-input label:hover ~ label { color: #e0a100; }
.rate-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }

/* ---------- deposit ---------- */
.amount-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -4px 0 16px; }
.amount-picks .chip { text-align: center; }
.methods { border: 0; padding: 0; margin: 0 0 16px; }
.methods legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.method { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 8px; cursor: pointer; }
.method:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.method input { margin-top: 4px; }
.method-body { display: flex; flex-direction: column; }
.method-body span { font-size: 13px; color: var(--ink-3); }
.accounts { display: grid; gap: 6px; margin: 0 0 8px 28px; }
.account { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 4%, transparent); cursor: pointer; }
.account input { margin-top: 4px; }
.dep-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dep-label { font-size: 13px; color: var(--ink-3); margin: 0; }
.dep-total { font-size: 32px; font-weight: 800; display: flex; align-items: center; gap: 6px; margin: 0 0 8px; letter-spacing: -.01em; }
.dep-unique { color: var(--primary); background: color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 6px; padding: 0 3px; }
.qr-box { background: #fff; border-radius: 18px; padding: 14px; width: fit-content; margin: 12px auto; box-shadow: var(--shadow-soft); }
.qr-box img { display: block; }
.acct-box { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--line); margin: 12px 0; }
.proof-form { margin-top: 14px; }

/* ---------- akun ---------- */
.profile-head { display: flex; gap: 14px; align-items: center; margin: 10px 0 18px; }
.profile-head h2 { margin: 0; font-size: 20px; }
.profile-head p { margin: 0; }
.avatar { width: 58px; height: 58px; border-radius: 20px; background: var(--hero); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.avatar-sm { width: 34px; height: 34px; border-radius: 11px; font-size: 14px; }
.menu-list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); overflow: hidden; margin-bottom: 16px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 600 15px var(--font); text-decoration: none !important; cursor: pointer; text-align: left; }
.menu-list > :last-child { border-bottom: 0; }
.menu-list .i { color: var(--primary); }
.auth { padding-top: 10px; }

/* ---------- status layanan ---------- */
.status-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border-radius: var(--r-lg); margin-bottom: 16px; text-align: center; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-partial { background: var(--warn-bg); color: var(--warn); }
.status-down { background: var(--danger-bg); color: var(--danger); }
.status-pulse { width: 14px; height: 14px; border-radius: 50%; background: currentColor; animation: pulse2 1.6s infinite; margin-bottom: 6px; }
@keyframes pulse2 { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 12px transparent; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--surface); padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- error & instalasi ---------- */
.err-page { max-width: 420px; margin: 0 auto; padding: 80px 20px; text-align: center; }
.err-code { display: inline-block; font-size: 64px; font-weight: 800; background: var(--hero); -webkit-background-clip: text; background-clip: text; color: transparent; }
.install-body { background: var(--hero); min-height: 100vh; padding: 24px 14px; }
.install { max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: 26px; padding: 26px 22px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5); }
.install-head { text-align: center; margin-bottom: 18px; }
.install-head h1 { font-size: 22px; font-weight: 800; }
.install-head p { color: var(--ink-3); font-size: 14px; }
.install-crest { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; font-size: 26px; background: linear-gradient(145deg, #ffe7a3, #f5b83d 55%, #b97b0f); color: #4a2f00; margin-bottom: 10px; }
.install-form section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.install-form h2 { font-size: 15px; }
.install-done { text-align: center; }
.a-login { max-width: 400px; margin-top: 8vh; }

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

/* ==========================================================================
   Fase 2: chat CS, tiket, hubungkan WhatsApp/Telegram
   ========================================================================== */
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 210px); }
.chat-hint { margin-bottom: 10px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 6px 0 12px; }
.chat-log-static { margin: 12px 0 16px; }
.bubble { max-width: 82%; padding: 9px 12px 6px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: 2px; align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.bubble.is-bot { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--ink); }
.bubble.is-internal { background: var(--warn-bg); color: var(--ink); border: 1px dashed var(--warn); }
.bubble-name { font-size: 11px; font-weight: 700; opacity: .75; }
.bubble-text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble time { font-size: 10px; opacity: .65; align-self: flex-end; }
.chat-form { position: sticky; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0; }
.chat-form textarea { resize: none; min-height: 46px; max-height: 140px; }
.chat-form .btn { flex: none; }
.menu-badge { margin-left: auto; }
.link-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-card { margin-bottom: 12px; }
.link-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-head .badge { margin-left: auto; }
.link-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.link-wa { background: #1fa855; }
.link-tg { background: #229ed9; }
.link-code { font-size: 34px; font-weight: 800; letter-spacing: .2em; margin: 4px 0 12px; }
.link-actions { display: grid; gap: 8px; margin-bottom: 10px; }
@media (max-width: 380px) { .link-cards { grid-template-columns: 1fr; } }

/* ---------- Fase 3 ---------- */
.legal h3 { font-size: 16px; margin-top: 18px; }
.legal ul { padding-left: 18px; margin: 0 0 10px; font-size: 14px; }
.legal li { margin-bottom: 6px; }
.legal p { font-size: 14px; }
.list-flat { box-shadow: none; background: transparent; margin-bottom: 8px; }
.list-flat .list-row { padding: 10px 0; }
.target-row { display: flex; gap: 8px; align-items: stretch; }
.target-row input { flex: 1; }
.target-row .btn { flex: none; }
.is-app [data-install-app] { display: none !important; }
.is-app .c-footer { padding-bottom: 0; }

/* ---------- Fase 3: tampilan di dalam aplikasi Android ---------- */
.in-app [data-install-app], .in-app .web-only { display: none !important; }
html:not(.in-app) .app-only { display: none !important; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.input-btn { flex: none; width: 48px; padding: 0; }
.pick-list { display: grid; gap: 8px; margin: 10px 0; }
.app-banner { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow-soft); margin-bottom: 18px; color: var(--ink); text-decoration: none !important; }
.app-banner .link-ico { background: var(--hero); }
.app-banner > span { flex: none; }
.app-banner > .app-banner-text { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }
.app-banner-text b { display: block; font-size: 14px; color: var(--ink); }
.legal h3 { font-size: 16px; margin-top: 18px; }
.legal ul { padding-left: 18px; }
.legal li { margin-bottom: 6px; font-size: 14px; }

/* ---------- struk cetak ---------- */
.print-body { background: var(--bg); }
.print-wrap { max-width: 520px; margin: 0 auto; padding: 16px; }
.print-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.paper { background: #fff; color: #111; font: 13px/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; padding: 14px 12px; margin: 0 auto 12px; border-radius: 6px; box-shadow: var(--shadow-soft); white-space: pre; overflow-x: auto; }
.paper-58 { width: calc(32ch + 24px); max-width: 100%; }
.paper-80 { width: calc(48ch + 24px); max-width: 100%; }
@media print {
  @page { margin: 0; }
  .no-print, .toast { display: none !important; }
  .print-body { background: #fff; }
  .print-wrap { padding: 0; max-width: none; }
  .paper { box-shadow: none; border-radius: 0; margin: 0; padding: 2mm; font-size: 11px; width: auto; }
}
.install-alt { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.install-alt summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.install-alt[open] summary { margin-bottom: 10px; }
.rc-sn-row code { white-space: pre-wrap; word-break: break-all; }
