#header {
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 2px solid var(--c-amber);
  background: var(--c-grey-0a0a0a);
  z-index: 2000;
  flex-shrink: 0;
}

#title {
  color: var(--c-cyan);
  text-shadow: 0 0 10px var(--c-cyan);
  font-weight: bold;
  font-size: 1.3rem;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: auto;
}

#menu-btn {
  cursor: pointer;
  width: 40px;
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  background: none;
  border: 0;
  padding: 0;
  color: var(--c-amber);
}

#tab-bar {
  display: flex;
  background: var(--c-black);
  border-bottom: 2px solid var(--c-amber);
  flex-shrink: 0;
}

/* Links standing in for the original <button>s, so they carry the UA button font size explicitly. */
.tab-btn {
  flex: 1;
  display: block;
  background: var(--c-black);
  color: var(--c-grey-555);
  border: none;
  border-right: 1px solid var(--c-grey-111);
  padding: 12px;
  font-family: inherit;
  font-size: 13.3333px;
  font-weight: bold;
  line-height: normal;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--c-amber);
  background: var(--c-grey-111);
  text-shadow: 0 0 8px var(--c-amber);
}

#stats-panel {
  height: 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
  background: var(--c-grey-0a0a0a);
  border-bottom: 1px solid var(--c-grey-222);
  flex-shrink: 0;
}

.stat-card {
  background: var(--c-black);
  border: 1px solid var(--c-grey-111);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-val {
  color: var(--c-yellow);
  font-size: 1.8rem;
  font-weight: bold;
}

.stat-label {
  color: var(--c-cyan);
  font-size: 0.6rem;
  text-transform: uppercase;
}

/* Background, stacking and opacity reflect the overrides in the original index.html <head>. */
#side-nav {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: var(--c-grey-111);
  border-left: 2px solid var(--c-amber);
  transition: 0.4s;
  z-index: 3000;
  padding-top: 50px;
  overflow-y: auto;
  opacity: 1;
  pointer-events: auto;
}

#side-nav.open {
  right: 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 2500;
}

.overlay.open {
  display: block;
}

.sidenav-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--c-grey-222);
  background: var(--c-grey-080808);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidenav-tab-btn {
  flex: 1;
  background: var(--c-grey-050505);
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--c-grey-888);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: bold;
  padding: 12px 0;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
  text-align: center;
}

.sidenav-tab-btn:hover {
  color: var(--c-white);
  background: var(--c-grey-111);
}

.sidenav-tab-btn.active {
  color: var(--c-amber);
  border-bottom: 2px solid var(--c-amber);
  background: var(--c-grey-111);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.45);
}

.sidenav-panel {
  padding: 15px;
}

.sidenav-heading {
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.sidenav-note {
  color: var(--c-grey-666);
  font-size: 0.65rem;
  margin: 8px 0 0;
}

.operator-box {
  padding: 15px;
  border-bottom: 1px solid var(--c-grey-222);
  background: var(--c-grey-111);
}

.operator-label {
  color: var(--c-amber);
  font-size: 0.7rem;
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
}

.operator-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operator-icon {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  border: 2px solid var(--operator-color);
  background: var(--c-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.operator-icon span {
  font-size: 24px;
  line-height: 1;
}

/* Stands in for the original operator <select>, which used the UA select font. */
.operator-name {
  flex-grow: 1;
  height: 40px;
  display: flex;
  align-items: center;
  background: var(--c-black);
  color: var(--c-cyan-bright);
  border: 1px solid var(--c-cyan);
  padding: 5px;
  font-family: monospace;
  font-size: 13.3333px;
}

.nav-item {
  display: block;
  padding: 15px 25px;
  border-bottom: 1px solid var(--c-grey-222);
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-signout {
  margin: 0;
}

.nav-item-button {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--c-grey-222);
  color: var(--c-grey-666);
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
}

#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25px;
  background: var(--c-grey-050505);
  border-top: 1px solid var(--c-grey-222);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 5000;
}

.footer-status {
  display: flex;
  gap: 10px;
  align-items: center;
}

#sync-time {
  color: var(--c-amber);
  font-size: 0.75rem;
  font-weight: bold;
}

#sync-text {
  color: var(--c-green);
  font-size: 0.75rem;
}

.fullscreen-btn {
  background: none;
  border: 1px solid var(--c-grey-333);
  color: var(--c-grey-555);
  font-family: inherit;
  font-size: 0.6rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
}

#notify {
  position: fixed;
  right: 12px;
  bottom: 40px;
  background: var(--c-grey-111);
  color: var(--c-white);
  padding: 8px 12px;
  border: 1px solid var(--c-grey-333);
  border-left: 4px solid var(--c-amber);
  border-radius: 4px;
  display: none;
  z-index: 6000;
  font-weight: bold;
}

@media (max-width: 768px) {
  #title {
    font-size: 1rem;
  }

  .stat-val {
    font-size: 1.4rem;
  }

  .stat-label {
    font-size: 0.5rem;
  }

  #footer {
    padding-left: max(18px, env(safe-area-inset-left, 18px));
    padding-right: max(18px, env(safe-area-inset-right, 18px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(25px + env(safe-area-inset-bottom, 0px));
  }
}
