:root {
  --bg: #17191e;
  --panel: #20242c;
  --ink: #f3efe4;
  --copper: #c9843f;
  --mute: #8d97a6;
  --line: #323843;
  --ok: #3dcc7a;
  --no: #e24b3c;
  --warn: #e08a2a;
  --wifi: #4aa3ff;
  --fault: #ff8a3d;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 "Avenir Next", "Segoe UI", sans-serif;
}
body { min-height: 100vh; }
header, main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding-top: 1.6rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.mark {
  margin: 0;
  color: var(--copper);
  font: 13px/1.2 ui-monospace, "Cascadia Mono", monospace;
}
h1 {
  margin: .2rem 0 0;
  font: 650 2.75rem/1 Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
}
h2 {
  margin: 2rem 0 .4rem;
  font: 600 1.2rem/1.2 Palatino, "Palatino Linotype", Georgia, serif;
}
.reader, .lede, .notice, .pager, label, .swatches, .reader-bar p { color: var(--mute); }
.lede { font-size: 1.05rem; margin: .8rem 0 1rem; color: var(--ink); }
.notice {
  background: var(--panel);
  border-left: 3px solid var(--copper);
  padding: .7rem .9rem;
}
.reader-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.1rem 0 .2rem;
}
.reader-bar p { margin: 0; }
.lamp {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--mute);
  box-shadow: 0 0 10px currentColor;
  flex: none;
}
.lamp.ok { background: var(--ok); color: var(--ok); }
.lamp.warn { background: var(--warn); color: var(--warn); }
.lamp.off { background: var(--no); color: var(--no); }
a { color: var(--wifi); }
button, input, select {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .5rem .7rem;
}
button { cursor: pointer; }
button:hover, button:focus-visible, input:focus-visible, select:focus-visible {
  border-color: var(--copper);
  outline: none;
}
button[type="submit"] {
  background: var(--copper);
  color: #1a1208;
  border-color: transparent;
  font-weight: 650;
}
.ghost { background: transparent; }
.toolbar, .tag-form, .pager { display: grid; gap: .65rem; margin: .8rem 0 1rem; }
.tag-form label, .search { display: grid; gap: .25rem; color: var(--mute); font-size: .92rem; }
.toolbar {
  grid-template-columns: minmax(12rem, 1.4fr) auto auto auto;
  align-items: end;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: .62rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
th {
  color: var(--mute);
  font-weight: 550;
  font-size: .82rem;
  position: sticky;
  top: 0;
  background: #252a33;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-edit-tag] { cursor: pointer; }
tbody tr[data-edit-tag]:hover td { background: #2a303a; }
.pip {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}
.when, .uid, .rssi, .code, .latency {
  font-family: ui-monospace, "Cascadia Mono", "IBM Plex Mono", monospace;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.result { font-weight: 650; }
.result.identified, .result.online { color: var(--ok); }
.result.unassigned { color: var(--warn); }
.result.blocked, .result.reader_fault { color: var(--no); }
.split {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
.identities { display: flex; flex-wrap: wrap; gap: .45rem; margin: .6rem 0; }
.identities button { font-size: .88rem; }
.tag-form { grid-template-columns: 1fr 1fr; }
.tag-form button, .tag-form .check, .tag-form .form-error { grid-column: 1 / -1; }
.check { display: flex; gap: .5rem; align-items: center; }
.form-error { color: var(--no); min-height: 1.2em; margin: 0; }
.swatches {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.4rem;
}
.swatches li { display: flex; gap: .55rem; align-items: center; }
.swatch {
  width: .85rem;
  height: .85rem;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 8px currentColor;
}
.swatch.flash { animation: blink .5s steps(1) infinite; }
.wires td:first-child { font-family: ui-monospace, monospace; }
img { max-width: 100%; height: auto; background: #f6f8fb; margin: 1rem 0; }
.token { word-break: break-all; background: var(--panel); padding: .8rem; }
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: .7rem 1rem;
}
.toast.error { border-color: var(--no); }
body.unconfigured #workspace { display: none; }
@media (max-width: 860px) {
  .toolbar, .tag-form, .split { grid-template-columns: 1fr; }
  h1 { font-size: 2.1rem; }
  header, main { padding: 0 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .swatch.flash { animation: none; }
}
@keyframes blink { 50% { opacity: .18; } }
