:root {
  color-scheme: light;
  --sky: #d9e3e6;
  --paper: #f2f0e9;
  --ink: #142019;
  --muted: #647068;
  --line: rgb(20 32 25 / 18%);
  --glass: rgb(242 240 233 / 88%);
  --leaf: #2d7045;
  --chlorophyll: #b8f04a;
  --water: #4f9ca5;
  --heat: #e96843;
  --asphalt: #363b37;
  --header: 3.45rem;
  font-family: Figtree, Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  min-width: 20rem;
  min-height: 100%;
  margin: 0;
  background: var(--sky);
  color: var(--ink);
}
body {
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 0.16rem solid var(--heat);
  outline-offset: 0.16rem;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
.micro-label {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 11.5rem minmax(18rem, 1fr) auto 13.5rem;
  align-items: center;
  height: var(--header);
  border-bottom: 1px solid var(--line);
  background: rgb(233 238 236 / 90%);
  backdrop-filter: blur(1rem);
}
.brand {
  display: flex;
  gap: 0.62rem;
  align-items: center;
  height: 100%;
  padding: 0 0.9rem;
  border-right: 1px solid var(--line);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}
.brand-symbol {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.brand-symbol i {
  position: absolute;
  top: -0.1rem;
  left: 0.5rem;
  width: 0.2rem;
  height: 1.4rem;
  background: var(--heat);
  transform: rotate(28deg);
}
.brand-symbol i:last-child {
  background: var(--leaf);
  transform: rotate(-28deg);
}
.place-search {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  border-right: 1px solid var(--line);
}
.place-search > span {
  color: var(--heat);
  font-size: 1rem;
}
.place-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 650;
}
.place-search kbd {
  padding: 0.18rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.18rem;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.46rem;
}
.data-state {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.8rem;
}
.data-state span {
  padding: 0.26rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.43rem;
  text-transform: uppercase;
}
.data-state span::before {
  display: inline-block;
  width: 0.34rem;
  height: 0.34rem;
  margin-right: 0.28rem;
  border-radius: 50%;
  background: var(--leaf);
  content: "";
}
.simulate-button {
  align-self: stretch;
  border: 0;
  background: var(--ink);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
}
.simulate-button:hover {
  background: #21352a;
}

.world-shell {
  position: relative;
  height: 100vh;
  overflow: hidden;
  padding-top: var(--header);
}
.world-canvas {
  position: absolute;
  inset: var(--header) 0 0;
  background: var(--sky);
}
.world-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.world-label {
  position: absolute;
  z-index: 5;
  top: calc(var(--header) + 1rem);
  display: flex;
  gap: 0.45rem;
  align-items: center;
  color: rgb(20 32 25 / 62%);
  font-family: "DM Mono", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}
.world-label span {
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}
.current-label {
  left: 1rem;
}
.future-label {
  right: 1rem;
}
.split-handle {
  position: absolute;
  z-index: 15;
  top: var(--header);
  bottom: 0;
  left: 56%;
  width: 2.6rem;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  transform: translateX(-50%);
  touch-action: none;
}
.split-handle i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 0 0 1px rgb(20 32 25 / 15%);
}
.split-handle span {
  position: absolute;
  top: 48%;
  left: 50%;
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid rgb(20 32 25 / 28%);
  border-radius: 50%;
  background: rgb(242 240 233 / 92%);
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  box-shadow: 0 0.4rem 1.5rem rgb(20 32 25 / 16%);
  transform: translate(-50%, -50%);
}

