:root {
  --bg: #080808;
  --panel: #0e0e0e;
  --panel-2: #121212;
  --fg: #efefef;
  --muted: #8a8a8a;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.06);
  --brand: #b8954a;
  --brand-dim: rgba(184, 149, 74, 0.14);
  --tinggi: #f0564f;
  --sedang: #e0913a;
  --rendah: #d8c24a;
  --aman: #3fb57e;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a { color: var(--brand); }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px 80px; }

/* Header */
header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(184, 149, 74, 0.05), transparent);
}
.head-inner { max-width: 920px; margin: 0 auto; padding: 28px 16px 22px; }
.eyebrow {
  font-size: 11px; letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 10px;
}
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h1 .dot { color: var(--brand); }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 60ch; }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(8, 8, 8, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 920px; margin: 0 auto; padding: 8px 12px; display: flex; gap: 2px; overflow-x: auto; }
.nav-inner button {
  flex: 0 0 auto; background: none; border: none; color: var(--muted);
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 10px 14px; cursor: pointer; border-radius: 8px;
  white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.nav-inner button:hover { color: var(--fg); }
.nav-inner button[aria-current="true"] { color: var(--bg); background: var(--brand); }

/* Views */
.view { display: none; padding-top: 26px; }
.view.active { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h2 { font-size: 18px; margin: 0 0 4px; font-weight: 700; }
.section-desc { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 14px; letter-spacing: 0.02em;
  border-radius: 12px; padding: 13px 18px; cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--brand); color: #1a1403; border-color: var(--brand); width: 100%; }
.btn-primary:hover { background: #c9a558; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 9px; }

/* Permission + notice banners */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
  background: var(--panel); font-size: 13.5px;
}
.banner.warn { border-color: rgba(224, 145, 58, 0.4); background: rgba(224, 145, 58, 0.08); }
.banner .ico { font-size: 18px; line-height: 1.2; }
.banner p { margin: 0 0 8px; color: var(--muted); }
.banner strong { color: var(--fg); }
.banner .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Summary */
.summary {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 22px;
  background: linear-gradient(180deg, var(--panel), var(--bg));
}
.summary .verdict { display: flex; align-items: center; gap: 14px; }
.verdict .badge {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px;
}
.verdict h3 { margin: 0; font-size: 19px; }
.verdict p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip {
  font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.chip b { margin-right: 5px; }

/* Finding groups */
.group { margin-bottom: 24px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.group-head h3 { margin: 0; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.group-head .meta { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.card {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px;
  padding: 13px 15px; margin-bottom: 9px; background: var(--panel);
}
.card.lv-tinggi { border-left-color: var(--tinggi); }
.card.lv-sedang { border-left-color: var(--sedang); }
.card.lv-rendah { border-left-color: var(--rendah); }
.card.lv-aman { border-left-color: var(--line); opacity: 0.82; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { font-weight: 700; font-size: 15px; word-break: break-word; }
.card-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.lvl {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
}
.lvl-tinggi { background: rgba(240, 86, 79, 0.16); color: var(--tinggi); }
.lvl-sedang { background: rgba(224, 145, 58, 0.16); color: var(--sedang); }
.lvl-rendah { background: rgba(216, 194, 74, 0.16); color: var(--rendah); }
.lvl-aman { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.reasons { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.reasons li { font-size: 13px; color: #cfcfcf; padding-left: 16px; position: relative; }
.reasons li::before { content: "›"; position: absolute; left: 2px; color: var(--brand); }

.empty { color: var(--muted); font-size: 13px; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.spinner-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 10px 0; }
.spin { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: rot 0.7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* IR camera */
.cam-stage { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.cam-stage video, .cam-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-stage canvas { pointer-events: none; }
.cam-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }
.cam-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.cam-controls select { background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-family: var(--sans); font-size: 13px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--brand); width: 16px; height: 16px; }

/* Steps / guide */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: s; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 52px; position: relative; background: var(--panel); }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-dim); color: var(--brand); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.steps h4 { margin: 0 0 4px; font-size: 15px; }
.steps p { margin: 0; color: var(--muted); font-size: 13.5px; }
.tip { margin-top: 7px !important; color: #b9975a !important; font-size: 12.5px !important; }

.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spot { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); }
.spot h4 { margin: 0 0 4px; font-size: 14px; color: var(--brand); }
.spot p { margin: 0; font-size: 13px; color: var(--muted); }

/* Checklist */
.check-group { margin-bottom: 20px; }
.check-group h3 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.check-item { display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; background: var(--panel); cursor: pointer; }
.check-item input { margin-top: 2px; accent-color: var(--brand); width: 17px; height: 17px; flex: 0 0 auto; }
.check-item.done { opacity: 0.55; }
.check-item.done .ci-label { text-decoration: line-through; }
.ci-label { font-size: 14px; }
.ci-hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.progress-bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0 20px; }
.progress-bar > div { height: 100%; background: var(--brand); transition: width 0.3s; }

/* Report */
.report-box { border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--panel); font-size: 14px; }
.report-box h3 { margin: 0 0 4px; }
.report-box .rb-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line-2); padding: 9px 0; gap: 12px; }
.report-box .rb-row:last-child { border-bottom: none; }
.report-box textarea { width: 100%; min-height: 90px; background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 11px; font-family: var(--sans); font-size: 14px; resize: vertical; }

.disclaimer { margin-top: 30px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 36px; }

@media (max-width: 560px) {
  .guide-grid { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
}

/* Print (for the report) */
@media print {
  nav, header .eyebrow, .btn, .nav-inner, .disclaimer, footer { display: none !important; }
  body { background: #fff; color: #000; }
  .view { display: none !important; }
  #print-area { display: block !important; }
}
#print-area { display: none; }

/* Screen-reader-only text (used in the h1); missing from the Mac app's stylesheet. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
