:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --panel: #fffdfa;
  --ink: #1f1c17;
  --muted: #6f6658;
  --accent: #c5532f;
  --accent-2: #1e5b74;
  --border: #ded6ca;
  --body-bg:
    radial-gradient(circle at 5% 10%, #e5efe8 0%, transparent 35%),
    radial-gradient(circle at 90% 20%, #f3dfd6 0%, transparent 30%),
    var(--bg);
  --section-frame-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 250, 0.96));
  --shadow: rgba(40, 20, 10, 0.18);
  --soft-shadow: rgba(38, 23, 14, 0.06);
  --button-bg: #fff;
  --media-bg: #f3efe8;
  --placeholder-bg: #ece7dc;
  --success-bg: #e8f6ea;
  --error-bg: #ffe5e5;
  --modal-bg: #fff;
  --modal-overlay: rgba(0, 0, 0, 0.7);
  --image-stage: #111;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1114;
  --panel: #151b1f;
  --ink: #f2f0e8;
  --muted: #b8b1a5;
  --accent: #e26b48;
  --accent-2: #87c9dd;
  --border: #33414a;
  --body-bg:
    radial-gradient(circle at 6% 8%, rgba(37, 88, 93, 0.28) 0%, transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(151, 72, 54, 0.22) 0%, transparent 32%),
    var(--bg);
  --section-frame-bg: linear-gradient(180deg, rgba(25, 33, 38, 0.86), rgba(16, 21, 25, 0.98));
  --shadow: rgba(0, 0, 0, 0.42);
  --soft-shadow: rgba(0, 0, 0, 0.24);
  --button-bg: #10171b;
  --media-bg: #0f1519;
  --placeholder-bg: #12191d;
  --success-bg: #10291b;
  --error-bg: #351716;
  --modal-bg: #0d1114;
  --modal-overlay: rgba(0, 0, 0, 0.84);
  --image-stage: #050709;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--body-bg);
  font-family: "Space Grotesk", sans-serif;
}

html {
  scroll-behavior: smooth;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

h1,
h2,
h3 {
  font-family: "Newsreader", serif;
  line-height: 1.1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-toggle-icon {
  display: grid;
  gap: 0.22rem;
}

.nav-toggle-icon span {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: block;
  width: auto;
  height: clamp(28px, 3.4vw, 44px);
  max-width: min(100%, 310px);
  object-fit: contain;
}

a {
  color: var(--accent-2);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.2rem;
  align-items: center;
  margin-top: 1rem;
}

.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  margin: 0.5rem 0;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin: 0;
}

.hero-media img {
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 20px 45px var(--shadow);
}

.highlights,
.package-grid,
.photo-grid,
.grid-2 {
  display: grid;
  gap: 1rem;
}

.highlights {
  margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.service-block {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  align-items: start;
}

.section-frame {
  position: relative;
  margin-top: 2rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--section-frame-bg);
  box-shadow: 0 10px 22px var(--soft-shadow);
}

.section-frame::before {
  content: "";
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  top: 0;
  height: 4px;
  border-radius: 0 0 8px 8px;
  background: var(--accent-2);
  opacity: 0.9;
}

.timelapse-frame::before {
  background: #1e5b74;
}

.drone-frame::before {
  background: #2b7a56;
}

.captures-frame::before {
  background: #c5532f;
}

.projects-frame::before {
  background: #8a6a2b;
}

.service-block-reverse {
  grid-template-columns: 1fr 1.1fr;
}

.service-media img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.feature-list {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

.feature-list li {
  margin-bottom: 0.35rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.showcase {
  margin-top: 2.2rem;
}

.showcase-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.showcase-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.showcase-track {
  display: flex;
  gap: 0.8rem;
}

.carousel-btn {
  min-width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.1rem;
}

.showcase-item {
  margin: 0;
  flex: 0 0 calc((100% - 1.6rem) / 3);
  scroll-snap-align: start;
}

.showcase-item img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.carousel-image-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  cursor: zoom-in;
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: #bbaea0;
  cursor: pointer;
  padding: 0;
}

.carousel-dot.active {
  background: var(--accent);
}

.carousel-hint {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

#homeExpandedImage {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  margin: 0.8rem auto 0;
  object-fit: contain;
  border-radius: 10px;
  background: var(--image-stage);
}

.projects-section {
  margin-top: 2.2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.project-reel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.project-reel-card h3 {
  margin-top: 0;
}

.video-embed {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--image-stage);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-preview-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.video-preview-poster {
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
  min-height: 100%;
  aspect-ratio: 16 / 9;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(14, 16, 20, 0.92), rgba(32, 42, 48, 0.72)),
    linear-gradient(160deg, rgba(226, 107, 72, 0.18), transparent 55%),
    var(--image-stage);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.video-preview-play {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
}

.video-preview-copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  color: #fff;
}

.video-preview-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.76;
}

.video-preview-title {
  font-size: 1rem;
  font-weight: 700;
}

.video-preview-label {
  font-size: 0.88rem;
  opacity: 0.85;
}

.video-preview-trigger:focus-visible .video-preview-poster,
.video-preview-trigger:hover .video-preview-poster {
  box-shadow: 0 0 0 2px var(--accent-2) inset, inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}


.video-modal-content {
  width: min(1200px, 96vw);
}

.video-modal-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--image-stage);
}

