:root {
  --bg: #07131a;
  --panel: rgba(10, 24, 33, 0.92);
  --panel-2: rgba(14, 28, 38, 0.96);
  --line: rgba(126, 172, 196, 0.18);
  --text: #eaf7ff;
  --muted: #9fb8c6;
  --accent: #55d6ff;
  --accent-2: #5ef0c0;
  --danger: #ff6b6b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(85, 214, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #061018 0%, #08161f 100%);
}

img {
  max-width: 100%;
}

canvas {
  width: 100%;
  height: 140px;
  display: block;
}

.page-shell {
  max-width: 1880px;
  margin: 0 auto;
  padding: 20px;
}

.page-shell--dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.page-shell--dashboard > .hero,
#dashboardSensors,
#dashboardCharts,
#cameraControlGrid,
#dashboardRecorder,
#dashboardArchive {
  grid-column: 1 / -1;
}

#dashboardSensors {
  margin-top: 0;
}

#dashboardCharts {
  margin-top: 0;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  background: linear-gradient(145deg, rgba(18, 42, 56, 0.96), rgba(8, 20, 28, 0.96));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero--promo {
  position: relative;
  min-height: clamp(270px, 25vw, 360px);
  overflow: hidden;
  display: block;
  padding: 0;
  isolation: isolate;
}

.hero--promo .promo-carousel__viewport {
  position: absolute;
  inset: 0 0 0 420px;
  z-index: 0;
}

