/*! © 2026 Ngaji Pegon. Seluruh hak dilindungi. Dilarang menyalin atau memakai ulang tanpa izin tertulis. Lihat LICENSE.md */
/* Auto Pegon — tema "Premium" Siang & Malam (TAHAP5/01, K-56): flat, sudut 2px, ornamen Ar-Risalah.
 * Dipakai bersama oleh semua halaman publik, admin.php, dan install.php.
 * SEMUA warna layar ditulis di blok token ini; :root = Siang, :root[data-tema="malam"] = Malam.
 * Pengecualian: area cetak & ekspor (selalu Siang/hitam-putih, lihat @media print). */
:root {
  --bg: #FAF7F0;            /* latar halaman */
  --surface: #FFFFFF;       /* kotak teks, bingkai, kartu */
  --bg-isian: #FFFFFF;      /* (lama) isian = permukaan */
  --isi-lembut: #F4EEE1;    /* isian lembut: kode, chip netral, hover */
  --text: #1A1814;          /* teks utama */
  --judul: #1A1814;         /* judul & teks Pegon */
  --muted: #5B5548;         /* teks sekunder 6.9:1 */
  --garis: #E4D9C2;         /* garis pembagi */
  --garis-dalam: #E9DDBF;   /* garis bingkai dalam Pegon */
  --garis-buku: #F4EEE1;    /* (lama) isian lembut */
  --garis-tombol: #8F8268;  /* garis komponen yang bisa diklik 3.5:1 (K-41b) */
  --emas: #B08A3E;          /* dekorasi saja (garis, ornamen), bukan teks */
  --emas-teks: #6E521C;     /* label kecil, tautan 6.8:1 */
  --emas-teks-hover: #4A3712;
  --sakelar-bg: #F3EAD6;    /* sakelar aktif */
  --sakelar-ink: #4A3712;
  --arah-bg: #1A1814;       /* sakelar arah aktif */
  --arah-ink: #FAF7F0;
  --utama: #1A1814;         /* tombol utama */
  --utama-ink: #FAF7F0;
  --utama-hover: #3A342A;
  --accent: #6E521C;        /* (lama) aksen = teks emas: tautan, fokus, garis bawah */
  --accent-ink: #FAF7F0;
  --accent-hover: #4A3712;
  --chip-bg: #F3EAD6;
  --chip-ink: #4A3712;
  --offline-bg: #F5E7C8;
  --offline-ink: #6B4410;
  --danger: #A93226;
  --danger-hover: #8E2A20;
  --danger-ink: #FFFFFF;
  --danger-soft: #F8E5E1;
  --ok: #2E6B45;
  --ok-soft: #E3EFE6;
  --fokus: #6E521C;         /* garis fokus 2px */
  --latar-gelap: rgba(26, 24, 20, .5);   /* tirai dialog */
  --toast-bg: #1A1814;
  --toast-ink: #FAF7F0;
  --radius: 2px;
  --font-ui: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-judul: "Cormorant Garamond", Georgia, serif;
  --font-pegon: Amiri, "Noto Naskh Arabic", serif;
  color-scheme: light;
}
:root[data-tema="malam"] {
  --bg: #0B0F1A;
  --surface: #121828;
  --bg-isian: #121828;
  --isi-lembut: #1A2134;
  --text: #ECE6D8;
  --judul: #F2EAD6;
  --muted: #A3A9B8;
  --garis: #232B40;
  --garis-dalam: #2B344B;
  --garis-buku: #1A2134;
  --garis-tombol: #6B7590;
  --emas: #D8B878;
  --emas-teks: #E2C88E;
  --emas-teks-hover: #F2DDAE;
  --sakelar-bg: #1F2840;
  --sakelar-ink: #F2DDAE;
  --arah-bg: #F2EAD6;
  --arah-ink: #0B0F1A;
  --utama: #D8B878;
  --utama-ink: #0B0F1A;
  --utama-hover: #E6CC94;
  --accent: #E2C88E;
  --accent-ink: #0B0F1A;
  --accent-hover: #F2DDAE;
  --chip-bg: #1F2840;
  --chip-ink: #F2DDAE;
  --offline-bg: #33291A;
  --offline-ink: #F0D29A;
  --danger: #F2958A;
  --danger-hover: #F6B0A8;
  --danger-ink: #0B0F1A;
  --danger-soft: #3A1E22;
  --ok: #8FD3A6;
  --ok-soft: #173025;
  --fokus: #E2C88E;
  --latar-gelap: rgba(0, 0, 0, .6);
  --toast-bg: #F2EAD6;
  --toast-ink: #0B0F1A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  -webkit-text-size-adjust: 100%;
}
h1, h2 { margin: 0; line-height: 1.25; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
p { margin: 0; }
code { background: var(--isi-lembut); padding: .05em .35em; border-radius: var(--radius); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--danger); }
.ok { color: var(--ok); }

/* ---------- tombol & isian ---------- */
button, .btn {
  font: inherit; font-size: 15px; font-weight: 600;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--utama); background: var(--utama); color: var(--utama-ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover, .btn:hover { background: var(--utama-hover); border-color: var(--utama-hover); color: var(--utama-ink); }
button:disabled { opacity: .55; cursor: default; }
button.sekunder, button.ghost, .btn.ghost {
  background: transparent; color: var(--text); border-color: var(--garis-tombol); font-weight: 500;
}
button.sekunder:hover, button.ghost:hover, .btn.ghost:hover { background: var(--isi-lembut); color: var(--text); border-color: var(--muted); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
button.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--danger-ink); }
button.kecil { min-width: 44px; padding: 0 12px; font-size: 17px; }
/* admin: tombol kecil tetap ≥ 44px tinggi */
button.small, .btn.small { padding: 0 12px; font-size: 14px; }
button.tombol-teks {
  background: none; border: 0; color: var(--accent); font-weight: 600; padding: 0 8px;
  text-decoration: underline; text-underline-offset: 3px;
}
button.tombol-teks:hover { background: var(--isi-lembut); color: var(--accent-hover); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--garis-tombol); border-radius: var(--radius); padding: 8px 10px; width: 100%;
}
select, input:not([type=range]) { min-height: 44px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible,
.btn:focus-visible, summary:focus-visible, .kata:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--fokus); outline-offset: 2px;
}
label { display: block; font-size: 13px; color: var(--muted); }
label > input, label > select { margin-top: 6px; }