.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
}


.highlights article,
.package-card,
.card,
.photo-card,
.project-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.packages {
  margin-top: 2rem;
}

.package-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.price {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.btn.ghost {
  background: var(--button-bg);
  color: var(--ink);
}

.btn.danger {
  background: #9f2f25;
  color: #fff;
  border-color: transparent;
}

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

.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.theme-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  min-width: 3.1rem;
  padding: 0.3rem 0.55rem;
  text-align: center;
  line-height: 1;
}

.site-nav a {
  text-decoration: none;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.auth-wrap {
  min-height: 72vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(460px, 100%);
}

label {
  display: block;
  margin: 0.65rem 0;
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--button-bg);
  color: var(--ink);
  font: inherit;
}

.checkbox {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.checkbox input {
  width: auto;
  margin: 0;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dashboard-head {
  margin: 1rem 0;
}

.project-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.project-title-row h1 {
  margin: 0;
}

.project-description-inline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.admin-dashboard > * + * {
  margin-top: 10px;
}

.admin-disclosure-form {
  margin-top: 0.85rem;
}

.camera-config-list {
  display: grid;
  gap: 0.55rem;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.section-heading-row h2,
.section-heading-row p {
  margin: 0;
}

.section-heading-row p {
  color: var(--muted);
  font-size: 0.92rem;
}

.project-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

.project-health-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}

.project-health-image {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--media-bg);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.project-health-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-health-body {
  padding: 0.75rem;
}

.project-health-body h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.project-health-body p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.project-health-footer {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.project-health-note {
  color: var(--accent-2);
  font-weight: 700;
}

.project-health-stamp {
  display: inline-flex;
  justify-self: start;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}

.project-health-stamp.status-good {
  background: #198754;
}

.project-health-stamp.status-warn {
  background: #c46a12;
}

.project-health-stamp.status-bad {
  background: #b42318;
}

.camera-config-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
}

.camera-config-summary,
.admin-project-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
}

.camera-config-summary::-webkit-details-marker,
.admin-project-summary::-webkit-details-marker {
  display: none;
}

.camera-config-summary::after,
.admin-project-summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 700;
}

.camera-config-item[open] .camera-config-summary::after,
.admin-project-item[open] .admin-project-summary::after {
  content: "−";
}

.camera-config-summary > span,
.admin-project-summary > span {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.camera-config-summary span span,
.admin-project-summary span span,
.camera-config-summary > span:last-child,
.admin-project-summary > span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
}

.camera-config-body {
  border-top: 1px solid var(--border);
  padding: 0.85rem;
}

.camera-config-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.camera-config-head h3 {
  margin: 0 0 0.25rem;
}

.camera-config-head p {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.camera-config-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.1rem 0.75rem;
}

.camera-config-form .camera-enabled {
  align-self: end;
  margin-bottom: 0.85rem;
}

.camera-field-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.1rem 0.75rem;
}

.camera-config-form .btn {
  justify-self: start;
}

.admin-project-list {
  display: grid;
  gap: 0.55rem;
}

