/* Mobile-first. Satu kolom, tombol besar, status lewat warna + teks (tidak cuma warna). */
:root {
  --bg: #f4f6f5; --card: #ffffff; --fg: #17201c; --muted: #5e6b65; --line: #dde3e0;
  --accent: #116a57; --accent-fg: #ffffff;
  --red: #c2352b; --red-soft: #fbe9e7; --yellow: #a06a00; --yellow-soft: #fbf1db; --green: #1d7a45; --green-soft: #e3f3e9;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412; --card: #161e1b; --fg: #e4ebe7; --muted: #95a39c; --line: #26312d;
    --accent: #4fc3a3; --accent-fg: #06211a;
    --red: #ff7a6e; --red-soft: #3a1714; --yellow: #f0be5a; --yellow-soft: #33280f; --green: #6fd39a; --green-soft: #12301f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
a { color: var(--accent); }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); letter-spacing: -.01em; }
.bar nav { display: flex; gap: 4px; align-items: center; }
.bar nav a { text-decoration: none; padding: 8px 10px; font-size: 14px; }
main { max-width: 640px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px; }
h1 { font-size: 22px; margin: 4px 0 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 8px 0 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.acc { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 64px; }
.acc:active { transform: scale(.99); }
.acc .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .sub { grid-column: 2; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .right { grid-row: 1 / span 2; grid-column: 3; text-align: right; font-variant-numeric: tabular-nums; }
.dot { grid-row: 1 / span 2; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.dot.red { background: var(--red); } .dot.yellow { background: var(--yellow); } .dot.off { background: var(--line); }
.pos { color: var(--green); } .neg { color: var(--red); }
.banner { border-radius: var(--radius); padding: 14px 16px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.banner.ok { background: var(--green-soft); color: var(--green); }
.banner.red { background: var(--red-soft); color: var(--red); }
.banner.yellow { background: var(--yellow-soft); color: var(--yellow); }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--fg); }
.chip.red { background: var(--red-soft); color: var(--red); } .chip.yellow { background: var(--yellow-soft); color: var(--yellow); }
.chip.green { background: var(--green-soft); color: var(--green); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.steps { display: flex; gap: 3px; } .steps i { flex: 1; height: 8px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); } .steps i.hot { background: var(--yellow); } .steps i.max { background: var(--red); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input, select { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; min-height: 48px; width: 100%; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 1px; }
button { font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 12px 16px; min-height: 48px; cursor: pointer;
  background: var(--accent); color: var(--accent-fg); }
button.ghost { background: transparent; color: var(--fg); min-height: 40px; padding: 8px 10px; font-weight: 500; font-size: 14px; }
button.danger { background: var(--red); color: #fff; }
button.soft { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .wide { grid-column: 1 / -1; }
.row { display: flex; gap: 8px; } .row > * { flex: 1; }
.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 999px; padding: 14px 20px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.ev { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qr { background: #fff; border-radius: 12px; align-self: center; line-height: 0; width: min(240px, 100%); }
.qr svg { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
code, .mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.copy { display: flex; gap: 8px; align-items: center; } .copy code { flex: 1; background: var(--bg); padding: 10px; border-radius: 8px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.err { color: var(--red); font-size: 14px; }
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { background: var(--card); width: 100%; max-width: 640px; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; gap: 16px;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
