:root {
  --bg: #0b0f14;
  --bg-elevated: #151b24;
  --bg-card: #1a222e;
  --bg-nav: rgba(18, 24, 33, 0.92);
  --text: #f3f6fb;
  --text-muted: #8b97a8;
  --accent: #3db4ff;
  --accent-soft: #5bc2ff;
  --accent-deep: #1a8fd9;
  --success: #2ecc71;
  --success-bg: rgba(46, 204, 113, 0.14);
  --border: rgba(255, 255, 255, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(61, 180, 255, 0.12), transparent 55%),
    var(--bg);
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

.hidden {
  display: none !important;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: 16px 16px calc(110px + var(--safe-bottom));
  position: relative;
}

/* Header */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  animation: fadeUp 0.45s ease both;
}

.brand {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 2px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.btn-ambil {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #041018;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(61, 180, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-ambil:active {
  transform: scale(0.96);
}

/* Promo */
.promo {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #1a7fd4 0%, #2aa3f5 45%, #0d6cb5 100%);
  min-height: 128px;
  box-shadow: 0 10px 28px rgba(26, 127, 212, 0.35);
  animation: fadeUp 0.5s ease 0.05s both;
}

.promo-glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 65%);
  pointer-events: none;
}

.promo-content {
  position: relative;
  z-index: 1;
  max-width: 54%;
}

.promo-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.95;
  margin-bottom: 6px;
}

.promo-logo {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

.promo-headline {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.promo-cta {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: #0a5a9c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.promo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.9;
}

.promo-art {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 52%;
  pointer-events: none;
}

.star {
  position: absolute;
  color: #ffe566;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  animation: float 3s ease-in-out infinite;
}

.star.s1 { font-size: 22px; right: 8px; top: 6px; }
.star.s2 { font-size: 16px; left: 4px; bottom: 22px; animation-delay: 0.6s; }

/* Fan 5 bendera mengisi ruang tengah–kanan */
.promo-flags {
  position: absolute;
  left: 4px;
  right: 18px;
  top: 50%;
  height: 64px;
  transform: translateY(-54%);
}

.promo-flag-img {
  position: absolute;
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.15);
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.promo-flag-img:nth-child(1) {
  left: 0%;
  top: 18px;
  transform: rotate(-22deg);
  z-index: 1;
}

.promo-flag-img:nth-child(2) {
  left: 18%;
  top: 4px;
  transform: rotate(-10deg);
  z-index: 2;
}

.promo-flag-img:nth-child(3) {
  left: 36%;
  top: 0;
  transform: rotate(1deg);
  z-index: 5;
}

.promo-flag-img:nth-child(4) {
  left: 54%;
  top: 6px;
  transform: rotate(12deg);
  z-index: 3;
}

.promo-flag-img:nth-child(5) {
  left: 72%;
  top: 16px;
  transform: rotate(22deg);
  z-index: 2;
}

.promo-flag-img.is-swap {
  opacity: 0.35;
  filter: brightness(1.2);
}

.plane {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-size: 24px;
  transform: rotate(-22deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: float 2.6s ease-in-out 0.3s infinite;
  z-index: 6;
}

/* Stats */
.stats-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  animation: fadeUp 0.55s ease 0.1s both;
}

.stats-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #4eb8ff, #1a8fd9);
  box-shadow: 0 6px 18px rgba(61, 180, 255, 0.28);
  position: relative;
}

.stats-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stats-avatar span {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.stats-avatar.has-photo span {
  display: none;
}

.stats-main {
  flex: 1;
  min-width: 0;
}

.stats-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stats-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.stats-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stats-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-sub strong {
  color: var(--text);
  font-weight: 700;
}

.stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
}

.stats-action {
  width: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent-deep));
  color: #041018;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(61, 180, 255, 0.28);
  transition: transform 0.15s ease;
}

.stats-action:active:not(:disabled) {
  transform: scale(0.95);
}

