:root {
  color-scheme: dark;
  --bg: #07101d;
  --bg-soft: #0b1626;
  --surface: #101d2e;
  --surface-raised: #15253a;
  --surface-hover: #1a2d45;
  --border: #293c54;
  --border-strong: #3a526e;
  --text: #f3f7fb;
  --muted: #a8b6c8;
  --primary: #34d17b;
  --primary-strong: #19a95d;
  --primary-ink: #03150b;
  --danger: #ff6b6b;
  --danger-soft: #35171e;
  --warning: #f6c85f;
  --warning-soft: #33270e;
  --info: #66b8ff;
  --info-soft: #102a43;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --content: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(35, 97, 141, 0.18), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  max-width: 100%;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--info);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(58, 82, 110, 0.75);
  background: rgba(7, 16, 29, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  width: min(100%, var(--content));
  min-width: 0;
  margin: 0 auto;
  padding: 12px 16px;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(52, 209, 123, 0.35);
  border-radius: 13px;
  background: rgba(52, 209, 123, 0.1);
  font-size: 23px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 0.72rem;
}

.main-nav {
  display: flex;
  min-width: 0;
  margin-left: auto;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.main-nav a {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--surface-raised);
  color: var(--text);
}

.user-pill {
  display: inline-flex;
  min-height: 36px;
  max-width: 220px;
  padding: 7px 10px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 29, 46, 0.72);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  min-width: 0;
  margin-left: auto;
  padding: 7px 10px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.main-nav:not([hidden]) + .status-pill {
  margin-left: 0;
}

.status-dot,
.device-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.is-success {
  color: var(--primary);
}

.is-danger {
  color: var(--danger);
}

.is-neutral {
  color: var(--muted);
}

.app-shell {
  width: min(100%, var(--content));
  min-width: 0;
  min-height: calc(100vh - 170px);
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.app-shell:focus {
  outline: none;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  line-height: 1.16;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.25rem, 4vw, 1.6rem);
}

h3 {
  font-size: 1rem;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
}

.button[aria-disabled="true"]:hover {
  transform: none;
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
}

.button-primary:hover:not(:disabled) {
  border-color: #62e79a;
  background: #62e79a;
}

.button-secondary,
.button-quiet {
  border-color: var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.button-danger {
  border-color: rgba(255, 107, 107, 0.4);
  background: var(--danger-soft);
  color: #ffb0b0;
}

.button-danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: #482029;
}

.button-small {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.button-block {
  width: 100%;
}

.page-heading {
  display: flex;
  min-width: 0;
  margin-bottom: 24px;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.page-heading > div:first-child {
  min-width: 0;
  max-width: 700px;
}

.page-heading p {
  margin: 0;
}

.page-actions,
.card-actions,
.form-actions,
.row-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.breadcrumb {
  margin-bottom: 18px;
}

.breadcrumb a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
}

.center-state,
.empty-state {
  display: flex;
  min-height: 52vh;
  padding: 40px 18px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.center-state h1,
.empty-state h2 {
  margin: 18px 0 7px;
}

.center-state p,
.empty-state p {
  max-width: 520px;
  margin: 0 0 20px;
}

.center-state.compact-state {
  min-height: 260px;
}

.empty-state {
  min-height: 360px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(16, 29, 46, 0.55);
}

.state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface-raised);
  color: var(--primary);
  font-size: 1.7rem;
  font-weight: 850;
}

.state-icon.is-danger {
  color: var(--danger);
}

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 3px solid rgba(168, 182, 200, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-layout {
  display: grid;
  min-height: calc(100vh - 220px);
  align-items: center;
  gap: 28px;
}

.auth-copy {
  max-width: 600px;
}

.auth-copy > p {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.04rem;
}

.auth-card,
.form-card,
.settings-section,
.probe-result {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(21, 37, 58, 0.97), rgba(13, 26, 43, 0.97));
  box-shadow: var(--shadow);
}

.auth-card h2,
.form-card h2 {
  margin-bottom: 6px;
}

.auth-card > p,
.form-card > p {
  margin: 0 0 22px;
}

.check-list {
  display: grid;
  margin: 22px 0 0;
  padding: 0;
  gap: 10px;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 27px;
  color: var(--muted);
}

.check-list li::before {
  position: absolute;
  left: 0;
  color: var(--primary);
  content: "✓";
  font-weight: 900;
}

.auth-form,
.download-form,
.device-form {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.field {
  min-width: 0;
}

.field label,
.compact-control label {
  display: block;
  margin-bottom: 6px;
  color: #cfdae7;
  font-size: 0.83rem;
  font-weight: 750;
}

.field input,
.field select,
.compact-control select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:hover,
.field select:hover,
.compact-control select:hover {
  border-color: var(--border-strong);
}

.field input:focus,
.field select:focus,
.compact-control select:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(102, 184, 255, 0.14);
  outline: none;
}

.field input::placeholder {
  color: #708199;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.form-row {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.form-message {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: #ffc1c1;
  font-size: 0.86rem;
}

.check-control {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.check-control input {
  width: 19px;
  height: 19px;
  accent-color: var(--primary);
}

.narrow {
  max-width: 620px;
}

.info-note {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(102, 184, 255, 0.25);
  border-radius: var(--radius-sm);
  background: var(--info-soft);
}

.info-note strong {
  color: #b9dcff;
}

.info-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.alert {
  display: flex;
  margin-bottom: 18px;
  padding: 13px 14px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: #ffd0d0;
}

.alert.is-info {
  border-color: rgba(102, 184, 255, 0.3);
  background: var(--info-soft);
  color: #d0e8ff;
}

.alert-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
}

.alert p {
  margin: 0;
}

.status-summary {
  display: grid;
  min-width: 0;
  margin-bottom: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.status-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(16, 29, 46, 0.72);
}

.status-metric span,
.status-metric strong {
  display: block;
  overflow-wrap: anywhere;
}

.status-metric span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.status-metric strong {
  margin-top: 3px;
  font-size: 0.95rem;
}

.camera-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.camera-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.camera-card:hover {
  border-color: var(--border-strong);
}

.camera-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.camera-frame,
.live-frame {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  place-items: center;
  background: #02060a;
}

.camera-frame {
  aspect-ratio: 16 / 9;
}

.camera-frame img,
.live-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.stream-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 18px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(20, 38, 60, 0.52), rgba(4, 11, 19, 0.86)),
    repeating-linear-gradient(135deg, #08121f 0, #08121f 12px, #0b1727 12px, #0b1727 24px);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.stream-placeholder-icon {
  color: var(--primary);
  font-size: 1.8rem;
}

