:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f5f0;
  color: #171717;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  min-height: 100vh;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #24312f;
  color: #f8f4ec;
}

.eyebrow {
  margin: 0 0 8px;
  color: #9ea9a4;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

form {
  display: grid;
  gap: 18px;
}

label,
legend {
  display: grid;
  gap: 8px;
  color: #d9ded8;
  font-size: 0.9rem;
  font-weight: 700;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.input-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid #63706b;
  border-radius: 8px;
  background: #17211f;
}

.input-row span {
  padding: 12px;
  color: #aeb9b3;
  font-weight: 800;
}

input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 0;
  background: #fffdf8;
  color: #171717;
}

.segmented {
  display: grid;
  gap: 8px;
}

.segmented label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #5b6964;
  border-radius: 8px;
  background: #1b2825;
  cursor: pointer;
}

.segmented strong {
  display: block;
  color: #fffaf2;
}

.segmented small {
  display: block;
  margin-top: 2px;
  color: #bec8c3;
  font-weight: 500;
  line-height: 1.35;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #f0b35a;
  color: #1b160f;
  font-weight: 800;
  cursor: pointer;
}

.persona {
  display: grid;
  gap: 12px;
  margin: auto 0 0;
}

.persona div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #4c5a55;
  padding-bottom: 10px;
}

.persona dt {
  color: #aeb9b3;
}

.persona dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.results {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 28px;
}

.summary-bar,
.panel,
.location-card {
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #fffdf8;
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
}

.summary-bar p {
  margin-bottom: 0;
  max-width: 70ch;
  color: #4c4c4c;
}

.badge {
  align-self: start;
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  background: #dbe8e2;
  color: #20352f;
  font-size: 0.82rem;
  font-weight: 800;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

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

.lifecycle-card {
  display: grid;
  gap: 16px;
}

.lifecycle-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4ded4;
}

.lifecycle-card header span {
  color: #68615a;
  font-size: 0.85rem;
  font-weight: 800;
}

.lifecycle-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.timeline-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  color: #3b3834;
}

.timeline-row strong {
  text-align: right;
}

.timeline-row small {
  grid-column: 1 / -1;
  color: #716a63;
  font-weight: 700;
}

.timeline-bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece7de;
}

.timeline-bar span {
  display: block;
  height: 100%;
}

.timeline-bar.positive span {
  background: #477f74;
}

.timeline-bar.negative span {
  background: #b65d49;
}

.location-card {
  overflow: hidden;
}

.location-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: #f3eee5;
}

.location-header strong {
  font-size: 1.2rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #e4ded4;
  border-bottom: 1px solid #e4ded4;
}

.metric {
  padding: 14px 18px;
}

.metric span {
  display: block;
  color: #68615a;
  font-size: 0.82rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.breakdown {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.rows {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: #3b3834;
  font-size: 0.9rem;
}

.bar {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece7de;
}

.bar span {
  display: block;
  height: 100%;
  background: #477f74;
}

.costs .bar span {
  background: #b65d49;
}

.panel {
  padding: 18px;
}

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

.panel-heading span {
  color: #706b64;
  font-size: 0.85rem;
  font-weight: 800;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.warning-list li {
  color: #54402f;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e1dbd0;
  border-radius: 8px;
}

.source a {
  color: #275f87;
  font-weight: 800;
  text-decoration: none;
}

.source span {
  color: #716a63;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .workspace,
  .location-grid,
  .lifecycle-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    min-height: auto;
  }

  .summary-bar {
    flex-direction: column;
  }
}