.stats-action:disabled,
.stats-action.is-loading {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.stats-action.is-loading svg {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pages / list */
.pages {
  position: relative;
}

.page {
  display: none;
  animation: fadeUp 0.35s ease both;
}

.page.active {
  display: block;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: background 0.15s ease;
}

.user-item:active {
  background: #1c2430;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #041018;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent-deep));
  flex-shrink: 0;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-handle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--success-bg);
  color: var(--success);
  flex-shrink: 0;
}

.status-pill.is-skip,
.status-pill.is-drop {
  background: rgba(201, 178, 122, 0.14);
  color: #c9b27a;
}

.status-pill.is-error {
  background: rgba(255, 139, 107, 0.14);
  color: #ff8b6b;
}

.status-pill.is-disconnect {
  background: rgba(255, 107, 138, 0.14);
  color: #ff6b8a;
}

.status-pill.is-wait {
  background: rgba(61, 180, 255, 0.14);
  color: var(--accent-soft);
}

.btn-eye {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.btn-eye:active {
  color: var(--accent);
}

/* Empty / terms */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--accent);
}

.empty h2 {
  color: var(--text);
  font-size: 20px;
  margin-bottom: 8px;
}

.empty p {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #041018;
  font-weight: 700;
  font-size: 14px;
  position: relative;
}

.btn-primary:disabled,
.btn-primary.is-loading {
  opacity: 0.75;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary.is-loading {
  color: transparent;
}

.btn-primary.is-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(4, 16, 24, 0.25);
  border-top-color: #041018;
  animation: spin 0.7s linear infinite;
}

.otp-resend-btn.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.otp-resend-btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  vertical-align: -1px;
  border-radius: 50%;
  border: 2px solid rgba(61, 180, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

.terms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.term-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.term-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.term-icon-gold {
  color: #e8b84a;
  background: rgba(232, 184, 74, 0.14);
}

.term-icon-blue {
  color: var(--accent-soft);
  background: rgba(61, 180, 255, 0.14);
}

.term-icon-green {
  color: var(--success);
  background: var(--success-bg);
}

.term-icon-muted {
  color: #9aa6b5;
  background: rgba(154, 166, 181, 0.12);
}

.term-body h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.term-body p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.term-body strong {
  color: var(--text);
  font-weight: 700;
}

.terms-foot {
  margin-top: 16px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.32);
}

body.page-ketentuan .btn-ambil {
  visibility: hidden;
  pointer-events: none;
}

/* Terms gate (first open) */
body.terms-locked .app {
  visibility: hidden;
  pointer-events: none;
}

.terms-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(61, 180, 255, 0.12), transparent 55%),
    var(--bg);
  display: flex;
  flex-direction: column;
}

.terms-gate[hidden] {
  display: none !important;
}

.terms-gate-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
}

.terms-gate-head {
  flex-shrink: 0;
  margin-bottom: 14px;
}

.terms-gate-head .brand {
  display: block;
  margin-bottom: 6px;
}

.terms-gate-head h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.terms-gate-head p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.terms-gate-head strong {
  color: var(--text);
}

.terms-gate-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.terms-gate-scroll .btn-agree {
  margin-top: 12px;
  margin-bottom: 8px;
  min-height: 48px;
  font-size: 15px;
}

.terms-gate-scroll .btn-agree:disabled {
  opacity: 0.45;
}

/* Kunci klik saat job aktif — scroll halaman tetap boleh (hasil Creator bisa dilirik) */
body.is-user-busy .header .btn-ambil,
body.is-user-busy #usernamesChrome a,
body.is-user-busy #usernamesChrome button,
body.is-user-busy main button,
body.is-user-busy main a,
body.is-user-busy main input,
body.is-user-busy main textarea,
body.is-user-busy main label,
body.is-user-busy .select-bar,
body.is-user-busy .modal:not(.hidden) {
  pointer-events: none !important;
}

/* Tombol Stop Check/Create tetap bisa diklik saat job aktif */
body.is-user-busy main .creator-main-actions .is-stop {
  pointer-events: auto !important;
  opacity: 1 !important;
  filter: none !important;
}

body.is-user-busy .header,
body.is-user-busy #usernamesChrome,
body.is-user-busy main,
body.is-user-busy .select-bar {
  opacity: 0.72;
  filter: grayscale(0.08);
}

body.is-user-busy .bottom-nav {
  pointer-events: auto !important;
  opacity: 1;
  filter: none;
}

body.is-user-busy .creator-log,
body.is-user-busy .creator-log-body,
body.is-user-busy .account-list,
body.is-user-busy .list {
  opacity: 1;
  filter: none;
}

