:root {
  --bg: #141617;
  --panel: #1A1D1E;
  --panel-2: #202425;
  --line: #282D2E;
  --line-kuat: #343A3B;
  --text: #E9ECEB;
  --muted: #8B9391;
  --accent: #3ECF8E;
  --accent-teduh: rgba(62, 207, 142, 0.12);
  --danger: #E8705A;
  --warn: #E9C46A;
  --r-l: 16px;
  --r-s: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Atribut hidden harus selalu menang atas display di kelas mana pun.
   Tanpa baris ini, .gerbang dan .panel tetap tampil walau sudah hidden. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.02rem; }
h3 { font-size: 0.95rem; margin-bottom: 10px; }
p { margin: 0 0 10px; }

button, input, select, textarea { font: inherit; color: inherit; }

input[type="text"], input[type="url"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  background: #101314;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 13px 14px;
  margin-bottom: 12px;
}
input[type="file"] {
  width: 100%; background: #101314; border: 1px dashed var(--line-kuat);
  border-radius: var(--r-s); padding: 14px; margin-bottom: 12px;
  font-size: 0.88rem;
}
textarea { resize: vertical; }

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.88rem; }

.utama {
  width: 100%; background: var(--accent); color: #08221A; border: 0;
  border-radius: var(--r-s); padding: 14px 20px; font-weight: 700; cursor: pointer;
}
.utama:disabled { opacity: 0.45; }
.sekunder {
  background: var(--panel-2); border: 1px solid var(--line-kuat); color: var(--text);
  border-radius: var(--r-s); padding: 11px 15px; cursor: pointer; font-size: 0.88rem;
}
.tautan-kecil {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font-size: 0.86rem; font-weight: 600; padding: 4px 0;
}
.tombol-baris { display: flex; gap: 8px; flex-wrap: wrap; }
.tombol-baris > * { flex: 1 1 auto; }

.galat { color: var(--danger); min-height: 1.2em; font-size: 0.86rem; margin: 8px 0 0; }
.kaki-halus { color: var(--muted); font-size: 0.82rem; margin: 10px 0 0; }

/* ---------- Lambang ---------- */
.lambang { width: 34px; height: 34px; display: block; flex: 0 0 auto; }
.lambang.besar { width: 76px; height: 76px; margin: 0 auto 16px; }

/* ---------- Gerbang ---------- */
.gerbang {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: var(--bg); padding: 26px; text-align: center;
}
.gerbang-isi { width: min(390px, 100%); }
.merek-judul { font-size: 1.6rem; letter-spacing: 0.02em; }
.merek-tag { color: var(--muted); font-size: 0.9rem; margin-bottom: 22px; }
.gerbang-kartu { text-align: left; }

