:root {
  --bg: #101214;
  --panel: #191c20;
  --line: #2a2f35;
  --text: #e6e8ea;
  --dim: #8a929b;
  --on: #5fd38d;
  --wait: #f2c14e;
  --off: #ff6b6b;
  --accent: #4ea8ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
h1 { font-size: 20px; margin: 0; letter-spacing: .04em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 13px; border: 1px solid currentColor; cursor: default; }
.pill.on { color: var(--on); } .pill.wait { color: var(--wait); } .pill.off { color: var(--off); }
main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding: 16px; }
.board-box { min-height: 0; display: flex; align-items: center; justify-content: center; }
#board { width: 100%; height: 100%; max-height: calc(100vh - 90px); aspect-ratio: 1; }
.side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.card.grow { flex: 1; min-height: 160px; display: flex; flex-direction: column; }
.row { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
input { flex: 1; min-width: 0; background: #0c0e10; color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; font: inherit; }
button { background: #252a30; color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; font: inherit; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
.small-btn { padding: 2px 8px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.visit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot { border: 1px dashed var(--line); border-radius: 6px; padding: 8px 4px; text-align: center; min-height: 58px; }
.slot.hit { border: 1px solid var(--accent); }
.slot b { display: block; font-size: 22px; }
.slot span { font-size: 12px; color: var(--dim); }
.total { margin-top: 8px; text-align: right; color: var(--dim); }
.total b { color: var(--text); font-size: 20px; }
.dim { color: var(--dim); } .small { font-size: 12px; }
.hint { color: var(--wait); font-size: 12px; margin: 4px 0 0; }
.code { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .12em; color: var(--accent); }
.log { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0 0 0 4px; list-style: none; font: 12px/1.5 ui-monospace, monospace; }
.log li.dart { color: var(--text); } .log li.fix { color: var(--wait); } .log li.takeout { color: var(--accent); } .log li.status { color: var(--dim); }
.raw { max-height: 160px; overflow: auto; font-size: 11px; background: #0c0e10; padding: 6px; border-radius: 4px; white-space: pre-wrap; word-break: break-all; }
p { margin: 4px 0; }
@media (max-width: 820px) {
  main { grid-template-columns: 1fr; }
  #board { max-height: 70vw; }
}