.user-busy-bar {
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(18, 24, 33, 0.96);
  border: 1px solid rgba(61, 180, 255, 0.45);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.user-busy-bar.hidden {
  display: none;
}

.user-busy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(61, 180, 255, 0.5);
  animation: busyPulse 1.2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes busyPulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 180, 255, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(61, 180, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 180, 255, 0); }
}

body.is-user-busy .user-busy-bar {
  pointer-events: none;
  opacity: 1;
  filter: none;
}

body.is-user-busy.has-select-bar .select-bar {
  display: none !important;
}

/* Bottom nav */
.select-bar {
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(18, 24, 33, 0.96);
  border: 1px solid rgba(61, 180, 255, 0.35);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.select-bar.hidden {
  display: none;
}

/* Bulk ping jalan: hanya teks status, tombol disembunyikan */
.select-bar.is-busy .select-bar-btn,
.select-bar.is-busy .select-bar-clear {
  display: none;
}

.select-bar.is-busy .select-bar-count {
  flex: 1;
  text-align: center;
}

.select-bar-count {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.select-bar-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #041018;
  font-size: 13px;
  font-weight: 800;
}

.select-bar-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 700;
}

.select-bar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-toolbar {
  display: flex;
  align-items: center;
  margin: 0 0 12px;
}

.account-toolbar[hidden] {
  display: none;
}

.account-status-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 1px 0;
}

.account-status-filters::-webkit-scrollbar {
  display: none;
}

.account-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.account-status-chip-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.account-status-chip.is-ok {
  color: var(--success);
}

.account-status-chip.is-danger {
  color: #f07178;
}

.account-status-chip.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.account-status-chip.is-ok.is-active {
  background: var(--success-bg);
  border-color: rgba(61, 214, 140, 0.45);
}

.account-status-chip.is-ok.is-active .account-status-chip-count {
  background: rgba(61, 214, 140, 0.22);
}

.account-status-chip.is-danger.is-active {
  background: rgba(220, 60, 70, 0.14);
  border-color: rgba(240, 113, 120, 0.45);
}

.account-status-chip.is-danger.is-active .account-status-chip-count {
  background: rgba(220, 60, 70, 0.22);
}

.account-status-chip.is-all.is-active {
  background: rgba(61, 180, 255, 0.12);
  border-color: rgba(61, 180, 255, 0.4);
  color: var(--accent-soft);
}

.account-status-chip.is-all.is-active .account-status-chip-count {
  background: rgba(61, 180, 255, 0.2);
}

.account-list.is-selecting .btn-ping {
  opacity: 0.4;
  pointer-events: none;
}

.account-list.is-selecting .account-card {
  cursor: default;
}

.select-bar-clear {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  border-radius: 22px;
  background: var(--bg-nav);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 16px;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-item.active {
  color: var(--accent);
  background: rgba(61, 180, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(61, 180, 255, 0.35);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.plane {
  animation-name: floatPlane;
}

@keyframes floatPlane {
  0%, 100% { transform: rotate(-18deg) translateY(0); }
  50% { transform: rotate(-18deg) translateY(-6px); }
}

/* Skeleton */
.skeleton {
  height: 66px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #151b24 25%, #1c2430 50%, #151b24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Hide usernames chrome on other pages */
body.page-accounts #usernamesChrome,
body.page-ketentuan #usernamesChrome {
  display: none;
}

/* Accounts tip */
.tip-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(61, 180, 255, 0.12), rgba(26, 34, 46, 0.95));
  border: 1px solid rgba(61, 180, 255, 0.2);
  margin-bottom: 14px;
}

.tip-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(61, 180, 255, 0.18);
  color: var(--accent);
}

.tip-body h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tip-body p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.tip-body strong {
  color: var(--text);
  font-weight: 700;
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 12px;
}

.account-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.account-group-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account-group-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.account-group-head.is-ok .account-group-label {
  color: var(--success);
}

.account-group-head.is-ok .account-group-count {
  background: var(--success-bg);
  color: var(--success);
}

.account-group-head.is-danger .account-group-label {
  color: #f07178;
}