/* ---------- Kerangka ---------- */
.bar-atas {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(20, 22, 23, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.bar-merek { display: flex; align-items: center; gap: 11px; min-width: 0; }
.bar-nama { font-weight: 800; font-size: 1.02rem; letter-spacing: 0.01em; }
.bar-tag { color: var(--muted); font-size: 0.76rem; margin-top: -2px; }

.lonceng {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 50%; width: 40px; height: 40px;
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.titik {
  position: absolute; top: 7px; right: 8px; width: 9px; height: 9px;
  background: var(--accent); border: 2px solid var(--panel); border-radius: 50%;
}

.panggung { padding: 16px 16px 92px; max-width: 700px; margin: 0 auto; }

.judul-baris {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 10px;
}

/* ---------- Kartu ---------- */
.kartu {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 16px; margin-bottom: 12px;
}
.tempel { background: linear-gradient(180deg, #1D2221, var(--panel)); }
.nota {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--warn); border-radius: var(--r-s);
  padding: 13px 15px; color: var(--muted); font-size: 0.86rem; margin-top: 20px;
}

/* ---------- Angka ---------- */
.angka-baris { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.angka {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 14px 15px;
}
.angka b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.angka span { color: var(--muted); font-size: 0.8rem; }

/* ---------- Daftar ringkas ---------- */
.daftar-ringkas { display: flex; flex-direction: column; gap: 8px; }
.ringkas {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 10px; cursor: pointer;
}
.ringkas img {
  width: 42px; height: 72px; object-fit: cover; border-radius: 8px;
  background: var(--panel-2); flex: 0 0 auto;
}
.ringkas-teks { min-width: 0; }
.ringkas-judul {
  font-weight: 600; font-size: 0.92rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ringkas-meta { color: var(--muted); font-size: 0.78rem; }

/* ---------- Segmen ---------- */
.segmen {
  display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 4px; margin-bottom: 14px;
}
.segmen-tombol {
  flex: 1; background: none; border: 0; color: var(--muted);
  padding: 10px; border-radius: 7px; cursor: pointer; font-size: 0.9rem; font-weight: 600;
}
.segmen-tombol.aktif { background: var(--panel-2); color: var(--text); }

/* ---------- Alur ---------- */
.alur { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.alur::-webkit-scrollbar { display: none; }
.alur-langkah {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px 6px 6px;
  color: var(--muted); font-size: 0.8rem;
}
.alur-langkah b {
  background: var(--panel-2); width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.74rem; font-weight: 700;
}
.alur-langkah.lewat { color: var(--text); border-color: var(--accent); }
.alur-langkah.lewat b { background: var(--accent); color: #08221A; }
.alur-langkah.kini { color: var(--text); border-color: var(--accent); background: var(--accent-teduh); }
.alur-langkah.kini b { background: var(--accent); color: #08221A; }

/* ---------- Pilihan ---------- */
.pilihan, .saklar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.saklar { flex-direction: column; }
.pil {
  display: flex; align-items: center; gap: 9px; margin: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 11px 14px; color: var(--text); font-size: 0.9rem; background: #101314;
}
.pil.lebar { width: 100%; }
.pil input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.pil:has(input:checked) { border-color: var(--accent); background: var(--accent-teduh); }

.pernyataan {
  display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0;
  color: var(--text); font-size: 0.87rem; line-height: 1.45;
}
.pernyataan input { accent-color: var(--accent); width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }

.pratayang { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pratayang img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- Antrean ---------- */
.daftar-kerja { display: flex; flex-direction: column; gap: 10px; }
.kerja {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 14px;
}
.kerja-atas { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.kerja-judul { font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.kerja-status { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.kerja-status.jalan { color: var(--accent); }
.kerja-status.selesai { color: var(--accent); }
.kerja-status.gagal { color: var(--danger); }
.batang { height: 5px; background: var(--panel-2); border-radius: 99px; margin: 11px 0 7px; overflow: hidden; }
.batang span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.kerja-tahap { color: var(--muted); font-size: 0.82rem; }
.catatan {
  margin-top: 10px; background: #101314; border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 10px 12px; font-size: 0.76rem;
  color: var(--muted); max-height: 180px; overflow: auto; white-space: pre-wrap;
}

/* ---------- Hasil ---------- */
.daftar-hasil { display: flex; flex-direction: column; gap: 12px; }
.hasil {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-l); overflow: hidden;
}
.hasil-atas { display: flex; gap: 12px; padding: 12px; }
.hasil-atas img {
  width: 74px; height: 128px; object-fit: cover; border-radius: 10px;
  background: var(--panel-2); flex: 0 0 auto;
}
.hasil-teks { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hasil-judul { font-weight: 700; font-size: 0.95rem; }
.hasil-meta { color: var(--muted); font-size: 0.78rem; }
.hasil-alasan { color: var(--muted); font-size: 0.8rem; }
.lencana {
  display: inline-block; font-size: 0.72rem; border: 1px solid var(--line-kuat);
  border-radius: 999px; padding: 2px 9px; color: var(--muted);
}
.lencana.hijau { color: var(--accent); border-color: var(--accent); }
.hasil-aksi { display: flex; gap: 8px; padding: 0 12px 12px; }
.hasil-aksi > * { flex: 1; }

/* ---------- Salinan teks ---------- */
.salin-blok { border-top: 1px solid var(--line); padding: 12px 14px; }
.salin-kepala {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.salin-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.salin-isi {
  background: #101314; border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 11px 12px; font-size: 0.86rem; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---------- Panel geser ---------- */
.panel {
  position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 10, 0.66);
  display: flex; align-items: flex-end; justify-content: center;
}
.panel-isi {
  width: 100%; max-width: 700px; max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
.panel-kepala { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.daftar-notif { display: flex; flex-direction: column; gap: 8px; }
.notif {
  background: #101314; border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 12px 14px;
}
.notif.baru { border-left: 3px solid var(--accent); }
.notif-judul { font-weight: 600; font-size: 0.9rem; }
.notif-pesan { color: var(--muted); font-size: 0.82rem; white-space: pre-wrap; }
.notif-waktu { color: var(--muted); font-size: 0.74rem; margin-top: 4px; }

/* ---------- Bar bawah ---------- */
.bar-bawah {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: rgba(20, 22, 23, 0.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bar-tautan {
  flex: 1; background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 7px 2px; border-radius: 9px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.7rem; font-weight: 600;
}
.bar-tautan.aktif { color: var(--accent); }

/* ---------- Roti ---------- */
.roti {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 60;
  background: var(--panel-2); border: 1px solid var(--line-kuat);
  border-radius: 999px; padding: 11px 20px; font-size: 0.86rem;
  max-width: 90vw; text-align: center; box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}

.kosong { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 26px 12px; }

@media (min-width: 720px) {
  .angka-baris { grid-template-columns: repeat(4, 1fr); }
  .panggung { padding: 22px 22px 96px; }
  .panel { align-items: center; }
  .panel-isi { border-radius: 20px; max-height: 82vh; }
}

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