:root {
  color-scheme: dark;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  background: rgb(30, 30, 30);
  color: rgb(255, 255, 255);
}
* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; }

body {
  min-height: 100vh;
  min-height: 100svh;
  background: rgb(30, 30, 30);
  display: flex;
  justify-content: center;
  align-items: center;
}

button, input, select { font: inherit; }

.scanner {
  display: block;
  width: 100%;
  max-width: 640px;
  min-width: 0;
  padding: 24px;
  user-select: none;
}

.rdio-status {
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  flex-direction: row;
  margin-bottom: 24px;
}

.branding {
  color: rgb(64, 64, 64);
  flex: 1;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 2px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: -1px -1px 1px rgba(0,0,0,.7), 1px 1px 1px rgba(255,255,255,.3);
  text-transform: uppercase;
  white-space: nowrap;
}

.led {
  background: rgb(80,80,80);
  display: block;
  height: 12px;
  margin-left: 24px;
  width: 24px;
}

.led.on {
  background: rgb(0,230,118);
  box-shadow: 0 0 6px 3px rgb(0,230,118);
}

.led.paused { animation: led-blink 2s step-end infinite; }

@keyframes led-blink { 50% { background: rgb(80,80,80); box-shadow: none; } }

.rdio-display {
  background: rgb(209,238,238);
  box-shadow: 2px 2px 4px rgb(0,0,0) inset, 1px 1px 2px 1px rgb(255,255,255);
  color: rgba(0,0,0,.8);
  cursor: default;
  display: block;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  margin-bottom: 24px;
  padding: 8px;
}

.rdio-display.idle { background: rgb(190,190,174); }
.rdio-display * { overflow: hidden; text-overflow: clip; white-space: nowrap; }

.display-row {
  display: flex;
  flex-direction: row;
  height: 20px;
  justify-content: space-between;
}

.display-row.big { font-size: 24px; height: 32px; line-height: 32px; }
.display-row.right { justify-content: flex-end; }
.display-row.small { font-size: 12px; height: 14px; line-height: 14px; }
.display-wrapper { position: relative; }

.flag {
  background: rgba(0,0,0,.8);
  border-radius: 3px;
  color: rgb(209,238,238);
  display: none;
  margin-left: 4px;
  opacity: .87;
  padding: 0 3px;
}

.flag.flagged { display: block; }

.history { border-collapse: collapse; font-size: 11px; table-layout: fixed; width: 100%; }
.history td, .history th { padding: 0 6px; text-align: start; }
.history td:nth-child(1), .history th:nth-child(1) { width: 10%; }
.history td:nth-child(2), .history th:nth-child(2) { width: 25%; }
.history td:nth-child(3), .history th:nth-child(3) { width: 25%; }
.history td:nth-child(4), .history th:nth-child(4) { width: 40%; }
.history th { color: rgba(0,0,0,.4); font-weight: 400; text-transform: uppercase; }
.history tr { height: 21px; }
.history tr.replaying { font-weight: 700; }
.history tbody > tr { border-top: 1px solid rgba(0,0,0,.2); }

.auth {
  align-items: center;
  background: rgba(190,190,174,.96);
  display: none;
  height: 100%;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 3;
}

.auth.visible { display: flex; }

.login-card {
  align-items: end;
  background: rgb(240,240,240);
  border-radius: 8px;
  box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14);
  display: grid;
  gap: 6px 12px;
  grid-template-columns: 1fr auto;
  padding: 10px 18px;
}

.login-card label { color: rgba(0,0,0,.6); display: grid; font-size: 10px; line-height: 14px; }
.login-card input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0,0,0,.45);
  color: rgba(0,0,0,.87);
  min-width: 100px;
  outline: 0;
  padding: 2px 0;
}
.login-card input:focus { border-bottom-color: rgb(0,100,80); }
.login-card button { background: rgb(45,45,45); border: 0; color: white; padding: 7px 10px; }
.login-error { color: rgb(180,0,0); font-size: 10px; grid-column: 1 / -1; margin: 0; min-height: 12px; text-align: center; }

.rdio-control .control-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rdio-control .spacer { display: block; width: 24px; }

