:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #f7931a;
  --long: #0f9d58;
  --short: #d93025;
  --wait: #6b7280;
  --warn-bg: #fff7e6;
  --warn-text: #8a5300;
  --err-bg: #fdecea;
  --err-text: #a1251b;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #181b21;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --line: #2a2e36;
    --warn-bg: #2b2210;
    --warn-text: #f3c26b;
    --err-bg: #2d1514;
    --err-text: #f28b82;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
h1 { font-size: 18px; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
h1 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
h2 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.row .k { color: var(--muted); }
.row .v { font-variant-numeric: tabular-nums; text-align: right; }
.big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 13px; }
.pos { color: var(--long); } .neg { color: var(--short); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; color: #fff; }
.badge.LONG { background: var(--long); } .badge.SHORT { background: var(--short); }
.badge.WAIT, .badge.HOLD { background: var(--wait); } .badge.CLOSE { background: var(--short); }
.badge.ADJUST { background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.block { border-color: var(--short); color: var(--short); }
.chip.wait { border-color: var(--accent); color: var(--accent); }
.note { border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.note.warn { background: var(--warn-bg); color: var(--warn-text); }
.note.err { background: var(--err-bg); color: var(--err-text); }
ul { margin: 6px 0; padding-left: 18px; }
li { margin: 3px 0; }
button {
  font: inherit; border: 0; border-radius: 12px; padding: 14px; width: 100%;
  background: var(--accent); color: #111; font-weight: 700; cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }
button.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 8px; width: auto; }
input {
  font: inherit; width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); margin: 6px 0 10px;
}
label { font-size: 13px; color: var(--muted); }
.hidden { display: none !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.history-item { border-top: 1px solid var(--line); padding: 8px 0; }
.history-item:first-child { border-top: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.qr { display: block; margin: 8px auto; width: 220px; height: 220px; background: #fff; border-radius: 8px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.topbar { display: flex; justify-content: space-between; align-items: center; }
.button-link { display: block; text-align: center; text-decoration: none; border-radius: 12px; padding: 14px;
  background: var(--accent); color: #111; font-weight: 700; margin: 8px 0; }
.mono#secret { font-size: 15px; padding: 8px 0; }
label.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; color: var(--text); }
label.check input { width: auto; margin: 3px 0 0; }
