:root {
  color-scheme: light dark;
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #e3e7ec;
  --line-2: #eef1f5;
  --ink: #131720;
  --ink-2: #5a6674;
  --ink-3: #8d98a6;
  --accent: #2563c9;
  --accent-2: #e8f0fd;
  --accent-ink: #ffffff;
  --pass: #1c7a4d;   --pass-bg: #e3f4ea;
  --already: #8a5a08; --already-bg: #fcf1d8;
  --fail: #b4272b;   --fail-bg: #fceaea;
  --skip: #8d98a6;   --skip-bg: #eef1f5;
  --r: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --bar: 58px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101318;
    --panel: #171b22;
    --panel-2: #1d222a;
    --line: #272d37;
    --line-2: #21262e;
    --ink: #e7ebf0;
    --ink-2: #9fabb9;
    --ink-3: #6d7986;
    --accent: #5093f0;
    --accent-2: #17263d;
    --pass: #5fd39a;   --pass-bg: #122c20;
    --already: #e8c05a; --already-bg: #2e2711;
    --fail: #f38080;   --fail-bg: #331b1b;
    --skip: #6d7986;   --skip-bg: #21262e;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom, 0px));
}
a { color: var(--accent); }

/* ── kepala ────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header .brand { font-weight: 700; font-size: 16px; letter-spacing: -0.015em; }
header .brand small { font-weight: 400; font-size: 12px; color: var(--ink-3); margin-left: 7px; }
main { max-width: 760px; margin: 0 auto; padding: 12px 12px 28px; }

/* ── menu bawah ────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; height: var(--bar);
  text-decoration: none; color: var(--ink-3);
  font-size: 11px; font-weight: 500; letter-spacing: .01em;
}
.tabbar a .ic { font-size: 17px; line-height: 1; }
.tabbar a.on { color: var(--accent); }

/* ── seksi & grup ──────────────────────────────────────────── */
.seksi {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 4px 7px;
}
.seksi h2 {
  margin: 0; font-size: 12px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
}
.grup {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.grup + .grup { margin-top: 10px; }

/* ── baris ─────────────────────────────────────────────────── */
.baris {
  position: relative;
  display: block; width: 100%; text-align: left;
  padding: 11px 13px 11px 17px;
  color: inherit; text-decoration: none;
  background: none; border: 0; border-top: 1px solid var(--line-2);
  font: inherit; cursor: pointer;
}
.baris:first-child { border-top: 0; }
.baris::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--tanda, transparent);
}
.baris:hover { background: var(--panel-2); }
.baris.diam { cursor: default; }
.baris.diam:hover { background: none; }
.t-PASS { --tanda: var(--pass); }
.t-ALREADY, .t-UNKNOWN { --tanda: var(--already); }
.t-FAIL, .t-ERROR { --tanda: var(--fail); }
.t-SKIP, .t-ANTRE, .t-JALAN { --tanda: var(--skip); }

.baris .atas { display: flex; align-items: center; gap: 8px; }
.baris .nama { font-weight: 600; font-size: 14.5px; letter-spacing: -.005em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baris .kanan { margin-left: auto; flex: none; display: flex; align-items: center; gap: 8px; }
.baris .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.baris .catatan {
  font-size: 12.5px; color: var(--ink-2); margin-top: 5px;
  font-family: var(--mono); word-break: break-word;
  background: var(--panel-2); padding: 6px 8px; border-radius: 7px;
}
.baris .aksi { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }

/* ── lencana ───────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.s-PASS { background: var(--pass-bg); color: var(--pass); }
.s-ALREADY, .s-UNKNOWN { background: var(--already-bg); color: var(--already); }
.s-FAIL, .s-ERROR { background: var(--fail-bg); color: var(--fail); }
.s-SKIP, .s-ANTRE, .s-JALAN { background: var(--skip-bg); color: var(--ink-2); }

/* ── kendali ───────────────────────────────────────────────── */
button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 550;
  padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink); cursor: pointer;
  text-decoration: none; display: inline-block; text-align: center;
}
button:hover, .btn:hover { border-color: var(--ink-3); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.primary:hover { filter: brightness(1.08); }
button.lebar { width: 100%; padding: 13px; font-size: 15px; border-radius: 11px; }
button.sm, .btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
button.link { border: 0; background: none; color: var(--accent); padding: 4px 2px; font-size: 13px; }

input, select, textarea {
  font: inherit; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: var(--accent); }
textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; min-height: 52vh; resize: vertical; }
label { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin: 0 0 5px; }
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.isi { padding: 13px; }
.isi + .isi { border-top: 1px solid var(--line-2); }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--panel); font-size: 13px; cursor: pointer; user-select: none;
}
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ── langkah ───────────────────────────────────────────────── */
.step { display: flex; gap: 10px; padding: 10px 13px; border-top: 1px solid var(--line-2); }
.step:first-child { border-top: 0; }
.step .icon { width: 18px; text-align: center; font-weight: 700; flex: none; }
.step .body { min-width: 0; flex: 1; }
.step .name { font-weight: 600; font-size: 14px; }
.step .act { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); word-break: break-word; }
.step .det { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; word-break: break-word; }
.step .drift { font-size: 12.5px; color: var(--already); margin-top: 3px; }
.step .ms { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.i-PASS { color: var(--pass); } .i-ALREADY { color: var(--already); }
.i-FAIL, .i-ERROR { color: var(--fail); } .i-SKIP { color: var(--skip); }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.shots a { display: block; text-decoration: none; }
.shots img { width: 100%; border: 1px solid var(--line); border-radius: 8px; display: block; background: var(--panel-2); }
.shots span { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

/* ── peta & pratinjau ──────────────────────────────────────── */
#map { height: 260px; border-radius: 10px; border: 1px solid var(--line); z-index: 1; }
.readout { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.readout b { color: var(--ink); font-weight: 600; }
.pratinjau { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.pratinjau img { width: 100%; display: block; }
.tanda { position: absolute; border: 2px solid; border-radius: 3px; pointer-events: none; }
.tanda span { position: absolute; left: -1px; top: -15px; font: 600 10px/14px var(--mono); color: #fff; padding: 0 4px; border-radius: 3px; }

/* ── pesan ─────────────────────────────────────────────────── */
.log { font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding: 2px 0; }
.log.warn { color: var(--already); }
.kosong { text-align: center; color: var(--ink-3); padding: 30px 16px; font-size: 14px; }
.err { background: var(--fail-bg); color: var(--fail); padding: 10px 13px; border-radius: 9px; font-size: 13.5px; margin-bottom: 10px; }
.note {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--already);
  padding: 10px 12px; border-radius: 0 9px 9px 0; font-size: 13px; color: var(--ink-2); margin-bottom: 10px;
}
.note.baik { border-left-color: var(--pass); }
.spin { display: inline-block; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ── kelas lama yang masih dipakai perekam ─────────────────────
   Wizard itu halaman formulir, bukan daftar; kartu memang bentuk yang tepat
   di sana. Yang perlu disamakan bukan strukturnya, melainkan rupanya. */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px; margin-bottom: 10px;
}
.card h2 { margin: 0 0 3px; font-size: 16px; letter-spacing: -.015em; }
.card .sub { color: var(--ink-3); font-size: 12.5px; margin-bottom: 8px; word-break: break-all; }
.card > label:first-child { margin-bottom: 8px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px;
}
.item:hover { border-color: var(--ink-3); }
.item .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.item .why { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; font-family: var(--mono); word-break: break-word; }