.account-group-head.is-danger .account-group-count {
  background: rgba(220, 60, 70, 0.14);
  color: #f07178;
}

.account-group-head.is-muted .account-group-label,
.account-group-head.is-muted .account-group-count {
  color: #9aa4b2;
}

.account-group-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.account-card.is-selected {
  border-color: rgba(61, 180, 255, 0.45);
  background: rgba(61, 180, 255, 0.06);
}

.account-flag {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.account-flag:active {
  transform: scale(0.94);
}

.account-flag .flag-emoji {
  font-size: 26px;
  line-height: 1;
}

.account-flag .flag-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(61, 180, 255, 0.88);
  color: #041018;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.account-flag.is-checked {
  border-color: var(--accent);
}

.account-flag.is-checked .flag-check {
  opacity: 1;
}

.account-flag.is-checked .flag-emoji {
  opacity: 0.25;
}

.account-meta {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.account-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 8px;
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-blue {
  background: rgba(61, 180, 255, 0.16);
  color: var(--accent-soft);
}

.badge-green {
  background: var(--success-bg);
  color: var(--success);
}

.badge-frozen {
  background: rgba(220, 60, 70, 0.14);
  color: #f07178;
}

.badge-inactive {
  background: rgba(255, 255, 255, 0.08);
  color: #9aa4b2;
}

.badge-action {
  cursor: pointer;
  border: 1px dashed rgba(61, 180, 255, 0.45);
}

.badge-action:active {
  transform: scale(0.97);
  background: rgba(61, 180, 255, 0.28);
}

.btn-ping {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.btn-ping .ping-ico {
  display: block;
}

.btn-ping.is-ok {
  color: #3dd68c;
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.08);
}

.btn-ping.is-inactive {
  color: #f0c14a;
  border-color: rgba(240, 193, 74, 0.4);
  background: rgba(240, 193, 74, 0.1);
}

.btn-ping.is-frozen {
  color: #7ec8ff;
  border-color: rgba(126, 200, 255, 0.4);
  background: rgba(126, 200, 255, 0.1);
}

.btn-ping:active:not(:disabled) {
  filter: brightness(1.08);
}

.btn-ping:disabled,
.btn-ping.is-loading {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ping.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.empty-accounts {
  padding: 28px 16px;
}

.empty-accounts p {
  margin: 0;
}

.empty-accounts .empty-hint {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.empty-accounts strong {
  color: var(--accent-soft);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background: #141b25;
  border: 1px solid var(--border);
  border-bottom: none;
  animation: fadeUp 0.25s ease both;
}

.modal-sheet h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

.modal-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-align: left;
}

.modal-option strong {
  font-size: 14px;
}

.modal-option span {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-option:active {
  border-color: rgba(61, 180, 255, 0.4);
}

.modal-option-danger strong {
  color: #f07178;
}

.modal-option-danger:active {
  border-color: rgba(240, 113, 120, 0.45);
  background: rgba(220, 60, 70, 0.1);
}

.modal-cancel {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(61, 180, 255, 0.5);
}

.creator-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.creator-hint {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(61, 180, 255, 0.08);
  border: 1px solid rgba(61, 180, 255, 0.16);
}

.creator-hint p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}

.creator-hint strong {
  color: var(--accent-soft);
  font-weight: 700;
}

.creator-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 18px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.creator-stat-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.creator-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.creator-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: -6px;
}

.creator-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.creator-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 84px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.creator-tool:active {
  border-color: rgba(61, 180, 255, 0.4);
  background: #1c2430;
}

.creator-tool-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(61, 180, 255, 0.12);
  color: var(--accent-soft);
}

.modal-creator-input .field textarea {
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 650;
  font-size: 13px;
}

.btn-secondary:active {
  border-color: rgba(61, 180, 255, 0.4);
}

.btn-secondary:disabled,
.btn-secondary.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.creator-main-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.creator-main-actions .btn-block {
  margin-top: 0;
  margin-bottom: 0;
  min-height: 48px;
  font-size: 14px;
}

.creator-main-actions .btn-secondary.is-stop,
.creator-main-actions .btn-primary.is-stop {
  background: rgba(255, 107, 138, 0.16);
  border: 1px solid rgba(255, 107, 138, 0.45);
  color: #ff8fa3;
  pointer-events: auto !important;
  opacity: 1 !important;
}

