:root {
  --crimson: #BA1C44; --yellow: #FFDD00; --ink: #3a3a3a; --grey: #6b6b6b;
  --bg: #f7f7f7; --line: #e4e4e4; --surface: #ffffff; --surface2: #efefef;
  --green: #2e7d32; --green-bg: #eef7ee; --amber: #c77700; --amber-bg: #fff4dc;
  --red: #d32f2f; --link: #1565c0; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e8e8; --grey: #9a9aa2; --bg: #131316; --line: #3a3a42; --surface: #1e1e22; --surface2: #2a2a30;
    --green: #6abf6e; --green-bg: #1d2b1e; --amber: #f0b44a; --amber-bg: #3a2e14; --red: #ff6b6b; --link: #8ab4ff;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--bg); color: var(--ink); }
button { color: inherit; font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; background: var(--surface); color: var(--ink); }
a { color: var(--link); }
.hidden { display: none !important; }
.brand { font-weight: 800; color: var(--crimson); }
.brand span { color: var(--ink); }

/* login */
#login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 20px; }
#login h1 { font-size: 28px; }
.namegrid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 480px; }
.namegrid button { padding: 12px 20px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 700; font-size: 16px; }
.namegrid button.sel { border-color: var(--crimson); background: var(--crimson); color: #fff; }
.pinrow { display: flex; gap: 12px; }
.pindot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--grey); }
.pindot.full { background: var(--crimson); border-color: var(--crimson); }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pad button { height: 62px; font-size: 24px; font-weight: 700; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pad button:active { background: var(--yellow); color: #3a3a3a; }
#loginErr { color: var(--crimson); font-weight: 700; min-height: 22px; }

.plate { display: inline-block; background: var(--yellow); color: #111; font-weight: 800; letter-spacing: 1px;
  border-radius: 5px; padding: 3px 8px; font-family: 'Charles Wright', 'Plus Jakarta Sans', sans-serif; white-space: nowrap; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface2); color: var(--grey); }
.chip.ok { background: var(--green-bg); color: var(--green); }
.chip.warn { background: var(--amber-bg); color: var(--amber); }
.chip.bad { background: #fde8ec; color: var(--crimson); }
.btn { border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 800; font-size: 16px; background: var(--surface2); }
.btn.primary { background: var(--crimson); color: #fff; }
.btn.ghost { background: transparent; border: 2px solid var(--line); }
.btn:disabled { opacity: .5; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 12px 18px;
  border-radius: 10px; font-weight: 700; z-index: 99; max-width: calc(100% - 32px); text-align: center; }

/* still with damage boxes */
.still { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.still img { display: block; width: 100%; height: auto; }
.still .lbl { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.box { position: absolute; border: 3px dashed #ffb300; border-radius: 6px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.box.confirmed { border: 3px solid #ff3b3b; }
.box.dismissed { display: none; }
.box .n { position: absolute; top: -12px; left: -12px; background: #ffb300; color: #111; font-size: 11px; font-weight: 800;
  width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.box.confirmed .n { background: #ff3b3b; color: #fff; }