.rdio-button {
  --def: rgb(45,45,45);
  --green: rgb(0,230,118);
  --red: rgb(255,23,68);
  --yellow: rgb(255,234,0);
  background: var(--def);
  border: 1px solid;
  border-bottom-color: rgba(0,0,0,.87);
  border-left-color: rgba(255,255,255,.7);
  border-right-color: rgba(0,0,0,.87);
  border-top-color: rgba(255,255,255,.7);
  box-sizing: content-box;
  color: rgb(250,250,250);
  flex: 1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  height: 40px;
  line-height: normal;
  margin: 2px;
  min-width: 80px;
  overflow: hidden;
  padding: 2px 8px;
  position: relative;
  text-overflow: clip;
  text-shadow: 0 0 4px rgb(0,0,0);
  text-transform: uppercase;
  white-space: normal;
}

.rdio-button:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.rdio-button:active { top: 2px; transform: scale(.98); transform-origin: bottom center; }
.rdio-button.off::after, .rdio-button.on::after, .rdio-button.partial::after {
  content: "";
  display: block;
  height: 6px;
  position: absolute;
  right: 4px;
  top: 4px;
  width: 6px;
}
.rdio-button.off::after { background: var(--red); box-shadow: 1px 1px 1px rgba(255,255,255,.7) inset, 0 0 3px 1px var(--red); }
.rdio-button.on::after { background: var(--green); box-shadow: 1px 1px 1px rgba(255,255,255,.7) inset, 0 0 3px 1px var(--green); }
.rdio-button.partial::after { background: var(--yellow); box-shadow: 1px 1px 1px rgba(255,255,255,.7) inset, 0 0 3px 1px var(--yellow); }

.panel {
  background: rgb(30,30,30);
  bottom: 0;
  color: white;
  overflow: auto;
  padding-bottom: 24px;
  position: fixed;
  top: 0;
  transition: transform 180ms ease;
  width: 100%;
  z-index: 10;
}

