/* Cek Penanda Nomor
   Satu aksen (amber) untuk seluruh halaman; merah/kuning/hijau dipakai hanya
   sebagai status nyata tingkat risiko, bukan hiasan.
   Radius: panel 16px, kontrol 12px, chip pill. */

:root {
  --bg: #0b0c0f;
  --bg-soft: #111317;
  --surface: #14161b;
  --surface-2: #191c22;
  --line: #262a33;
  --line-soft: #1e222a;
  --text: #f2f3f5;
  --text-dim: #a2a8b4;
  --text-faint: #6f7682;

  --accent: #5fa8f5;
  --accent-ink: #061a2e;
  --accent-soft: rgba(95, 168, 245, .16);
  --hl-1: #bfe0ff;
  --hl-2: #5fa8f5;

  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .12);
  --danger-line: rgba(255, 107, 107, .32);
  --warn: #ffb648;
  --warn-soft: rgba(255, 182, 72, .12);
  --warn-line: rgba(255, 182, 72, .3);
  --safe: #4ade80;
  --safe-soft: rgba(74, 222, 128, .1);
  --safe-line: rgba(74, 222, 128, .28);

  --r-panel: 16px;
  --r-control: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --aurora-1: rgba(47, 120, 207, .22);
  --aurora-2: rgba(95, 168, 245, .14);
  --aurora-3: rgba(24, 70, 150, .24);
}

:root[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-soft: #eceff4;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e1e5ec;
  --line-soft: #edf0f5;
  --text: #121520;
  --text-dim: #555d70;
  --text-faint: #868da0;

  --accent: #2566b6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(37, 102, 182, .12);
  --hl-1: #12345c;
  --hl-2: #2f7ad0;

  --danger: #cc2b2b;
  --danger-soft: rgba(204, 43, 43, .08);
  --danger-line: rgba(204, 43, 43, .25);
  --warn: #a96612;
  --warn-soft: rgba(169, 102, 18, .09);
  --warn-line: rgba(169, 102, 18, .24);
  --safe: #17803d;
  --safe-soft: rgba(23, 128, 61, .08);
  --safe-line: rgba(23, 128, 61, .22);

  --shadow: 0 14px 44px rgba(18, 22, 35, .09);
  --aurora-1: rgba(37, 102, 182, .22);
  --aurora-2: rgba(125, 195, 255, .32);
  --aurora-3: rgba(90, 140, 255, .20);
}

* { box-sizing: border-box; }

/* Aturan bawaan browser untuk [hidden] cuma selector atribut, jadi kalah
   kekhususan dari selector class. Tanpa baris ini, elemen seperti .modal dan
   .login-screen yang punya display sendiri tetap tampil walau sudah diberi
   atribut hidden, dan panel yang "ditutup" lewat JavaScript tidak pernah hilang. */
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Latar beranimasi: tiga bidang warna besar yang hanyut pelan.
   Dipasang fixed dan hanya menganimasikan transform, jadi tidak ikut
   menggulung dan tidak memaksa browser menggambar ulang isi halaman. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.aurora i:nth-child(1) {
  width: 52vw;
  height: 52vw;
  min-width: 420px;
  min-height: 420px;
  top: -16vw;
  left: -10vw;
  background: radial-gradient(circle, var(--aurora-1), transparent 68%);
  animation: drift-a 38s ease-in-out infinite alternate;
}

.aurora i:nth-child(2) {
  width: 44vw;
  height: 44vw;
  min-width: 360px;
  min-height: 360px;
  top: -8vw;
  right: -12vw;
  background: radial-gradient(circle, var(--aurora-2), transparent 68%);
  animation: drift-b 46s ease-in-out infinite alternate;
}

.aurora i:nth-child(3) {
  width: 48vw;
  height: 48vw;
  min-width: 380px;
  min-height: 380px;
  top: 38vh;
  left: 32vw;
  background: radial-gradient(circle, var(--aurora-3), transparent 70%);
  animation: drift-c 52s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(9vw, 7vh, 0) scale(1.18); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to { transform: translate3d(-11vw, 10vh, 0) scale(.92); }
}

