:root {
  --merah: #dc2626; --merah-gelap: #b91c1c; --merah-muda: #fef2f2;
  --teks: #111827; --redup: #6b7280; --garis: #eceef1; --latar: #ffffff;
  --hijau: #15803d; --bayang: 0 1px 2px rgb(17 24 39 / .04), 0 8px 24px rgb(17 24 39 / .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--latar); color: var(--teks);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.02em; }
h2 { font-size: .85rem; font-weight: 600; color: var(--redup); margin: 0 0 .5rem; }
a { color: var(--merah-gelap); }
[hidden] { display: none !important; }
.redup { color: var(--redup); }
.kecil { font-size: .82rem; margin: .25rem 0; }

.aplikasi { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.samping { border-right: 1px solid var(--garis); padding: 1.25rem .9rem; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; gap: 1rem; }
.merek { font-size: 1.2rem; font-weight: 800; margin: 0 .6rem; letter-spacing: -.03em; }
.merek span { color: var(--merah); }
.samping nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.samping nav a { display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .6rem .75rem; border-radius: 10px; text-decoration: none; color: var(--teks);
  transition: background .15s, color .15s; }
.samping nav a:hover { background: #f7f7f8; }
.samping nav a[aria-current] { background: var(--merah-muda); color: var(--merah-gelap); font-weight: 600; }
.lencana { background: var(--merah); color: #fff; border-radius: 999px; font-size: .72rem;
  font-weight: 700; padding: .05rem .45rem; }
.lencana:empty { display: none; }

main { padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: 1200px; width: 100%;
  view-transition-name: isi; }
.atas { margin-bottom: .75rem; }
.pilih-channel { display: flex; gap: .4rem; overflow-x: auto; padding: .2rem .1rem; margin-bottom: .75rem; }
.pil { white-space: nowrap; border: 1px solid var(--garis); background: #fff; border-radius: 999px;
  padding: .3rem .85rem; font: inherit; font-size: .85rem; cursor: pointer; }
.pil[aria-pressed="true"] { background: var(--teks); border-color: var(--teks); color: #fff; }
.baris-judul, .kendali { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.periode { display: inline-flex; gap: .2rem; background: #f4f4f5; padding: .2rem; border-radius: 10px; margin-bottom: 0; }
.periode a { padding: .3rem .75rem; border-radius: 8px; text-decoration: none; color: var(--redup); font-size: .85rem; }
.periode a[aria-current] { background: #fff; color: var(--teks); font-weight: 600; box-shadow: var(--bayang); }
main > .periode { margin-bottom: 1rem; }

.kartu { background: #fff; border: 1px solid var(--garis); border-radius: 16px; padding: 1.1rem 1.2rem;
  box-shadow: var(--bayang); min-width: 0; }
.angka-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .9rem; margin: .75rem 0 .9rem; }
.angka-grid .kartu { transition: transform .15s, box-shadow .15s; }
.angka-grid .kartu:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgb(17 24 39 / .09); }
.besar { font-size: 1.9rem; font-weight: 700; margin: 0; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ubah { font-weight: 600; }
.naik { color: var(--hijau); }
.turun { color: var(--merah); }
.dua-kolom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .9rem; margin-bottom: .9rem; }
.grafik { position: relative; height: 260px; }
.kosong { color: var(--redup); text-align: center; padding: 1.5rem 0; }

progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: #f1f2f4; }
progress::-webkit-progress-bar { background: #f1f2f4; }
progress::-webkit-progress-value { background: var(--merah); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--merah); border-radius: 99px; }
.syarat { margin-bottom: .8rem; }
.syarat-judul { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.atau { font-size: .8rem; font-weight: 600; color: var(--redup); margin: .5rem 0; }

.daftar { list-style: none; padding: 0; margin: 0 0 1rem; }
.daftar li { border-bottom: 1px solid var(--garis); padding: .6rem 0; }
.isi { white-space: pre-wrap; overflow-wrap: anywhere; margin: .25rem 0; }
.komentar { margin-bottom: .75rem; }
.komentar > p:first-child { margin-top: 0; }
.cap { background: #ecfdf3; color: var(--hijau); font-size: .72rem; font-weight: 600; border-radius: 99px; padding: .1rem .5rem; }
.balas form { display: flex; gap: .5rem; align-items: flex-end; margin-top: .5rem; }
textarea { flex: 1; min-width: 0; font: inherit; border: 1px solid #d9dce1; border-radius: 10px; padding: .55rem .7rem; resize: vertical; }
textarea:focus { border-color: var(--merah); }
.terkirim { color: var(--hijau); font-weight: 600; margin: .5rem 0 0; animation: muncul .35s ease; }

.tombol { display: inline-block; border: 1px solid #d9dce1; background: #fff; color: var(--teks);
  border-radius: 10px; padding: .5rem 1rem; font: inherit; font-size: .88rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .1s; }
.tombol:hover { background: #f7f7f8; }
.tombol:active { transform: scale(.97); }
.tombol.utama { background: var(--merah); border-color: var(--merah); color: #fff; }
.tombol.utama:hover { background: var(--merah-gelap); }
.tombol.polos { border-color: transparent; color: var(--redup); }
.tombol:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid rgb(220 38 38 / .45); outline-offset: 2px; }

.peringatan { background: #fffbeb; border: 1px solid #fde68a; color: #854d0e; border-radius: 10px; padding: .6rem .85rem; font-size: .88rem; }
#toast { position: fixed; right: 1rem; bottom: 5rem; max-width: 22rem; background: var(--teks); color: #fff;
  border-radius: 12px; padding: .8rem 1rem; font-size: .88rem; z-index: 30; animation: muncul .25s ease; }
#muat { position: fixed; inset: 0 auto auto 0; height: 3px; width: 0; background: var(--merah); z-index: 40; }
body:has(.htmx-request) #muat, body.htmx-request #muat { width: 85%; transition: width 6s cubic-bezier(.1, .7, .2, 1); }

.baris-channel { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.baris-channel p { overflow-wrap: anywhere; }
.cap.mati { background: #f4f4f5; color: var(--redup); }
.keluar-hp { display: none; }
.saklar { width: 46px; height: 26px; border: 0; border-radius: 99px; background: #d9dce1; position: relative; cursor: pointer; transition: background .2s; }
.saklar::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: left .2s; }
.saklar[aria-checked="true"] { background: var(--merah); }
.saklar[aria-checked="true"]::after { left: 23px; }

.dua-setara { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .9rem; margin-bottom: .9rem; }
.urutan { max-width: 100%; overflow-x: auto; margin-bottom: .9rem; }
.urutan a { white-space: nowrap; }
.tabel-bungkus { padding: .25rem .5rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
th, td { padding: .6rem .5rem; text-align: right; border-bottom: 1px solid var(--garis); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafafa; }
th { font-size: .75rem; font-weight: 600; }
th a { color: var(--redup); text-decoration: none; }
th[aria-sort] a { color: var(--merah-gelap); }
th:first-child, td:first-child { text-align: left; }
.judul-video { min-width: 220px; }
.judul-video a { display: flex; align-items: center; gap: .6rem; color: var(--teks); text-decoration: none; font-weight: 600; }
.judul-video img { object-fit: cover; border-radius: 8px; flex: none; }
.judul-video small { display: block; font-weight: 400; }
.info-video { display: flex; gap: 1rem; align-items: center; margin-bottom: .9rem; }
.info-video img { object-fit: cover; border-radius: 10px; }
.info-video p { margin: .1rem 0; }

.halaman-masuk { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(60rem 30rem at 50% -10%, var(--merah-muda), transparent); }
.masuk { text-align: center; max-width: 24rem; padding: 2rem; }
.masuk .merek { font-size: 1.8rem; }

::view-transition-old(isi) { animation: hilang .12s ease both; }
::view-transition-new(isi) { animation: muncul .28s ease both; }
@keyframes hilang { to { opacity: 0; } }
@keyframes muncul { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 767px) {
  .aplikasi { display: block; }
  .samping { position: fixed; inset: auto 0 0 0; height: auto; z-index: 20; background: #fff;
    border-right: 0; border-top: 1px solid var(--garis); padding: .35rem .25rem; }
  .samping .merek, .samping .keluar { display: none; }
  .samping nav { flex-direction: row; justify-content: space-around; }
  .samping nav a { flex-direction: column; justify-content: center; font-size: .72rem; padding: .45rem .3rem; gap: .1rem; }
  main { padding-bottom: 6rem; }
  .dua-kolom { grid-template-columns: minmax(0, 1fr); }
  .balas form { flex-direction: column; align-items: stretch; }
  textarea { width: 100%; }
  /* tabel menjadi kartu */
  .tabel-bungkus { padding: .25rem .9rem; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--garis); padding: .5rem 0; }
  tbody tr:last-child { border-bottom: 0; }
  td { display: flex; justify-content: space-between; border: 0; padding: .15rem 0; }
  td[data-label]::before { content: attr(data-label); color: var(--redup); }
  .judul-video { min-width: 0; padding-bottom: .4rem; }
  .info-video { flex-direction: column; align-items: flex-start; }
  .keluar-hp { display: block; margin-top: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-old(isi), ::view-transition-new(isi) {
    animation: none !important; transition: none !important; }
}