.search-panel { left: 0; transform: translateX(-105%); }
.select-panel { right: 0; transform: translateX(105%); }
.panel.open { transform: translateX(0); box-shadow: 0 0 24px rgba(0,0,0,.8); }
.panel header {
  align-items: center;
  background: rgb(30,30,30);
  box-shadow: 0 4px 8px rgba(30,30,30,.8);
  display: flex;
  height: 64px;
  justify-content: flex-start;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.panel-close { background: none; border: 0; color: white; cursor: pointer; font-size: 28px; padding: 10px; }
.panel-content { margin: 0 auto; max-width: 1200px; padding: 8px; }
.panel footer button, .search-reset button {
  background: rgb(45,45,45);
  border: 1px solid rgb(100,100,100);
  color: white;
  min-height: 36px;
  padding: 8px 16px;
}

.talkgroup-selection { padding: 0; user-select: none; }
.talkgroup-selection .fieldset {
  border-color: rgba(255,255,255,.7);
  color: rgba(255,255,255,.7);
  font: 400 14px/20px inherit;
  margin: 0 0 12px;
  padding: 4px;
}
.talkgroup-selection .fieldset > div {
  align-items: stretch;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-evenly;
}
.talkgroup-selection .rdio-button {
  box-sizing: border-box;
  flex: 0 0 calc(25% - 4px);
  height: 48px;
  min-width: 0;
  width: calc(25% - 4px);
}
.rdio-button-mini {
  background: rgb(45,45,45);
  border: 1px solid;
  border-bottom-color: rgba(0,0,0,.87);
  border-left-color: rgba(255,255,255,.7);
  border-right-color: rgba(0,0,0,.87);
  border-top-color: rgba(255,255,255,.7);
  box-sizing: border-box;
  color: rgb(250,250,250);
  flex: 0 0 calc(12.5% - 4px);
  font-size: 12px;
  font-weight: 500;
  height: 48px;
  margin: 2px;
  min-width: 0;
  padding: 2px 8px;
  position: relative;
  text-shadow: 0 0 4px rgb(0,0,0);
  width: calc(12.5% - 4px);
}
.rdio-button-mini:nth-last-child(2) { margin-left: auto; }
.rdio-button-mini.all-off { background: rgb(100,50,50); }
.rdio-button-mini.all-on { background: rgb(50,100,50); }
.rdio-button-mini:active { top: 2px; transform: scale(.98); transform-origin: bottom center; }
.panel footer { display: flex; justify-content: flex-end; padding: 18px 0; }

.search-card {
  background: rgb(48,48,48);
  border-radius: 4px;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.14), 0 1px 3px rgba(0,0,0,.12);
}
.rdio-list { margin-bottom: 16px; overflow: hidden; padding: 0; }
.search-table-scroll { overflow-x: auto; }
.search-table { border-collapse: collapse; min-width: 760px; table-layout: fixed; width: 100%; }
.search-table th, .search-table td {
  border-bottom: 1px solid rgba(255,255,255,.12);
  height: 48px;
  overflow: hidden;
  padding: 0 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-table th { color: rgba(255,255,255,.7); font-size: 12px; font-weight: 500; }
.search-table td { color: rgba(255,255,255,.87); font-size: 14px; }
.search-table th:nth-child(1), .search-table td:nth-child(1) { padding: 0; text-align: center; width: 88px; }
.search-table th:nth-child(2), .search-table td:nth-child(2) { width: 76px; }
.search-table th:nth-child(3), .search-table td:nth-child(3) { width: 68px; }
.search-table th:nth-child(4), .search-table td:nth-child(4),
.search-table th:nth-child(5), .search-table td:nth-child(5) { width: 20%; }
.search-table td span { display: block; overflow: hidden; text-overflow: ellipsis; }
.search-table .empty-row td { color: transparent; }
.search-controls { align-items: center; display: flex; justify-content: center; }
.search-control {
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  font-size: 19px;
  height: 40px;
  padding: 0;
  width: 40px;
}
.search-control:hover { background: rgba(255,255,255,.08); }
.search-control:disabled { cursor: default; opacity: .35; }
.search-control.play { font-size: 21px; }
.search-control.download { font-size: 24px; }
.search-control.stop { font-size: 0; }
.search-control.stop::before {
  background: currentColor;
  content: "";
  display: block;
  height: 18px;
  margin: auto;
  width: 18px;
}
.search-progress { background: transparent; height: 4px; overflow: hidden; position: relative; }
.search-progress.pending::before {
  animation: search-progress 1s linear infinite;
  background: rgb(0,230,118);
  content: "";
  height: 100%;
  left: -35%;
  position: absolute;
  width: 35%;
}
@keyframes search-progress { to { left: 100%; } }
.search-paginator { align-items: center; display: flex; justify-content: flex-end; min-height: 56px; padding: 0 8px; }
.search-paginator nav { align-items: center; display: flex; gap: 2px; }
.search-paginator button {
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: white;
  font-size: 22px;
  height: 40px;
  width: 40px;
}
.search-paginator button:disabled { opacity: .3; }
.search-paginator #search-page { color: rgba(255,255,255,.7); font-size: 12px; margin: 0 8px; white-space: nowrap; }
.search-message { color: rgba(255,255,255,.7); font-size: 13px; margin: -10px 16px 14px; min-height: 16px; }

.rdio-filters { display: flex; flex-flow: row wrap; gap: 16px; padding: 16px; }
.rdio-filters label { color: rgba(255,255,255,.7); display: grid; flex: calc(100% / 3 - 16px); font-size: 12px; gap: 6px; }
.rdio-filters input, .rdio-filters select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.42);
  color: white;
  min-height: 36px;
  outline: 0;
  padding: 6px 0;
}
.rdio-filters input:focus, .rdio-filters select:focus { border-bottom: 2px solid rgb(0,150,136); }
.rdio-filters select option { background: rgb(48,48,48); color: white; }
.search-reset { display: flex; flex: 100%; justify-content: flex-end; }

@media (max-width: 560px) {
  .scanner { padding: 16px; }
  .rdio-control .spacer { width: 10px; }
  .rdio-button { min-width: 0; }
  .login-card { grid-template-columns: 1fr 1fr; }
  .login-card button { grid-column: 1 / -1; }
  .rdio-filters label { flex: 100%; }
  .search-table { min-width: 700px; }
  .search-paginator { align-items: flex-start; flex-direction: column; gap: 4px; padding: 8px; }
  .search-paginator nav { align-self: stretch; justify-content: flex-end; }
  .search-paginator #search-page { margin: 0 2px; }
}

@media (max-height: 620px) {
  body { align-items: flex-start; }
}

@media (min-width: 720px) {
  .talkgroup-selection .rdio-button { flex-basis: calc(20% - 4px); width: calc(20% - 4px); }
  .rdio-button-mini { flex-basis: calc(10% - 4px); width: calc(10% - 4px); }
}

@media (min-width: 1200px) {
  .talkgroup-selection .rdio-button { flex-basis: calc(10% - 4px); width: calc(10% - 4px); }
  .rdio-button-mini { flex-basis: calc(5% - 4px); width: calc(5% - 4px); }
}
