html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.signal-test {
  padding-top: 1rem;
}

.live-surface {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(22, 101, 52, .08) 1px, transparent 1px),
    linear-gradient(rgba(22, 101, 52, .08) 1px, transparent 1px),
    #f8faf7;
  background-size: 32px 32px;
  cursor: crosshair;
}

.surface-copy {
  max-width: 34rem;
  padding: 2rem;
  pointer-events: none;
}

.surface-copy h1 {
  margin-bottom: .75rem;
}

.eyebrow {
  margin-bottom: .5rem;
  color: #166534;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.control-panel {
  height: 100%;
  padding: 1.25rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

.db-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.db-counts div {
  min-width: 0;
  padding: .75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #f8f9fa;
}

.db-counts span {
  display: block;
  color: #6c757d;
  font-size: .8rem;
}

.db-counts strong {
  display: block;
  margin-top: .15rem;
  font-size: 1.35rem;
  line-height: 1.1;
}

.throughput-panel {
  margin-bottom: 1rem;
  padding: .75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
}

.throughput-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: .75rem;
}

.throughput-grid div {
  min-width: 0;
}

.throughput-grid span,
.chart-legend {
  color: #6c757d;
  font-size: .75rem;
}

.throughput-grid strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

#throughputChart {
  display: block;
  width: 100%;
  height: 140px;
  border: 1px solid #edf0f2;
  border-radius: 4px;
  background: #fbfcfd;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .5rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.chart-legend i {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
}

.legend-out {
  background: #0d6efd;
}

.legend-in {
  background: #198754;
}

.legend-db {
  background: #dc3545;
}

.stress-panel {
  margin-bottom: 1rem;
  padding: .75rem;
  border: 1px solid #f1c2c7;
  border-radius: 6px;
  background: #fff8f8;
}

.stress-status {
  margin-top: .5rem;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.messages-list {
  min-height: 170px;
  max-height: 260px;
  margin: 0;
  padding-left: 1.25rem;
  overflow-y: auto;
}

.remote-cursor {
  position: absolute;
  z-index: 2;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #dc3545;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  transform: translate(-50%, -50%);
  transition: left .08s linear, top .08s linear;
  pointer-events: none;
}

.remote-cursor span {
  position: absolute;
  top: 16px;
  left: 10px;
  max-width: 11rem;
  padding: .15rem .4rem;
  overflow: hidden;
  border-radius: 4px;
  background: #212529;
  color: #fff;
  font-size: .75rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-info dt,
.server-info dd {
  padding-top: .75rem;
  padding-bottom: .75rem;
  border-top: 1px solid #dee2e6;
}

.info-page {
  padding-bottom: 2rem;
}

.info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-header p {
  margin-bottom: 0;
  color: #6c757d;
}

.metric {
  height: 100%;
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

.metric span {
  display: block;
  color: #6c757d;
  font-size: .85rem;
}

.metric strong {
  display: block;
  margin-top: .25rem;
  font-size: 1.8rem;
  line-height: 1.1;
}

.metric .metric-text {
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.info-section {
  margin-top: 2rem;
}

.info-section h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.server-info code,
.table code {
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 575.98px) {
  .throughput-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-header {
    display: block;
  }

  .info-header .btn {
    margin-top: 1rem;
  }
}

.login-page {
  display: grid;
  min-height: 55vh;
  place-items: center;
}

.login-panel {
  width: min(100%, 360px);
  padding: 1.5rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

.login-panel h1 {
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}