.hero__promo-content {
  position: absolute;
  inset: 0 auto 0 0;
  width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 32px;
  background: linear-gradient(145deg, #152832 0%, #0b171e 100%);
  z-index: 2;
}

.hero--promo .brand-wrap {
  position: static;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 0;
  text-align: center;
}

.hero--promo .brand-logo {
  width: 158px;
  height: 158px;
  flex-basis: 158px;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(2, 7, 11, 0.48);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hero--promo .hero__text {
  max-width: 100%;
  width: 100%;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9);
}

.hero--promo .hero__text h1 {
  color: #fff;
  font-size: 29px;
}

.hero--promo .hero__purpose {
  max-width: 320px;
  margin: 12px auto 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.hero--promo .promo-carousel__text {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  z-index: 3;
  padding: 8px 18px;
  text-align: left;
  background: transparent;
  color: #fff;
  font-size: clamp(18px, 2vw, 27px);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.hero--promo .promo-carousel__lead--panel {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
  opacity: 1;
}

.hero--promo .promo-carousel__text {
  bottom: 28px;
  max-height: 1.3em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.hero-actions--promo {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 3;
  justify-content: flex-end;
}

.hero-actions--promo .top-link-btn {
  min-width: 118px;
  padding: 14px 22px;
  color: #061018;
  background: #65e1ff;
  border: 2px solid #ffffff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.55), 0 0 14px rgba(101, 225, 255, 0.55);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.hero-actions--promo .top-link-btn:hover {
  background: #ffffff;
  color: #061018;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 138px;
  height: 138px;
  flex: 0 0 138px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.1;
}

.hero__subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 800px;
  font-size: 16px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.top-link-btn--compact {
  padding: 9px 14px;
}

.status-strip {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.status-card,
.camera-card,
.timeline-panel,
.viewer-top-panel,
.info-card,
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.status-card {
  border-radius: 18px;
  padding: 16px 18px;
  min-width: 220px;
  flex: 1 1 220px;
}

#dashboardRecorder > .status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  align-items: stretch;
}

#dashboardRecorder > .status-strip .status-card {
  min-width: 0;
  width: 100%;
}

.status-title {
  font-size: 18px;
  font-weight: 700;
}

.status-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.camera-control-grid--stacked {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.actuator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.camera-card {
  border-radius: 18px;
  padding: 16px;
}

.camera-card__layout {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.camera-card__left {
  flex: 1 1 auto;
  min-width: 0;
}

.camera-card__right {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.camera-card__hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.camera-card--live .camera-card__hero {
  align-items: flex-start;
}

.camera-badge {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  opacity: 0.78;
}

.camera-badge img {
  width: 208px;
  height: 208px;
  border-radius: 18px;
  object-fit: cover;
  filter: saturate(0.75) brightness(0.92);
}

.camera-preview {
  width: 156px;
  flex: 0 0 156px;
}

.camera-preview__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.camera-preview__button img,
.camera-preview--empty .thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}

.camera-preview__age {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.camera-live-wait {
  color: #ffff00 !important;
  background: rgba(66, 48, 0, 0.95) !important;
  border: 1px solid #ffff00 !important;
  text-shadow:
    0 0 10px rgba(255, 255, 0, 0.95),
    0 0 22px rgba(255, 255, 0, 0.65),
    0 0 34px rgba(255, 255, 0, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 0, 0.22),
    0 0 16px rgba(255, 255, 0, 0.22);
}

.camera-live-wait:disabled {
  opacity: 1 !important;
  color: #ffff00 !important;
  background: rgba(66, 48, 0, 0.95) !important;
  border-color: #ffff00 !important;
}

.camera-name {
  font-size: 18px;
  font-weight: 700;
}

.camera-id {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.camera-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  margin-top: 14px;
  justify-content: space-between;
}

.camera-card__actions--stack {
  margin-top: 0;
  flex-direction: column;
  flex-wrap: nowrap;
}

.camera-card__actions .btn {
  padding: 8px 8px;
  white-space: nowrap;
  flex: 1 1 0;
  font-size: 12px;
}

.camera-card__actions--stack .btn {
  width: 100%;
  flex: 0 0 auto;
}

.camera-card__meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.camera-card__meta--compact {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
}

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

.timelapse-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.timelapse-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.timelapse-card__head strong {
  color: var(--text);
}

.timelapse-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
}

.timelapse-setting-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.timelapse-setting-card .settings-field {
  margin: 0;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-live {
  background: rgba(94, 240, 192, 0.15);
  color: var(--accent-2);
}

.status-idle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.viewer-top-panel,
.timeline-panel {
  border-radius: 22px;
  padding: 18px;
  margin-top: 18px;
}

.site-spotlight {
  overflow: hidden;
}

.promo-carousel__viewport {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #02070b;
}

.promo-carousel__track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  width: max-content;
  min-width: 100%;
  transform: translateX(0);
  z-index: 2;
}

.promo-carousel__slide {
  flex: 0 0 auto;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
}

.promo-carousel__slide img {
  width: auto;
  height: 100%;
  max-width: none;
  display: block;
  object-position: center;
}

.promo-carousel__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 7, 11, 0.74), rgba(2, 7, 11, 0.14) 54%, rgba(2, 7, 11, 0.32));
}

.promo-carousel__caption {
  position: absolute;
  left: 24px;
  bottom: 22px;
  z-index: 1;
  max-width: min(620px, 72%);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.78);
}

.promo-carousel__text {
  color: #fff;
  font-size: clamp(14px, 1.5vw, 20px);
  line-height: 1.15;
  font-weight: 800;
}

.promo-carousel__lead {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(12px, 1.1vw, 16px);
  line-height: 1.25;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.hero--promo .promo-carousel__text {
  margin-top: 4px;
}

.promo-carousel__counter {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(2, 7, 11, 0.52);
  font-size: 12px;
  font-weight: 700;
}

.site-spotlight__media {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.site-spotlight__photo-wrap {
  position: relative;
  min-height: 260px;
  max-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}

.site-spotlight__photo-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 16px;
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.site-spotlight__site-label,
.site-spotlight__title {
  font-family: inherit;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.12;
}

.site-spotlight__site-label {
  letter-spacing: 0.01em;
}

.site-spotlight__online {
  color: #43e27b;
  font-size: 18px;
  font-weight: 900;
}

.site-photo-missing::after {
  content: "Site photo unavailable";
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.site-spotlight__photo-img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
}

.site-spotlight__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  text-align: left;
}

.site-spotlight__topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.site-spotlight__title {
  margin: 0;
}

.site-spotlight__subhead {
  color: rgba(234, 247, 255, 0.84);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0;
}

.site-spotlight__period {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.site-spotlight__period--current {
  color: #43e27b;
  font-size: 16px;
}

.site-spotlight__text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.site-spotlight__actions {
  margin-top: 2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.site-spotlight__source-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spotlight-quicklinks {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.spotlight-card-link {
  display: grid;
  grid-template-columns: 198px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.spotlight-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(85, 214, 255, 0.45);
}

.spotlight-card-link__media {
  width: 198px;
  height: 129px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 20, 27, 0.95);
}

.spotlight-card-link__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spotlight-card-link__body {
  min-width: 0;
}

.spotlight-card-link__title {
  font-weight: 700;
  line-height: 1.2;
}

.spotlight-card-link__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.online-now-label {
  display: inline-block;
  color: #43e27b;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.spotlight-card-link--icon {
  grid-template-columns: 52px minmax(0, 1fr);
}

.spotlight-card-link__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent);
  background: rgba(85, 214, 255, 0.10);
  border: 1px solid rgba(85, 214, 255, 0.18);
}

.camera-list--site {
  margin: 0;
  padding-left: 20px;
}

.camera-list--site li {
  margin: 6px 0;
  color: var(--muted);
}

.status-strip--compact {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.status-card--group {
  min-height: 0;
  padding: 14px 16px;
}

.status-card--group .status-title {
  margin-bottom: 8px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.section-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  margin-bottom: 6px;
}

.section-head h2 {
  margin: 0;
}

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

.sensor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.sensor-grid--history {
  align-items: stretch;
}

.sensor-history-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sensor-history-row {
  display: grid;
  gap: 12px;
}

.sensor-history-row--air,
.sensor-history-row--underwater {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sensor-history-row--surface {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sensor-history-row--air {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.metric-value {
  color: var(--accent-2);
  font-size: 22px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px 16px;
}

.metric-inline-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}

.metric-chip {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.metric-chip strong {
  color: var(--accent-2);
  font-weight: 800;
}

.sensor-grid--stacked {
  grid-template-columns: 1fr;
}

.sensor-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sensor-controls select,
.sensor-controls input {
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 18, 24, 0.95);
  color: var(--text);
}

.chart-card {
  border-radius: 18px;
  padding: 10px;
  min-height: 170px;
}

.chart-card--history {
  min-height: 196px;
}

.chart-card--history canvas {
  height: 132px;
}

.chart-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sensor-history-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sensor-history-toggle {
  min-width: 220px;
  font-weight: 700;
}

.settings-actions--restart {
  margin-top: 8px;
  justify-content: flex-start;
}

@media (max-width: 1100px) {
  .sensor-history-row--air,
  .sensor-history-row--underwater,
  .sensor-history-row--surface {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chart-card--large {
  min-height: 220px;
}

.filter-mode-bar,
.period-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.archive-pager {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.archive-pager .section-meta {
  min-width: 110px;
  text-align: center;
}

.scope-btn,
.period-tab {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.scope-btn.active,
.period-tab.active {
  background: linear-gradient(135deg, #1c8dff, #55d6ff);
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-bar select {
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 18, 24, 0.95);
  color: var(--text);
}

.quick-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.quick-chip {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
}

.quick-chip.active {
  background: rgba(85, 214, 255, 0.18);
  border-color: rgba(85, 214, 255, 0.45);
}

.timeline-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}

.timeline-header {
  margin-bottom: 10px;
  min-width: 900px;
}

.timeline-header-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  padding-right: 110px;
}

.timeline-col-head {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  text-align: center;
}

.timeline-col-head--liked {
  min-height: 18px;
  padding: 6px 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.timeline-body-wrap {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 12px;
  align-items: stretch;
  min-width: 900px;
}

.timeline-body {
  display: grid;
  gap: 10px;
}

.timeline-row {
  min-height: 220px;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.timeline-cell {
  background: var(--panel-2);
  border: 1px solid rgba(126, 172, 196, 0.12);
  border-radius: 16px;
  overflow: hidden;
  min-height: 220px;
}

.clip-cell {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.clip-cell:hover {
  transform: translateY(-2px);
  border-color: rgba(85, 214, 255, 0.45);
}

.timeline-thumb-wrap {
  position: relative;
}

.timeline-thumb-wrap img,
.thumb-placeholder {
  width: 100%;
  height: 130px;
  display: block;
  object-fit: cover;
  background: #02090d;
}

.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.clip-mode {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(4, 14, 19, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  text-transform: uppercase;
}

.timeline-cell-body {
  padding: 10px;
}

.clip-actions,
.clip-social-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.clip-social-bar {
  padding: 12px 0 0;
}

.clip-action-btn {
  border: 1px solid rgba(126, 172, 196, 0.16);
  background: rgba(7, 18, 24, 0.92);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.clip-action-btn:hover {
  border-color: rgba(85, 214, 255, 0.45);
}

.clip-action-btn--liked {
  color: #ffd36f;
  border-color: rgba(255, 211, 111, 0.35);
}

.clip-action-btn--primary {
  color: #aee8ff;
}

.clip-action-btn--plain {
  border: none;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
  color: #aee8ff;
}

.clip-action-btn--plain:hover {
  border: none;
  color: #d7f5ff;
}

.btn-active {
  color: #07131a;
  background: #7fe7ff;
  border-color: #7fe7ff;
  box-shadow: 0 0 0 1px rgba(127, 231, 255, 0.25), 0 0 18px rgba(127, 231, 255, 0.35);
}

.viewer-time-badge {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 107, 0.55);
  background: rgba(86, 16, 16, 0.9);
  color: #ffd7d7;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 150, 150, 0.08);
}

.clip-badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.clip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(9, 24, 30, 0.85);
  border: 1px solid rgba(126, 172, 196, 0.16);
}

.clip-badge--important {
  color: #ffd36f;
  border-color: rgba(255, 211, 111, 0.28);
}

.timeline-time {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.timeline-date {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.sensor-inline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text);
}

#cameraControlGrid.camera-control-grid--stacked {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.camera-card__aux-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.camera-card__aux-actions .btn {
  padding: 7px 8px;
  font-size: 12px;
  white-space: nowrap;
}

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

.empty-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 22px;
}

.timeline-scale {
  display: grid;
  gap: 10px;
  align-content: start;
}

.timeline-scale-item {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 10px;
  border-left: 2px solid rgba(85, 214, 255, 0.25);
  color: var(--muted);
  position: relative;
}

.timeline-scale-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: -6px;
  top: calc(50% - 5px);
}

.timeline-scale-time {
  font-weight: 700;
  color: var(--text);
}

.timeline-scale-time--approx::before {
  content: "~ ";
  color: var(--muted);
}

.timeline-scale-date {
  margin-top: 4px;
  font-size: 12px;
}

.period-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.calendar-card {
  background: var(--panel-2);
  border: 1px solid rgba(126, 172, 196, 0.12);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  color: var(--text);
  text-align: left;
}

.calendar-card:hover {
  border-color: rgba(85, 214, 255, 0.45);
  transform: translateY(-2px);
}

.calendar-card--active {
  border-color: rgba(85, 214, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(85, 214, 255, 0.25) inset;
}

.calendar-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.calendar-card__title {
  font-weight: 700;
  line-height: 1.25;
}

.calendar-card__count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.calendar-card__thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.calendar-card__thumbs img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  background: #02090d;
}

.metric-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-mini {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
}

.period-card {
  background: var(--panel-2);
  border: 1px solid rgba(126, 172, 196, 0.12);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.period-card:hover {
  border-color: rgba(85, 214, 255, 0.45);
  transform: translateY(-2px);
}

.period-loading {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid rgba(126, 172, 196, 0.12);
  color: var(--muted);
}

.period-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.period-card__title {
  font-weight: 700;
}

.period-card__count {
  color: var(--muted);
  font-size: 13px;
}

.period-card__thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.period-card__thumbs img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  background: #02090d;
}

.viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.viewer-modal.hidden {
  display: none;
}

.viewer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 12, 0.72);
  backdrop-filter: blur(3px);
}

.viewer-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100vw - 24px));
  margin: 24px auto;
  background: linear-gradient(145deg, rgba(18, 42, 56, 0.98), rgba(8, 20, 28, 0.98));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.viewer-modal__top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
}

.viewer-modal__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.viewer-modal__body video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.current-info {
  margin-top: 8px;
  color: var(--muted);
}

.info-card {
  border-radius: 16px;
  padding: 14px;
}

.info-card-title {
  font-weight: 700;
}

.mono {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  margin-top: 8px;
}

.link {
  color: var(--accent);
  text-decoration: none;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #1c8dff, #55d6ff);
}

.btn-danger {
  background: linear-gradient(135deg, #d44f5a, #ff6b6b);
}

.btn-success {
  background: linear-gradient(135deg, #1f9b65, #47d98f);
}

.btn-warning {
  background: linear-gradient(135deg, #c97a18, #ffb347);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px 18px;
  align-items: end;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 14px;
}

.settings-field span {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.settings-field input {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 12, 18, 0.85);
  color: var(--text);
  padding: 9px 11px;
}

.settings-field textarea,
.settings-select {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 12, 18, 0.85);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
}

.settings-field textarea {
  resize: vertical;
  min-height: 92px;
}

.settings-field--wide {
  grid-column: 1 / -1;
}

.settings-field--checkbox {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.settings-field--checkbox input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
  border-radius: 6px;
}

.settings-field--checkbox span {
  margin: 0;
}

.settings-select--compact {
  min-width: 180px;
  max-width: 220px;
}

.settings-actions {
  display: flex;
  align-items: end;
  grid-column: 1 / -1;
}

.settings-actions .btn {
  width: auto;
  min-width: 260px;
}

.hidden {
  display: none !important;
}

.debug-box {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: #071218;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7edf8;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1600px) {
  .camera-control-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .camera-card__layout {
    flex-direction: column;
  }

  .camera-card__right {
    flex: 1 1 auto;
    width: 100%;
  }

  .camera-preview {
    width: min(100%, 220px);
    flex-basis: min(100%, 220px);
  }

  .actuator-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .sensor-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .page-shell--dashboard {
    grid-template-columns: 1fr;
  }

  #dashboardSensors,
  #dashboardCharts,
  #cameraControlGrid {
    grid-column: auto;
  }

  .compact-metric-grid {
    grid-template-columns: 1fr;
  }

  .timeline-header-grid,
  .timeline-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .timeline-body-wrap {
    grid-template-columns: 1fr;
  }

  .timeline-scale {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .timeline-scale-item {
    min-height: auto;
    border-left: none;
    border-top: 2px solid rgba(85, 214, 255, 0.25);
  }

  .timeline-scale-item::before {
    left: 12px;
    top: -6px;
  }
}

@media (max-width: 980px) {
  .hero--promo {
    min-height: 0;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 205px 200px auto;
    align-items: stretch;
  }

  .hero__promo-content {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 12px 14px;
    grid-row: 1;
  }

  .hero--promo .promo-carousel__viewport {
    position: relative;
    inset: auto;
    height: 200px;
    grid-row: 2;
  }

  .promo-carousel__track {
    inset: 0;
  }

  .hero-actions--promo {
    position: relative;
    top: auto;
    right: auto;
    grid-row: 3;
    padding: 10px 14px 14px;
    justify-content: center;
  }

  .hero--promo .brand-wrap {
    align-items: center;
    width: 100%;
    padding: 0;
    gap: 7px;
  }

  .hero--promo .brand-logo {
    width: 92px;
    height: 92px;
    flex-basis: 92px;
  }

  .hero--promo .hero__text h1 {
    font-size: 22px;
    line-height: 1.05;
  }

  .hero--promo .hero__purpose {
    max-width: 290px;
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.2;
  }

  .hero--promo .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .hero--promo .promo-carousel__text {
    left: 0;
    right: 0;
    width: 100%;
    padding: 0 14px;
    text-align: left;
    bottom: 18px;
    font-size: 16px;
    line-height: 1.1;
  }

  .hero--promo .promo-carousel__lead--panel {
    margin-top: 10px;
    font-size: 13px;
  }

  .site-spotlight__media {
    grid-template-columns: 1fr;
  }

  .spotlight-quicklinks {
    grid-template-columns: 1fr;
  }

  .status-strip--compact {
    grid-template-columns: 1fr;
  }

  .sensor-history-row--air,
  .sensor-history-row--underwater,
  .sensor-history-row--surface {
    grid-template-columns: 1fr;
  }

  .site-spotlight__photo {
    min-height: 220px;
  }

  .site-spotlight__photo-title {
    font-size: 24px;
  }

  .site-spotlight__brand {
    align-items: flex-start;
  }

  .site-spotlight__brand-logo {
    width: 82px;
    height: 82px;
  }
}

@media (max-width: 980px) {
  .camera-control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) {
  .page-shell {
    padding: 14px;
  }

  .hero {
    flex-direction: column;
    align-items: start;
    padding: 18px;
  }

  .brand-wrap {
    flex-direction: column;
    align-items: start;
  }

  .brand-logo {
    width: 96px;
    height: 96px;
    flex-basis: 96px;
  }

  .camera-control-grid {
    grid-template-columns: 1fr;
  }

  .actuator-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }

  #archiveSection .section-head > .hero-actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #archiveSection .section-head > .hero-actions > * {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  #archiveSection .settings-select--compact {
    min-width: 0;
    max-width: none;
  }

  #archiveSection .archive-pager--bottom {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "size"
      "count"
      "prev"
      "next";
    gap: 8px;
    overflow: hidden;
  }

  #archiveSection #archivePageSizeBottom {
    grid-area: size;
  }

  #archiveSection #archivePrevBtnBottom {
    grid-area: prev;
  }

  #archiveSection #countInfoBottom {
    grid-area: count;
    align-self: center;
  }

  #archiveSection #archiveNextBtnBottom {
    grid-area: next;
  }

  #archiveSection .archive-pager--bottom > * {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-shell,
  #archiveSection,
  #archiveSection .section-head,
  #archiveSection .hero-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .filter-bar,
  .sensor-controls {
    flex-direction: column;
  }

  .filter-bar select,
  .sensor-controls select,
  .sensor-controls input,
  .sensor-controls .btn {
    width: 100%;
  }

  .timeline-scroll {
    overflow: visible;
  }

  .timeline-header,
  .timeline-body-wrap {
    min-width: 0;
  }

  .timeline-header-grid,
  .timeline-grid {
    grid-template-columns: 1fr;
    padding-right: 0;
  }

  .timeline-scale {
    display: none;
  }

  .timeline-row,
  .timeline-cell {
    min-height: auto;
  }

  .viewer-modal__top {
    flex-direction: column;
    align-items: start;
  }

  .viewer-modal__dialog {
    width: calc(100vw - 16px);
    margin: 8px auto;
    padding: 12px;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }
}