.stream-state {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(2, 6, 10, 0.82);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-state::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.stream-state.is-success {
  color: var(--primary);
}

.stream-state.is-danger {
  color: var(--danger);
}

.stream-state.is-loading {
  color: var(--warning);
}

.camera-card-body {
  display: grid;
  min-width: 0;
  padding: 15px;
  gap: 15px;
}

.camera-card-body h2 {
  margin: 0 0 5px;
  font-size: 1.05rem;
}

.camera-meta,
.device-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.card-actions .button {
  flex: 1 1 125px;
}

.card-actions .preview-toggle {
  flex-basis: 100%;
}

.live-heading {
  margin-bottom: 16px;
}

.live-frame {
  min-height: min(66vh, 680px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.live-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: 0;
  border-radius: 0;
}

.live-frame:fullscreen img {
  object-fit: contain;
}

.compact-control {
  min-width: 130px;
}

.compact-control label {
  margin-bottom: 3px;
  font-size: 0.7rem;
}

.compact-control select {
  min-height: 39px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.settings-section,
.probe-result {
  margin-bottom: 20px;
  box-shadow: none;
}

.section-heading {
  display: flex;
  min-width: 0;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-heading h2,
.section-heading h3,
.section-heading p,
.section-heading .eyebrow {
  margin-bottom: 0;
}

.count-badge {
  display: grid;
  min-width: 34px;
  height: 28px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.device-list {
  display: grid;
  gap: 10px;
}

.device-card,
.user-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(7, 16, 29, 0.52);
}

.device-card > .device-row {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.device-row {
  display: flex;
  min-width: 0;
  padding: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(7, 16, 29, 0.52);
  flex-wrap: wrap;
}

.device-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.device-main > div {
  min-width: 0;
}

.device-main h3 {
  margin: 0 0 4px;
}

.device-status {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 750;
}

.device-editor {
  border-top: 1px solid var(--border);
}

.device-editor summary {
  padding: 12px 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.device-editor summary:hover,
.device-editor[open] summary {
  background: rgba(21, 37, 58, 0.58);
  color: var(--text);
}

.device-edit-form,
.channel-form,
.user-edit-form {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.device-edit-form {
  padding: 4px 14px 16px;
}

.channel-editor {
  min-width: 0;
  padding: 16px 14px;
  border-top: 1px solid var(--border);
  background: rgba(11, 22, 38, 0.78);
}

.channel-editor .section-heading {
  margin-bottom: 12px;
}

.inline-loading {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.inline-loading .spinner {
  width: 22px;
  height: 22px;
}

.channel-rows {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.channel-row {
  display: grid;
  min-width: 0;
  padding: 10px;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.channel-row label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.channel-row input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #07101d;
  color: var(--text);
}

.channel-row input:not([type="checkbox"]):focus {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(102, 184, 255, 0.14);
  outline: none;
}

.channel-enabled-label {
  justify-items: start;
}

.channel-enabled-label input {
  width: 20px;
  height: 20px;
  margin: 9px 0;
  accent-color: var(--primary);
}

.user-list {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.user-edit-form {
  padding: 15px;
}

.user-heading {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.user-heading h3 {
  margin-bottom: 4px;
}

.current-badge {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid rgba(52, 209, 123, 0.35);
  border-radius: 999px;
  background: rgba(52, 209, 123, 0.1);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.user-controls {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.user-enabled {
  align-self: end;
}

.retry-actions {
  margin: -8px 0 18px;
}

.row-actions {
  justify-content: flex-end;
}

.discovered-list,
.compact-list {
  display: grid;
  margin: 16px 0 0;
  padding: 0;
  gap: 9px;
  list-style: none;
}

.discovered-list li {
  display: flex;
  min-width: 0;
  padding: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  flex-wrap: wrap;
}

.discovered-list li > div {
  min-width: 0;
}

.discovered-list strong,
.discovered-list span {
  display: block;
  overflow-wrap: anywhere;
}

.discovered-list span {
  color: var(--muted);
  font-size: 0.78rem;
}

.mode-fields {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.details-list {
  display: grid;
  margin: 0 0 16px;
  gap: 8px;
}

.details-list > div {
  display: grid;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}

.details-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.details-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.compact-list {
  padding-left: 19px;
  list-style: disc;
}

.compact-list.is-danger {
  color: #ffc1c1;
}

.probe-result h4 {
  margin: 18px 0 0;
}

.toast-region {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 100;
  display: grid;
  width: min(390px, calc(100% - 28px));
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.toast.is-success {
  border-color: rgba(52, 209, 123, 0.55);
}

.toast.is-danger {
  border-color: rgba(255, 107, 107, 0.6);
}

.site-footer {
  padding: 24px 16px 34px;
  color: #71839b;
  font-size: 0.75rem;
  text-align: center;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--text);
  text-align: center;
}

@media (min-width: 600px) {
  .app-shell {
    padding: 38px 22px 60px;
  }

  .header-inner {
    padding-inline: 22px;
  }

  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .channel-row {
    grid-template-columns: 74px minmax(180px, 1fr) 68px 74px auto;
  }

  .user-controls {
    grid-template-columns: minmax(130px, 0.45fr) minmax(220px, 1fr) auto;
    align-items: end;
  }

  .camera-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  }

  .status-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .camera-card-body {
    padding: 17px;
  }

  .auth-card,
  .form-card,
  .settings-section,
  .probe-result {
    padding: 24px;
  }
}

@media (min-width: 840px) {
  .header-inner {
    flex-wrap: nowrap;
  }

  .status-pill {
    margin-left: auto;
  }

  .main-nav {
    order: 2;
    margin-left: 0;
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.75fr);
    gap: clamp(40px, 8vw, 110px);
  }

  .auth-layout.compact {
    min-height: calc(100vh - 240px);
  }

  .device-row {
    flex-wrap: nowrap;
  }
}

@media (max-width: 480px) {
  .header-inner {
    align-items: flex-start;
  }

  .brand {
    max-width: calc(100% - 120px);
  }

  .status-pill {
    max-width: 112px;
  }

  .status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-nav {
    width: 100%;
    margin-left: 0;
  }

  .main-nav a,
  .main-nav .button {
    flex: 1 1 auto;
  }

  .page-actions,
  .form-actions,
  .row-actions {
    width: 100%;
  }

  .page-actions .button,
  .page-actions > a,
  .form-actions .button {
    flex: 1 1 130px;
  }

  .row-actions .button {
    flex: 1 1 90px;
  }

  .live-frame {
    min-height: 52vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
