:root { color-scheme: light dark; }
* { box-sizing: border-box; }
body {
  font-family: system-ui, sans-serif; margin: 0; padding: 0;
  background: #0f1115; color: #e7e9ee;
  -webkit-user-select: none; user-select: none;
}
header {
  padding: .8rem 1rem; background: #171a21; border-bottom: 1px solid #262a33;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
header .title { font-weight: 700; }
header .device { color: #8b90a0; font-size: .85rem; }
header .device.unset { color: #e0a03a; }
main { padding: 1rem; max-width: 640px; margin: 0 auto; }

.flash {
  background: #171a21; border: 1px solid #262a33; border-radius: 14px;
  padding: 1.4rem 1rem; text-align: center; margin-bottom: 1rem;
  transition: background .12s, border-color .12s;
}
.flash.hit { background: #14351f; border-color: #2f7d4f; }
.flash .code { font-size: 1.8rem; font-weight: 700; word-break: break-all; }
.flash .code.idle { color: #8b90a0; font-size: 1.1rem; font-weight: 500; }
.flash .cnt { color: #5ed39a; font-size: 1rem; margin-top: .3rem; min-height: 1.2em; }

.total { text-align: center; margin-bottom: 1rem; }
.total .n { font-size: 2rem; font-weight: 700; }
.total .l { color: #8b90a0; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #262a33; }
th { color: #8b90a0; font-size: .72rem; text-transform: uppercase; }
td.num { text-align: right; font-weight: 600; }
td.empty { color: #8b90a0; font-style: italic; }

.row { display: flex; gap: .6rem; margin-top: 1rem; }
button {
  flex: 1; padding: .9rem; font-size: 1rem; font-weight: 600; border: 0;
  border-radius: 12px; cursor: pointer; color: #fff;
}
button.sync { background: #ff9532; }
button:active { filter: brightness(.85); }

.status { margin-top: .8rem; text-align: center; font-size: .88rem; min-height: 1.3em; }
.status.ok { color: #5ed39a; }
.status.err { color: #f0736f; }
.status.info { color: #8b90a0; }

details { margin-top: 1.4rem; border-top: 1px solid #262a33; padding-top: 1rem; }
/* When settings are open, leave room below so a focused field can scroll up
   clear of the soft keyboard. Only applies while open, so scanning stays clean. */
details[open] { padding-bottom: 55vh; }
summary { color: #8b90a0; cursor: pointer; font-size: .9rem; }
.field { margin-top: .8rem; }
.field label { display: block; color: #8b90a0; font-size: .8rem; margin-bottom: .3rem; }
.field input {
  width: 100%; padding: .7rem; font-size: 1rem; border-radius: 10px;
  border: 1px solid #333a47; background: #0f1115; color: #e7e9ee;
}
.field .hint { color: #6b7080; font-size: .75rem; margin-top: .25rem; }