@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(.95); }
  to { transform: translate3d(-14vw, -12vh, 0) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none; }
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }

.muted { color: var(--text-dim); }
.sm { font-size: 13px; }

/*  topbar  */
.topbar {
  height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -.015em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 19px;
}

.brand-name { font-size: 16px; white-space: nowrap; }

.brand-logo {
  height: 34px;
  width: auto;
  max-width: 150px;
  display: block;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/*  tombol  */
.btn-primary,
.btn-ghost,
.btn-icon {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .12s ease, color .18s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 22px;
  height: 52px;
  font-weight: 600;
  font-size: 15px;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text-dim);
  padding: 0 14px;
  height: 38px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }
.btn-ghost.sm { height: 34px; font-size: 13px; padding: 0 12px; }
.btn-ghost.dev { border-style: dashed; }

.btn-icon {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text-dim);
  width: 38px;
  height: 38px;
  font-size: 17px;
}
.btn-icon:hover { color: var(--text); border-color: var(--text-faint); }

:is(.btn-primary, .btn-ghost, .btn-icon):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/*  pengumuman  */
.announce {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  font-size: 14px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}
.announce-dev { background: var(--surface-2); color: var(--text-dim); }

/*  layout  */
.wrap {
  width: min(1060px, 100%);
  margin: 0 auto;
  padding: 0 20px 80px;
}

/*  hero + pencarian  */
.hero { padding: clamp(48px, 9vw, 88px) 0 0; }

