:root {
  --brand-yellow: #ffc400;
  --brand-dark: #1f1f1f;
  --ink: #111827;
  --muted: #657083;
  --line: #e5e7eb;
  --surface: #ffffff;
  --surface-soft: #f6f7f4;
  --green: #198754;
  --blue: #0ea5e9;
  --warning: #f59e0b;
  --shadow: 0 18px 48px rgba(17, 24, 39, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

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

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 7rem 1fr 7rem;
  align-items: center;
  min-height: 74px;
  padding: 0.65rem clamp(1rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 18px rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  text-decoration: none;
}

.brand-logo {
  width: 64px;
  height: 48px;
  object-fit: contain;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.62rem);
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.dashboard-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.slider-wrap {
  position: relative;
  padding-bottom: 3.25rem;
}

.slider {
  position: relative;
}

.slide-viewport {
  min-height: 650px;
}

.slide {
  display: none;
}

.slide.is-active {
  display: block;
}

.plant-layout,
.recap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.25rem);
  align-items: stretch;
}

.plant-layout > *,
.recap-layout > * {
  min-width: 0;
}

.media-frame,
.map-frame,
.recap-visual {
  overflow: hidden;
  background: #eef0ed;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.media-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow);
}

.media-frame img,
.map-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 26%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.photo-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.plant-panel,
.recap-panel {
  display: flex;
  min-width: 0;
  padding: clamp(0.95rem, 2vw, 1.25rem);
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.plant-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.plant-logo {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.plant-title {
  min-width: 0;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plant-title h2,
.recap-panel h2 {
  margin: 0.1rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0;
  line-height: 1.08;
}

.plant-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.map-frame {
  aspect-ratio: 4 / 3;
  margin-bottom: 0.85rem;
}

.fact-list {
  display: grid;
  gap: 0.7rem;
}

.fact-label,
.metric-label,
.eco-label,
.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fact-value {
  margin-top: 0.12rem;
  color: var(--ink);
  line-height: 1.35;
}

.metric-grid {
  display: grid;
  gap: 0.7rem;
}

.metric-tile,
.eco-tile,
.summary-tile {
  min-width: 0;
  padding: 0.8rem;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-value,
.eco-value,
.summary-value {
  display: block;
  margin-top: 0.28rem;
  font-size: clamp(1.2rem, 2.4vw, 1.48rem);
  font-weight: 750;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.metric-value.small {
  font-size: clamp(1.05rem, 2vw, 1.18rem);
}

.metric-value.status {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.22;
}

.eco-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 1rem;
}

.eco-tile {
  text-align: center;
}

.slider-controls {
  position: absolute;
  right: 0;
  bottom: -2.8rem;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--brand-dark);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
  cursor: pointer;
}

.icon-btn span {
  display: block;
  margin-top: -0.1rem;
  font-size: 2rem;
  line-height: 1;
}

.icon-btn:hover,
.indicator:hover {
  border-color: var(--brand-yellow);
}

.slide-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 42px;
}

.indicator {
  width: 0.86rem;
  height: 0.86rem;
  padding: 0;
  background: var(--brand-dark);
  border: 1px solid transparent;
  border-radius: 999px;
  opacity: 0.28;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.indicator.is-active {
  background: var(--brand-yellow);
  opacity: 1;
  transform: scale(1.18);
}

.recap-layout {
  min-height: 600px;
}

.recap-visual {
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 196, 0, 0.98), rgba(255, 225, 101, 0.92)),
    #ffc400;
  box-shadow: var(--shadow);
}

.recap-visual img {
  width: min(72%, 440px);
  height: auto;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.18));
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.summary-tile.accent {
  color: #ffffff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.summary-tile.accent .summary-label {
  color: rgba(255, 255, 255, 0.72);
}

.recap-credit {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.credit-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.footer {
  display: flex;
  justify-content: center;
  padding: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #ffffff;
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  color: #ffffff;
  background: var(--brand-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .slide-viewport {
    min-height: auto;
  }

  .plant-layout,
  .recap-layout,
  .plant-body {
    grid-template-columns: 1fr;
  }

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

}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 4.5rem 1fr;
    row-gap: 0.55rem;
  }

  .brand-logo {
    width: 54px;
    height: 40px;
  }

  .dashboard-shell {
    padding: 0.75rem;
  }

  .plant-heading {
    align-items: flex-start;
  }

  .plant-logo {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .eco-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .slider-controls {
    gap: 0.45rem;
  }
}
