html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

/* Statuslampa (online/offline) */
.lamp {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: #6c757d;
}
.lamp.on { background: #2ecc71; }
.lamp.off { background: #e74c3c; }

/* Id och nycklar visas i fast bredd så att de är lätta att kopiera */
code.id {
  user-select: all;
  font-size: 0.95rem;
}

.card-metric .value {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Diagram (SVG) */
svg.chart {
  width: 100%;
  height: auto;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}
svg.chart .grid { stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; }
svg.chart .axis { fill: #9aa0a6; font-size: 10px; }
svg.chart .avg { fill: none; stroke: #4aa3ff; stroke-width: 1.6; }
svg.chart .max { fill: rgba(74, 163, 255, 0.15); stroke: none; }

.table td, .table th { vertical-align: middle; }
.message-cell { max-width: 60ch; word-break: break-word; }

/* QR-koden skalas till sin ruta så att den inte täcker texten bredvid */
.otp-qr { width: 220px; max-width: 100%; }
.otp-qr svg { width: 100%; height: auto; display: block; }

/* Inmatning av engångskod: en ruta per siffra */
.otp-boxes { display: flex; gap: 0.5rem; justify-content: center; }
.otp-box {
  width: 3rem;
  height: 3.6rem;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--bs-body-color);
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.6rem;
  caret-color: #4aa3ff;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.otp-box:focus {
  outline: none;
  border-color: #4aa3ff;
  box-shadow: 0 0 0 0.2rem rgba(74, 163, 255, 0.25);
  transform: translateY(-1px);
}
.otp-box:not(:placeholder-shown), .otp-box[value]:not([value=""]) { border-color: var(--bs-border-color); }
.otp-busy .otp-box { opacity: 0.6; border-color: #4aa3ff; animation: otp-pulse 1s ease-in-out infinite; }
.otp-error .otp-boxes { animation: otp-shake 0.4s; }
.otp-error .otp-box { border-color: var(--bs-danger); }
.otp-status { text-align: center; min-height: 1.25rem; }
@keyframes otp-pulse { 50% { opacity: 0.35; } }
@keyframes otp-shake {
  20% { transform: translateX(-8px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .otp-box, .otp-busy .otp-box, .otp-error .otp-boxes { animation: none; transition: none; }
}
@media (max-width: 400px) { .otp-box { width: 2.5rem; height: 3.2rem; font-size: 1.5rem; } .otp-boxes { gap: 0.35rem; } }