.hero h1 {
  font-size: clamp(34px, 6.2vw, 58px);
  max-width: 14ch;
  letter-spacing: -.035em;
}
.hero h1 .hl {
  background: linear-gradient(100deg, var(--hl-1), var(--hl-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: clamp(15px, 2vw, 18px);
  max-width: 46ch;
}

.searchbar {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 620px;
}

/*  dua paket  */
.buy {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
}

.btn-second {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.btn-second:hover { border-color: var(--text-faint); background: var(--surface-2); }
.btn-second:active { transform: translateY(1px); }
.btn-second:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-second:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.buy-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.buy-price {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-ink) 14%, transparent);
  flex: none;
}
.btn-second .buy-price {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.is-busy { position: relative; }
.is-busy .buy-label::after {
  content: "...";
  animation: ellipsis 1.2s steps(4, end) infinite;
}
@keyframes ellipsis { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/*  ajakan buka tag pada paket profil  */
.upsell {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r-control);
  background: var(--surface-2);
}
.upsell-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 21px;
  flex: none;
}
.upsell-main { flex: 1; min-width: 180px; }
.upsell-main h3 { font-size: 16px; }
.upsell-main p { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.upsell .btn-primary b { font-family: var(--mono); font-weight: 600; }

.field {
  display: flex;
  align-items: center;
  height: 52px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 0 6px 0 0;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.prefix {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px 0 14px;
  margin-right: 10px;
  height: 100%;
  border-right: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}
.prefix i { font-size: 16px; }

.field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: .02em;
  outline: none;
  padding: 0;
}
.field input::placeholder { color: var(--text-faint); letter-spacing: .04em; }

.clear {
  border: none;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 15px;
}
.clear:hover { color: var(--text); background: var(--surface-2); }

.field-error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/*  strip statistik  */
.meta-strip {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
}
.meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 36px;
  margin-right: 36px;
  border-right: 1px solid var(--line-soft);
}
.meta:last-child { border-right: none; padding-right: 0; margin-right: 0; }
.meta-value {
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -.02em;
}
.meta-label { font-size: 13px; color: var(--text-faint); }
.meta-value.low { color: var(--warn); }
.meta-value.out { color: var(--danger); }

/*  panel umum  */
.panel {
  margin-top: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 26px;
  box-shadow: var(--shadow);
  animation: rise .35s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/*  pembayaran  */
.pay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.pay-head h2 { font-size: 19px; }
.pay-head p { font-size: 14px; margin-top: 3px; }

.pay-body {
  padding-top: 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.qr-frame {
  background: #ffffff;
  border-radius: var(--r-control);
  padding: 14px;
  width: 232px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qr { width: 204px; height: 204px; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-brand {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  color: #11131a;
}

.amount-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.amount {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.03em;
}
.pay-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 12px;
}

.pay-steps {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  counter-reset: step;
}
.pay-steps li {
  position: relative;
  padding-left: 30px;
  font-size: 14px;
  color: var(--text-dim);
}
.pay-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

.countdown {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
}
.countdown b { font-family: var(--mono); color: var(--text); font-weight: 500; }
.countdown.urgent b { color: var(--danger); }

.pay-status {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
}
.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  to { box-shadow: 0 0 0 12px transparent; }
}

#btn-dev-pay { margin-top: 18px; }

/*  proses  */
.process { text-align: center; }
.process-icon { font-size: 46px; color: var(--safe); line-height: 1; }
.process h2 { margin-top: 10px; font-size: 20px; }
.process .muted { margin-top: 5px; font-size: 14px; }

.skeleton-card {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}
.sk {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line-soft) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-avatar { width: 62px; height: 62px; border-radius: 14px; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 9px; }
.sk-line { height: 13px; }
.skeleton-tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.sk-chip { height: 30px; border-radius: 999px; }
.w60 { width: 60%; } .w40 { width: 40%; } .w32 { width: 124px; }
.w28 { width: 108px; } .w24 { width: 96px; } .w20 { width: 80px; }
.w18 { width: 72px; } .w16 { width: 64px; }

/*  gagal  */
.failed { text-align: center; }
.failed-icon { font-size: 42px; color: var(--warn); }
.failed h2 { margin-top: 8px; font-size: 20px; }
.failed .muted { margin-top: 6px; font-size: 14px; }
.row-actions { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/*  hasil: banner risiko  */
.risk {
  margin-top: 36px;
  border-radius: var(--r-panel);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  animation: rise .35s cubic-bezier(.16, 1, .3, 1) both;
}
.risk-icon { font-size: 30px; line-height: 1; flex: none; margin-top: 1px; }
.risk h2 { font-size: 18px; }
.risk p { font-size: 14px; color: var(--text-dim); margin-top: 3px; }

.risk[data-level="bahaya"] { background: var(--danger-soft); border-color: var(--danger-line); }
.risk[data-level="bahaya"] .risk-icon, .risk[data-level="bahaya"] h2 { color: var(--danger); }
.risk[data-level="hati-hati"] { background: var(--warn-soft); border-color: var(--warn-line); }
.risk[data-level="hati-hati"] .risk-icon, .risk[data-level="hati-hati"] h2 { color: var(--warn); }
.risk[data-level="aman"] { background: var(--safe-soft); border-color: var(--safe-line); }
.risk[data-level="aman"] .risk-icon, .risk[data-level="aman"] h2 { color: var(--safe); }

.risk-cats { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.risk-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--danger-line);
  font-size: 13px;
}
.risk-cat b { font-family: var(--mono); font-weight: 500; }

/*  hasil: identitas  */
.id-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise .4s cubic-bezier(.16, 1, .3, 1) both;
}

.id-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  flex: none;
}
.avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 30px;
  color: var(--text-faint);
}

