:root {
  --ar-font: 'Amiri'; --ar-size: 26px;
  --bg: #f6f3ea; --surface: #fffdf7; --text: #263238; --muted: #6b7a82; --line: #ddd6c2;
  --primary: #1565c0; --primary-text: #fff; --danger: #c62828; --shadow: 0 1px 3px rgba(0,0,0,.18);
  --code: rgba(120,120,120,.16);
  --c-yellow: #fff3b0; --c-green: #d4f0c7; --c-blue: #cfe6fb; --c-pink: #fbd5e4; --c-purple: #e4d8fb; --c-orange: #ffdcb8; --c-gray: #e3e6e8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181a; --surface: #202427; --text: #e6e9ea; --muted: #97a3a9; --line: #394044;
    --primary: #64a8f0; --primary-text: #0b1a2a; --danger: #ef7a7a; --shadow: 0 1px 3px rgba(0,0,0,.6);
    --c-yellow: #5b4d12; --c-green: #1f4a2a; --c-blue: #1d3f5e; --c-pink: #5a2a40; --c-purple: #40305f; --c-orange: #5c3a16; --c-gray: #33393c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .85em; }
.spacer { flex: 1; }
button { font: inherit; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
button:hover { background: var(--code); }
button.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
button.danger { color: var(--danger); }
button.link { border: 0; color: var(--primary); padding: 4px; text-decoration: underline; }
button.icon { border: 0; font-size: 20px; padding: 8px 10px; }
input, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* login */
#login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card-login { width: min(380px, 100%); background: var(--surface); border-radius: 16px; padding: 28px 24px; box-shadow: var(--shadow); display: grid; gap: 12px; text-align: center; }
.card-login img { margin: 0 auto; border-radius: 14px; }
.card-login h1 { margin: 0; font-size: 1.5rem; }
.card-login p { margin: 0; }
.error { color: var(--danger); min-height: 1.4em; font-size: .9rem; }

/* header */
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { white-space: nowrap; margin-right: 6px; }
#search { flex: 1; min-width: 0; }
.sync { font-size: 12px; color: #9aa; }
.sync.ok { color: #2e9d4f; } .sync.busy { color: #e0a000; } .sync.off { color: #c62828; }

/* kerangka */
.shell { display: flex; align-items: flex-start; }
#side { display: flex; flex-direction: column; width: 208px; flex: none; padding: 8px; position: sticky; top: 58px; max-height: calc(100vh - 58px); overflow: auto; }
.nav { display: block; width: 100%; text-align: left; border: 0; border-radius: 18px; padding: 6px 12px; margin-bottom: 0; font-size: .875rem; line-height: 1.35; }
.nav.active { background: var(--code); font-weight: 600; }
.sep { height: 1px; background: var(--line); margin: 5px 4px; }
#main { flex: 1; min-width: 0; padding: 14px; padding-bottom: 96px; }
.composer { display: block; width: min(560px, 100%); margin: 8px auto 18px; text-align: left; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); padding: 12px 16px; }
#trashBar { text-align: center; color: var(--muted); margin: 6px 0 14px; }
.section { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 8px; }
.empty { text-align: center; color: var(--muted); margin-top: 48px; }
.fab { display: none; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-text); font-size: 30px; padding: 0; box-shadow: 0 3px 10px rgba(0,0,0,.35); }

/* kartu */
.grid { columns: 240px; column-gap: 12px; }
.grid.list { columns: 1; max-width: 640px; margin: 0 auto; }
.note { break-inside: avoid; display: block; width: 100%; margin: 0 0 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; overflow: hidden; position: relative; }
.note:hover { box-shadow: var(--shadow); }
.note .t { font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.note .b { max-height: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.note .b.short { -webkit-mask-image: none; mask-image: none; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { font-size: .75rem; padding: 1px 8px; border-radius: 10px; background: var(--code); }
.pin { position: absolute; top: 8px; right: 10px; font-size: .8rem; opacity: .6; }
.c-yellow { background: var(--c-yellow); } .c-green { background: var(--c-green); } .c-blue { background: var(--c-blue); }
.c-pink { background: var(--c-pink); } .c-purple { background: var(--c-purple); } .c-orange { background: var(--c-orange); } .c-gray { background: var(--c-gray); }

/* isi Markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h1 { font-size: 1.5rem; margin: .8em 0 .3em; } .md h2 { font-size: 1.3rem; margin: .8em 0 .3em; }
.md h3 { font-size: 1.15rem; margin: .8em 0 .3em; } .md h4, .md h5, .md h6 { font-size: 1rem; margin: .8em 0 .3em; }
.md p { margin: .5em 0; }
.md ul, .md ol { margin: .4em 0; padding-left: 1.4em; }
.md li.task { list-style: none; margin-left: -1.2em; }
.md li.task input { margin-right: .5em; width: 1.05em; height: 1.05em; vertical-align: -2px; }
.md li.done > span { text-decoration: line-through; color: var(--muted); }
.md code { background: var(--code); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.md pre { background: var(--code); padding: 10px 12px; border-radius: 8px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: .5em 0; padding: 0 0 0 12px; border-left: 3px solid var(--line); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.md a { color: var(--primary); }
.md img { max-width: 100%; border-radius: 6px; }
.md .tbl { overflow: auto; } .md table { border-collapse: collapse; } .md th, .md td { border: 1px solid var(--line); padding: 4px 10px; } .md th { background: var(--code); }

/* editor */
#editor { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; color: inherit; }
#editor::backdrop { background: rgba(0,0,0,.5); }
.ed { width: min(860px, 100%); height: min(92vh, 100%); margin: auto; display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4); overflow: hidden; position: relative; top: 50%; transform: translateY(-50%); }
.ed.c-yellow { background: var(--c-yellow); } .ed.c-green { background: var(--c-green); } .ed.c-blue { background: var(--c-blue); }
.ed.c-pink { background: var(--c-pink); } .ed.c-purple { background: var(--c-purple); } .ed.c-orange { background: var(--c-orange); } .ed.c-gray { background: var(--c-gray); }
.ed input, .ed textarea { background: transparent; }
.ed-top { display: flex; gap: 4px; padding: 10px 10px 0; }
#eTitle { flex: 1; border: 0; font-size: 1.25rem; font-weight: 700; }
.ed-tabs { display: none; gap: 4px; padding: 4px 12px 0; }
.ed-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.ed-tabs button.active { border-bottom-color: var(--primary); font-weight: 600; }
.tools { display: flex; gap: 2px; overflow-x: auto; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.tools button { border: 0; font-family: ui-monospace, Menlo, Consolas, monospace; padding: 8px 11px; flex: none; }
.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
#eBody { border: 0; border-radius: 0; resize: none; unicode-bidi: plaintext; font-family: ui-monospace, Menlo, Consolas, monospace, 'Amiri'; font-size: 15px; padding: 12px 16px; min-height: 0; }
#eView { overflow: auto; padding: 12px 18px; display: none; }
.ed.wide .panes { grid-template-columns: 1fr 1fr; }
.ed.wide #eView { display: block; border-left: 1px solid var(--line); }
.ed.narrow-view #eBody { display: none; } .ed.narrow-view #eView { display: block; }
.ed.narrow-view #eTools { visibility: hidden; }
.ed-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line); }
.colors { display: flex; gap: 6px; }
.dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); padding: 0; background: var(--surface); }
.colors .dot.c-yellow { background: var(--c-yellow); } .colors .dot.c-green { background: var(--c-green); } .colors .dot.c-blue { background: var(--c-blue); }
.colors .dot.c-pink { background: var(--c-pink); } .colors .dot.c-purple { background: var(--c-purple); } .colors .dot.c-orange { background: var(--c-orange); } .colors .dot.c-gray { background: var(--c-gray); }
.dot.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
#eLabels { flex: 1; min-width: 160px; padding: 6px 10px; }
.ed-bottom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #263238; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: 90vw; }

/* ponsel */
#scrim { display: none; }
@media (max-width: 800px) {
  .brand { display: none; }
  #side { position: fixed; left: 0; top: 0; bottom: 0; max-height: none; z-index: 10; width: 224px; background: var(--surface); box-shadow: 4px 0 16px rgba(0,0,0,.35); transform: translateX(-105%); transition: transform .18s; padding-top: max(12px, env(safe-area-inset-top)); }
  #side.open { transform: none; }
  #scrim { position: fixed; inset: 0; z-index: 9; background: rgba(0,0,0,.4); display: block; }
  #scrim.hidden { display: none; }
  .fab { display: block; }
  .composer { display: none; }
  .ed { width: 100%; height: 100%; border-radius: 0; top: 0; transform: none; }
  .ed-tabs { display: flex; padding-top: 2px; }
  .ed-tabs button { padding: 4px 10px; font-size: .85rem; }
  .ed-top { padding: 6px 8px 0; gap: 2px; }
  #eTitle { font-size: 1.05rem; padding: 6px 8px; }
  .ed-top button { padding: 5px 9px; font-size: .85rem; }
  .ed-top .icon { padding: 5px 6px; }
  /* bilah alat: tampil penuh di halaman (grid 10 kolom x 2 baris), bukan digeser */
  .tools { display: grid; grid-template-columns: repeat(11, 1fr); gap: 1px; overflow: visible; padding: 2px 4px; }
  .tools button { padding: 6px 0; font-size: .82rem; min-width: 0; text-align: center; border-radius: 6px; }
  .tools button[data-f="cariayat"], .tools button[data-f="carihadits"] { font-size: .55rem; }
  .ed-meta { padding: 4px 8px; }
  #eLabels { min-width: 120px; padding: 4px 8px; font-size: .85rem; }
  .ed-bottom { gap: 4px; padding: 5px 8px; padding-bottom: max(5px, env(safe-area-inset-bottom)); }
  .ed-bottom button { padding: 5px 6px; font-size: .78rem; }
  .ed-bottom .icon { padding: 4px 5px; }
  #eInfo { display: none; }
}

/* ---------- font Arab (disertakan di aplikasi, tanpa internet) ---------- */
@font-face { font-family: 'Amiri'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/amiri-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Amiri'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/amiri-arabic-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Scheherazade New'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/scheherazade-new-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Scheherazade New'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/scheherazade-new-arabic-700-normal.woff2) format('woff2'); }

.ar, .ar-inline { font-family: var(--ar-font), 'Noto Naskh Arabic', 'Geeza Pro', 'Traditional Arabic', serif; }
.ar-inline { font-size: 1.3em; line-height: 1.6; }
.ar-block { position: relative; margin: .7em 0; padding: 12px 16px 10px; background: var(--code); border-radius: 12px; border-right: 4px solid var(--primary); }
.ar-block.hadits { border-right-color: #2e7d32; }
.ar-block.arab { border-right-color: var(--muted); }
.ar-block .ar { font-size: var(--ar-size); line-height: 2.1; text-align: right; direction: rtl; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 28px; }
.ar-block.ayat .ar::before { content: "\FD3F\00A0"; }
.ar-block.ayat .ar::after { content: "\00A0\FD3E"; }
.ar-block .tr { margin-top: .5em; font-size: .95em; }
.ar-block figcaption { margin-top: .4em; font-size: .8rem; color: var(--muted); }
.ar-block figcaption::before { content: "— "; }
.ar-copy { position: absolute; left: 6px; top: 6px; border: 0; padding: 4px 8px; font-size: 15px; opacity: .5; }
.ar-copy:hover { opacity: 1; }

#arSet { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(440px, 92vw); box-shadow: 0 8px 30px rgba(0,0,0,.4); margin: auto; }
#arSet::backdrop { background: rgba(0,0,0,.5); }
.arset { display: grid; gap: 14px; padding: 18px; }
.arset h3 { margin: 0; }
.arset label { display: grid; gap: 6px; }
.arset select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

.arset .check { display: flex; align-items: center; gap: 8px; }
.arset input:not([type=checkbox]) { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.arset .small { font-size: 12px; margin: 0; }
.qs-act { display: flex; gap: 8px; justify-content: flex-end; }
#qsDlg .ar-block { margin: 0; }
#qsDlg .tr { white-space: pre-wrap; }
#qsDlg .ar-block { max-height: 150px; overflow: hidden; }
#qsDlg .ar-block .ar { font-size: 20px; line-height: 1.9; }
#qsDlg .tr { font-size: 13px; }

.ver { margin: 12px 4px 4px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--code); text-align: center; font-size: .7rem; line-height: 1.35; white-space: pre-line; font-variant-numeric: tabular-nums; }
.ver.warn { border-color: var(--danger); color: var(--danger); }

/* mode baca: hanya tayangan + tombol Edit */
#eEdit { display: none; flex: none; }
.ed.reading #eEdit { display: inline-block; }
.ed.reading .findbar, .ed.reading .tools, .ed.reading .ed-tabs, .ed.reading .ed-meta { display: none; }
.ed.reading #eBody { display: none; }
.ed.reading #eView { display: block; border-left: 0; }
.ed.reading .panes { grid-template-columns: 1fr; }
.ed.reading #eTitle { pointer-events: none; }
.ed-top #eTitle { flex: 1 1 0; min-width: 0; }
.ed-top button { flex: none; }

/* gambar */
.note .b img { display: block; width: 100%; max-height: 150px; object-fit: cover; }
#eView img { cursor: zoom-in; }
#imgBox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
#imgBox::backdrop { background: rgba(0, 0, 0, .8); }
#imgBig { display: block; max-width: 96vw; max-height: 94vh; border-radius: 6px; }
/* pengingat */
.rem { font-size: 12px; color: var(--muted, #667); margin-top: 6px; }
.rem.due { color: #b3261e; font-weight: 600; }
.rem-quick { display: flex; gap: 6px; flex-wrap: wrap; }

/* pencarian lanjutan */
.filters { margin: 0 0 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; }
.f-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.f-colors { display: flex; gap: 6px; }
.f-colors .dot { width: 26px; height: 26px; }
.f-line select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
.f-has button { padding: 5px 10px; font-size: 13px; }
.f-has button.on, .f-colors .dot.on { outline: 2px solid var(--primary); outline-offset: 1px; }
.f-has button.on { background: color-mix(in srgb, var(--primary) 14%, transparent); border-color: var(--primary); }
.f-tips { margin: 0; line-height: 1.7; }
.f-tips code { background: rgba(127, 127, 127, .16); border-radius: 4px; padding: 0 4px; }
#resCount { margin: 0 0 8px; }
mark { background: rgba(255, 200, 0, .5); color: inherit; border-radius: 3px; padding: 0 1px; }
.f-colors .dot.c-yellow { background: var(--c-yellow); } .f-colors .dot.c-green { background: var(--c-green); } .f-colors .dot.c-blue { background: var(--c-blue); }
.f-colors .dot.c-pink { background: var(--c-pink); } .f-colors .dot.c-purple { background: var(--c-purple); } .f-colors .dot.c-orange { background: var(--c-orange); } .f-colors .dot.c-gray { background: var(--c-gray); }

/* keuangan */
.fin { max-width: 720px; margin: 0 auto; display: grid; gap: 10px; }
.fin-nav { display: flex; align-items: center; justify-content: center; gap: 10px; }
.fin-nav strong { min-width: 9em; text-align: center; }
.fin-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fin-card { background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 10px; display: grid; gap: 2px; min-width: 0; }
.fin-card span { font-size: .75rem; color: var(--muted); }
.fin-card b { font-size: 1rem; overflow-wrap: anywhere; }
.fin-card.in b, .tx-amt.in { color: #2e7d32; }
.fin-card.out b, .tx-amt.out { color: var(--danger); }
@media (prefers-color-scheme: dark) { .fin-card.in b, .tx-amt.in { color: #7fd48a; } }
.fin-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fin-filter select, .fin-filter + * select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 7px 12px; background: var(--surface); }
.seg button.on { background: var(--primary); color: var(--primary-text); }
.fin-h { margin: 10px 0 0; font-size: .95rem; }
.fin-cats { display: grid; gap: 6px; }
.fin-cat { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: .9rem; }
.fin-cat progress { grid-column: 1 / -1; width: 100%; height: 8px; }
.tx-day { font-size: .8rem; color: var(--muted); margin: 10px 0 4px; }
.tx { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; width: 100%; text-align: left; background: var(--surface); box-shadow: var(--shadow); border: 0; border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; }
.tx-main { min-width: 0; overflow-wrap: anywhere; }
.tx-sub { grid-column: 1; font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.tx-amt { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 600; white-space: nowrap; }
.fin-recap { width: 100%; border-collapse: collapse; font-size: .85rem; }
.fin-recap th, .fin-recap td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.fin-recap th:first-child, .fin-recap td:first-child { text-align: left; }
.fin-act { display: flex; gap: 8px; flex-wrap: wrap; }
.fin-tips pre { background: var(--code); padding: 8px; border-radius: 8px; overflow-x: auto; font-size: .8rem; }
.fin-tbl { border-collapse: collapse; font-size: .9em; }
.fin-tbl th, .fin-tbl td { border: 1px solid var(--line); padding: 3px 8px; }
#txDlg { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(440px, 92vw); box-shadow: 0 8px 30px rgba(0,0,0,.4); margin: auto; }
#txDlg::backdrop { background: rgba(0,0,0,.5); }
#txDlg .seg { display: flex; }
#txDlg .seg button { flex: 1; }
#txDlg input[type=date] { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
#txChips .chip { border: 0; cursor: pointer; }
.fin { padding-bottom: 90px; }
.fin-card b { font-size: .95rem; }

#helpDlg { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, 94vw); max-height: 88vh; box-shadow: 0 8px 30px rgba(0,0,0,.4); margin: auto; }
#helpDlg::backdrop { background: rgba(0,0,0,.5); }
.help details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.help summary { font-weight: 600; cursor: pointer; padding: 4px 0; }
.help p { margin: 6px 0; font-size: .92rem; }
.help pre { background: var(--code); padding: 8px; border-radius: 8px; overflow-x: auto; font-size: .8rem; margin: 6px 0; }
.fin-tbl { display: block; max-width: 100%; overflow-x: auto; }
.fin-tbl th, .fin-tbl td { white-space: nowrap; }

/* hadits arba'in */
#hdDlg { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, 94vw); max-height: 92vh; box-shadow: 0 8px 30px rgba(0,0,0,.4); margin: auto; }
#hdDlg::backdrop { background: rgba(0,0,0,.5); }
.hd-list { display: grid; gap: 1px; max-height: 26vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.hd-list:empty { display: none; }
.hd-list button { text-align: left; border: 0; border-radius: 6px; padding: 5px 9px; font-size: .86rem; line-height: 1.3; }
.hd-list button.sel { background: var(--code); font-weight: 600; }
#hdDlg .ar-block { margin: 0; max-height: 34vh; overflow: auto; }
#hdDlg .ar-block .ar { font-size: 20px; line-height: 1.9; }
#hdDlg .tr { white-space: pre-wrap; font-size: 13px; }

.auto-title { pointer-events: none; color: var(--muted); text-overflow: ellipsis; }

.qs-list { max-height: 30vh; }
.ed-bottom .icon { padding: 5px 7px; font-size: 1rem; }

/* cetak / PDF */
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing { background: #fff !important; color: #000 !important; }
  body.printing #printArea { display: block !important; max-width: none; padding: 0; margin: 0; font-size: 12pt; color: #000; }
  body.printing #printArea pre, body.printing #printArea .ar-block { break-inside: avoid; }
  body.printing #printArea img { max-width: 100%; break-inside: avoid; }
  body.printing #printArea a { color: #000; text-decoration: underline; }
}
@page { margin: 16mm; }

/* cari / ganti */
.findbar { display: grid; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--code); }
.findbar.hidden { display: none; }
.findbar .fr { display: flex; gap: 4px; align-items: center; }
.findbar input { flex: 1 1 0; width: 0; min-width: 0; padding: 6px 8px; font-size: .9rem; }
.findbar button { padding: 6px 8px; flex: none; font-size: .85rem; }
.findbar button.on { background: var(--primary); color: #fff; }
