:root {
  --tinta: #0E1A2F;
  --abu: #55627A;
  --garis: #E6ECF5;
  --biru: #2D6BE4;
  --biru-tua: #1A4FB5;
  --biru-muda: #E6EEFD;
  --latar: #F4F7FC;
  --pink-muda: #FCE9F3;
  --pink: #A3245F;
  --hijau-muda: #E1F4EC;
  --hijau: #0F7A55;
  --merah: #B42318;
  --bayang: 0 1px 2px rgba(14,26,47,.04), 0 10px 28px rgba(14,26,47,.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: #FFFFFF; color: var(--tinta); font: 14px/1.5 'Plus Jakarta Sans', system-ui, sans-serif; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; transition: background-color .18s, border-color .18s, transform .18s, box-shadow .18s; }
button:active { transform: scale(.97); }
button:disabled { opacity: .55; cursor: not-allowed; }
[hidden] { display: none !important; }
.isi-hasil { display: flex; flex-direction: column; gap: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.kerangka { min-height: 100vh; display: flex; flex-wrap: wrap; }
.menu { flex: 1 1 88px; max-width: 96px; padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; border-right: 1px solid var(--garis); }
.logo { width: 44px; height: 44px; border-radius: 14px; background: var(--biru); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.menu a { width: 64px; padding: 10px 0; border-radius: 16px; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--abu); }
.menu a.aktif { color: #1F57C3; background: var(--biru-muda); font-weight: 700; }

main.kotak { flex: 999 1 600px; min-width: 0; padding: 32px 32px 40px; display: flex; flex-direction: column; gap: 22px;
  background-color: var(--latar);
  background-image: linear-gradient(#E2E9F4 1px, transparent 1px), linear-gradient(90deg, #E2E9F4 1px, transparent 1px);
  background-size: 32px 32px; }
.kepala { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.kepala h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.kepala p { margin: 0; color: var(--abu); }
.lencana { padding: 8px 14px; border-radius: 99px; background: #FFFFFF; border: 1px solid var(--garis); font-size: 13px; font-weight: 600; color: var(--abu); }

.baris { display: flex; flex-wrap: wrap; gap: 18px; align-items: stretch; }
.kartu { min-width: 0; padding: 24px; border-radius: 32px; background: #FFFFFF; border: 1px solid var(--garis); box-shadow: var(--bayang); display: flex; flex-direction: column; gap: 16px; transition: transform .2s, box-shadow .2s; }
.kartu:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(14,26,47,.04), 0 18px 40px rgba(31,87,195,.10); }
/* Kartu dengan dropdown terbuka: di atas kartu lain, tanpa transform (transform mengurung panel di bawah kartu berikutnya). */
.kartu:has(.pemilih-tombol[aria-expanded="true"]) { position: relative; z-index: 30; transform: none; }
.kartu h2 { margin: 0; font-size: 18px; font-weight: 800; }
.kartu .judul-baris { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.tab { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: #F0F4FA; }
.tab button { height: 36px; padding: 0 16px; border-radius: 99px; border: 0; font-weight: 700; font-size: 13px; background: transparent; color: var(--abu); }
.tab button[aria-selected="true"] { background: var(--biru); color: #FFFFFF; }

.isian { display: flex; flex-wrap: wrap; gap: 10px; }
.input { width: 100%; min-width: 0; padding: 0 20px; height: 54px; border-radius: 99px; border: 1px solid #DCE4EF; background: #F7F9FD; color: var(--tinta); font-size: 15px; outline-color: var(--biru); }
textarea.input { height: auto; padding: 14px 20px; border-radius: 24px; resize: vertical; font-size: 14px; }
.isian .input { flex: 999 1 280px; width: auto; }
.tombol-gelap { flex: 1 1 150px; height: 54px; border-radius: 99px; border: 0; background: var(--tinta); color: #FFFFFF; font-weight: 800; }
.catatan { margin: 0; font-size: 12px; color: var(--abu); }
.galat { margin: 0; font-size: 13px; font-weight: 600; color: var(--merah); }
.unggah { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 96px; padding: 12px; border-radius: 24px; border: 1.5px dashed #C6D2E4; background: #F7F9FD; cursor: pointer; text-align: left; }
.unggah input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.unggah b { display: block; }
.unggah small { color: var(--abu); font-size: 12px; }

.input-kecil { height: 36px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--garis); background: var(--latar); color: var(--tinta); font-size: 12px; outline-color: var(--biru); }
.centang { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; cursor: pointer; }
.centang input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--biru); }
.centang small { display: block; color: var(--abu); font-size: 12px; }
.info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.info > span:first-child { font-size: 12px; font-weight: 700; color: var(--abu); }
.chip-info { padding: 7px 14px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--hijau-muda); color: var(--hijau); }

.kartu-suara { padding: 24px 0 18px; }
.kartu-suara > .judul-baris, .kartu-suara > .ubah { padding-left: 24px; padding-right: 24px; }
.saring { display: flex; gap: 6px; }
.pil { height: 34px; padding: 0 16px; border-radius: 99px; font-weight: 700; font-size: 13px; background: #FFFFFF; color: var(--tinta); border: 1px solid var(--garis); }
.pil[aria-pressed="true"] { background: var(--biru-muda); color: var(--biru-tua); border-color: var(--biru); }
.geser { display: flex; gap: 14px; overflow-x: auto; padding: 6px 24px 12px; scroll-snap-type: x mandatory; }
.geser::-webkit-scrollbar { height: 6px; } .geser::-webkit-scrollbar-thumb { background: #C9D6EA; border-radius: 99px; }
.suara { flex: 0 0 112px; scroll-snap-align: start; padding: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--tinta); }
.suara .muka { width: 84px; height: 84px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 28px; }
.suara .muka.w { background: var(--pink-muda); color: var(--pink); }
.suara .muka.m { background: var(--biru-muda); color: #1F57C3; }
.suara .muka.klon { border: 2px dashed #9DB5DE; color: #1F57C3; background: transparent; }
.suara[aria-pressed="true"] .muka { box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 6px var(--biru); }
.suara b { font-size: 13px; }
.suara small { font-size: 11px; color: var(--abu); text-align: center; line-height: 1.3; }
.ubah { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid #EEF2F8; }
.ubah > span { font-size: 12px; font-weight: 700; color: var(--abu); margin-right: 4px; }
.ubah .pil { height: 32px; padding: 0 14px; font-size: 12px; }
.ubah > input { flex: 1 1 260px; min-width: 0; height: 36px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--garis); background: var(--latar); color: var(--tinta); font-size: 12px; outline-color: var(--biru); }

.grid-gaya { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grid-energi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pilihan { min-height: 72px; padding: 12px 14px; border-radius: 22px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; background: #FFFFFF; color: var(--tinta); border: 1px solid var(--garis); }
.pilihan[aria-pressed="true"] { background: var(--biru-muda); color: var(--biru-tua); border-color: var(--biru); }
.pilihan b { font-size: 13px; } .pilihan small { font-size: 11px; opacity: .8; line-height: 1.3; }
.geseran { display: flex; flex-direction: column; gap: 6px; }
.geseran > label { font-size: 12px; font-weight: 700; color: var(--abu); }

.siap { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 18px 18px 26px; }
.siap span { display: block; } .siap .kecil { font-size: 12px; font-weight: 700; color: var(--abu); } .siap .besar { font-size: 15px; font-weight: 800; }
.tombol-utama { height: 54px; padding: 0 30px; border-radius: 99px; border: 0; background: var(--biru); color: #FFFFFF; font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 10px 24px rgba(45,107,228,.28); text-decoration: none; }

.layar { position: fixed; inset: 0; z-index: 50; padding: 16px; display: flex; align-items: center; justify-content: center; background: rgba(14,26,47,.38); backdrop-filter: blur(3px); }
.layar[hidden] { display: none; }
.popup { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px; border-radius: 32px; background: #FFFFFF; box-shadow: 0 30px 70px rgba(14,26,47,.25); display: flex; flex-direction: column; gap: 16px; }
.popup h2 { margin: 0; font-size: 20px; font-weight: 800; }
.popup .atas { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bulat { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 99px; border: 1px solid var(--garis); background: #FFFFFF; color: var(--tinta); display: flex; align-items: center; justify-content: center; }
.pemutar { padding: 12px; border-radius: 24px; background: #F0F4FA; display: flex; align-items: center; gap: 12px; }
.pemutar .putar { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 99px; border: 0; background: var(--biru); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.gelombang { flex: 1 1 auto; min-width: 0; height: 42px; display: flex; align-items: center; gap: 3px; overflow: hidden; cursor: pointer; }
.gelombang span { flex: 1 1 0; min-width: 2px; border-radius: 99px; background: #C9D6EA; }
.gelombang span.lewat { background: var(--biru); }
.waktu { font-size: 12px; font-weight: 700; color: var(--abu); font-variant-numeric: tabular-nums; }
.naskah { padding: 14px 16px; border-radius: 20px; border: 1px solid var(--garis); font-size: 13px; line-height: 1.6; color: #2A3550; white-space: pre-wrap; }
.aksi { display: flex; gap: 8px; }
.aksi .tombol-utama { flex: 1 1 0; height: 50px; box-shadow: none; }
.aksi .bulat { width: 50px; height: 50px; }
.aksi .bulat[aria-pressed="true"] { background: var(--biru-muda); border-color: var(--biru); color: var(--biru-tua); }
.gabung { padding: 18px; border-radius: 24px; background: var(--latar); border: 1px solid var(--garis); display: flex; flex-direction: column; gap: 12px; }
.gabung .unggah { min-height: 0; justify-content: flex-start; background: #FFFFFF; padding: 14px; border-radius: 20px; }
.ok { font-size: 12px; font-weight: 700; color: var(--hijau); }
.memuat { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 0 10px; text-align: center; }
.putaran { width: 44px; height: 44px; border-radius: 99px; border: 4px solid var(--biru-muda); border-top-color: var(--biru); animation: putar 1s linear infinite; }
@keyframes putar { to { transform: rotate(360deg); } }

.riwayat { display: flex; flex-direction: column; gap: 10px; }
.riwayat .item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; border: 1px solid var(--garis); background: #FFFFFF; }
.riwayat .item div { flex: 1 1 auto; min-width: 0; }
.riwayat .item small { color: var(--abu); }

@media (max-width: 640px) {
  .menu { max-width: none; flex: 1 1 100%; flex-direction: row; justify-content: space-around; padding: 10px; border-right: 0; border-bottom: 1px solid var(--garis); }
  .logo { display: none; }
  main.kotak { padding: 20px 16px 32px; }
  .kartu { padding: 20px; border-radius: 26px; }
  .kartu-suara { padding: 20px 0 14px; }
  .kartu-suara > .judul-baris, .kartu-suara > .ubah { padding-left: 20px; padding-right: 20px; }
  .geser { padding: 6px 20px 12px; }
  .siap .tombol-utama { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 3s !important; } .kartu:hover { transform: none; } }
#in-link { resize: none; overflow: hidden; height: 54px; padding-top: 15px; padding-bottom: 15px; line-height: 1.5; border-radius: 27px; }

/* Layar lebar: konten dibatasi dan ditaruh di tengah, supaya tidak melar selebar layar */
main.kotak > * { width: 100%; max-width: 1120px; margin-left: auto; margin-right: auto; }
.grid-energi + .geseran, .geseran input[type=range] { max-width: 100%; }

/* HP: tab dan filter boleh digeser/bungkus, tidak boleh melebarkan halaman */
.tab { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab::-webkit-scrollbar { display: none; }
.tab button { flex: 0 0 auto; white-space: nowrap; }
.saring { flex-wrap: wrap; }
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .menu a { width: auto; flex: 1 1 0; }
  .kartu .judul-baris > .tab, .kartu .judul-baris > .saring { width: 100%; }
}

/* Riwayat: satu kartu per VO */
.item-riwayat { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 24px; border: 1px solid var(--garis); background: #FFFFFF; box-shadow: var(--bayang); }
.item-riwayat h3 { margin: 0; font-size: 16px; font-weight: 800; flex: 1 1 auto; min-width: 0; }
.item-riwayat small { color: var(--abu); }
.item-riwayat audio { width: 100%; height: 40px; }
.item-riwayat .naskah { margin: 0; }
.kepala-item, .aksi-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kepala-item .input-kecil { flex: 1 1 220px; }
.tautan-pil { display: inline-flex; align-items: center; text-decoration: none; }
.pil.bahaya { color: var(--merah); border-color: #F2C5C0; }
.edit-naskah { display: flex; flex-direction: column; gap: 8px; }
.edit-naskah .tombol-utama { height: 46px; box-shadow: none; }

/* Riwayat & Pengaturan: satu kolom rapi di tengah, judul sejajar dengan isi */
#hal-riwayat > *, #hal-pengaturan > * { max-width: 760px; }
.riwayat > p { margin: 0; padding: 28px; border-radius: 24px; border: 1.5px dashed #C6D2E4; background: #FFFFFF; text-align: center; color: var(--abu); }

/* Rata kiri: konten mulai dari samping menu, lebar tetap dibatasi */
main.kotak > * { margin-left: 0; margin-right: auto; }
.menu .keluar { margin-top: auto; border: 0; background: transparent; cursor: pointer; font-family: inherit; }

/* Modal konfirmasi */
.modal-kecil { width: min(420px, 100%); gap: 12px; }
.modal-kecil h2 { font-size: 18px; }
.aksi-modal { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.aksi-modal .tombol-utama { height: 42px; padding: 0 22px; box-shadow: none; }
.tombol-utama.bahaya { background: var(--merah); }

/* Halaman masuk: kotak login tetap di tengah layar */
main.kotak.tengah > * { margin-left: auto; margin-right: auto; }

/* Dropdown: sama persis dengan kolom input (tinggi, sudut, warna), panah sendiri, bukan gaya bawaan browser */
select.pilih { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 48px; font-size: 14px; font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355627A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center; }
select.pilih:hover { border-color: #B9C8E0; }
select.pilih:disabled { cursor: not-allowed; opacity: .6; }
.isian select.pilih { flex: 999 1 240px; width: auto; }

/* Dropdown buatan sendiri (pengganti daftar <select> bawaan sistem) */
.pemilih { position: relative; flex: 999 1 240px; min-width: 0; }
.pemilih-tombol { width: 100%; height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 18px 0 20px; border-radius: 99px; border: 1px solid #DCE4EF; background: #F7F9FD; color: var(--tinta); font-size: 14px; font-weight: 600; text-align: left; }
.pemilih-tombol:hover { border-color: #B9C8E0; }
.pemilih-tombol[aria-expanded="true"] { border-color: var(--biru); box-shadow: 0 0 0 3px var(--biru-muda); }
.pemilih-tombol span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pemilih-tombol .kosong { color: var(--abu); font-weight: 500; }
.pemilih-tombol svg { flex: 0 0 auto; color: var(--abu); transition: transform .18s; }
.pemilih-tombol[aria-expanded="true"] svg { transform: rotate(180deg); }
.pemilih-panel { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px); padding: 8px; border-radius: 22px; border: 1px solid var(--garis); background: #FFFFFF; box-shadow: 0 18px 44px rgba(14,26,47,.16); display: flex; flex-direction: column; gap: 6px; }
.pemilih-panel input { height: 40px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--garis); background: var(--latar); font-size: 13px; color: var(--tinta); outline-color: var(--biru); }
.pemilih-daftar { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.pemilih-daftar li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.pemilih-daftar li[aria-selected="true"] { color: var(--biru-tua); }
.pemilih-daftar li[aria-selected="true"]::after { content: "✓"; margin-left: auto; }
.pemilih-daftar li.sorot { background: var(--biru-muda); }
.pemilih-daftar .hampa { color: var(--abu); font-weight: 500; cursor: default; }
.pemilih-tombol:focus { outline: none; }
.pemilih-tombol:focus-visible { border-color: var(--biru); box-shadow: 0 0 0 3px var(--biru-muda); }

.pemilih-baris { flex: 1 1 260px; min-width: 0; display: flex; }
.pemilih-baris .pemilih-tombol { height: 36px; padding: 0 14px 0 16px; font-size: 12px; }

/* Panel dropdown tidak mewarisi gaya baris tempat ia dipasang */
.pemilih-panel input { flex: none; width: 100%; box-sizing: border-box; }
.pemilih-daftar, .pemilih-panel { overscroll-behavior: contain; }
