:root {
  --bg: #f4f6f1;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --line: rgba(32, 48, 41, 0.1);
  --text: #203029;
  --muted: #728078;
  --accent: #90be72;
  --accent-deep: #5f8752;
  --shadow: 0 20px 60px rgba(34, 54, 43, 0.08);
  --shadow-soft: 0 10px 28px rgba(34, 54, 43, 0.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1200px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(144, 190, 114, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(121, 182, 151, 0.12), transparent 24%),
    linear-gradient(180deg, #fafbf8 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
textarea,
select {
  font: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.app-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

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

.brand-logo {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #f4f8ef, #ffffff);
  color: var(--accent);
  border: 1px solid rgba(144, 190, 114, 0.24);
}

.brand-logo svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: #2a342f;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.main-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(244, 246, 241, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.nav-link {
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.nav-link.is-active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.header-status,
.hero-meta,
.hero-actions,
.timelapse-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill,
.soft-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.status-pill.subtle {
  color: var(--muted);
}

.status-label {
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d0d8d2;
  box-shadow: 0 0 0 6px rgba(208, 216, 210, 0.24);
}

.status-dot.is-online {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(144, 190, 114, 0.2);
}

.content {
  display: grid;
  gap: 24px;
}

.hero-card,
.panel,
.summary-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  border-radius: var(--radius-xl);
}

.hero-card h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero-copy {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.meta-chip {
  min-width: 150px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f7faf5);
  border: 1px solid var(--line);
}

.meta-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.summary-card,
.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.summary-card p,
.summary-card span,
.panel-footnote,
.action-response,
.timelapse-meta p {
  margin: 0;
  color: var(--muted);
}

.summary-card h2 {
  margin: 14px 0 10px;
  font-size: clamp(1.8rem, 2.3vw, 2.5rem);
  letter-spacing: -0.05em;
}

.accent-card {
  background: linear-gradient(135deg, rgba(144, 190, 114, 0.18), rgba(255, 255, 255, 0.98));
  border-color: rgba(144, 190, 114, 0.2);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.chart-panel {
  min-height: 430px;
}

.chart-wrap {
  position: relative;
  min-height: 320px;
}

.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  cursor: pointer;
}

.toggle-chip.is-active {
  background: color-mix(in srgb, var(--chip-color) 14%, #ffffff);
  box-shadow: inset 0 0 0 1px var(--chip-color);
  color: var(--text);
}

.dashboard-lower,
.gallery-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 24px;
}

.latest-photo-frame,
.timelapse-preview {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(237, 243, 236, 0.7), rgba(255, 255, 255, 0.98)),
    #f8faf7;
}

.latest-photo-frame img,
.timelapse-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 220ms ease;
}

.latest-photo-frame img.is-visible,
.timelapse-preview img.is-visible {
  opacity: 1;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.hidden {
  display: none !important;
}

.text-link {
  color: var(--accent-deep);
  font-weight: 700;
}

.actions-stack {
  display: grid;
  gap: 12px;
}

.action-button {
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #22332b, #18241f);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(24, 36, 31, 0.16);
}

.action-button.secondary {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.action-button:hover,
.toggle-chip:hover,
.photo-tile:hover {
  transform: translateY(-1px);
}

.action-button:disabled {
  opacity: 0.64;
  cursor: progress;
}

.action-response {
  min-height: 52px;
  margin-top: 18px;
  line-height: 1.6;
}

.divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.info-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.info-list dt {
  color: var(--muted);
}

.info-list dd {
  margin: 0;
  font-weight: 700;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.photo-tile {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-solid);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.photo-tile img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.photo-tile span {
  display: block;
  padding: 14px 16px;
  text-align: left;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 20, 0.72);
  backdrop-filter: blur(12px);
}

.lightbox img {
  max-width: min(95vw, 1100px);
  max-height: 80vh;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.lightbox p {
  margin: 16px 0 0;
  color: #f4f7f3;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.7rem;
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-lower,
  .gallery-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .app-shell {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .site-header,
  .hero-card,
  .panel-heading,
  .header-status,
  .hero-meta,
  .hero-actions,
  .timelapse-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header {
    border-radius: 28px;
  }

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

@media (max-width: 620px) {
  .summary-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .summary-card,
  .panel {
    padding: 22px;
  }

  .latest-photo-frame,
  .timelapse-preview {
    min-height: 260px;
  }
}