.admin-project-item {
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-project-delete {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.2fr minmax(240px, 0.8fr);
  gap: 1rem;
  padding: 0.85rem;
}

.project-rename-form,
.project-flag-form,
.project-owner-form,
.customer-edit-form,
.customer-assign-form {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}

.project-flag-form .checkbox {
  margin: 0;
}

/* These forms are grids, so a button would stretch to the full column width
   (~280px) and look oversized — worst on the red Delete Project button. Size
   them to their label instead, like the "View Project" link above them. */
.project-rename-form button,
.project-owner-form button,
.project-flag-form button,
.delete-project-form button {
  justify-self: start;
  align-self: start;
}

.admin-project-delete p {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.delete-project-form {
  display: grid;
  gap: 0.6rem;
  /* This form is the right-hand column of .admin-project-delete, so it's
     stretched to the (tall) height of the left column. Without this, its auto
     rows stretch to fill that height — which dropped the Delete button far down
     the column and blew it up into a huge tall pill. Pack rows to the top. */
  align-content: start;
}

.customer-admin-list {
  display: grid;
  gap: 0.55rem;
}

.customer-admin-item {
  border: 1px solid var(--border);
  border-radius: 10px;
}

.customer-admin-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
}

.customer-admin-summary::-webkit-details-marker {
  display: none;
}

.customer-admin-summary::after {
  content: "+";
  color: var(--accent);
}

.customer-admin-item[open] .customer-admin-summary::after {
  content: "−";
}

.customer-admin-summary > span:first-child {
  display: grid;
  gap: 0.2rem;
}

.customer-admin-summary span span {
  color: var(--muted);
  font-size: 0.9rem;
}

.customer-admin-body {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem;
}

.customer-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
}

.customer-projects h3 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
}

.delete-project-form label {
  margin: 0;
}


.project-block {
  margin: 1rem 0;
}

.photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.image-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: zoom-in;
}

.gallery-image {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  background: var(--media-bg);
  border-radius: 10px;
  display: block;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.timelapse-filename {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.project-placeholder {
  width: 100%;
  min-height: 220px;
  border-radius: 10px;
  background: var(--placeholder-bg);
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.project-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

.project-sync-note,
.timelapse-sync-note {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.timelapse-filters-disclosure {
  margin-bottom: 0.8rem;
  padding: 0.7rem 0.85rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-bg);
}

.timelapse-filters-disclosure summary {
  list-style: none;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
}

.timelapse-filters-disclosure summary::-webkit-details-marker {
  display: none;
}

.timelapse-filters-disclosure summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.timelapse-filters-disclosure[open] summary::after {
  content: "▴";
}

.timelapse-filters-disclosure .timelapse-filters {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.download-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.timelapse-filters {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(130px, 1fr) minmax(130px, 1fr) auto auto;
  gap: 0.45rem 0.6rem;
  align-items: end;
  margin-bottom: 0.8rem;
}

.timelapse-filters label {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.82rem;
}

.timelapse-filters input,
.timelapse-filters select {
  margin-top: 0;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
}

.timelapse-filters .btn {
  padding: 0.45rem 0.85rem;
}

.timelapse-summary {
  margin: -0.1rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.timelapse-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.timelapse-pagination-info {
  color: var(--muted);
  font-size: 0.92rem;
}

.photo-select {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}

.photo-select input {
  width: auto;
  margin: 0;
}

.alerts {
  max-width: 1100px;
  margin: 1rem auto 0;
  padding: 0 1rem;
}

.alert {
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.5rem;
}

.alert.ok {
  background: var(--success-bg);
}

.alert.error {
  background: var(--error-bg);
}

.modal {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  display: none;
  place-items: center;
  z-index: 20;
}

.modal[aria-hidden="false"] {
  display: grid;
}

.modal-content {
  width: min(1000px, 95vw);
  background: var(--modal-bg);
  border-radius: 12px;
  padding: 1rem;
}

#imageModal .modal-content,
#homeImageModal .modal-content {
  width: min(1500px, 98vw);
  max-height: 98vh;
}

#imageModal .modal-content {
  height: 98vh;
  display: flex;
  flex-direction: column;
}

#sphereViewer {
  width: 100%;
  height: min(75vh, 680px);
  margin-top: 0.8rem;
  border-radius: 10px;
}

.zoom-stage {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0.8rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  border-radius: 10px;
  background: var(--image-stage);
}

.zoom-stage.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}

.zoom-stage.is-zoomed #expandedImage {
  margin: 0;
}