/* ---------- §4.2 header ---------- */
.topbar { background: var(--bg-isian); border-bottom: 1px solid var(--garis); }
.topbar-dalam {
  max-width: 1180px; margin: 0 auto; padding: 18px 32px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-teks, .brand > div { display: flex; flex-direction: column; }
.logo {
  width: 48px; height: 48px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; flex: none;
  font: 30px/1 Amiri, "Noto Naskh Arabic", serif;
}
.topbar h1 { font-family: var(--font-judul); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.tagline { font-size: 13px; color: var(--muted); }

/* ---------- tata letak ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }

/* §4.3 baris bahasa */
.baris-bahasa { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pil-bahasa { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.label-kecil { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 6px; }
button.pil {
  min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 500;
  background: var(--surface); color: var(--text); border: 1px solid var(--garis-tombol);
}
button.pil:hover { background: var(--bg-isian); color: var(--text); border-color: var(--muted); }
button.pil[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip {
  margin-left: auto; font-size: 13px; border-radius: 999px; padding: 6px 12px; white-space: nowrap;
  background: var(--garis-buku); color: var(--muted);
}
.chip-online { background: var(--chip-bg); color: var(--chip-ink); }
.chip-offline { background: var(--offline-bg); color: var(--offline-ink); }

/* §4.4 dua panel */
.panels { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.panel {
  flex: 1 1 400px; min-width: 0; background: var(--surface); border: 1px solid var(--garis);
  border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; }
.panel-head-kanan { display: flex; align-items: center; gap: 6px; }
.judul-panel { font-family: var(--font-judul); font-size: 18px; font-weight: 600; color: var(--text); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
textarea#input {
  min-height: 260px; flex: 1; resize: vertical; padding: 14px;
  background: var(--bg-isian); border: 1px solid var(--garis-tombol); border-radius: var(--radius);
  font-size: 17px; line-height: 1.6;
}
.output {
  --baris: 56px;
  flex: 1; min-height: 260px; padding: 22px 26px; border-radius: var(--radius);
  border: 1px solid var(--garis); background-color: var(--bg-isian);
  /* garis buku: satu garis tipis di bawah tiap baris tulisan */
  background-image: linear-gradient(var(--garis-buku) 1px, transparent 1px);
  background-size: 100% var(--baris);
  background-position: 0 calc(22px - 1px);
  font-family: var(--font-pegon); font-size: 34px; line-height: var(--baris); color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere; text-align: right;
}
.output.kosong::before { content: "هاسيل ڤڮون مونچول دي سيني"; color: var(--muted); }
.kata { cursor: pointer; border-radius: var(--radius); transition: background .12s; }
.kata:hover { background: var(--chip-bg); }
.kata.tak-dikenal { text-decoration: underline wavy var(--danger); text-underline-offset: 8px; text-decoration-thickness: 1.5px; }

/* sakelar harakat (TAHAP3/02): dua tombol bersambung */
.sakelar { display: inline-flex; border: 1px solid var(--garis-tombol); border-radius: var(--radius); overflow: hidden; }
button.segmen {
  border: 0; border-radius: 0; background: var(--surface); color: var(--text); font-weight: 500; padding: 0 14px;
}
button.segmen + button.segmen { border-left: 1px solid var(--garis-tombol); }
button.segmen:hover { background: var(--bg-isian); color: var(--text); }
button.segmen[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.segmen:focus-visible { outline-offset: -3px; }

/* tombol sisip huruf Madura */
.sisip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sisip[hidden] { display: none; }

/* §4.5 bagian yang bisa dilipat */
.lipat { background: var(--bg-isian); border: 1px solid var(--garis); border-radius: var(--radius); padding: 0 18px; }
.lipat summary {
  cursor: pointer; padding: 12px 0; min-height: 44px; font-weight: 600; display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.lipat summary::-webkit-details-marker { display: none; }
.lipat summary::before { content: "▸"; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .lipat summary::before { transition: transform .15s; } }
.lipat[open] summary::before { transform: rotate(90deg); }
.grid-pengaturan { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-bottom: 16px; }
.grid-pengaturan label { display: flex; flex-direction: column; gap: 6px; }
.grid-pengaturan label > select, .grid-pengaturan label > input { margin-top: 0; }
.grid-pengaturan output { color: var(--text); font-variant-numeric: tabular-nums; }
.grid-pengaturan input[type=range] { min-height: 44px; padding: 0; border: 0; background: none; accent-color: var(--accent); }
.daftar-bantuan { margin: 0; padding: 0 0 16px 20px; font-size: 14px; }
.daftar-bantuan li { margin: 4px 0; }

/* §4.6 footer */
.kaki { border-top: 1px solid var(--garis); }
.kaki-dalam {
  max-width: 1180px; margin: 0 auto; padding: 18px 32px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted);
}
.kaki [lang="ar"] { font-family: var(--font-pegon); font-size: 17px; }

/* ---------- dialog usulan ---------- */
dialog {
  border: 1px solid var(--garis); border-radius: var(--radius); background: var(--surface); color: var(--text);
  width: min(460px, calc(100vw - 32px)); padding: 20px 22px;
}
dialog::backdrop { background: var(--latar-gelap); }
dialog h2 { font-family: var(--font-judul); font-size: 20px; font-weight: 600; }
dialog form > * + * { margin-top: 10px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pegon-inline, .pegon-input { font-family: var(--font-pegon); font-size: 24px; }
.pegon-inline { color: var(--text); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--toast-bg); color: var(--toast-ink); padding: 10px 18px; border-radius: var(--radius); font-size: 14px;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- halaman sederhana (install / login admin) ---------- */
.page-simple { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--garis); border-radius: var(--radius);
  padding: 22px 24px; width: 100%;
}
.card h1 { font-family: var(--font-judul); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.card.narrow { max-width: 440px; }
.card form label { margin-top: 12px; }
.card form button { margin-top: 16px; }
.card p + p { margin-top: 8px; }

/* ---------- admin (§4.8: warna & huruf saja, tata letak tetap) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--garis); }
.tabs a {
  padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center;
  text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tabs a.aktif { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.flash { padding: 10px 14px; border-radius: var(--radius); background: var(--chip-bg); color: var(--chip-ink); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--garis); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--garis); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg-isian); }
tr:last-child td { border-bottom: 0; }
td.ar { font-family: var(--font-pegon); font-size: 24px; direction: rtl; text-align: right; white-space: nowrap; }
td form { display: inline; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.toolbar label { flex: 1 1 160px; }
.toolbar button { flex: 0 0 auto; }
.form-entri {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end;
  background: var(--surface); border: 1px solid var(--garis); border-radius: var(--radius); padding: 14px 16px;
}
.form-entri .pratinjau { font-family: var(--font-pegon); font-size: 26px; min-height: 44px; direction: rtl; text-align: right; }
/* pratinjau dua bentuk di admin (TAHAP3/02) */
.pv-polos, .pv-harakat { display: block; }
.pv-harakat { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- layar sempit ---------- */
@media (max-width: 900px) {
  .grid-pengaturan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar-dalam, .kaki-dalam { padding-left: 16px; padding-right: 16px; }
  .wrap { padding: 20px 16px 36px; }
  .chip { margin-left: 0; }
  .panel { padding: 16px; }
  textarea#input, .output { min-height: 200px; }
  .output { padding: 18px 18px; background-position: 0 calc(18px - 1px); }
  .grid-pengaturan { grid-template-columns: minmax(0, 1fr); }
}
.card form + p { margin-top: 12px; }

/* =====================================================================
 * TAHAP4/02 M1 — arah Pegon → Latin & keyboard Pegon
 * ===================================================================== */
#pil-arah { margin-bottom: -6px; }
.isian-pegon {
  min-height: 150px; resize: vertical; padding: 12px 16px; direction: rtl; text-align: right;
  background: var(--bg-isian); border: 1px solid var(--garis-tombol); border-radius: var(--radius);
  font-family: var(--font-pegon); font-size: 28px; line-height: 1.9;
}
.kb-bilah { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button.segmen-tunggal {
  background: var(--surface); color: var(--text); border: 1px solid var(--garis-tombol); font-weight: 500; font-size: 14px;
}
button.segmen-tunggal:hover { background: var(--bg-isian); color: var(--text); }
button.segmen-tunggal[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.segmen-tunggal[aria-pressed="true"]::before { content: "✓ "; }
.kb {
  display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius);
  background: var(--bg-isian); border: 1px solid var(--garis);
}
.kb[hidden] { display: none; }
.kb-baris { display: flex; flex-wrap: wrap; gap: 6px; direction: rtl; }
.kb-baris[hidden] { display: none; }
.kb-baris[data-baris="kendali"] { direction: ltr; }
button.kb-tombol {
  min-width: 48px; min-height: 52px; padding: 2px 6px; flex-direction: column; gap: 0;
  background: var(--surface); color: var(--text); border: 1px solid var(--garis-tombol); border-radius: var(--radius); font-weight: 400;
}
button.kb-tombol:hover { background: var(--chip-bg); color: var(--text); border-color: var(--accent); }
button.kb-tombol:active { background: var(--accent); color: var(--accent-ink); }
.kb-huruf { font-family: var(--font-pegon); font-size: 24px; line-height: 1.25; }
.kb-label { font-size: 11px; line-height: 1.1; color: var(--muted); font-family: var(--font-ui); direction: ltr; }
button.kb-tombol:active .kb-label { color: var(--accent-ink); }
button.kb-aksi { font-size: 18px; font-weight: 600; font-family: var(--font-ui); }
button.kb-lebar { min-width: 96px; }
.output-latin {
  flex: 1; min-height: 180px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--garis);
  background: var(--bg-isian); font-size: 18px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere;
}
.output-latin.kosong::before { content: "Hasil Latin muncul di sini"; color: var(--muted); }
.kata-latin { border-radius: var(--radius); }
.kata-latin[role="button"] { cursor: pointer; }
.kata-latin[role="button"]:hover { background: var(--chip-bg); }
.kata-latin.status-ragu, .contoh-ragu { text-decoration: underline dotted var(--accent); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.kata-latin.arab-lain { text-decoration: underline wavy var(--danger); text-underline-offset: 5px; }
.kata-latin.dipilih { text-decoration: underline solid var(--accent); text-underline-offset: 5px; }
.kata-latin:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.popover {
  position: absolute; z-index: 50; background: var(--surface); color: var(--text);
  border: 1px solid var(--garis-tombol); border-radius: var(--radius); padding: 12px 14px;
}
.popover[hidden] { display: none; }
.popover-judul { font-weight: 600; margin-bottom: 8px; overflow-wrap: anywhere; }
.popover-daftar { display: flex; flex-wrap: wrap; gap: 6px; }
.popover-daftar button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.popover-aksi { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 10px; }
label.cek { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-size: 14px; }
label.cek input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--accent); }
.isi-bantuan { padding-bottom: 16px; font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
.tabel-gulir { overflow-x: auto; }
.tabel-kb { border: 1px solid var(--garis); border-radius: var(--radius); background: var(--surface); }
.tabel-kb caption { text-align: left; font-weight: 600; padding: 4px 0; }
.tabel-kb td[lang="ar"] { font-family: var(--font-pegon); font-size: 22px; }
kbd {
  font-family: ui-monospace, Consolas, monospace; font-size: .9em; padding: .05em .4em; border-radius: var(--radius);
  border: 1px solid var(--garis-tombol); background: var(--surface);
}
@media (max-width: 640px) {
  .kb-baris { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  button.kb-tombol { flex: 0 0 auto; }
  .isian-pegon { font-size: 24px; }
}

/* =====================================================================
 * TAHAP4/02 M3 — ekspor & berbagi
 * ===================================================================== */
.bilah-ekspor { display: flex; flex-wrap: wrap; gap: 8px; }
.bilah-ekspor button { font-size: 14px; }
/* F21 Latin di bawah Pegon */
ruby { ruby-position: under; }
rt { font-family: var(--font-ui); font-size: 13px; color: var(--muted); line-height: 1.2; letter-spacing: 0; }
.output.dengan-rubi { background-image: none; }
/* F26 riwayat */
.daftar-riwayat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.daftar-riwayat li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item-riwayat { flex: 1 1 220px; justify-content: flex-start; text-align: start; font-weight: 500; overflow: hidden; }
button.tombol-ikon {
  min-width: 44px; padding: 0; background: var(--surface); color: var(--accent); border: 1px solid var(--garis-tombol); font-size: 20px;
}
button.tombol-ikon:hover { background: var(--bg-isian); color: var(--accent-hover); }
button.tombol-ikon[aria-pressed="true"] { background: var(--chip-bg); }
/* F5 cetak */
.area-cetak { display: none; }
@media print {
  @page { size: A4; margin: 2cm; }
  body.sedang-cetak { background: #fff; }
  body.sedang-cetak > *:not(#area-cetak) { display: none !important; }
  body.sedang-cetak #area-cetak { display: block !important; color: #000; }
  #area-cetak h1 { font-family: var(--font-judul); font-size: 20pt; margin: 0 0 12pt; text-align: center; }
  #area-cetak .cetak-pegon { font-family: var(--font-pegon); line-height: 2.1; white-space: pre-wrap; text-align: right; }
  #area-cetak .cetak-pegon.dengan-rubi { line-height: 2.8; }
  #area-cetak rt { color: #333; font-size: 10pt; }
}

/* =====================================================================
 * TAHAP4/02 M4 — halaman bersama: menu utama, aksesibilitas
 * ===================================================================== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lompat { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius); font-weight: 600; }
.lompat:focus { top: 8px; color: var(--accent-ink); }
a.brand { text-decoration: none; color: var(--text); border-radius: var(--radius); }
a.brand:hover { color: var(--text); }
.nama-app { font-family: var(--font-judul); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.menu-utama ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.menu-utama a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--radius);
  text-decoration: none; font-weight: 500; color: var(--text);
}
.menu-utama a:hover { background: var(--garis-buku); color: var(--text); }
.menu-utama a[aria-current="page"] { background: var(--garis-buku); color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 900px) {
  .menu-utama { width: 100%; }
  .menu-utama ul { gap: 2px; }
  .menu-utama a { padding: 0 10px; }
}
/* halaman konten (cek, panduan, tentang, alat, belajar) */
.judul-halaman { font-family: var(--font-judul); font-size: 28px; font-weight: 600; margin: 0; }
.kartu { background: var(--surface); border: 1px solid var(--garis); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.kartu h2 { font-family: var(--font-judul); font-size: 20px; font-weight: 600; }
.kartu h3 { font-size: 16px; font-weight: 600; margin: 4px 0 0; }
.prosa { max-width: 72ch; }
.prosa p, .prosa li { line-height: 1.65; }
.prosa ul, .prosa ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.pegon-besar { font-family: var(--font-pegon); font-size: 40px; line-height: 1.6; direction: rtl; text-align: right; }
.contoh { font-family: var(--font-pegon); font-size: 1.35em; }
.tabel-isi { border-collapse: collapse; width: 100%; background: var(--surface); }
.tabel-isi th, .tabel-isi td { border-bottom: 1px solid var(--garis); padding: 8px 10px; text-align: left; vertical-align: top; }
.tabel-isi td.ar, .tabel-isi .ar { font-family: var(--font-pegon); font-size: 24px; direction: rtl; }
.baris-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.baris-form label { flex: 1 1 200px; }
.daftar-huruf { display: flex; flex-wrap: wrap; gap: 6px; }
.daftar-huruf button { min-width: 44px; }
.grid-dua { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .grid-dua { grid-template-columns: minmax(0, 1fr); } }
.chip-netral { background: var(--garis-buku); color: var(--text); }
.kartu .chip { margin-left: 0; align-self: flex-start; }
.daftar-jejak { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.rincian-huruf { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rincian-huruf li { white-space: nowrap; }
.rincian-latin { font-weight: 600; }
.rincian-pegon { font-family: var(--font-pegon); font-size: 22px; }
.popover-lebar .daftar-jejak { font-size: 14px; max-height: 50vh; overflow-y: auto; }
a.tautan-tombol { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 600; text-underline-offset: 3px; }
.panel-rapikan { border: 1px solid var(--garis-tombol); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.rapikan-judul { font-weight: 600; }

/* =====================================================================
 * TAHAP4/02 M5 — Alat (nama, ucapan, latihan), Belajar, presentasi
 * ===================================================================== */
.daftar-alat { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; padding: 10px 14px; }
.daftar-alat a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-weight: 600; text-underline-offset: 3px; }
.kartu[tabindex="-1"]:focus { outline: none; }
.baris-opsi { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.baris-opsi > label { flex: 1 1 180px; }
.baris-tombol { display: flex; flex-wrap: wrap; gap: 8px; }
.pegon-sedang { font-family: var(--font-pegon); font-size: 28px; line-height: 1.9; direction: rtl; text-align: right; min-height: 1.9em; background: var(--bg-isian); border-radius: var(--radius); padding: 8px 14px; overflow-wrap: anywhere; }
.pegon-besar { overflow-wrap: anywhere; min-height: 1.6em; }
.pratinjau-kartu img { display: block; max-width: min(100%, 560px); height: auto; border: 1px solid var(--garis); border-radius: var(--radius); }
.rincian-nama summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.tabel-isi td.sel-pegon { font-family: var(--font-pegon); font-size: 24px; text-align: right; }
.tabel-gulir { overflow-x: auto; }
/* lembar latihan (cetak) */
@media print {
  body.sedang-cetak-latihan { background: #fff; }
  body.sedang-cetak-latihan > *:not(#cetak-latihan) { display: none !important; }
  body.sedang-cetak-latihan #cetak-latihan { display: block !important; color: #000; }
  .halaman-latihan + .halaman-latihan { break-before: page; page-break-before: always; }
  .kepala-latihan { display: flex; justify-content: space-between; gap: 16pt; align-items: flex-start; margin-bottom: 10pt; }
  .halaman-latihan h1 { font-family: var(--font-judul); font-size: 18pt; margin: 0 0 8pt; }
  .halaman-latihan .isian { font-size: 12pt; margin: 0 0 6pt; }
  .halaman-latihan .petunjuk { font-size: 11pt; margin: 0; }
  .qr-latihan { margin: 0; width: 2.6cm; text-align: center; font-size: 7pt; }
  .qr-latihan img { width: 2.6cm; height: 2.6cm; display: block; }
  .tabel-latihan { width: 100%; border-collapse: collapse; }
  .tabel-latihan th, .tabel-latihan td { border: 1px solid #000; padding: 6pt 8pt; font-size: 12pt; text-align: left; }
  .tabel-latihan th.no, .tabel-latihan td.no { width: 1.2cm; text-align: center; }
  .tabel-latihan td.sel-pegon { font-family: var(--font-pegon); font-size: 20pt; text-align: right; line-height: 1.8; }
  .tabel-latihan td.kotak { width: 50%; height: 1.4cm; }
  .tabel-latihan tr { break-inside: avoid; }
  .tabel-latihan tr:last-child td { border-bottom: 1px solid #000; }
}
.rincian-huruf li.rincian-teks { white-space: normal; flex-basis: 100%; }
.baris-opsi > label.cek { flex: 0 0 auto; }
/* F25 mode presentasi */
.pres-lapis { position: fixed; inset: 0; z-index: 1000; background: var(--bg); color: var(--judul); display: flex; flex-direction: column; }
.pres-lapis:focus { outline: none; }
body.pres-aktif { overflow: hidden; }
.pres-isi { flex: 1; margin: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4vh 5vw;
  font-family: var(--font-pegon); line-height: 1.7; direction: rtl; overflow-wrap: anywhere; overflow-y: auto; }
.pres-bawah { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; border-top: 1px solid var(--garis); }
.pres-hitung { min-width: 5em; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
button.pres-tombol { min-width: 52px; min-height: 52px; font-size: 22px; background: transparent; color: var(--text); border: 1px solid var(--garis-tombol); border-radius: var(--radius); }
button.pres-tombol:hover { background: var(--isi-lembut); color: var(--text); }
button.pres-tombol:disabled { opacity: .45; }
button.pres-tutup { margin-left: auto; }
/* F13 belajar */
.grid-huruf { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
button.tombol-huruf { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; padding: 6px 4px; background: var(--surface); color: var(--text); border: 1px solid var(--garis-tombol); border-radius: var(--radius); }
button.tombol-huruf .glif { font-family: var(--font-pegon); font-size: 32px; line-height: 1.3; }
button.tombol-huruf .nama { font-size: 13px; color: var(--muted); }
button.tombol-huruf:hover { background: var(--bg-isian); }
button.tombol-huruf[aria-pressed="true"] { background: var(--chip-bg); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.detail-huruf { border-top: 1px solid var(--garis); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.detail-kepala { display: flex; align-items: center; gap: 18px; }
.huruf-raksasa { font-family: var(--font-pegon); font-size: 72px; line-height: 1.2; margin: 0; min-width: 1.2em; text-align: center; }
.detail-nama { font-family: var(--font-judul); font-size: 22px; font-weight: 600; margin: 0; }
.tabel-bentuk th, .tabel-bentuk td { text-align: center; }
.tabel-bentuk td.sel-bentuk { font-family: var(--font-pegon); font-size: 40px; line-height: 1.6; }
.daftar-contoh { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.daftar-contoh li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.contoh-besar { font-family: var(--font-pegon); font-size: 30px; }
.contoh-harakat { font-family: var(--font-pegon); font-size: 26px; color: var(--muted); }
.contoh-latin { font-weight: 600; }
.kuis-tanya { font-weight: 600; margin: 0; }
.kuis-teks { font-size: 26px; font-weight: 600; margin: 0; }
.kuis-teks.ar { font-family: var(--font-pegon); font-size: 44px; font-weight: 400; line-height: 1.6; }
.kuis-pilihan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
button.pilihan-kuis { min-height: 56px; background: var(--surface); color: var(--text); border: 1px solid var(--garis-tombol); border-radius: var(--radius); font-size: 18px; }
button.pilihan-kuis.ar { font-family: var(--font-pegon); font-size: 30px; }
button.pilihan-kuis:disabled { opacity: 1; cursor: default; }
button.pilihan-kuis.benar { background: var(--chip-bg); border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
button.pilihan-kuis.salah { background: var(--danger-soft); border-color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger); }
.kuis-umpan { margin: 0; min-height: 1.5em; }
.kuis-umpan.ok { color: var(--ok); font-weight: 600; }
.kuis-umpan.err { color: var(--danger); font-weight: 600; }
.kuis-skor { font-family: var(--font-judul); font-size: 22px; font-weight: 600; margin: 0; }
/* M6 F14 profil ejaan, F15 unggah */
.blok-profil { border-top: 1px solid var(--garis); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.label-blok { font-size: 15px; font-weight: 600; margin: 0; font-family: var(--font-ui); }
.kartu-unggah { margin-top: 0; }
.unggah-progres { display: flex; align-items: center; gap: 10px; }
.unggah-progres progress { flex: 1; height: 12px; accent-color: var(--accent); }

/* =====================================================================
 * TAHAP5/01 — tema Premium (K-56): kepala, tombol mode, dasar flat
 * ===================================================================== */
/* Pergantian tema tanpa transisi (instan): tidak ada kedipan setengah jalan, aman untuk prefers-reduced-motion. */
h1, h2, h3 { color: var(--judul); }
a { color: var(--emas-teks); }
a:hover { color: var(--emas-teks-hover); }
.hanya-malam { display: none !important; }
:root[data-tema="malam"] .hanya-siang { display: none !important; }
:root[data-tema="malam"] .hanya-malam { display: block !important; }
/* kepala */
.kepala { background: var(--bg); }
.kepala-dalam {
  position: relative; max-width: 1180px; margin: 0 auto; padding: 24px 32px 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
button.tombol-tema {
  width: 44px; min-width: 44px; height: 44px; padding: 0; flex: none;
  background: transparent; color: var(--judul); border: 1px solid var(--garis-tombol); border-radius: var(--radius);
}
.kepala button.tombol-tema { position: absolute; top: 24px; right: 32px; }
button.tombol-tema:hover { background: var(--isi-lembut); color: var(--judul); border-color: var(--garis-tombol); }
.tombol-tema svg { display: block; }
.tombol-tema .ikon-matahari { display: none; }
:root[data-tema="malam"] .tombol-tema .ikon-bulan { display: none; }
:root[data-tema="malam"] .tombol-tema .ikon-matahari { display: block; }
.kepala a.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--judul); padding: 0 4px; }
.kepala a.brand:hover { color: var(--judul); }
.mihrab { display: block; width: 150px; height: 56px; }
.mihrab.hanya-malam { width: 170px; height: 50px; object-fit: contain; }
.kepala .nama-app { font-family: var(--font-judul); font-size: 34px; font-weight: 600; letter-spacing: .04em; line-height: 1.1; color: var(--judul); }
.kepala .tagline { font-size: 13px; color: var(--muted); text-align: center; }
.menu-utama { border-top: 1px solid var(--garis); border-bottom: 1px solid var(--garis); padding: 0 12px; margin-top: 4px; }
.menu-utama ul { justify-content: center; gap: 2px; }
.menu-utama a {
  padding: 0 16px; border-radius: 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.menu-utama a:hover { background: transparent; color: var(--text); box-shadow: inset 0 -2px 0 var(--garis-tombol); }
.menu-utama a[aria-current="page"] { background: transparent; color: var(--judul); font-weight: 600; box-shadow: inset 0 -2px 0 var(--emas); }
@media (max-width: 900px) { .menu-utama { width: auto; max-width: 100%; } }
@media (max-width: 600px) {
  .kepala-dalam { padding: 16px 16px 0; gap: 8px; }
  .kepala button.tombol-tema { top: 16px; right: 16px; }
  .mihrab { width: 104px; height: 39px; }
  .mihrab.hanya-malam { width: 118px; height: 35px; }
  .kepala .nama-app { font-size: 26px; }
  .kepala .tagline { max-width: 240px; }
  .menu-utama { padding: 0; width: 100%; }
  .menu-utama a { padding: 0 10px; letter-spacing: .04em; }
}
/* judul & huruf */
.judul-halaman { font-family: var(--font-judul); font-size: 34px; font-weight: 600; color: var(--judul); }
.kartu h2, dialog h2, .card h1 { font-family: var(--font-judul); font-size: 24px; font-weight: 600; }
.judul-panel { font-family: var(--font-judul); font-size: 24px; font-weight: 600; color: var(--judul); }
.detail-nama, .kuis-skor { font-family: var(--font-judul); font-size: 24px; }
/* pil pilihan (lebih dari dua) = sudut 2px; status = sudut 2px */
button.pil { border-radius: var(--radius); background: transparent; }
button.pil:hover { background: var(--isi-lembut); }
button.pil[aria-pressed="true"] { background: var(--sakelar-bg); border-color: var(--garis-tombol); color: var(--sakelar-ink); }
.chip { border-radius: var(--radius); background: var(--isi-lembut); }
/* sakelar dua pilihan = oval (999px) */
.sakelar, #pil-arah {
  display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 0; padding: 3px;
  border: 1px solid var(--garis-tombol); border-radius: 999px; overflow: visible; margin: 0;
}
#pil-arah .label-kecil { padding: 0 8px 0 12px; margin: 0; }
button.segmen, #pil-arah button.pil {
  border: 0; border-radius: 999px; background: transparent; color: var(--text); font-weight: 500; padding: 0 16px;
}
button.segmen + button.segmen { border-left: 0; }
button.segmen:hover, #pil-arah button.pil:hover { background: var(--isi-lembut); color: var(--text); }
button.segmen[aria-pressed="true"] { background: var(--sakelar-bg); color: var(--sakelar-ink); font-weight: 600; }
#pil-arah button.pil[aria-pressed="true"] { background: var(--arah-bg); color: var(--arah-ink); font-weight: 600; }
button.segmen:focus-visible, #pil-arah button.pil:focus-visible { outline-offset: 1px; }
button.segmen-tunggal { border-radius: 999px; background: transparent; }
button.segmen-tunggal:hover { background: var(--isi-lembut); }
button.segmen-tunggal[aria-pressed="true"] { background: var(--sakelar-bg); border-color: var(--garis-tombol); color: var(--sakelar-ink); }
/* permukaan flat */
.kartu, .lipat, .card, dialog, .popover, .table-wrap, .form-entri, .panel-rapikan, .kb, .tabel-kb { border-radius: var(--radius); }
.lipat { background: var(--surface); }

/* ---------- TAHAP5/01 D2: halaman Konversi ---------- */
.bilah-kontrol { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 24px; }
.pemisah-tegak { width: 1px; height: 28px; background: var(--garis); flex: none; }
label.label-sebaris { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
label.label-sebaris > select { margin-top: 0; width: auto; min-width: 150px; padding: 0 14px; }
.baris-status { display: flex; justify-content: center; margin: -8px 0 0; }
.baris-status .chip { margin: 0; }
.panels { gap: 28px; }
.panel { background: transparent; border: 0; border-radius: 0; padding: 0; gap: 12px; }
.panel-head { border-bottom: 1px solid var(--garis); padding-bottom: 10px; }
textarea#input, .isian-pegon { background: var(--surface); border-color: var(--garis-tombol); border-radius: var(--radius); }
textarea#input { min-height: 340px; padding: 18px; font-size: 17px; line-height: 1.7; }
/* bingkai hasil Pegon: garis luar, celah 8px, garis dalam + 4 ornamen sudut + garis bintang */
.bingkai-pegon { flex: 1; display: flex; min-height: 340px; background: var(--surface); border: 1px solid var(--garis); padding: 8px; }
.bingkai-dalam {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px;
  border: 1px solid var(--garis-dalam); padding: 56px 64px;      /* ≥ 96 × 0.55 */
}
.sudut { position: absolute; width: 96px; height: 96px; pointer-events: none; user-select: none; }
.sudut-tl { top: -1px; left: -1px; }
.sudut-tr { top: -1px; right: -1px; }
.sudut-bl { bottom: -1px; left: -1px; }
.sudut-br { bottom: -1px; right: -1px; }
.garis-bintang { color: var(--emas); flex: none; }
.output {
  align-self: stretch; flex: 1; min-height: 160px; padding: 0; border: 0; border-radius: 0;
  background: none; background-image: none; color: var(--judul); line-height: 2.05; text-align: right;
}
.output.dengan-rubi { line-height: 2.9; }
.output.kosong::before { color: var(--muted); }
.kata:hover, .kata-latin[role="button"]:hover { background: var(--isi-lembut); }
.output-latin { background: var(--surface); border-color: var(--garis); border-radius: var(--radius); }
.bilah-ekspor { justify-content: flex-end; }
#arah-lp .actions { justify-content: flex-end; }
/* pemisah bagian + deretan fitur */
.pemisah-ornamen { display: flex; align-items: center; gap: 16px; }
.pemisah-garis { flex: 1; height: 1px; background: var(--garis); }
.pemisah-ornamen img { width: 40px; height: 40px; flex: none; }
.deret-fitur { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--garis); border-bottom: 1px solid var(--garis); }
.deret-fitur a { display: flex; flex-direction: column; gap: 4px; padding: 22px 20px; text-decoration: none; color: var(--text); min-height: 44px; }
.deret-fitur a + a { border-left: 1px solid var(--garis); }
.deret-fitur a:hover { background: var(--isi-lembut); color: var(--text); }
.fitur-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--emas-teks); }
.fitur-judul { font-family: var(--font-judul); font-size: 20px; font-weight: 600; color: var(--judul); }
/* footer satu baris tipis */
.kaki { border-top: 1px solid var(--garis); }
.kaki-dalam { padding: 14px 32px; }
/* keyboard Pegon layar */
.kb { background: var(--isi-lembut); }
button.kb-tombol { background: var(--surface); border-radius: var(--radius); }
button.kb-tombol:hover { background: var(--sakelar-bg); border-color: var(--garis-tombol); color: var(--text); }
button.kb-tombol:active { background: var(--utama); color: var(--utama-ink); }
button.kb-tombol:active .kb-label { color: var(--utama-ink); }
/* popover, dialog, toast: flat, tanpa bayangan */
.popover { border-color: var(--garis-tombol); }
.popover-daftar button[aria-pressed="true"] { background: var(--sakelar-bg); border-color: var(--garis-tombol); color: var(--sakelar-ink); }
@media (max-width: 600px) {
  .bilah-kontrol { gap: 10px 12px; justify-content: flex-start; }
  .pemisah-tegak { display: none; }
  label.label-sebaris > select { min-width: 140px; }
  .baris-status { justify-content: flex-start; margin: 0; }
  textarea#input { min-height: 220px; }
  .bingkai-pegon { min-height: 240px; }
  .bingkai-dalam { padding: 36px 36px; }          /* ≥ 64 × 0.55 */
  .sudut { width: 64px; height: 64px; }
  .output { min-height: 120px; }
  .deret-fitur { grid-template-columns: minmax(0, 1fr); }
  .deret-fitur a + a { border-left: 0; border-top: 1px solid var(--garis); }
  .kaki-dalam { padding: 14px 16px; }
}

/* ---------- TAHAP5/01 D3: halaman lain ---------- */
.kartu { gap: 14px; }
.pegon-sedang { background: var(--isi-lembut); border-radius: var(--radius); color: var(--judul); }
.pegon-besar, .huruf-raksasa, .contoh-besar, .kuis-teks.ar, .tabel-bentuk td.sel-bentuk, .rincian-pegon { color: var(--judul); }
.tabel-isi { background: transparent; }
.tabel-isi th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.daftar-alat a, a.tautan-tombol { color: var(--emas-teks); }
button.tombol-huruf { background: transparent; border-radius: var(--radius); }
button.tombol-huruf:hover { background: var(--isi-lembut); }
button.tombol-huruf[aria-pressed="true"] { background: var(--sakelar-bg); border-color: var(--emas); box-shadow: inset 0 0 0 1px var(--emas); }
button.tombol-huruf[aria-pressed="true"] .nama { color: var(--sakelar-ink); }
button.pilihan-kuis { background: transparent; border-radius: var(--radius); }
button.pilihan-kuis:hover { background: var(--isi-lembut); color: var(--text); }
button.pilihan-kuis.benar { background: var(--ok-soft); color: var(--text); }
button.pilihan-kuis.salah { background: var(--danger-soft); color: var(--text); }
.pratinjau-kartu img { border-radius: var(--radius); }
.unggah-progres progress { accent-color: var(--emas); }
label.cek input, .grid-pengaturan input[type=range] { accent-color: var(--emas-teks); }
.contoh-ragu { text-decoration-color: var(--emas-teks); }
@media (prefers-reduced-motion: reduce) { .toast, .kata { transition: none; } }

/* ---------- TAHAP5/01 D4: admin & install ---------- */
.topbar { background: var(--bg); border-bottom: 1px solid var(--garis); }
.topbar h1 { font-family: var(--font-judul); font-size: 28px; font-weight: 600; letter-spacing: .02em; color: var(--judul); }
.logo { background: var(--utama); color: var(--utama-ink); border-radius: var(--radius); }
.topbar .row-actions { align-items: center; }
.sudut-tema { position: fixed; top: 16px; right: 16px; z-index: 10; }
.tabs a { border-radius: 0; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.tabs a.aktif { color: var(--judul); border-bottom-color: var(--emas); }
th { background: var(--isi-lembut); }
.flash { border-radius: var(--radius); }
.form-entri .pratinjau { color: var(--judul); }

/* ---------- TAHAP5/01 D5: cetak selalu Siang (tidak ikut mode Malam) ---------- */
@media print {
  :root, :root[data-tema="malam"] {
  --bg: #FAF7F0;
  --surface: #FFFFFF;
  --bg-isian: #FFFFFF;
  --isi-lembut: #F4EEE1;
  --text: #1A1814;
  --judul: #1A1814;
  --muted: #5B5548;
  --garis: #E4D9C2;
  --garis-dalam: #E9DDBF;
  --garis-buku: #F4EEE1;
  --garis-tombol: #8F8268;
  --emas: #B08A3E;
  --emas-teks: #6E521C;
  --emas-teks-hover: #4A3712;
  --sakelar-bg: #F3EAD6;
  --sakelar-ink: #4A3712;
  --arah-bg: #1A1814;
  --arah-ink: #FAF7F0;
  --utama: #1A1814;
  --utama-ink: #FAF7F0;
  --utama-hover: #3A342A;
  --accent: #6E521C;
  --accent-ink: #FAF7F0;
  --accent-hover: #4A3712;
  --chip-bg: #F3EAD6;
  --chip-ink: #4A3712;
  --offline-bg: #F5E7C8;
  --offline-ink: #6B4410;
  --danger: #A93226;
  --danger-hover: #8E2A20;
  --danger-ink: #FFFFFF;
  --danger-soft: #F8E5E1;
  --ok: #2E6B45;
  --ok-soft: #E3EFE6;
  --fokus: #6E521C;
  --latar-gelap: rgba(26, 24, 20, .5);
  --toast-bg: #1A1814;
  --toast-ink: #FAF7F0;
    color-scheme: light;
  }
  body { background: #FFFFFF; }
  .sudut, .garis-bintang, .pemisah-ornamen, .tombol-tema, .mihrab, .lompat { display: none !important; }
}

/* ===== TAHAP5/02 (K-58): logo mendatar Ngaji Pegon ===== */
.kepala a.brand.logo-np { flex-direction: row; align-items: flex-end; gap: 10px; padding: 2px 4px; }
.logo-tanda { display: block; width: 54px; height: 57px; flex: none; }
.logo-tulisan { display: flex; flex-direction: column; align-items: flex-start; font-family: "Jost", "Inter", system-ui, sans-serif; color: var(--judul); padding-bottom: 2px; }
.logo-ngaji { font-weight: 300; font-size: 19px; line-height: 1; letter-spacing: .01em; margin-left: 2px; }
.logo-pegon { display: inline-flex; align-items: baseline; font-weight: 700; font-size: 34px; line-height: .95; letter-spacing: -.01em; }
.logo-kotak { display: inline-block; width: 7px; height: 7px; border-radius: 1px; background: var(--emas); margin-left: 3px; }
@media (max-width: 600px) {
  .logo-tanda { width: 44px; height: 46px; }
  .logo-ngaji { font-size: 15px; }
  .logo-pegon { font-size: 28px; }
}
@media print { .logo-np { display: none !important; } }

/* ===== TAHAP5/02 (K-58): halaman Profil ===== */
:root {
  --nama-sy: #675E4C;   /* warna kaos di foto, 6.0:1 di Siang */
  --nama-iwei: #72595A; /* warna gamis di foto (versi lebih gelap), 6.0:1 di Siang */
}
:root[data-tema="malam"] { --nama-sy: #9A9270; --nama-iwei: #B6A5A6; }
.profil { display: flex; flex-direction: column; gap: 56px; padding-top: 56px; padding-bottom: 64px; max-width: 1080px; }
.profil-atas { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.profil-foto { flex: 0 0 auto; margin: 0 auto; width: 360px; max-width: 100%; padding: 12px; border: 1px solid var(--emas); border-radius: 180px 180px 2px 2px; }
.profil-foto-dalam { overflow: hidden; border-radius: 170px 170px 2px 2px; background: var(--isi-lembut); aspect-ratio: 336 / 470; }
.profil-foto img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  filter: saturate(.82) contrast(1.06) sepia(.10) brightness(1.02); }
:root[data-tema="malam"] .profil-foto img { filter: saturate(.72) contrast(1.08) sepia(.14) brightness(.92); }
.profil-teks { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.profil-identitas { display: flex; flex-direction: column; gap: 14px; }
.profil-baris-nama { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.profil-nama { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 76px; font-weight: 600; line-height: 1; letter-spacing: 0; }
.profil-nama .nama-s { font-family: "Playfair Display", Georgia, serif; font-style: normal; font-weight: 800; font-size: 84px; line-height: .9; margin-right: 1px; color: var(--nama-sy); }
.profil-nama .nama-sy { color: var(--nama-sy); }
.profil-nama .nama-iwei { color: var(--nama-iwei); }
.profil-garis-tegak { width: 1px; height: 56px; background: var(--garis); }
.profil-pegon { font-family: "Aref Ruqaa", Amiri, serif; font-size: 56px; font-weight: 700; line-height: 1; color: var(--emas-teks); }
.profil-baris-dua { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.profil-sunda { font-family: "Noto Sans Sundanese", sans-serif; font-size: 26px; line-height: 1.4; color: var(--emas-teks); letter-spacing: normal; }
.profil-garis-emas { width: 24px; height: 1px; background: var(--emas); }
.profil-peran { font-size: 15px; color: var(--muted); }
.profil-bio { margin: 0; font-size: 17px; line-height: 1.8; }
.profil-tombol { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.profil-tombol .btn { padding: 0 18px; }
.profil .pemisah-ornamen { margin: 0; }
.kartu-sapaan.bingkai-pegon { min-height: 0; }
.kartu-sapaan .bingkai-dalam { padding: 56px 72px; gap: 22px; }
.kartu-sapaan .sudut { width: 72px; height: 72px; }
.sapaan-label { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--emas-teks); font-weight: 600; }
.sapaan-judul { margin: 0; font-family: Amiri, serif; font-size: 44px; font-weight: 400; line-height: 1.6; color: var(--judul); }
.sapaan-isi { max-width: 640px; display: flex; flex-direction: column; gap: 14px; text-align: center; font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; line-height: 1.6; }
.sapaan-isi p { margin: 0; }
.sapaan-salam { font-style: italic; color: var(--emas-teks); }
.sapaan-ttd { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 6px; }
.ttd-latin { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 26px; color: var(--judul); }
.ttd-pegon { font-family: "Aref Ruqaa", Amiri, serif; font-size: 30px; font-weight: 700; color: var(--emas-teks); }
@media (max-width: 600px) {
  .profil { gap: 40px; padding-top: 32px; padding-bottom: 48px; }
  .profil-atas { gap: 32px; }
  .profil-foto { width: min(100%, 320px); border-radius: 160px 160px 2px 2px; }
  .profil-foto-dalam { border-radius: 150px 150px 2px 2px; }
  .profil-teks { flex-basis: 100%; }
  .profil-nama { font-size: 60px; }
  .profil-nama .nama-s { font-size: 66px; }
  .profil-pegon { font-size: 46px; }
  .kartu-sapaan .bingkai-dalam { padding: 44px 22px; }
  .kartu-sapaan .sudut { width: 48px; height: 48px; }
  .sapaan-judul { font-size: 36px; }
  .sapaan-isi { font-size: 20px; }
}

/* ===== TAHAP5/02 N4: tanda logo di admin & install ===== */
.topbar .brand .logo-tanda { width: 44px; height: 46px; }
.page-simple { align-content: center; row-gap: 20px; }
.logo-sederhana { display: flex; justify-content: center; }

/* ===== TAHAP5/03 (K-59): Tentang bermodel tab, tab pertama Profil ===== */
.tab-deret { border-top: 1px solid var(--garis); border-bottom: 1px solid var(--garis); min-width: 0; }
.tab-daftar {
  position: relative; display: flex; gap: 2px; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tab-daftar::-webkit-scrollbar { display: none; }
.tab-daftar .tab {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500;
  color: var(--muted); text-decoration: none; white-space: nowrap; border-radius: 0;
}
.tab-daftar .tab:hover { color: var(--text); box-shadow: inset 0 -2px 0 var(--garis-tombol); }
.tab-daftar .tab[aria-selected="true"] { color: var(--judul); font-weight: 600; box-shadow: inset 0 -2px 0 var(--emas); }
.tab-daftar .tab:focus-visible { outline-offset: -3px; }
.tentang .tab-panel { scroll-margin-top: 16px; }
.tentang .tab-panel.profil { padding: 16px 0 8px; max-width: none; }
.tentang .tab-panel:focus-visible { outline: 3px solid var(--fokus); outline-offset: 4px; }
.tentang .tab-panel.profil:focus:not(:focus-visible), .tentang .tab-panel:focus:not(:focus-visible) { outline: none; }
@media (max-width: 600px) {
  .tab-daftar .tab { padding: 0 12px; letter-spacing: .04em; }
  .tentang .tab-panel.profil { padding-top: 8px; }
}
@media print { .tab-deret { display: none !important; } .tab-panel[hidden] { display: block !important; } }

/* =====================================================================
 * TAHAP5/04 (K-60) — desain final dari prototipe yang disetujui EL
 * Batas layar sama dengan prototipe: ≤ 1099, ≤ 900, ≤ 767, lalu 560/520/480/420/380.
 * ===================================================================== */
.judul-halaman { font-size: 40px; line-height: 1.1; }
.wrap { gap: 0; }
.wrap > * + * { margin-top: 20px; }
.wrap > .tab-deret + * { margin-top: 24px; }
/* tombol kecil & tombol ikon */
button.kcl, .btn.kcl { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--garis-tombol); font-weight: 600; }
.btn.ghost:hover { background: var(--isi-lembut); color: var(--text); }
button.ik { width: 44px; min-width: 44px; height: 44px; padding: 0; flex: none; background: transparent; color: var(--text); border: 1px solid var(--garis-tombol); }
button.ik:hover { background: transparent; color: var(--emas-teks); border-color: var(--emas); }
button.ik svg { display: block; }
button.ik[aria-pressed="true"] { background: var(--sakelar-bg); border-color: var(--emas); color: var(--sakelar-ink); }
.lb { font-family: var(--font-ui); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--emas-teks); font-weight: 600; margin: 0; }

/* ---------- menu atas & navigasi bawah HP ---------- */
.nav-bawah { display: none; }
@media (max-width: 768px) {
  .menu-utama { display: none; }
  .kepala-dalam { align-items: flex-start; padding: 14px 16px 12px; border-bottom: 1px solid var(--garis); }
  .kepala button.tombol-tema { top: 10px; right: 12px; }
  body.premium { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .nav-bawah {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--garis);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  }
  .nav-bawah-deret { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .nav-bawah-deret a, .nav-bawah-deret button {
    min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; border-radius: 0; background: transparent; color: var(--muted); text-decoration: none;
    font: 500 11.5px/1.2 var(--font-ui); padding: 0 2px; min-width: 0;
  }
  .nav-bawah-deret span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-bawah-deret a:hover, .nav-bawah-deret button:hover { background: transparent; color: var(--text); }
  .nav-bawah-deret [aria-current="page"], .nav-bawah-deret button[data-aktif] { color: var(--judul); font-weight: 600; }
  .nav-bawah-deret [aria-current="page"] svg, .nav-bawah-deret button[data-aktif] svg { color: var(--emas); }
  .nav-bawah-deret button:focus-visible, .nav-bawah-deret a:focus-visible { outline-offset: -3px; }
  .lainnya {
    position: absolute; right: 12px; bottom: calc(100% + 8px); width: min(240px, calc(100vw - 24px));
    background: var(--surface); border: 1px solid var(--garis); border-radius: var(--radius); padding: 6px;
  }
  .lainnya a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--garis); }
  .lainnya a:last-child { border-bottom: 0; }
  .lainnya a[aria-current="page"] { color: var(--judul); font-weight: 600; box-shadow: inset 2px 0 0 var(--emas); }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .kaki-dalam { flex-direction: column; gap: 6px; }
}

/* ---------- tab seragam (Tentang, Panduan, Cek kata, Alat, Auto Pegon, stepper Ngaji) ---------- */
.tab-daftar .tab { min-height: 46px; }
button.tab { background: transparent; border: 0; border-radius: 0; color: var(--muted); font-weight: 500; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 0 16px; }
button.tab:hover { background: transparent; color: var(--text); box-shadow: inset 0 -2px 0 var(--garis-tombol); }
button.tab[aria-selected="true"] { color: var(--judul); font-weight: 600; box-shadow: inset 0 -2px 0 var(--emas); }
@media (max-width: 768px) {
  .tab-daftar { gap: 0; justify-content: space-between; overflow: visible; }
  .tab-daftar .tab { flex: 1 1 auto; justify-content: center; padding: 0 6px; font-size: 11px; letter-spacing: .02em; white-space: nowrap; text-align: center; }
}

/* ---------- pilihan bahasa berupa tombol (pola 1 + 4 di HP) ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--garis); background: transparent; color: var(--text); font-weight: 500; }
.seg button:hover { background: var(--isi-lembut); color: var(--text); border-color: var(--garis-tombol); }
.seg button[aria-pressed="true"] { border-color: var(--emas); background: var(--sakelar-bg); color: var(--sakelar-ink); font-weight: 600; }
@media (max-width: 768px) {
  .seg-bahasa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .seg-bahasa button { padding: 0 4px; font-size: 14px; min-height: 44px; }
  .seg-bahasa button:first-child { grid-column: 1 / -1; }
}

/* ---------- bingkai area kerja: garis ganda saja, garis bintang menumpang di garis atas ---------- */
.bingkai-kerja { background: var(--surface); border: 1px solid var(--garis); padding: 7px; }
.bingkai-kerja-dalam { position: relative; border: 1px solid var(--garis-dalam); padding: 36px 28px 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bingkai-kerja-dalam > .garis-bintang { position: absolute; top: -6.5px; left: 50%; transform: translateX(-50%); background: var(--surface); padding: 0 8px; box-sizing: content-box; }

/* ---------- Auto Pegon ---------- */
.kendali { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.kendali .sakelar { margin: 0; }
.konv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pnl { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pnl-kepala { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.pnl-kepala > span:nth-child(2) { margin-left: auto; }
.pnl-kepala .tombol-teks { min-height: 40px; }
.auto textarea#input { min-height: 240px; padding: 14px; font-size: 17px; line-height: 1.7; }
.auto .isian-pegon { min-height: 130px; font-size: 30px; line-height: 1.8; }
.status-kamus { margin-top: -4px; }
.auto .bingkai-kerja-dalam { min-height: 240px; justify-content: flex-start; }
.auto .output { flex: none; align-self: stretch; min-height: 0; text-align: center; line-height: 2.1; color: var(--judul); }
.auto .output.kosong::before { color: var(--muted); }
/* Latin di bawah: jarak aman, tidak bertabrakan di 375px */
.output ruby { ruby-position: under; -webkit-ruby-position: after; }
.output.dengan-rubi { line-height: 3.1; }
.output.dengan-rubi rt { padding-top: 6px; font: 500 12px/1.2 var(--font-ui); color: var(--muted); }
.output.dengan-rubi .kata { margin: 0 4px; }
.ekspor { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.jejak-panel { border: 1px solid var(--emas); background: var(--surface); padding: 14px 16px; border-radius: var(--radius); }
.jejak-panel .daftar-jejak { font-size: 14px; }
.jejak-panel .popover-aksi { justify-content: flex-start; align-items: center; }
.output-latin { min-height: 130px; padding: 14px; font-size: 18px; line-height: 1.8; }
.auto .kb-bilah { gap: 6px; }
.wrap > .lipatan { margin-top: 32px; border-top: 1px solid var(--garis); }
.lipatan .lipat { background: transparent; border: 0; border-bottom: 1px solid var(--garis); border-radius: 0; padding: 0; }
.lipatan .lipat summary { min-height: 52px; padding: 0; }
.lipatan .lipat summary::before { content: none; }
.lipatan .lipat summary::after { content: "+"; margin-left: auto; font-size: 20px; font-weight: 400; color: var(--emas-teks); }
.lipatan .lipat[open] summary::after { content: "−"; }
.lipatan .grid-pengaturan { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 4px 0 20px; }
.lipatan .isi-bantuan { padding: 0 0 20px; }
@media (max-width: 900px) {
  .konv { grid-template-columns: minmax(0, 1fr); }
  .lipatan .grid-pengaturan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .judul-halaman { font-size: 32px; }
  .kendali { flex-direction: column; align-items: stretch; }
  .kendali .sakelar { align-self: center; }
  .auto textarea#input { min-height: 160px; }
  .auto .bingkai-kerja-dalam { min-height: 180px; padding: 36px 20px 24px; }
  .lipatan .grid-pengaturan { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Beranda ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-judul { font-size: 46px; margin: 0 0 10px; }
.hero-pembuka { margin: 0 0 16px; font-size: 16px; line-height: 1.6; max-width: 520px; }
.hero-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
#coba { min-height: 48px; padding: 0 14px; font-size: 16px; }
.hero-hasil .bingkai-kerja-dalam { min-height: 260px; justify-content: center; }
.hero-pegon { font-family: var(--font-pegon); font-size: 44px; line-height: 1.8; text-align: center; color: var(--judul); overflow-wrap: anywhere; max-width: 100%; }
.fitur4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--garis); border-bottom: 1px solid var(--garis); }
.wrap > .fitur4 { margin-top: 40px; }
.fitur4 a { padding: 20px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--garis); }
.fitur4 a:first-child { border-left: 0; }
.fitur4 svg { color: var(--emas-teks); margin-bottom: 2px; }
.fitur4 b { font: 600 22px/1.2 var(--font-judul); color: var(--judul); }
.fitur4 a:hover { color: var(--text); background: transparent; }
.fitur4 a:hover b { color: var(--emas-teks); }
.fitur4 span { font-size: 14px; color: var(--muted); }
.sekilas { display: flex; gap: 16px; align-items: center; max-width: 760px; }
.wrap > .sekilas { margin-top: 36px; }
.sekilas-foto { width: 64px; height: 80px; object-fit: cover; border-radius: 32px 32px 2px 2px; border: 1px solid var(--emas); padding: 3px; background: var(--surface); flex: none;
  filter: saturate(.82) contrast(1.06) sepia(.1) brightness(1.02); }
.sekilas > div { display: flex; flex-direction: column; gap: 2px; }
.sekilas-nama { font: 600 24px/1.1 var(--font-judul); }
.sekilas-nama .nama-sy { color: var(--nama-sy); }
.sekilas-nama .nama-iwei { color: var(--nama-iwei); }
.sekilas-harap { font: italic 500 18px/1.45 var(--font-judul); color: var(--text); margin: 2px 0 4px; }
.sekilas a { font-size: 14px; font-weight: 600; align-self: flex-start; min-height: 32px; display: inline-flex; align-items: center; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .fitur4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fitur4 a:nth-child(3) { border-left: 0; }
  .fitur4 a:nth-child(n+3) { border-top: 1px solid var(--garis); }
}
@media (max-width: 520px) {
  .fitur4 { grid-template-columns: minmax(0, 1fr); }
  .fitur4 a { border-left: 0; border-top: 1px solid var(--garis); }
  .fitur4 a:first-child { border-top: 0; }
  .hero-judul { font-size: 34px; }
}

/* ---------- Cek kata ---------- */
.cari { display: flex; gap: 8px; max-width: 640px; margin-bottom: 24px; }
.cari input { flex: 1; min-height: 48px; padding: 0 14px; font-size: 17px; width: auto; }
.cari button { flex: none; min-height: 48px; padding: 0 22px; }
.hk-kepala { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hk-kepala h2 { margin: 0; font: 600 34px/1.1 var(--font-judul); color: var(--judul); }
.sumber { display: inline-block; margin-top: 6px; font-size: 13px; padding: 2px 8px; border-radius: var(--radius); border: 1px solid var(--garis); color: var(--muted); }
.sumber[data-k="kamus"] { border-color: var(--ok); color: var(--ok); }
.hk-dua { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.hk-dua .bingkai-kerja-dalam { padding: 20px 16px; gap: 4px; }
.hk-ar { margin: 0; font: 400 44px/1.7 var(--font-pegon); color: var(--judul); text-align: center; overflow-wrap: anywhere; max-width: 100%; }
.hk-rinci { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.hk-rinci h3 { font: 600 20px/1.3 var(--font-judul); color: var(--judul); margin: 0 0 8px; }
.hk-rinci .tabel-gulir + h3 { margin-top: 18px; }
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 16px; }
.az button { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: var(--radius); border: 1px solid var(--garis); background: transparent; color: var(--text); font-weight: 600; }
.az button:hover { background: var(--isi-lembut); color: var(--text); }
.az button[aria-pressed="true"] { border-color: var(--emas); background: var(--sakelar-bg); color: var(--sakelar-ink); }
.az button:disabled { opacity: .35; }
.tabel-isi td.ar { color: var(--judul); white-space: nowrap; text-align: right; }
@media (max-width: 768px) {
  .hk-rinci { grid-template-columns: minmax(0, 1fr); }
  .hk-ar { font-size: 36px; }
  .hk-kepala h2 { font-size: 28px; }
  .az button { width: 36px; min-width: 36px; }
  .hk-dua { gap: 8px; }
  .tabel-isi td, .tabel-isi th { padding: 8px 6px; }
  .tabel-isi td.ar { font-size: 21px; white-space: normal; }
}
@media (max-width: 420px) { .cek .hk-dua { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Alat ---------- */
.dua-alat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.dua-alat .kol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pengantar { margin: 0; color: var(--muted); }
.kotak { border: 1px solid var(--garis); background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; align-items: center; min-width: 0; }
.kotak .hk-ar { font-size: 34px; min-height: 1.7em; }
.alat .hk-dua { margin-bottom: 0; }
.alat .pratinjau-kartu img { max-width: 100%; width: 100%; border: 0; }
.alat .pratinjau-kartu p { padding: 40px 16px; text-align: center; border: 1px dashed var(--garis); }
.alat .baris-opsi > label { flex: 1 1 160px; }
@media (max-width: 900px) { .dua-alat { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
@media (max-width: 768px) {
  .alat .baris-opsi > label { flex: 1 1 100%; }
  .alat .baris-opsi > label.cek { min-height: 36px; }
  .alat .baris-tombol > button { flex: 1 1 auto; padding: 0 10px; }
}

/* ---------- Ngaji ---------- */
.ngaji-kepala { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: -28px -32px 0; padding: 18px 32px 0; }
.ngaji-kepala .judul-halaman { font-size: 30px; margin: 0 0 10px; }
.ngaji-kepala .tab-deret { background: var(--bg); }
.ngaji .bag { scroll-margin-top: 140px; }
.ngaji .vk, .ngaji .sub-ngaji { scroll-margin-top: 130px; }
.langkah-cek { color: var(--ok); margin-left: 6px; font-weight: 700; text-transform: none; }
.bag-pengantar { max-width: 760px; margin: 0 0 18px; }
.bag > h2:not(.sr-only) { font: 600 30px/1.15 var(--font-judul); }
.sub-ngaji { font: 600 22px/1.25 var(--font-judul); color: var(--judul); margin: 28px 0 6px; }
.sub-ngaji + p { margin: 0 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.vk { padding: 18px; gap: 0; }
.vk .v { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.vk .v b { font: 600 44px/1 var(--font-judul); color: var(--judul); }
.vk .v span { color: var(--muted); font-size: 13px; }
.tulis { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; color: var(--muted); margin: 6px 0 10px; align-items: center; }
.tulis dt, .tulis dd { margin: 0; }
.tulis .ar { font: 26px/1.3 var(--font-pegon); color: var(--judul); text-align: right; }
.tulis .teks { text-align: right; }
.cth { display: flex; flex-wrap: wrap; gap: 8px; }
.cth a { flex: 1 1 110px; text-decoration: none; color: inherit; border: 1px solid var(--garis); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; }
.cth a:hover { border-color: var(--emas); color: inherit; }
.cth small { color: var(--muted); }
#vokal-awal a { flex: 0 1 140px; }
.ar2 { font: 28px/1.5 var(--font-pegon); color: var(--judul); }
.ar2-kecil { font-size: 22px; }
.kartu-kembar.bingkai-pegon { min-height: 0; }
.kartu-kembar .bingkai-dalam { padding: 36px 28px; align-items: stretch; text-align: left; }
.kartu-kembar .sakelar { align-self: center; }
.kembar { display: grid; gap: 0; }
.kb-baris-kembar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px 12px; align-items: center; border-bottom: 1px solid var(--garis); padding: 10px 0; }
.kb-baris-kembar:last-child { border-bottom: 0; }
.kb-baris-kembar .w { display: flex; flex-direction: column; align-items: center; }
.kb-baris-kembar .ar2 { font-size: 38px; }
.kb-baris-kembar.sama .ar2 { color: var(--emas-teks); }
.kb-baris-kembar .vs { font: italic 600 18px var(--font-judul); color: var(--muted); }
.kb-baris-kembar .ket { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--muted); }
.kembar-ket { margin: 6px 0 0; text-align: center; font-size: 14px; }
.tabd { display: flex; gap: 2px; border-bottom: 1px solid var(--garis); margin-bottom: 14px; }
.tabd button { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-weight: 500; }
.tabd button:hover { background: transparent; color: var(--text); }
.tabd button[aria-selected="true"] { color: var(--judul); font-weight: 600; box-shadow: inset 0 -2px 0 var(--emas); }
#isi-daerah p { margin: 0 0 10px; }
#isi-daerah .cth a { flex: 0 1 140px; }
.lanjut { display: flex; justify-content: flex-end; margin-top: 20px; }
.lanjut-dua { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.ngaji #kuis > .sakelar { margin-bottom: 16px; }
.kuis-vokal .soal { font-size: 15px; color: var(--muted); margin: 0 0 6px; }
.kuis-vokal .tanya { font: 40px/1.6 var(--font-pegon); color: var(--judul); text-align: center; margin: 6px 0 14px; }
.kuis-vokal .tanya.lat { font: italic 600 34px var(--font-judul); }
.kuis-vokal .pil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kuis-vokal .pil button { min-height: 52px; border: 1px solid var(--garis-tombol); border-radius: var(--radius); background: transparent; color: var(--text); font-size: 16px; font-weight: 500; }
.kuis-vokal .pil button:hover { background: var(--isi-lembut); color: var(--text); }
.kuis-vokal .pil button.ar2 { font: 28px/1.4 var(--font-pegon); }
.kuis-vokal .pil button[aria-pressed="true"] { background: var(--sakelar-bg); border-color: var(--emas); }
.kuis-vokal .pil button.ok { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); background: var(--ok-soft); }
.kuis-vokal .pil button.no { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); background: var(--danger-soft); }
.kuis-vokal .umpan { min-height: 24px; margin: 12px 0; font-size: 14px; }
.kuis-vokal .umpan.ok { color: var(--ok); }
.kuis-vokal .umpan.err { color: var(--danger); }
.kuis-vokal .kaki-k { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.kuis-vokal .catat { font-size: 12px; color: var(--muted); }
.kuis-vokal .kuis-skor { font: 600 30px var(--font-judul); color: var(--judul); margin: 4px 0 8px; }
.ulangi { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.ulangi a { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; padding: 0 14px; border: 1px solid var(--emas); border-radius: var(--radius); text-decoration: none; color: var(--emas-teks); font-weight: 600; }
.ulangi small { font-weight: 400; }
@media (max-width: 900px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .ngaji-kepala { margin: -20px -16px 0; padding: 12px 16px 0; }
  .ngaji-kepala .judul-halaman { font-size: 24px; margin-bottom: 8px; }
  .kartu-kembar .bingkai-dalam { padding: 28px 18px; }
}
@media (max-width: 560px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .kuis-vokal .pil { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Panduan ---------- */
.pd + .pd { margin-top: 28px; }
.panduan .pd h2 { font: 600 24px/1.2 var(--font-judul); margin: 0 0 10px; }
.panduan .pd h3 { font: 600 19px/1.3 var(--font-judul); color: var(--judul); margin: 18px 0 6px; }
.panduan .tab-panel { max-width: 760px; }
.panduan .seg-bahasa { margin-bottom: 18px; }
.bhs-aktif .bhs > h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bhs + .bhs { margin-top: 14px; }
.panduan .contoh { color: var(--emas-teks); }

/* ---------- Tentang ---------- */
.tentang .tab-panel.profil { display: block; padding: 8px 0 0; max-width: none; gap: 0; }
.diri { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 28px; row-gap: 14px; align-items: end; }
.diri .profil-foto { grid-row: 1 / 3; align-self: center; margin: 0; width: 260px; padding: 10px; border-radius: 130px 130px 2px 2px; }
.diri .profil-foto-dalam { height: 340px; aspect-ratio: auto; border-radius: 120px 120px 2px 2px; }
.idn { display: flex; flex-direction: column; gap: 14px; container: idn / inline-size; width: 100%; }
.identitas { font-size: min(10px, calc(100cqi / 40)); display: inline-flex; flex-direction: column; gap: 1.2em; width: max-content; max-width: 100%; }
.identitas-nama { display: flex; flex-wrap: nowrap; align-items: center; gap: 2em; white-space: nowrap; }
.identitas .profil-nama { font-size: 6.8em; }
.identitas .profil-nama .nama-s { font-size: 1.12em; }
.identitas .profil-garis-tegak { flex: none; width: 1px; height: 5em; }
.identitas .profil-pegon { font-size: 5em; }
.identitas-dua { display: flex; flex-wrap: nowrap; align-items: center; gap: 1.2em; white-space: nowrap; }
.identitas .profil-sunda { font-size: 2.4em; }
.identitas .profil-garis-emas { flex: none; width: 2.4em; }
.identitas .profil-peran { font-size: 1.5em; }
.diri .profil-teks { flex: none; align-self: start; gap: 14px; }
.diri .profil-bio { font-size: 16px; line-height: 1.75; }
.diri .profil-tombol { flex-wrap: nowrap; }
.diri .profil-tombol .btn { white-space: nowrap; }
.tj-sapa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: start; }
.tj-sapa .prosa h2, .info-bagian h2, .tentang .tab-panel.prosa h2 { font: 600 26px/1.2 var(--font-judul); margin: 0 0 10px; }
.tentang .prosa li { margin: 6px 0; }
.info-bagian { margin-top: 36px; }
.info-bagian + .info-bagian { margin-top: 28px; }
.tj-sapa .kartu-sapaan.bingkai-pegon { min-height: 0; padding: 7px; }
.tj-sapa .kartu-sapaan .bingkai-dalam { padding: 30px 28px; gap: 16px; align-items: stretch; }
.tj-sapa .kartu-sapaan .sudut { width: 48px; height: 48px; }
.sapaan-atas { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--garis); }
.tj-sapa .sapaan-judul { font-size: 34px; line-height: 1.6; margin: 0; }
.sapaan-sub { margin-top: -10px; font-size: 13px; letter-spacing: .04em; color: var(--muted); }
.sapaan-salam { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sapaan-salam .ar { font: 400 22px/1.8 Amiri, serif; color: var(--emas-teks); }
.sapaan-salam .lt { font: italic 500 14px/1.4 var(--font-judul); color: var(--muted); }
.tj-sapa .sapaan-isi { max-width: none; display: flex; flex-direction: column; gap: 12px; text-align: left; font: 500 18px/1.6 var(--font-judul); }
.sapaan-penutup { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.garis-ttd { display: block; width: 48px; height: 1px; background: var(--emas); margin-top: 4px; }
.tj-sapa .sapaan-ttd { margin-top: 0; gap: 0; }
.tj-sapa .ttd-latin { font-size: 24px; font-weight: 600; }
.tj-sapa .ttd-pegon { font-size: 28px; }
@media (max-width: 900px) {
  .tj-sapa { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .tj-sapa .kartu-sapaan .bingkai-dalam { padding: 28px 20px; }
}
@media (max-width: 768px) {
  .diri { column-gap: 12px; row-gap: 16px; align-items: center; }
  .diri .profil-foto { grid-row: 1; width: 64px; padding: 3px; border-radius: 32px 32px 2px 2px; }
  .diri .profil-foto-dalam { height: 80px; border-radius: 29px 29px 2px 2px; }
  .idn > .garis-bintang { display: none; }
  .diri .profil-teks { grid-column: 1 / -1; }
  .diri .profil-tombol .btn { flex: 1 1 0; padding: 0 10px; }
  .tj-sapa .kartu-sapaan .sudut { width: 40px; height: 40px; }
  .tj-sapa .sapaan-judul { font-size: 30px; }
}
@media (max-width: 380px) { .diri .profil-tombol .btn { font-size: 14px; padding: 0 6px; } }
@media print { .nav-bawah, .ngaji-kepala .tab-deret { display: none !important; } .ngaji-kepala { position: static; } }
/* tab arah Auto Pegon memakai gaya tab seragam (bukan sakelar oval TAHAP5/01) */
#pil-arah.tab-daftar { display: flex; border: 0; border-radius: 0; padding: 0; margin: 0; gap: 2px; }
@media (max-width: 768px) { #pil-arah.tab-daftar { gap: 0; } }
/* Latin di bawah: tiap kata (Pegon + Latin) tidak boleh terpotong di tengah */
.output.dengan-rubi .kata { display: inline-block; white-space: nowrap; line-height: 1.6; padding: 6px 0; }
.output.dengan-rubi { line-height: 2.2; }

/* ---------- R8 PWA: dipasang sebagai aplikasi (standalone) + layar berponi (safe area) ---------- */
@media (display-mode: standalone) {
  .kepala-dalam { padding-top: calc(16px + env(safe-area-inset-top)); }
  .kepala button.tombol-tema { top: calc(12px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
  .ngaji-kepala { top: env(safe-area-inset-top); }
  dialog { max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px); }
  .pres-lapis { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) and (max-width: 768px) {
  .kepala-dalam { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .wrap, .kaki-dalam { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .kb { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
}
/* target sentuh ≥ 44px di HP (R9) */
@media (max-width: 768px) {
  button.kcl, .btn.kcl, .pnl-kepala .tombol-teks, .seg button, .tabd button, a.tautan-tombol { min-height: 44px; }
  .az button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .sekilas a { min-height: 44px; }
}
.kuis-vokal > button, .kuis-vokal > .soal + .kuis-skor ~ button { align-self: flex-start; }
.daerah-blok + .daerah-blok { margin-top: 16px; }
.sub-daerah { font: 600 18px/1.3 var(--font-judul); color: var(--judul); margin: 0 0 6px; }

/* ===== TAHAP5/06 H0 (permintaan EL): foto bernada lembut senada palet (gading/emas). Berkas gambar tidak diubah. ===== */
.profil-foto-dalam { position: relative; }
.profil-foto-dalam::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(250, 247, 240, .10), rgba(176, 138, 62, .18)); mix-blend-mode: soft-light; }
.profil-foto img, .sekilas-foto { filter: saturate(.38) sepia(.24) contrast(.95) brightness(1.05); }
:root[data-tema="malam"] .profil-foto img, :root[data-tema="malam"] .sekilas-foto { filter: saturate(.34) sepia(.28) contrast(1) brightness(.84); }
:root[data-tema="malam"] .profil-foto-dalam::after { background: linear-gradient(180deg, rgba(11, 15, 26, 0), rgba(216, 184, 120, .16)); }
.jangkar-lama { display: block; height: 0; }

/* ---------- Profil: nama pasangan "Baba & Ummah" (2026-11-24, EL) ----------
   Nama lebih panjang dari nama lama, jadi diperkecil dan boleh turun baris di layar sempit. */
.identitas .profil-nama.nama-pasangan { font-size: 5.2em; white-space: nowrap; }
.profil-nama .nama-amp { color: var(--emas); font-style: normal; font-weight: 500; margin: 0 .14em; }
.identitas-nama.pasangan { flex-wrap: wrap; column-gap: 1.6em; row-gap: .5em; white-space: normal; }
.identitas-nama.pasangan .profil-garis-tegak { height: 4em; }
.identitas-nama.pasangan .profil-pegon { font-size: 3.8em; white-space: nowrap; }
.identitas-dua { flex-wrap: wrap; row-gap: .5em; }
.identitas .profil-sunda { white-space: nowrap; }
@container idn (max-width: 520px) {
  .identitas-nama.pasangan { flex-direction: column; align-items: flex-start; }
  .identitas-nama.pasangan .profil-garis-tegak { display: none; }
  .identitas .profil-nama.nama-pasangan { font-size: 6em; }
  .identitas-nama.pasangan .profil-pegon { font-size: 4.4em; }
  .identitas-dua { flex-direction: column; align-items: flex-start; row-gap: .3em; }
  .identitas .profil-garis-emas { display: none; }
  .identitas .profil-peran { font-size: 12px; }
}
.sekilas-nama .nama-amp { color: var(--emas); font-style: normal; font-weight: 500; margin: 0 .14em; }
.tj-sapa .ttd-latin, .sapaan-ttd .ttd-latin { white-space: nowrap; }

/* ---------- Admin: impor kamus Excel/CSV + cek bacaan (TAHAP5/09, K-67) ---------- */
.form-entri .baris-penuh { grid-column: 1 / -1; margin: -2px 0 0; }
.petunjuk { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.45; }
.petunjuk code { font-size: 12px; }
.cek-bacaan, .cek-bacaan-form .cek-bacaan { display: block; margin-top: 6px; padding: 4px 8px; font-size: 12px; font-weight: 600; line-height: 1.4;
  background: var(--offline-bg); color: var(--offline-ink); border-left: 3px solid var(--emas); border-radius: var(--radius); white-space: normal; }
.lipat.impor { margin-top: 16px; padding-bottom: 4px; }
.lipat.impor > p, .form-impor { margin: 0 0 12px; }
.form-impor input[type="file"] { max-width: 100%; }
.impor-judul { font-size: 16px; margin: 16px 0 8px; overflow-wrap: anywhere; }
/* TAHAP5/11 F3.2: hapus massal */
.form-hapus .baris-penuh { flex: 1 1 100%; }
.form-hapus textarea { width: 100%; min-height: 84px; resize: vertical; font: inherit; }
h3#hapus-massal { border-top: 1px solid var(--garis, rgba(0,0,0,.12)); padding-top: 14px; }
.impor-ringkas { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 8px; }
.impor-ringkas li { padding: 3px 10px; font-size: 13px; background: var(--isi-lembut); color: var(--text); border-radius: var(--radius); }
.impor-ringkas li.st-baru, .tabel-impor tr.st-baru .lencana { background: var(--ok-soft); color: var(--ok); }
.impor-ringkas li.st-galat, .tabel-impor tr.st-galat .lencana { background: var(--danger-soft); color: var(--danger); }
.impor-ringkas li.st-timpa, .tabel-impor tr.st-timpa .lencana { background: var(--offline-bg); color: var(--offline-ink); }
.lipat.impor .row-actions { margin: 8px 0 12px; }
.tabel-impor .lencana { display: inline-block; padding: 2px 8px; font-size: 12px; background: var(--isi-lembut); color: var(--text); border-radius: var(--radius); white-space: nowrap; }
.tabel-impor tr.st-galat .lencana { white-space: normal; }
.tabel-impor tr.st-galat td, .tabel-impor tr.st-ganda td, .tabel-impor tr.st-lewati td, .tabel-impor tr.st-sama td { color: var(--muted); }
.tabel-impor tr.peringatan td:first-child { box-shadow: inset 3px 0 0 var(--emas); }
.tabel-impor td.kolom-status { min-width: 150px; }

/* =====================================================================
 * TAHAP6/01 (K-70) — tampilan HP ala aplikasi (≤ 768px), dari prototipe CC yang disetujui EL
 * (ASISTEN/DESAIN/TAHAP6/prototipe-mobile). Desktop (> 768px) TIDAK berubah: elemen baru disembunyikan di luar blok ini.
 * Ukuran kunci: bilah atas 56px, bilah bawah 64px + safe area, target sentuh ≥ 44px.
 * TAHAP6/02 (K-71): tetap flat K-56 di HP: sudut 2px (var(--radius)), tanpa bayangan dekoratif; oval 999px hanya
 * sakelar dua pilihan (arah, Gundhul/Berharakat, Periksa/Kamus, jenis kuis), sakelar hidup/mati, dan tema.
 * ===================================================================== */
.bilah-atas, .sapaan-hp, .lanjut-ngaji, .aksi-hp, .cari-ikon, .bilah-bahasa, .bagikan-hp { display: none; }
.kb-wadah { display: contents; }
/* M11: tautan footer desktop, area klik ≥ 24px */
.kaki-dalam a { display: inline-block; padding: 3px 0; }

@media (max-width: 768px) {
  :root { --hp-kartu-gelap: #1A1814; --hp-kartu-gelap-ink: #FAF7F0; --hp-kartu-gelap-aksen: #D8B878; --hp-kartu-gelap-garis: #3A342A; --hp-kb: #EFE7D6; }
  :root[data-tema="malam"] { --hp-kartu-gelap: #1A2134; --hp-kartu-gelap-ink: #ECE6D8; --hp-kartu-gelap-aksen: #D8B878; --hp-kartu-gelap-garis: #2B344B; --hp-kb: #1A2134; }

  /* ---------- M1 kerangka ---------- */
  .kepala, .kaki { display: none; }
  .judul-halaman:not(.hero-judul) { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .bilah-atas {
    display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 40;
    min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
    background: var(--bg); border-bottom: 1px solid var(--garis);
  }
  .bilah-judul { flex: 1; min-width: 0; margin: 0 0 0 10px; font: 700 24px/1.15 var(--font-judul); color: var(--judul); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bilah-kembali + .bilah-judul { margin-left: 0; }
  .bilah-kembali, button.bilah-ikon, .bilah-atas button.tombol-tema {
    flex: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: var(--radius); color: var(--judul);
  }
  .bilah-kembali:hover, button.bilah-ikon:hover, .bilah-atas button.tombol-tema:hover { background: var(--isi-lembut); color: var(--judul); }
  button.bilah-ikon[data-terbuka] { background: var(--chip-bg); color: var(--chip-ink); }
  .bilah-aksi { flex: none; display: flex; align-items: center; gap: 2px; }
  .bilah-aksi:empty { display: none; }
  .bilah-bahasa { position: relative; z-index: 0; margin: 0 4px 0 0; align-items: center; min-height: 44px; }
  .bilah-bahasa::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 6px; bottom: 6px; border-radius: var(--radius); background: var(--chip-bg); pointer-events: none; }
  .bilah-bahasa select {
    width: auto; height: 44px; min-height: 44px; margin: 0; padding: 0 28px 0 12px; border: 0; border-radius: var(--radius);
    background-color: transparent; color: var(--chip-ink); font-size: 13px; font-weight: 600;
  }
  .bilah-bahasa select option { color: var(--text); background: var(--surface); }
  .bilah-bahasa.selalu, body[data-arah="pl"] .bilah-bahasa { display: flex; }
  .bilah-info { padding-right: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
  .bilah-beranda { justify-content: space-between; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .bilah-logo { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--judul); }
  .bilah-logo img { width: 26px; height: 28px; display: block; }
  .bilah-logo:hover { color: var(--judul); }
  .bilah-merek { display: flex; flex-direction: column; line-height: 1; font-family: "Jost", var(--font-ui); }
  .bilah-merek span { font-size: 12px; font-weight: 300; color: var(--muted); }
  .bilah-merek b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
  .bilah-merek i { font-style: normal; color: var(--emas); }

  body.premium { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .wrap { padding: 14px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  .wrap > * + * { margin-top: 12px; }
  .wrap > .tab-deret + * { margin-top: 14px; }

  /* bilah bawah 5 item, item aktif = pil --chip-bg 52×28 */
  .nav-bawah { height: calc(64px + env(safe-area-inset-bottom)); padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left)); }
  .nav-bawah-deret { height: 64px; }
  .nav-bawah-deret a, .nav-bawah-deret button { min-height: 64px; gap: 3px; font-size: clamp(10px, 3.1vw, 11px); letter-spacing: -.01em; }
  .nav-ikon { display: flex; align-items: center; justify-content: center; width: 52px; height: 28px; border-radius: var(--radius); }
  .nav-ikon svg { width: 20px; height: 20px; }
  .nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-bawah-deret [aria-current="page"] .nav-ikon, .nav-bawah-deret button[data-aktif] .nav-ikon, .nav-bawah-deret button[data-terbuka] .nav-ikon { background: var(--chip-bg); }
  .nav-bawah-deret [aria-current="page"] svg, .nav-bawah-deret button[data-aktif] svg, .nav-bawah-deret button[data-terbuka] svg { color: var(--emas-teks); }
  .nav-bawah-deret button[data-terbuka] { color: var(--judul); font-weight: 600; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* ---------- lembar bawah (dialog modal) ---------- */
  dialog.lembar {
    position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%;
    max-height: calc(100dvh - 56px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain;
    border: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 10px max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    background: var(--surface); color: var(--text);
  }
  dialog.lembar::backdrop { background: rgba(26, 24, 20, .45); }
  :root[data-tema="malam"] dialog.lembar::backdrop { background: rgba(0, 0, 0, .6); }
  .lembar-pegangan { width: 40px; height: 4px; border-radius: 2px; background: var(--garis); margin: 0 auto 12px; }
  .lembar-kepala { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
  .lembar-kepala h2 { margin: 0; font: 700 24px/1.2 var(--font-judul); color: var(--judul); }
  .lembar-kepala button { min-height: 44px; padding: 0 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; }
  .lembar-baris { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--garis-buku); font-size: 15px; }
  button.sakelar-hp { position: relative; flex: none; width: 56px; min-width: 56px; min-height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; }
  button.sakelar-hp span { position: absolute; left: 4px; right: 4px; top: 50%; height: 28px; margin-top: -14px; border-radius: 999px; background: var(--garis-tombol); }
  button.sakelar-hp span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: var(--surface); }
  button.sakelar-hp[aria-pressed="true"] span { background: var(--utama); }
  button.sakelar-hp[aria-pressed="true"] span::after { left: auto; right: 3px; background: var(--utama-ink); }
  button.sakelar-hp:hover { background: transparent; }
  .lembar-menu { list-style: none; margin: 0; padding: 0; }
  .lembar-menu button {
    width: 100%; min-height: 56px; padding: 8px 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
    background: transparent; border: 0; border-bottom: 1px solid var(--garis-buku); border-radius: 0; color: var(--text); text-align: left; font-size: 15px;
  }
  .lembar-menu button:hover { background: var(--isi-lembut); color: var(--text); }
  .lembar-menu button span { font-size: 12px; font-weight: 400; color: var(--muted); }
  #lembar-atur .lipatan { margin: 0; border-top: 0; }
  #lembar-atur .lipat summary { min-height: 52px; font-size: 15px; font-weight: 500; }
  #lembar-atur .lipatan .grid-pengaturan { grid-template-columns: minmax(0, 1fr); }
  #lembar-atur .baris-opsi > label, #lembar-atur .baris-tombol > button { flex: 1 1 100%; }
  #lembar-atur .lipat:last-child { border-bottom: 0; }

  /* lembar Lainnya: di atas bilah bawah */
  dialog.lembar-lainnya { bottom: calc(64px + env(safe-area-inset-bottom)); padding: 10px 0 8px; max-height: calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .lainnya-profil { display: flex; align-items: center; gap: 12px; padding: 6px 18px 12px; border-bottom: 1px solid var(--garis-buku); }
  .lainnya-profil img { width: 40px; height: 50px; flex: none; border-radius: 20px 20px var(--radius) var(--radius); object-fit: cover; border: 1px solid var(--emas); filter: saturate(.38) sepia(.24) contrast(.95) brightness(1.05); }
  :root[data-tema="malam"] .lainnya-profil img { filter: saturate(.34) sepia(.28) contrast(1) brightness(.84); }
  .lainnya-profil > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .lainnya-nama { font: 700 22px/1.1 var(--font-judul); color: var(--judul); }
  .lainnya-nama span { color: var(--emas); font-weight: 500; }
  .lainnya-profil a { min-height: 44px; min-width: 52px; justify-content: flex-end; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; text-decoration: none; }
  .lainnya-menu { list-style: none; margin: 0; padding: 0; }
  .lainnya-menu a, .lainnya-menu button {
    width: 100%; min-height: 54px; padding: 0 18px; display: flex; align-items: center; gap: 14px;
    background: transparent; border: 0; border-bottom: 1px solid var(--garis-buku); border-radius: 0; color: var(--text); text-decoration: none; text-align: left; font-weight: 400;
  }
  .lainnya-menu a:hover, .lainnya-menu button:hover { background: var(--isi-lembut); color: var(--text); }
  .lainnya-menu a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--emas); }
  .lainnya-ikon { flex: none; width: 36px; height: 36px; border-radius: var(--radius); background: var(--chip-bg); color: var(--emas-teks); display: flex; align-items: center; justify-content: center; font: 700 18px/1 var(--font-pegon); }
  .lainnya-teks { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .lainnya-teks b { font-size: 15px; font-weight: 600; }
  .lainnya-teks span { font-size: 12px; color: var(--muted); }
  .lainnya-panah { color: var(--garis-tombol); font-size: 18px; }
  .pasang-info { padding: 8px 18px 10px; border-bottom: 1px solid var(--garis-buku); }
  .lainnya-tema { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 0 18px; font-size: 15px; font-weight: 600; }
  .segmen-hp { display: flex; background: var(--sakelar-bg); border-radius: 999px; }
  .segmen-hp button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--sakelar-ink); font-size: 13px; font-weight: 600; }
  .segmen-hp button:hover { background: transparent; color: var(--judul); }
  .segmen-hp button[aria-pressed="true"] { background: var(--surface); color: var(--judul); box-shadow: inset 0 0 0 3px var(--sakelar-bg); }
  .lainnya-kecil { padding: 6px 18px 2px; font-size: 11px; line-height: 1.7; color: var(--muted); }
  .lembar-tutup-hp { display: flex; width: calc(100% - 36px); margin: 8px 18px 0; border-radius: var(--radius); }

  /* ---------- tab (K-71): lebih dari dua pilihan = flat, garis bawah emas seperti desktop, bisa digeser (tab aktif
     digeser ke layar oleh navigasi.js); dua pilihan (arah Latin/Pegon, Periksa/Kamus) = sakelar oval ---------- */
  .tab-deret { border-top: 0; border-bottom: 1px solid var(--garis); }
  .tab-daftar { gap: 0; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: transparent; border-radius: 0; padding: 0; }
  .tab-daftar .tab, button.tab {
    flex: 1 0 auto; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: 0; background: transparent;
    font-size: 13px; letter-spacing: .02em; text-transform: none; font-weight: 500; color: var(--muted); box-shadow: none; white-space: nowrap;
  }
  .tab-daftar .tab:hover, button.tab:hover { color: var(--judul); box-shadow: inset 0 -2px 0 var(--garis-tombol); }
  .tab-daftar .tab[aria-selected="true"], button.tab[aria-selected="true"] { color: var(--judul); font-weight: 600; background: transparent; box-shadow: inset 0 -2px 0 var(--emas); }
  .tab-daftar .tab:focus-visible { outline-offset: -2px; }
  .auto .tab-deret, .cek .tab-deret { border-bottom: 0; }
  #pil-arah.tab-daftar, .cek .tab-daftar { background: var(--sakelar-bg); border-radius: 999px; }
  #pil-arah button.tab, .cek .tab-daftar .tab { border-radius: 999px; color: var(--sakelar-ink); letter-spacing: 0; }
  #pil-arah button.tab:hover, .cek .tab-daftar .tab:hover { box-shadow: none; }
  #pil-arah button.tab[aria-selected="true"], .cek .tab-daftar .tab[aria-selected="true"] { background: var(--surface); color: var(--judul); box-shadow: inset 0 0 0 3px var(--sakelar-bg); }

  /* chip bahasa satu baris, bisa digeser (36px tampak, 44px area sentuh) */
  .seg-bahasa { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .seg-bahasa::-webkit-scrollbar, .tab-daftar::-webkit-scrollbar { display: none; }
  .seg-bahasa button, .seg-bahasa button:first-child {
    grid-column: auto; position: relative; z-index: 0; flex: none; min-height: 44px; height: 44px; padding: 0 14px;
    border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font-size: 13px; font-weight: 600;
  }
  .seg-bahasa button::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 4px; bottom: 4px; border-radius: var(--radius); border: 1px solid var(--garis); background: var(--surface); }
  .seg-bahasa button:hover { background: transparent; color: var(--text); }
  .seg-bahasa button[aria-pressed="true"] { color: var(--arah-ink); background: transparent; }
  .seg-bahasa button[aria-pressed="true"]::before { background: var(--arah-bg); border-color: var(--arah-bg); }

  /* ---------- M2 Beranda ---------- */
  .sapaan-hp { display: block; margin: 0; padding: 16px max(16px, env(safe-area-inset-left)) 0; font-size: 13px; font-weight: 500; color: var(--emas-teks); }
  .hal-beranda .wrap { padding-top: 2px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .hero-judul { font-size: 30px; line-height: 1.1; font-weight: 700; margin: 0 0 16px; }
  .hero-pembuka { display: none; }
  .hero-label { margin: 0; padding: 14px 14px 4px; font-size: 12px; background: var(--surface); border: 1px solid var(--garis); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
  #coba { display: block; min-height: 44px; padding: 0 14px 8px; font-size: 16px; border: 1px solid var(--garis); border-top: 0; border-bottom: 0; border-radius: 0; background: var(--surface); box-shadow: inset 0 -1px 0 var(--garis-buku); }
  #coba:focus-visible { outline-offset: -2px; }
  .hero-hasil.bingkai-kerja { padding: 0; border: 1px solid var(--garis); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); }
  .hero-hasil .bingkai-kerja-dalam { min-height: 0; padding: 6px 14px 10px; border: 0; gap: 2px; }
  .hero-hasil .garis-bintang { display: none; }
  .hero-pegon { font-size: 34px; line-height: 1.6; }
  #buka-auto { min-height: 44px; background: transparent; border: 0; color: var(--emas-teks); font-size: 13px; padding: 0 8px; }
  .fitur4, .wrap > .fitur4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; margin-top: 16px; }
  .fitur4 a, .fitur4 a:first-child, .fitur4 a:nth-child(n+3) {
    min-height: 92px; padding: 14px; gap: 4px; justify-content: space-between; border: 1px solid var(--garis); border-radius: var(--radius); background: var(--surface);
  }
  .fitur4 svg { color: var(--emas); width: 22px; height: 22px; }
  .fitur4 b { font: 600 15px/1.25 var(--font-ui); }
  .fitur4 span { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .lanjut-ngaji {
    display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px; border-radius: var(--radius); text-decoration: none;
    background: var(--hp-kartu-gelap); color: var(--hp-kartu-gelap-ink);
  }
  :root[data-tema="malam"] .lanjut-ngaji { border: 1px solid var(--garis); }
  .lanjut-ngaji:hover { color: var(--hp-kartu-gelap-ink); }
  .lanjut-ngaji-huruf { flex: none; width: 44px; height: 44px; border-radius: var(--radius); border: 1.5px solid var(--hp-kartu-gelap-aksen); color: var(--hp-kartu-gelap-aksen); display: flex; align-items: center; justify-content: center; font: 22px/1 var(--font-pegon); }
  .lanjut-ngaji-teks { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .lanjut-ngaji-label { font-size: 12px; color: var(--hp-kartu-gelap-aksen); }
  .lanjut-ngaji-teks b { font-size: 15px; font-weight: 600; }
  .lanjut-ngaji-bilah { display: block; margin-top: 6px; height: 4px; border-radius: 2px; background: var(--hp-kartu-gelap-garis); }
  .lanjut-ngaji-bilah span { display: block; height: 4px; border-radius: 2px; background: var(--hp-kartu-gelap-aksen); width: 8%; }
  .lanjut-ngaji svg { flex: none; color: var(--hp-kartu-gelap-aksen); }
  .wrap > .sekilas { margin-top: 16px; }
  .sekilas { gap: 12px; align-items: center; }
  .sekilas-foto { width: 40px; height: 50px; padding: 0; border-radius: 20px 20px var(--radius) var(--radius); }
  .sekilas-nama { font-size: 18px; }
  .sekilas-harap { font-size: 15px; }

  /* ---------- M3 Auto Pegon Latin → Pegon ---------- */
  .auto .kendali { display: block; margin-top: 10px; }
  body[data-arah="pl"] .auto .kendali { display: none; }
  .auto .konv { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 10px; }
  .auto .pnl { gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--garis); border-radius: var(--radius); }
  #arah-lp > .pnl:last-child, #arah-pl > .pnl:last-child { border-color: var(--emas); }
  .auto .pnl-kepala { min-height: 32px; gap: 8px; }
  .auto .pnl-kepala .lb { font-size: 11px; }
  .auto .pnl-kepala .tombol-teks { min-height: 44px; margin: -6px 0; text-decoration: none; padding: 0 6px; }
  .auto textarea#input {
    min-height: calc(3 * 1.5em + 4px); max-height: calc(6 * 1.5em + 4px); field-sizing: content; resize: none;
    padding: 2px 0; border: 0; border-radius: 0; background: transparent; font-size: 17px; line-height: 1.5;
  }
  .auto textarea#input:focus-visible, .auto .isian-pegon:focus-visible { outline: 0; }
  .auto .pnl:focus-within { box-shadow: 0 0 0 2px var(--fokus); }
  #arah-lp > .pnl:first-child > p.muted.small:not(.status-kamus) { display: none; }
  #arah-lp .pnl-kepala .kcl, #arah-lp .ekspor { display: none; }
  #tempat-sakelar-hp { margin-left: auto; }
  #tempat-sakelar-hp .sakelar { display: flex; padding: 0; border: 0; background: var(--sakelar-bg); border-radius: 999px; }
  #tempat-sakelar-hp .sakelar button.segmen { min-height: 44px; padding: 0 12px; font-size: 12px; font-weight: 600; color: var(--sakelar-ink); background: transparent; border-radius: 999px; }
  #tempat-sakelar-hp .sakelar button.segmen[aria-pressed="true"] { background: var(--surface); color: var(--judul); box-shadow: inset 0 0 0 3px var(--sakelar-bg); }
  .auto .bingkai-kerja { padding: 0; border: 0; background: transparent; }
  .auto .bingkai-kerja-dalam { min-height: 0; padding: 2px 0 0; border: 0; align-items: stretch; }
  .auto .bingkai-kerja-dalam > .garis-bintang { display: none; }
  .auto .output { text-align: right; min-height: 1.9em; line-height: 1.9; }
  #arah-lp > .pnl:last-child > p.muted.small { padding-top: 8px; border-top: 1px dashed var(--garis-dalam); }
  .aksi-hp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  body[data-arah="pl"] .aksi-hp { display: none; }
  .aksi-hp button {
    min-height: 56px; height: 56px; padding: 0; flex-direction: column; gap: 3px; min-width: 0;
    background: var(--surface); color: var(--text); border: 1px solid var(--garis); border-radius: var(--radius); font-size: 11px; font-weight: 500;
  }
  .aksi-hp button:hover, .aksi-hp button[data-terbuka] { background: var(--isi-lembut); color: var(--text); border-color: var(--garis-tombol); }
  .aksi-hp svg { width: 19px; height: 19px; }
  .wrap.auto > .lipatan { display: none; }

  /* ---------- M4 Pegon → Latin: Latin di atas, Pegon di bawah, keyboard menempel ---------- */
  #arah-pl > .pnl:last-child { order: -1; }
  .auto .isian-pegon { min-height: 56px; padding: 0; border: 0; border-radius: 0; background: transparent; resize: none; font-size: 28px; line-height: 1.7; }
  .output-latin { min-height: 56px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 19px; line-height: 1.6; }
  #arah-pl > .pnl:last-child > p.muted.small, #arah-pl > .pnl:last-child > .ekspor, #btn-unduh-latin { display: none; }
  #arah-pl .pnl-kepala #btn-salin-latin { min-height: 44px; margin: -6px 0; padding: 0 6px; border: 0; background: transparent; color: var(--emas-teks); font-size: 15px; }
  #arah-pl .pnl-kepala .bagikan-hp { display: inline-flex; }
  .output-latin { min-height: 32px; }
  .kb-wadah { display: block; }
  #kb-hp, #kb-status { display: none; }
  .kb-bilah { flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
  #kb-fonetik, #kb-lipat { min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--sakelar-ink); font-size: 12px; font-weight: 600; text-decoration: none; }
  #kb-fonetik[aria-pressed="true"]::before { content: none; }
  #kb-fonetik[aria-pressed="true"]::after { content: " ✓"; }
  #kb-fonetik[aria-pressed="false"] { color: var(--muted); }
  #kb-lipat { color: var(--emas-teks); }
  body.kb-menempel .kb-wadah {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--hp-kb); border-top: 1px solid var(--garis);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  }
  body.kb-menempel .nav-bawah { display: none; }
  body.kb-menempel.premium { padding-bottom: calc(var(--kb-tinggi, 360px) + 12px); }
  body.kb-menempel .toast { bottom: calc(var(--kb-tinggi, 360px) + 12px); }
  .kb-wadah .kb { padding: 0; border: 0; border-radius: 0; background: transparent; gap: 6px; }
  .kb-wadah .kb-baris { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; overflow: visible; padding: 0; }
  .kb-wadah .kb-baris[hidden] { display: none; }
  .kb-wadah button.kb-tombol {
    min-width: 0; width: 100%; height: 46px; min-height: 46px; padding: 0; gap: 2px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--garis-tombol); box-shadow: none; overflow: hidden;
  }
  .kb-wadah .kb-huruf { font-size: 20px; line-height: 1; }
  .kb-wadah .kb-label { font-size: 9px; line-height: 1; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kb-wadah button.kb-lebar { grid-column: span 2; min-width: 0; }
  .kb-wadah button.kb-aksi { font-size: 15px; background: var(--garis-buku); }
  .kb-wadah button.kb-aksi.kb-lebar { font-size: clamp(10px, 3.2vw, 12px); }
  #hitung-pegon { display: none; }

  /* ---------- M5 Cek kata ---------- */
  .cek #pil-bahasa-cek { display: none; }
  .cari { align-items: center; gap: 8px; max-width: none; margin-bottom: 12px; padding: 0 4px 0 14px; background: var(--surface); border: 1px solid var(--emas); border-radius: var(--radius); }
  .cari:focus-within { box-shadow: 0 0 0 2px var(--fokus); }
  .cari-ikon { display: block; flex: none; color: var(--muted); }
  .cari input { min-width: 0; min-height: 52px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 17px; }
  .cari input:focus-visible { outline: 0; }
  .cari button { min-height: 44px; padding: 0 18px; border-radius: var(--radius); }
  .hk-kepala { margin-bottom: 10px; }
  .hk-kepala h2 { font-size: 26px; }
  .hk-kepala .sekunder { min-height: 44px; border-radius: var(--radius); font-size: 14px; }
  .hk-dua .bingkai-kerja { border-radius: var(--radius); }
  .hk-dua .bingkai-kerja-dalam { border: 0; }
  .hk-rinci { gap: 16px; }
  .cek .daftar-jejak { padding-left: 18px; }
  .cek .rincian-huruf { flex-direction: column; flex-wrap: nowrap; gap: 0; margin: 8px 0 4px -18px; background: var(--surface); border: 1px solid var(--garis); border-radius: var(--radius); overflow: hidden; }
  .cek .rincian-huruf li { display: grid; grid-template-columns: 40px 52px minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 48px; padding: 4px 14px; border-bottom: 1px solid var(--garis-buku); white-space: normal; }
  .cek .rincian-huruf li:last-child { border-bottom: 0; }
  .cek .rincian-huruf li > span:nth-child(2) { display: none; }
  .cek .rincian-huruf .rincian-pegon { grid-column: 1; grid-row: 1; text-align: center; font-size: 24px; }
  .cek .rincian-huruf .rincian-latin { grid-column: 2; grid-row: 1; font-size: 15px; }
  .cek .rincian-huruf .rincian-ket { grid-column: 3; grid-row: 1; font-size: 13px; line-height: 1.35; }
  .cek .rincian-huruf li.rincian-teks { display: block; }

  /* ---------- M6 Ngaji ---------- */
  .ngaji-kepala { top: calc(56px + env(safe-area-inset-top)); margin: -14px -16px 0; padding: 12px 16px 8px; }
  .ngaji .tab-deret { border-bottom: 0; }
  .ngaji .tab-daftar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0; background: transparent; border-radius: 0; overflow: visible; }
  .ngaji .tab-daftar .tab, .ngaji .tab-daftar .tab[aria-selected="true"] {
    position: relative; justify-content: flex-start; align-items: flex-end; min-height: 44px; padding: 0 0 4px; border-radius: 0;
    background: transparent; box-shadow: none; font-size: 12px; font-weight: 600; color: var(--muted);
  }
  .ngaji .tab-daftar .tab::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--garis); }
  .ngaji .tab-daftar .tab.lewat::before { background: var(--emas); }
  .ngaji .tab-daftar .tab[aria-selected="true"] { color: var(--judul); }
  .ngaji .bag { scroll-margin-top: 130px; }
  .ngaji .bag > h2:not(.sr-only) { font-size: 24px; }
  .ngaji .bag > h3 { font: 600 21px/1.2 var(--font-judul); color: var(--judul); margin: 18px 0 10px; }
  .grid-huruf { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  button.tombol-huruf { min-height: 76px; height: 76px; padding: 4px 2px; border-color: var(--garis); }
  button.tombol-huruf .glif { font-size: 28px; line-height: 1.2; }
  button.tombol-huruf .nama { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .detail-huruf { padding: 14px; border: 1px solid var(--emas); border-radius: var(--radius); background: var(--surface); scroll-margin-top: 130px; scroll-margin-bottom: 140px; }
  .huruf-raksasa { font-size: 56px; }
  .tabel-bentuk td.sel-bentuk { font-size: 30px; }
  .ngaji .lanjut { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom) + 12px); z-index: 5; margin-top: 16px; gap: 8px; }
  .ngaji .lanjut .btn { flex: 1 1 0; min-height: 52px; border-radius: var(--radius); }
  .ngaji .lanjut .btn.ghost { background: var(--bg); }
  .kuis-pilihan { grid-template-columns: minmax(0, 1fr); }
  button.pilihan-kuis, .kuis-vokal .pil button { min-height: 52px; width: 100%; }
  .kuis-vokal .pil { grid-template-columns: minmax(0, 1fr); }
  .ngaji .kartu, .kuis-vokal { border-radius: var(--radius); }
  .ngaji #kuis > .sakelar, .ngaji .kartu-kembar .sakelar { border-radius: 999px; }

  /* ---------- M8 Alat, Panduan, Tentang ---------- */
  .dua-alat { gap: 16px; }
  .alat .baris-tombol > button.utama, .alat .baris-tombol > .btn:not(.ghost) { flex: 1 1 100%; }
  .alat .baris-opsi > label.cek, label.cek { min-height: 44px; }
  .alat .pratinjau-kartu img, .alat .pratinjau-kartu canvas { width: 100%; max-width: 100%; height: auto; }
  .alat .kotak, .kartu, .tabel-gulir .tabel-isi { border-radius: var(--radius); }
  .tabel-gulir { border-radius: var(--radius); }
  .panduan .pd h2, .tentang .tab-panel.prosa h2, .tj-sapa .prosa h2, .info-bagian h2 { font-size: 22px; }

  /* tombol & isian umum (target sentuh ≥ 44px) */
  button.tombol-teks, a.btn, .btn { min-height: 44px; }
  .popover-aksi button, .popover-aksi .btn { min-height: 44px; }
}

/* layar HP pendek (≤ 600px, mis. 320×568): tombol keyboard 40px supaya kartu hasil Latin tetap terlihat di atas keyboard */
@media (max-width: 768px) and (max-height: 600px) {
  .kb-wadah button.kb-tombol { height: 40px; min-height: 40px; }
  .kb-wadah .kb-label { font-size: 8px; }
  .kb-wadah .kb, .kb-wadah .kb-baris { gap: 3px; }
  .kb-bilah #kb-fonetik, .kb-bilah #kb-lipat { min-height: 36px; }
}
/* M9: dipasang sebagai aplikasi (standalone): tombol Pasang tidak perlu (safe area atas sudah di bilah atas) */
@media (display-mode: standalone) { .lainnya-pasang { display: none; } }
