:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #101214;
  color: #f3f4f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #101214;
}

button,
input {
  font: inherit;
}

.topbar {
  align-items: center;
  background: #181b1f;
  border-bottom: 1px solid #2c3238;
  display: flex;
  justify-content: space-between;
  padding: 16px 22px;
}

h1,
h2,
p {
  margin: 0;
}

.topbar h1 {
  font-size: 22px;
}

.topbar p {
  color: #aeb7c2;
  font-size: 14px;
  margin-top: 4px;
}

a {
  color: #8abdf7;
}

a:visited {
  color: #b8a9ff;
}

.camera-tile a {
  display: inline-block;
  margin-right: 10px;
}

.camera-tile a:last-child {
  margin-right: 0;
}

button {
  background: #2f7dd3;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  padding: 9px 14px;
}

.camera-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  padding: 14px;
}

.camera-tile {
  background: #181b1f;
  border: 1px solid #2c3238;
  border-radius: 8px;
  overflow: hidden;
}

.tile-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.tile-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tile-header h2 {
  font-size: 15px;
}

.tile-header p {
  color: #8f9aa7;
  font-size: 12px;
  margin-top: 3px;
}

.status {
  background: #3f454d;
  border-radius: 999px;
  color: #d7dde5;
  font-size: 12px;
  padding: 4px 8px;
}

.status.online {
  background: #166534;
}

.status.idle {
  background: #374151;
}

.status.offline,
.status.reconnecting {
  background: #7f1d1d;
}

.live-link {
  background: #2f7dd3;
  border-radius: 6px;
  color: white;
  font-size: 12px;
  margin-right: 0;
  padding: 6px 9px;
  text-decoration: none;
  white-space: nowrap;
}

.live-link:visited {
  color: white;
}

.camera-tile img {
  aspect-ratio: 16 / 9;
  background: #050607;
  display: block;
  object-fit: contain;
  width: 100%;
}

.camera-feed {
  cursor: zoom-in;
}

.viewer-modal {
  background: #0b0d10;
  border: 1px solid #323943;
  border-radius: 8px;
  color: #f3f4f6;
  height: min(92vh, 980px);
  padding: 0;
  width: min(96vw, 1500px);
}

.viewer-modal::backdrop {
  background: rgb(0 0 0 / 78%);
}

.modal-header {
  align-items: center;
  background: #181b1f;
  border-bottom: 1px solid #2c3238;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.modal-header h2 {
  font-size: 18px;
}

.modal-header p {
  color: #aeb7c2;
  font-size: 13px;
  margin-top: 3px;
}

.viewer-modal img {
  background: #050607;
  display: block;
  height: calc(100% - 61px);
  object-fit: contain;
  width: 100%;
}

dl {
  border-top: 1px solid #2c3238;
  color: #c9d2dc;
  font-size: 12px;
  margin: 0;
  padding: 10px 12px;
}

dl div {
  display: grid;
  gap: 8px;
  grid-template-columns: 60px 1fr;
  margin-bottom: 6px;
}

dt {
  color: #8f9aa7;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.login-page {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.login-panel {
  background: #181b1f;
  border: 1px solid #2c3238;
  border-radius: 8px;
  max-width: 360px;
  padding: 22px;
  width: 100%;
}

.login-panel h1 {
  font-size: 28px;
  margin-bottom: 18px;
}

label {
  color: #c9d2dc;
  display: block;
  font-size: 14px;
  margin-bottom: 14px;
}

input {
  background: #0f1114;
  border: 1px solid #343b44;
  border-radius: 6px;
  color: white;
  display: block;
  margin-top: 6px;
  padding: 10px;
  width: 100%;
}

.error {
  color: #fca5a5;
  font-size: 14px;
  margin: 0 0 12px;
}
