:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2129; --muted: #5b6270; --line: #d9dde3;
  --accent: #0f62ac; --accent-soft: #e8f1fb; --ok: #18794e; --ok-soft: #e7f6ee;
  --warn: #a4400c; --warn-soft: #fff4ec; --warn-line: #f3c6a5; --danger: #b42318;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, "Segoe UI", Roboto, Arial, sans-serif; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.atas { background: var(--accent); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 0 12px; position: sticky; top: 0; z-index: 5; }
.atas .wrap { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.atas h1 { font-size: 17px; margin: 0; }
.badge { background: rgba(255,255,255,.18); border-radius: 99px; padding: 2px 10px; font-weight: 600; font-size: 13px; }
main { padding-top: 12px !important; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
label { display: block; font-weight: 600; color: var(--muted); margin: 10px 0 0; font-size: 14px; }
.panel > label:first-child { margin-top: 0; }
input, textarea, select {
  display: block; width: 100%; margin-top: 4px; font: 16px/1.4 system-ui, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
button {
  font: 600 15px system-ui, "Segoe UI", Roboto, Arial, sans-serif; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 8px; padding: 10px 14px; min-height: 44px; cursor: pointer;
}
button:disabled { opacity: .5; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button.kedua { background: #fff; color: var(--accent); }
button.halus { background: #fff; color: var(--accent); border-color: var(--line); padding: 6px 12px; min-height: 40px; }
button.bahaya { background: #fff; color: var(--danger); border-color: #f1b5ae; margin-top: 10px; }
button.utama { font-size: 16px; padding: 12px; }
button.penuh { width: 100%; }
.baris-tombol { display: flex; gap: 8px; margin-top: 10px; }
.baris-tombol button { flex: 1; }
.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiga { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--muted); font-weight: 400; }
.kecil { font-size: 13px; margin: 8px 0 0; }
.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.warn ul { margin: 4px 0 0 18px; padding: 0; }
.kartu { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; margin-bottom: 12px; }
.kartu.baru { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.kepala { display: flex; align-items: center; gap: 6px; }
.kepala b { flex: 1; }
.kepala button { min-height: 36px; padding: 4px 10px; }
.foto-baris { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.thumb { position: relative; width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb button { position: absolute; top: 3px; right: 3px; min-height: 28px; padding: 0 8px; background: rgba(255,255,255,.95); color: var(--danger); border-color: #f1b5ae; font-size: 14px; }
.ambil-foto { width: 92px; height: 92px; border: 1.5px dashed #b8c0cc; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin: 0; padding: 6px; cursor: pointer; }
.ambil-foto input { display: none; }
.judul-asli { font-size: 12px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.salin-baris { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.salin-baris:last-of-type { border-bottom: 0; }
details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.judul-bar { margin-bottom: 8px; }
.mail { border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; background: #fff; }
.mail img { max-width: 100%; height: auto !important; }
.kosong { text-align: center; color: var(--muted); padding: 22px 12px; background: var(--card); border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 12px; }
.bawah-lekat { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(244,245,247,.96); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 5; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: #1d2129; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; max-width: calc(100% - 32px); z-index: 10; }
[hidden] { display: none !important; }