#expandedImage {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  border-radius: 10px;
  background: var(--image-stage);
  cursor: zoom-in;
}

#expandedImage.is-zoomed {
  cursor: zoom-out;
}

#homeExpandedImage {
  max-height: calc(96vh - 76px);
}

.modal-image-name {
  flex: 0 0 auto;
  margin: 0.55rem 0 0;
  padding: 0.35rem 0.45rem 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.list-simple {
  margin: 0;
  padding-left: 1.2rem;
}

.modal-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

#imageModal .modal-toolbar {
  flex: 0 0 auto;
}

.modal-tool-icon {
  display: none;
}

.cta-card {
  margin-top: 2rem;
  text-align: center;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .service-block,
  .service-block-reverse {
    grid-template-columns: 1fr;
  }

  .showcase-item {
    flex-basis: calc((100% - 0.8rem) / 2);
  }

  .section-frame {
    padding: 1rem;
  }

  .modal-toolbar {
    flex-wrap: wrap;
  }

  #imageModal .modal-toolbar {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.35rem;
  }

  #imageModal .modal-tool-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
    font-size: 1.25rem;
    line-height: 1;
  }

  #imageModal #resetZoomImage {
    font-size: 0.82rem;
    font-weight: 700;
  }

  #imageModal .modal-tool-label {
    display: none;
  }

  #imageModal .modal-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .timelapse-filters {
    grid-template-columns: 1fr;
  }

  .timelapse-filters-disclosure {
    padding: 0.65rem 0.75rem 0.75rem;
  }

  .timelapse-filters-disclosure:not([open]) > .timelapse-filters {
    display: none;
  }
}

@media (min-width: 901px) {
  .timelapse-filters-disclosure summary {
    display: none;
  }

  .timelapse-filters-disclosure > .timelapse-filters {
    display: grid;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    position: relative;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 1rem;
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: 0 14px 30px var(--shadow);
    z-index: 10;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .site-nav .theme-toggle {
    width: 100%;
  }

  .brand-mark {
    height: 28px;
    max-width: 54vw;
  }

  .camera-config-head {
    flex-direction: column;
  }

  .camera-config-summary,
  .admin-project-summary {
    align-items: flex-start;
  }

  .admin-project-delete {
    grid-template-columns: 1fr;
  }

  .showcase-carousel {
    grid-template-columns: 1fr;
  }

  .carousel-btn {
    display: none;
  }

  .showcase-item {
    flex-basis: 100%;
  }
}

/* ---------------------------------------------------------------------------
   Admin dashboard: collapsible sections + compact health grid (2026-07-29)
   Scoped to .admin-* / .project-health-* which are used ONLY by admin.html —
   the client-facing pages are unaffected.
   --------------------------------------------------------------------------- */
.admin-section {
  padding: 0.85rem 1rem;
}

.admin-section > .admin-section-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  /* comfortable thumb target on mobile */
  min-height: 44px;
}

.admin-section > .admin-section-summary::-webkit-details-marker {
  display: none;
}

.admin-section-title {
  font-family: "Newsreader", serif;
  font-size: 1.45rem;
  line-height: 1.15;
}

