:root {
  --ink: #1f2523;
  --muted: #64716b;
  --line: #d8ded8;
  --bg: #f5f6f1;
  --panel: #ffffff;
  --green: #2c6e49;
  --olive: #6f7f38;
  --red: #b23b32;
  --amber: #b2782b;
  --blue: #315d77;
  --shadow: 0 18px 45px rgba(31, 37, 35, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #f0f2ea;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

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

h1 {
  font-size: 18px;
}

h2 {
  font-size: 28px;
  line-height: 1.1;
}

h3 {
  font-size: 19px;
}

.brand p,
small,
.eyebrow,
.muted {
  color: var(--muted);
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
}

.nav-list a {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}

.nav-list a.active,
.nav-list a:hover {
  background: white;
}

.brief-card,
.form-panel,
.detail-panel,
.agent-card,
.property-card,
.source-card,
.profile-chip,
.area-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brief-card {
  padding: 16px;
}

.brief-card p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

main {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.status-strip div {
  padding: 12px;
  border-left: 1px solid var(--line);
}

.status-strip div:first-child {
  border-left: 0;
}

.status-strip span {
  display: block;
  font-size: 20px;
  font-weight: 800;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  margin: 24px 0;
}

.compact-hero {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
}

.market-visual,
.signal-panel,
.education-panel {
  min-height: 286px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow);
}

.market-visual {
  overflow: hidden;
}

.market-visual canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.signal-panel,
.education-panel {
  padding: 22px;
}

.signal-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.signal-panel p {
  margin: 14px 0;
  color: var(--muted);
  line-height: 1.5;
}

.signal-grid {
  display: grid;
  gap: 10px;
}

.signal-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.signal-grid strong,
.signal-grid small {
  display: block;
}

.section {
  margin-top: 34px;
}

.settings-block {
  margin-top: 22px;
}

.agent-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.agent-card,
.source-card,
.property-card,
.detail-panel,
.form-panel,
.area-card {
  padding: 16px;
}

.agent-top,
.property-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.agent-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #edf2ec;
  color: var(--green);
  font-weight: 800;
}

.agent-card p,
.source-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef0e9;
  color: var(--muted);
  font-size: 12px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.property-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.property-card {
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.property-card:hover,
.property-card.selected,
.area-card:hover,
.area-card.selected {
  border-color: var(--green);
  transform: translateY(-1px);
}

.map-panel {
  min-height: 430px;
  margin-top: 16px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-panel canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.area-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.area-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.area-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.score {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: white;
  font-weight: 900;
}

.score.good {
  background: var(--green);
}

.score.watch {
  background: var(--amber);
}

.score.block {
  background: var(--red);
}

.property-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.risk-list,
.task-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.risk-list li,
.task-list li,
.timeline-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--green);
}

.dot.red {
  background: var(--red);
}

.dot.amber {
  background: var(--amber);
}

.form-panel {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcf8;
  color: var(--ink);
}

textarea {
  margin-top: 14px;
  min-height: 250px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.checks input {
  width: auto;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.inbox-copy {
  margin-top: 8px;
  line-height: 1.5;
}

.feed-message {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
}

.ordered-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.primary-button {
  padding: 12px 14px;
  background: var(--green);
  color: white;
}

.secondary-button,
.icon-button,
.secondary-link {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

.secondary-button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.icon-button {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.selected-details {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric strong,
.metric small {
  display: block;
}

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

.timeline-item {
  display: block;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline-item strong,
.timeline-item small {
  display: block;
}

.source-card strong,
.source-card small {
  display: block;
}

.profile-form textarea {
  min-height: 110px;
}

.profile-chip {
  padding: 12px;
}

.profile-chip strong,
.profile-chip small {
  display: block;
}

@media (max-width: 1040px) {
  .app-shell,
  .hero-panel,
  .two-column {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .agent-grid,
  .source-grid,
  .timeline,
  .area-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .property-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip,
  .agent-grid,
  .source-grid,
  .timeline,
  .area-list,
  .form-row,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 23px;
  }
}
