:root {
  --ink: #12241d;
  --muted: #5d6f66;
  --line: #dfe7e2;
  --paper: #f6f8f6;
  --card: #ffffff;
  --green: #1d6f42;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }

.topbar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.brand { margin: 0; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--green); font-weight: 700; }
.sep { color: #9db3a7; }
h1 { margin: .2rem 0 0; font-size: 1.7rem; letter-spacing: -.02em; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }

.badge {
  font-size: .72rem; padding: .32rem .6rem; border-radius: 999px;
  background: #e9efeb; color: #3c5045; border: 1px solid var(--line); white-space: nowrap;
}
.badge.ok { background: #e3f3e9; color: #1d6f42; border-color: #bfe0cd; }
.badge.warn { background: #fdf0e3; color: #92541a; border-color: #f0d6b6; }

.switch { display: flex; align-items: center; gap: .5rem; margin: 1.4rem 0 1rem; flex-wrap: wrap; }
.switch button {
  font: inherit; font-size: .86rem; padding: .5rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.switch button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.switch .muted { margin-left: auto; }

.grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 940px) { .grid { grid-template-columns: 1fr; } }

.map { position: relative; background: #0e2a22; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px rgba(16, 44, 34, .18); }
.map svg { display: block; width: 100%; height: auto; }

.legend {
  position: absolute; left: 1rem; bottom: 1rem; margin: 0; padding: .55rem .75rem;
  list-style: none; background: rgba(8, 26, 20, .82); border-radius: 10px;
  color: #eaf2ec; font-size: .74rem; display: flex; flex-wrap: wrap; gap: .55rem 1rem;
}
.legend li { display: flex; align-items: center; gap: .35rem; }
.legend .swatch { width: .7rem; height: .7rem; border-radius: 3px; display: inline-block; }
.legend .legend-note { color: #a9bcb1; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.15rem 1.2rem 1.3rem; box-shadow: 0 12px 30px rgba(16, 44, 34, .07);
}
.kicker { margin: 0; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.panel h2 { margin: .15rem 0 .25rem; font-size: 1.45rem; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.panel .muted { margin: 0; font-size: .85rem; }

.score {
  display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.1rem;
  padding: .9rem 1rem; border-left: 5px solid var(--green); background: #f8fbf9; border-radius: 12px;
}
.score-value { font-size: 2.9rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.chip { display: inline-block; padding: .18rem .55rem; border-radius: 999px; color: #fff; font-size: .74rem; font-weight: 600; }

.drivers { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.driver-head { display: flex; justify-content: space-between; font-size: .84rem; font-weight: 600; margin-bottom: .3rem; }
.bar { height: .45rem; background: #edf2ee; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; transition: width .35s ease; }
.drivers .small { margin: .28rem 0 0; }

.advice { margin: 1rem 0 0; font-size: .85rem; background: #f4f8f5; border-radius: 10px; padding: .65rem .8rem; color: #274237; }

.actions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.1rem; }
.actions button {
  font: inherit; font-size: .86rem; padding: .6rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-align: center;
}
.actions button:hover:not(:disabled) { border-color: #b9c9c0; }
.actions button:disabled { opacity: .55; cursor: not-allowed; }
.actions .primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.actions .ghost { background: #f7faf8; }

.evidence { margin: .9rem 0 0; display: grid; gap: .2rem; }
.evidence code { font-size: .74rem; background: #f1f5f2; padding: .3rem .45rem; border-radius: 6px; word-break: break-all; }
.notice { margin: .9rem 0 0; font-size: .82rem; color: #1d6f42; background: #e9f5ee; border-radius: 8px; padding: .55rem .7rem; }
.footnote { margin: 1.1rem 0 0; border-top: 1px solid var(--line); padding-top: .8rem; line-height: 1.45; }

.footer { margin-top: 1.25rem; display: grid; gap: .8rem; }
.footer p { margin: 0; line-height: 1.5; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .45rem 0 0; }
.chip-outline { font-size: .72rem; padding: .22rem .5rem; border-radius: 999px; border: 1px dashed #c3d2c9; color: #3f564a; }

.error { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 10px; background: #fbecea; color: #93261b; font-size: .85rem; }

.advisory { margin: .9rem 0 0; padding: .7rem .85rem; border-left: 3px solid #8fb8a2; background: #f7faf8; border-radius: 0 10px 10px 0; }
.advisory p { margin: .35rem 0 0; font-size: .86rem; line-height: 1.45; }

.scenarios { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .35rem; }
.scenarios li { display: flex; justify-content: space-between; gap: .6rem; font-size: .8rem; padding: .35rem .55rem; border-radius: 8px; background: #f4f8f5; }
.scenarios li strong { white-space: nowrap; }
.scenarios .small { background: none; padding: 0; line-height: 1.4; display: block; }