.admin-section-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* the +/- affordance, matching .admin-disclosure */
.admin-section > .admin-section-summary::after {
  content: "+";
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.admin-section[open] > .admin-section-summary::after {
  content: "−";
}

.admin-section[open] > .admin-section-summary {
  margin-bottom: 0.85rem;
}

.admin-count {
  min-width: 1.6rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--media-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

/* at-a-glance status counts in the health header (visible while collapsed) */
.admin-pill {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.admin-pill.status-good { background: #198754; }
.admin-pill.status-warn { background: #c46a12; }
.admin-pill.status-bad  { background: #b42318; }

/* Health grid: 2 columns on mobile with smaller thumbnails, scaling up wider.
   auto-fill alone won't give 2 columns in the narrow mobile card (~309px), so
   pin it to 2 there and let it grow on wider screens. */
.project-health-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}

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

.project-health-image {
  position: relative;
  aspect-ratio: 16 / 10;
}

/* status dot on the thumbnail — read the state without opening anything */
.project-health-dot {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}
.project-health-dot.status-good { background: #23c55e; }
.project-health-dot.status-warn { background: #f59e0b; }
.project-health-dot.status-bad  { background: #ef4444; }

/* Nightly jobs strip: replication + backup at a glance. Colour is never the
   only signal - every dot is paired with its own text (a time, "late", or
   "FAILED"), so it still reads correctly in greyscale or with low colour vision. */
.system-jobs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  padding: 0.7rem 0.9rem;
}
.system-jobs-title {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.7;
}
.system-job {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.system-job-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex: none;
  background: #9aa0a6;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18);
}
.system-job-dot.status-good { background: #23c55e; }
.system-job-dot.status-warn { background: #f59e0b; }
.system-job-dot.status-bad  { background: #ef4444; }
.system-job-label { font-weight: 600; }
.system-job-detail { opacity: 0.75; }

.project-health-body {
  padding: 0.5rem 0.6rem 0.6rem;
}

.project-health-body h3 {
  font-size: 0.9rem;
}

.project-health-body p {
  font-size: 0.78rem;
}

.project-health-footer {
  gap: 0.25rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
}

.project-health-stamp {
  padding: 0.2rem 0.45rem;
  font-size: 0.74rem;
}

/* the status word is already conveyed by the dot + stamp colour; keep it for
   screen readers and wider screens, but don't let it bloat small cards */
@media (max-width: 600px) {
  .project-health-status {
    display: none;
  }
  .admin-section-title {
    font-size: 1.2rem;
  }
}

/* ---------------------------------------------------------------------------
   Admin quick actions: a row of icon buttons that reveals one form panel at a
   time (replaces five stacked disclosure cards). Admin-only selectors.
   --------------------------------------------------------------------------- */
.admin-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  max-width: 700px;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.admin-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 64px;
  padding: 0.5rem 0.15rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.63rem;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}

.admin-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-action:hover {
  background: var(--media-bg);
}

.admin-action:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* active = its panel is open */
.admin-action[aria-expanded="true"] {
  background: var(--media-bg);
  border-color: var(--border);
}

.admin-action-panel h2 {
  margin-top: 0;
}

@media (min-width: 700px) {
  .admin-action {
    min-height: 74px;
    font-size: 0.72rem;
  }
  .admin-action svg {
    width: 26px;
    height: 26px;
  }
}

/* ---------------------------------------------------------------------------
   Admin: Pi storage used/free strip. Uses a native <progress> element for the
   bar because the portal's CSP forbids inline styles (no way to set a dynamic
   width via style="").
   --------------------------------------------------------------------------- */
.disk-usage {
  padding: 0.7rem 1rem 0.8rem;
}

.disk-usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.disk-usage-title {
  font-family: "Newsreader", serif;
  font-size: 1.2rem;
}

.disk-usage-figure {
  color: var(--muted);
  font-size: 0.8rem;
}

.disk-usage-bar {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--media-bg);
  -webkit-appearance: none;
  appearance: none;
}

/* the track */
.disk-usage-bar::-webkit-progress-bar {
  background: var(--media-bg);
  border-radius: 999px;
}

/* the fill — colour follows the same good/warn/bad scale as project health */
.disk-usage-bar::-webkit-progress-value {
  background: #23c55e;
  border-radius: 999px;
}
.disk-usage-bar::-moz-progress-bar {
  background: #23c55e;
  border-radius: 999px;
}
.disk-usage.status-warn .disk-usage-bar::-webkit-progress-value {
  background: #f59e0b;
}
.disk-usage.status-warn .disk-usage-bar::-moz-progress-bar {
  background: #f59e0b;
}
.disk-usage.status-bad .disk-usage-bar::-webkit-progress-value {
  background: #ef4444;
}
.disk-usage.status-bad .disk-usage-bar::-moz-progress-bar {
  background: #ef4444;
}

/* Admin: on-demand timelapse video block (project editor). Admin-only. */
.project-video-block {
  margin: 0.2rem 0 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.project-video-block h4 {
  margin: 0 0 0.5rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-video-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.project-video-label {
  min-width: 6.5rem;
  font-size: 0.9rem;
}
.project-video-row .video-generate-form {
  display: inline;
  margin: 0;
}
.project-video-status {
  font-size: 0.88rem;
  color: var(--accent-2);
  font-weight: 700;
}

/* Admin: camera Logs section — per-camera status reports FTP'd by the cameras. */
.camera-log-list {
  display: grid;
  gap: 0.8rem;
}
.camera-log-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: var(--panel);
  min-width: 0;   /* grid item: allow shrinking so the table scrolls, not the page */
}
/* Each camera's log is a collapsible, matching the other admin sections, so a
   fleet of cameras stays scannable instead of dumping every table at once. */
.camera-log-card > .camera-log-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  /* comfortable thumb target on mobile, same as .admin-section-summary */
  min-height: 44px;
}

.camera-log-card > .camera-log-head::-webkit-details-marker {
  display: none;
}

/* Only space the header off the content once it is actually open. */
.camera-log-card[open] > .camera-log-head {
  margin-bottom: 0.55rem;
}
.camera-log-when {
  font-size: 0.82rem;
  color: var(--muted);
}
.camera-log-chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
}
.camera-log-chip.status-ok   { background: var(--success-bg); color: #2b7a56; }
.camera-log-chip.status-warn { background: #f5e9d0; color: #8a6a2b; }
.camera-log-chip.status-bad  { background: var(--error-bg); color: #a33; }
[data-theme="dark"] .camera-log-chip.status-ok   { color: #7dd3a4; }
[data-theme="dark"] .camera-log-chip.status-warn { background: #3a3020; color: #e0b95e; }
[data-theme="dark"] .camera-log-chip.status-bad  { color: #ef9a9a; }
.camera-log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.35rem 0.9rem;
  margin: 0;
}
.camera-log-item dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.camera-log-item dd {
  margin: 0;
  font-size: 0.92rem;
  word-break: break-word;
}
.camera-log-raw {
  margin-top: 0.6rem;
}
.camera-log-raw summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--accent-2);
}
.camera-log-tail {
  max-height: 320px;
  overflow: auto;
  margin: 0.5rem 0 0;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--media-bg);
  font-size: 0.74rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Camera Logs: capture-history table — one line per row, sideways scroll on mobile. */
.camera-log-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.camera-log-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 0.8rem;
}
.camera-log-table th,
.camera-log-table td {
  white-space: nowrap;
  text-align: left;
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.camera-log-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--media-bg);
  position: sticky;
  top: 0;
}
.camera-log-table tbody tr:last-child td {
  border-bottom: 0;
}
.camera-log-table tbody tr:nth-child(even) {
  background: var(--media-bg);
}

/* Camera health cell: a stuck wake alarm is the one fault where every other
   column on the row still reads normal, so it has to be impossible to miss.
   Colours match .camera-log-chip.status-bad above rather than inventing a red —
   a hand-picked #b3261e scored only 2.66:1 on the dark theme (AA wants 4.5). */
.camera-log-health-bad {
  color: #a33;
  font-weight: 700;
  white-space: nowrap;
}
[data-theme="dark"] .camera-log-health-bad { color: #ef9a9a; }

/* Camera config change log — operator actions, shown above the camera's own
   reports so the two can be read together (which change preceded which fault,
   and when the camera actually adopted it). */
.camera-log-changes {
  margin: 0 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  min-width: 0;
}
.camera-log-changes > summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Camera Logs refresh. Sits outside .camera-log-list because that element's
   innerHTML is replaced on refresh — a control inside it would delete itself. */
.camera-log-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
  flex-wrap: wrap;
}
/* Uses .btn ghost from the design system; this only shrinks it to a secondary
   control so it does not compete with the page's primary actions. */
.camera-log-refresh {
  font-size: 0.85rem;
  padding: 0.35rem 0.95rem;
  /* min-height, not more padding: measured 29px tall at 375px, which is an
     awkward tap target on a phone. 38px is comfortable without making it look
     like a primary action. */
  min-height: 38px;
}
.camera-log-refreshed {
  font-size: 0.8rem;
  opacity: 0.7;
}