.creator-main-actions .btn-primary.is-stop {
  background: linear-gradient(180deg, #ff8fa3, #e85a7a);
  color: #1a060c;
  border: none;
}

.creator-log {
  margin-top: 14px;
}

.creator-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.creator-log-head #creatorLogSummary {
  font-weight: 600;
  color: var(--accent-soft);
}

.creator-log-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Tidak dibatasi tinggi — scroll halaman seperti Usernames / Accounts */
  padding-bottom: 8px;
}

.creator-log-body .user-item {
  margin: 0;
}

.btn-block {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Login OTP step */
.otp-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.otp-sub strong {
  color: var(--text);
  font-weight: 700;
}

.otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 14px;
}

.otp-digit {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 22, 32, 0.9);
  color: var(--text);
  outline: none;
  caret-color: var(--accent);
}

.otp-digit:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 180, 255, 0.25);
}

.otp-resend {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.otp-resend-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: -8px 0 14px;
  padding: 6px;
}

.otp-resend-btn.hidden {
  display: none;
}

/* Account detail modal — chrome Telegram putih + body gelap full-screen */
.modal#modalAccount {
  align-items: stretch;
}

.modal#modalAccount .modal-backdrop {
  background: #0e141c;
  pointer-events: none;
}

.modal#modalAccount .modal-account {
  margin: 0;
  flex: 1;
  max-height: none;
  height: 100%;
  max-width: none;
  border-radius: 0;
  border: none;
  padding: 16px 16px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  background: #0e141c;
  animation: none;
}

.modal#modalAccount .modal-close-x {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #c5ced8;
  font-size: 13px;
  z-index: 120;
  /* di luar area scroll → tetap tampak saat konten digulir */
}

.acc-detail-head {
  text-align: center;
  padding: 10px 8px 18px;
}

.acc-detail-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #4eb8ff, #1a8fd9);
  box-shadow: 0 8px 24px rgba(61, 180, 255, 0.28);
}

.acc-detail-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.acc-detail-id {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.acc-detail-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.acc-action-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.acc-action-ico {
  color: var(--accent);
  display: grid;
  place-items: center;
}

.acc-phone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.acc-phone-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.acc-phone-meta {
  flex: 1;
  min-width: 0;
}

.acc-phone-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.acc-phone-value {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.acc-phone-value.is-hidden {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12.5px;
}

.acc-phone-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 58px;
  min-height: 52px;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.acc-phone-btn.is-copied {
  background: rgba(46, 204, 113, 0.14);
  color: var(--success);
  border-color: rgba(46, 204, 113, 0.35);
}

.acc-login-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(61, 180, 255, 0.05);
  border: 1px solid rgba(61, 180, 255, 0.28);
}

.acc-login-top {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.acc-login-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(61, 180, 255, 0.14);
  flex-shrink: 0;
}

.acc-login-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.acc-login-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.acc-login-desc strong {
  color: var(--text);
}

.acc-login-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(61, 180, 255, 0.12);
  border: 1px solid rgba(61, 180, 255, 0.3);
  color: var(--accent-soft);
  font-size: 14px;
  font-weight: 800;
}

.acc-uname-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.acc-uname-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.acc-uname-head #accUnameCount {
  font-weight: 800;
  color: var(--accent-soft);
  letter-spacing: 0;
  text-transform: none;
}

.acc-uname-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-uname-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.acc-uname-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.acc-uname-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #5bc2ff, #3db4ff);
  color: #041018;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.acc-uname-meta {
  flex: 1;
  min-width: 0;
}

.acc-uname-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-uname-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-uname-pill {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(61, 180, 255, 0.14);
  color: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
}

.acc-remove-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 13px 12px;
  border-radius: 14px;
  background: rgba(220, 60, 70, 0.1);
  border: 1px solid rgba(220, 60, 70, 0.4);
  color: #f07178;
  font-size: 14px;
  font-weight: 800;
}

.acc-remove-btn:active {
  background: rgba(220, 60, 70, 0.18);
}

/* Non-blocking toast — pengganti Telegram showAlert */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  z-index: 1200;
  max-width: min(92vw, 360px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(22, 28, 38, 0.96);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.app-toast.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