.location-card,
.proposal-panel,
.impact-bar,
.time-control,
.camera-help {
  position: absolute;
  z-index: 10;
}
.location-card {
  top: calc(var(--header) + 1.1rem);
  left: 1rem;
  width: 12.5rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(1rem);
}
.location-card h1 {
  margin: 0.55rem 0 1rem;
  font-size: 1.12rem;
  font-weight: 550;
  line-height: 1.04;
  letter-spacing: -0.045em;
}
.condition-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.condition-row strong {
  color: var(--heat);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.06em;
}
.condition-row span {
  color: var(--muted);
  font-size: 0.52rem;
  line-height: 1.4;
}
.solar-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.7rem;
  font-size: 0.48rem;
}
.solar-row > span {
  color: var(--muted);
}
.solar-row > i {
  height: 0.25rem;
  overflow: hidden;
  border-radius: 1rem;
  background: #d3d3ca;
}
.solar-row b {
  display: block;
  width: 86%;
  height: 100%;
  background: linear-gradient(90deg, #e9bc56, var(--heat));
}
.solar-row strong {
  color: var(--heat);
  font-family: "DM Mono", monospace;
  font-size: 0.45rem;
  text-transform: uppercase;
}

.proposal-panel {
  top: calc(var(--header) + 1rem);
  right: 1rem;
  width: 18.5rem;
  max-height: calc(100vh - var(--header) - 8.5rem);
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(1.1rem);
}
.proposal-panel > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.proposal-panel h2 {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.proposal-status {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  color: var(--leaf);
  font-family: "DM Mono", monospace;
  font-size: 0.44rem;
  text-transform: uppercase;
}
.proposal-status i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--chlorophyll);
  box-shadow: 0 0 0 1px #6d9724;
}
.proposal-summary {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.55;
}
.intervention-list label {
  position: relative;
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  min-height: 3.75rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.intervention-list label > span:nth-child(2) strong,
.intervention-list label > span:nth-child(2) small {
  display: block;
}
.intervention-list label > span:nth-child(2) strong {
  font-size: 0.6rem;
}
.intervention-list label > span:nth-child(2) small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.48rem;
}
.intervention-list output {
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
}
.intervention-list input[type="range"] {
  position: absolute;
  right: 0.9rem;
  bottom: 0.35rem;
  left: 3rem;
  height: 2px;
  appearance: none;
  background: linear-gradient(90deg, var(--leaf), #bfc2b8);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.intervention-list label:hover input[type="range"],
.intervention-list input[type="range"]:focus {
  opacity: 1;
}
.intervention-list input[type="range"]::-webkit-slider-thumb {
  width: 0.6rem;
  height: 0.6rem;
  appearance: none;
  border-radius: 50%;
  background: var(--ink);
  cursor: ew-resize;
}
.control-icon {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
}
.tree-icon::before {
  position: absolute;
  inset: 0.05rem 0.2rem 0.45rem;
  border-radius: 50% 50% 45% 45%;
  background: var(--leaf);
  content: "";
}
.tree-icon::after {
  position: absolute;
  bottom: 0.05rem;
  left: 0.62rem;
  width: 0.12rem;
  height: 0.55rem;
  background: #7a543d;
  content: "";
}
.shade-icon {
  border-top: 0.35rem solid var(--heat);
  border-right: 0.2rem solid transparent;
  border-left: 0.2rem solid transparent;
}
.shade-icon::after {
  position: absolute;
  top: 0.1rem;
  left: 0.55rem;
  width: 0.1rem;
  height: 1rem;
  background: var(--ink);
  content: "";
}
.water-icon {
  border: 1px solid var(--water);
  border-radius: 50% 50% 50% 0;
  background: rgb(79 156 165 / 20%);
  transform: rotate(-45deg) scale(0.75);
}
.lane-icon {
  background: repeating-linear-gradient(90deg, var(--ink) 0 0.15rem, transparent 0.15rem 0.3rem);
  clip-path: polygon(0 35%, 100% 35%, 100% 65%, 0 65%);
}
.toggle-control input {
  position: absolute;
  opacity: 0;
}
.toggle-control > i {
  position: relative;
  width: 1.8rem;
  height: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #c8c9c1;
}
.toggle-control > i::after {
  position: absolute;
  top: 0.12rem;
  left: 0.13rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: white;
  content: "";
  transition: transform 0.18s ease;
}
.toggle-control input:checked + i {
  background: var(--leaf);
}
.toggle-control input:checked + i::after {
  transform: translateX(0.82rem);
}
.proposal-panel details {
  padding: 0.75rem 0.9rem;
}
.proposal-panel summary {
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.proposal-panel details p {
  margin: 0.65rem 0;
  color: var(--muted);
  font-size: 0.52rem;
  line-height: 1.5;
}
.source-links {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.source-links span {
  padding: 0.22rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.4rem;
}

.impact-bar {
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  min-height: 5.8rem;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(1.2rem);
}
.impact-heading,
.impact-metric {
  padding: 0.75rem 0.85rem;
  border-right: 1px solid var(--line);
}
.impact-heading {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.impact-heading strong {
  max-width: 9rem;
  font-size: 0.72rem;
  line-height: 1.25;
}
.impact-metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.impact-metric > span {
  color: var(--muted);
  font-size: 0.5rem;
}
.impact-metric div {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.impact-metric s {
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration-color: var(--heat);
}
.impact-metric strong {
  color: var(--leaf);
  font-size: 1.2rem;
  font-weight: 550;
  letter-spacing: -0.05em;
}
.heat-metric strong {
  color: var(--water);
}
.impact-metric small {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.43rem;
  text-transform: uppercase;
}
.time-control {
  bottom: 7.5rem;
  left: 1rem;
  display: flex;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(1rem);
}
.time-control button {
  min-width: 3rem;
  padding: 0.5rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.46rem;
  cursor: pointer;
}
.time-control button:last-child {
  border: 0;
}
.time-control button.is-active {
  background: var(--ink);
  color: white;
}
.camera-help {
  bottom: 7.75rem;
  left: 11.25rem;
  color: rgb(20 32 25 / 55%);
  font-family: "DM Mono", monospace;
  font-size: 0.43rem;
  text-transform: uppercase;
}

dialog {
  width: min(36rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0.75rem 0.75rem 0 rgb(20 32 25 / 18%);
}
dialog::backdrop {
  background: rgb(44 65 53 / 30%);
  backdrop-filter: blur(0.5rem);
}
.simulation-copy {
  padding: 1.1rem;
}
.simulation-copy h2 {
  margin: 0.45rem 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 550;
  letter-spacing: -0.05em;
}
.simulation-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.6rem;
}
.simulation-map {
  position: relative;
  height: 12rem;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #d3d9d4;
}
.simulation-map::before,
.simulation-map::after {
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(20deg, transparent 0 2rem, rgb(20 32 25 / 11%) 2rem 2.08rem);
  content: "";
  transform: rotate(12deg);
}
.simulation-map::after {
  background: repeating-linear-gradient(110deg, transparent 0 3rem, rgb(20 32 25 / 9%) 3rem 3.08rem);
}
.simulation-map i {
  position: absolute;
  z-index: 2;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--leaf);
  animation: mapPulse 1.4s ease-in-out infinite alternate;
}
.simulation-map i:nth-child(1) {
  top: 28%;
  left: 25%;
}
.simulation-map i:nth-child(2) {
  top: 54%;
  left: 44%;
  animation-delay: 0.25s;
}
.simulation-map i:nth-child(3) {
  top: 34%;
  left: 68%;
  animation-delay: 0.5s;
}
.simulation-map i:nth-child(4) {
  top: 68%;
  left: 78%;
  animation-delay: 0.75s;
}
.simulation-map span {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgb(184 240 74 / 42%), transparent);
  animation: scan 1.5s linear infinite;
}
.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.pipeline-steps span {
  padding: 0.7rem 0.3rem;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.43rem;
  text-align: center;
  text-transform: uppercase;
}
.pipeline-steps span:last-child {
  border: 0;
}
.pipeline-steps span.is-active {
  background: var(--ink);
  color: white;
}
.toast {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 7.4rem;
  padding: 0.7rem 0.9rem;
  background: var(--ink);
  color: white;
  font-size: 0.56rem;
  transform: translateX(calc(100% + 2rem));
  transition: transform 0.22s ease-out;
}
.toast.is-visible {
  transform: none;
}
@keyframes mapPulse {
  to {
    transform: scale(1.7);
    box-shadow: 0 0 0 0.4rem rgb(184 240 74 / 28%);
  }
}
@keyframes scan {
  to {
    left: 100%;
  }
}

@media (max-width: 65rem) {
  .topbar {
    grid-template-columns: 10.5rem 1fr 12rem;
  }
  .data-state {
    display: none;
  }
  .proposal-panel {
    width: 16.5rem;
  }
  .impact-bar {
    grid-template-columns: repeat(4, 1fr);
  }
  .impact-heading {
    display: none;
  }
}
@media (max-width: 48rem) {
  body {
    overflow: auto;
  }
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .place-search {
    display: none;
  }
  .simulate-button {
    min-width: 12rem;
  }
  .world-shell {
    min-height: 68rem;
  }
  .world-canvas {
    height: 32rem;
  }
  .proposal-panel {
    top: 34rem;
    right: 0.7rem;
    left: 0.7rem;
    width: auto;
    max-height: none;
  }
  .location-card {
    top: calc(var(--header) + 0.7rem);
    left: 0.7rem;
    width: 11.5rem;
  }
  .split-handle {
    bottom: auto;
    height: 28.55rem;
  }
  .impact-bar {
    top: 55rem;
    right: 0.7rem;
    bottom: auto;
    left: 0.7rem;
    grid-template-columns: repeat(2, 1fr);
  }
  .impact-metric {
    min-height: 5rem;
    border-bottom: 1px solid var(--line);
  }
  .time-control {
    top: 29rem;
    bottom: auto;
    left: 0.7rem;
  }
  .camera-help {
    display: none;
  }
}
@media (max-width: 31rem) {
  .simulate-button {
    min-width: 10rem;
    font-size: 0.54rem;
  }
  .location-card {
    width: 10.5rem;
  }
  .condition-row strong {
    font-size: 1.25rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
