:root {
  color-scheme: light;
  --bg: #eef1ed;
  --surface: #ffffff;
  --surface-strong: #f7faf8;
  --text: #17201d;
  --muted: #58655f;
  --line: #ccd6d0;
  --primary: #1d6b57;
  --primary-soft: #d7ece5;
  --accent: #8f2334;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  padding: 20px;
}

.topbar,
.band,
.sidebar,
.workspace__header {
  background: var(--surface);
  border: 1px solid var(--line);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

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

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.topbar__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

.field--inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  min-width: 0;
}

.lang-switch span {
  white-space: nowrap;
}

.lang-switch select {
  width: auto;
  min-width: 112px;
}

.text-link {
  color: var(--primary);
  text-decoration: none;
}

.layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.sidebar {
  padding: 16px;
  border-radius: 8px;
}

.sidebar__header {
  margin-bottom: 16px;
}

.sidebar__header p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.parcel-list {
  display: grid;
  gap: 10px;
}

.parcel-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 8px;
  cursor: pointer;
}

.parcel-item.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.parcel-item strong,
.parcel-item span {
  display: block;
}

.parcel-item span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  min-width: 0;
}

.workspace__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 8px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-groups {
  display: grid;
  gap: 10px;
}

.action-group {
  display: grid;
  gap: 6px;
}

.action-group__label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  margin-top: 16px;
  padding: 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.passport-shell {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.passport-shell.is-hidden {
  display: none;
}

.band {
  padding: 18px 20px;
  border-radius: 8px;
}

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

.metric {
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric__label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 20px;
}

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

.facts {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 8px 14px;
}

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

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.stack-list li {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.subheading {
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  font: inherit;
}

.assessment__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.assessment__controls {
  display: grid;
  gap: 10px;
  min-width: min(100%, 520px);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding-top: 24px;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.checkbox-field span {
  color: var(--text);
}

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

.checkbox-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.checkbox-tile input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.compact-grid {
  gap: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--primary-soft);
  border: 1px solid var(--line);
  color: var(--text);
  text-transform: lowercase;
}

.status-chip.is-incomplete {
  background: #f6e6cf;
  border-color: #d7b884;
}

.status-chip.is-error {
  background: #f7dadd;
  border-color: #d6a1a8;
}

.assessment-message {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.section-gap {
  margin-top: 18px;
}

.map-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  overflow: hidden;
}

.risk-map-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.legend-swatch--high {
  background: #b8333d;
}

.legend-swatch--medium {
  background: #d4842f;
}

.legend-swatch--low {
  background: #2d8a57;
}

.legend-swatch--stale {
  background: #7b8482;
}

.is-ok {
  color: var(--primary);
}

.is-error {
  color: var(--accent);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .metrics,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .assessment__header,
  .workspace__header,
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .assessment__controls {
    width: 100%;
    min-width: 0;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

thead th {
  color: var(--muted);
  font-size: 13px;
}

#health-status.is-ok {
  color: var(--primary);
}

#health-status.is-error {
  color: var(--accent);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .metrics,
  .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  h2 {
    font-size: 20px;
  }

  .topbar,
  .workspace__header,
  .band,
  .sidebar {
    padding: 14px 16px;
  }

  .topbar__meta {
    width: 100%;
    justify-content: space-between;
  }

  .field--inline,
  .lang-switch {
    width: 100%;
  }

  .lang-switch select {
    width: 100%;
    min-width: 0;
  }

  .assessment__controls .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .assessment__controls button {
    width: 100%;
    text-align: center;
  }
}