.id-main { flex: 1; min-width: 180px; }
.id-name { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.id-name.unknown { color: var(--text-dim); font-weight: 400; font-size: 18px; }
.id-number {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.id-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
}
/* Monogram operator. Logo telko Indonesia tidak tersedia di pustaka ikon,
   jadi dipakai inisial di atas warna merek (pendekatan, bukan logo resmi). */
.op-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  flex: none;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: #fff;
  background: #70778a;
}
.op-mark[data-op="Telkomsel"] { background: #e2231a; }
.op-mark[data-op="Indosat"] { background: #fbc700; color: #22252e; }
.op-mark[data-op="XL"] { background: #0b4ea2; font-size: 8px; }
.op-mark[data-op="Axis"] { background: #7b2d8e; }
.op-mark[data-op="Tri"] { background: #e2001a; }
.op-mark[data-op="Smartfren"] { background: #e8112d; }
.op-mark[data-op="Net1"] { background: #0a7d55; }

.badge-op { padding-left: 4px; gap: 6px; }
.detail-value .op-mark { margin-right: 1px; }

.badge.good { color: var(--safe); border-color: var(--safe-line); background: var(--safe-soft); }
.badge.bad { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.badge.accent { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }

/*  hasil: detail  */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-bottom: 1px solid var(--line-soft);
}
.detail {
  padding: 16px 20px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.detail:last-child { border-right: none; }
.detail-label {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: .01em;
}
.detail-value {
  margin-top: 3px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.detail-value.mono { font-family: var(--mono); font-size: 14px; }

/*  hasil: tag  */
.tags-section { padding: 22px; }
.tags-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.tags-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.count-pill {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}

.tag-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--bg-soft);
  color: var(--text-faint);
  min-width: 190px;
}
.tag-filter input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  width: 100%;
}

.tag-list { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 14px;
  max-width: 100%;
}
.tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag b {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 7px;
  flex: none;
}
.tag.flagged {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}
.tag.flagged b { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }

.tags-empty {
  margin-top: 16px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--r-control);
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}
.tags-empty i { font-size: 26px; display: block; margin-bottom: 8px; color: var(--text-faint); }

.tags-more {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.tags-more:hover { text-decoration: underline; }

/*  hasil: struk  */
.receipt {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-control);
  overflow: hidden;
}
.receipt div { background: var(--surface); padding: 12px 16px; }
.receipt dt { font-size: 12px; color: var(--text-faint); margin: 0; }
.receipt dd { margin: 2px 0 0; font-family: var(--mono); font-size: 13px; }

.result-foot { margin-top: 20px; display: flex; justify-content: center; }

/*  modal  */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 6, 8, .62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } }

.modal-card {
  width: min(560px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
  animation: rise .25s cubic-bezier(.16, 1, .3, 1) both;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 8px 10px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hist {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}
.hist:hover { background: var(--surface-2); border-color: var(--line); }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.hist-dot.done { background: var(--safe); }
.hist-dot.pending { background: var(--accent); }
.hist-dot.failed { background: var(--danger); }
.hist-main { flex: 1; min-width: 0; }
.hist-num { font-family: var(--mono); font-size: 14px; }
.hist-sub { font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.hist-name { font-size: 13px; color: var(--text-dim); max-width: 40%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--text-dim); }
.empty-state i { font-size: 30px; color: var(--text-faint); display: block; margin-bottom: 10px; }

/*  toast  */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 9px;
  justify-items: end;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: var(--r-control);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px;
  max-width: 330px;
  animation: rise .22s cubic-bezier(.16, 1, .3, 1) both;
}
.toast.err { border-color: var(--danger-line); color: var(--danger); }
.toast.ok { border-color: var(--safe-line); color: var(--safe); }

/*  footer  */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 26px 20px 40px;
  text-align: center;
}
.foot p {
  max-width: 62ch;
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-faint);
}

/*  layar kecil  */
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .brand-name { font-size: 15px; }
  #btn-history span { display: none; }
  .wrap { padding: 0 16px 60px; }
  .buy { grid-template-columns: 1fr; }
  .btn-primary { width: 100%; }
  .pay-body { grid-template-columns: 1fr; justify-items: center; }
  .pay-side { width: 100%; }
  .meta { padding-right: 20px; margin-right: 20px; }
  .meta-value { font-size: 20px; }
  .panel { padding: 20px; }
  .id-head { padding: 18px; }
  .detail { padding: 14px 16px; }
  .tags-section { padding: 18px; }
  .tags-head { align-items: stretch; }
  .tag-filter { width: 100%; }
  .toast-wrap { left: 16px; right: 16px; justify-items: stretch; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
