* { box-sizing: border-box; }
html, body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #e8eef3; background: #14202b; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0; } h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: #9fb0bf; } .small { font-size: 13px; } .err { color: #ff8a80; min-height: 1em; }
.card { background: #1d2c3a; border-radius: 12px; padding: 14px; margin: 12px 0; }
.card.warn { background: #4a3a14; } .card.bad { background: #4a1f1f; }
label { display: block; margin: 8px 0; font-size: 14px; color: #c5d2dd; }
input { display: block; width: 100%; margin-top: 4px; padding: 12px; font-size: 16px; border-radius: 8px; border: 1px solid #3a4c5d; background: #0f1922; color: #fff; }
button { font: inherit; border: 0; border-radius: 10px; padding: 12px 14px; background: #2d4256; color: #fff; cursor: pointer; }
button:disabled { opacity: .4; }
button.primary { background: #2f7de1; } button.big { width: 100%; padding: 16px; font-size: 18px; margin-top: 8px; }
button.danger { background: #8b2c2c; } button.ghost { background: transparent; border: 1px solid #3a4c5d; }
.seg { display: flex; gap: 6px; margin: 10px 0; } .seg button { flex: 1; background: #263849; } .seg button.on { background: #2f7de1; }
.list .item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid #2a3b4b; }
.list .item:first-child { border-top: 0; } .list a { color: #8cc4ff; text-decoration: none; }

/* AR overlay */
#ar { position: fixed; inset: 0; color: #fff; font-size: 16px; pointer-events: none; user-select: none; }
#ar button, #ar #sheet { pointer-events: auto; }
#top { position: absolute; top: 0; left: 0; right: 0; padding: 12px 14px 10px; background: linear-gradient(#000b, #0000); }
#status { font-size: 19px; font-weight: 600; text-shadow: 0 1px 3px #000; } #sub { font-size: 14px; opacity: .9; text-shadow: 0 1px 3px #000; min-height: 1.2em; }
#chips { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; } #chips span { background: #0008; border-radius: 99px; padding: 2px 10px; font-size: 13px; }
#chips span:empty { display: none; } #chips .bad { background: #c62828; }
#cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 3px #000; }
#cross::after { content: ""; position: absolute; left: 8px; top: 8px; width: 2px; height: 2px; background: #fff; border-radius: 50%; }
#ring { position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; margin: -120px 0 0 -120px; }
#arrowWrap { position: absolute; left: 50%; top: 58%; width: 140px; margin-left: -70px; text-align: center; }
#arrow { width: 0; height: 0; margin: 0 auto; border-left: 34px solid transparent; border-right: 34px solid transparent; border-bottom: 70px solid #2fe1a0; filter: drop-shadow(0 2px 3px #000); transition: transform .12s linear; }
#dist { margin-top: 8px; font-size: 22px; font-weight: 700; text-shadow: 0 1px 4px #000; }
#toast { position: absolute; left: 12px; right: 12px; top: 38%; text-align: center; background: #000c; border-radius: 12px; padding: 12px; font-size: 17px; }
#toast.bad { background: #b71c1cdd; }
#actions { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 8px; background: linear-gradient(#0000, #000a); }
#actions button { flex: 1 1 40%; padding: 15px 8px; font-size: 16px; background: #000a; border: 1px solid #fff5; }
#actions button.primary { background: #2f7de1; border-color: #2f7de1; } #actions button.go { background: #1f9d6b; border-color: #1f9d6b; }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82%; overflow: auto; background: #14202bf2; border-radius: 16px 16px 0 0; padding: 14px 12px calc(16px + env(safe-area-inset-bottom)); }
#sheet h3 { margin: 0 0 8px; font-size: 18px; }
.grid { display: grid; gap: 6px; margin: 6px 0; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g6 { grid-template-columns: repeat(6, 1fr); }
.grid button { padding: 13px 0; background: #263849; } .grid button.on { background: #2f7de1; }
.readout { font-size: 30px; font-weight: 700; text-align: center; padding: 6px; background: #0f1922; border-radius: 10px; }
.row { display: flex; gap: 8px; margin-top: 10px; } .row button { flex: 1; }
.lbl { font-size: 13px; color: #9fb0bf; margin-top: 8px; }
