:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --line: #d9ded8;
  --ink: #18211c;
  --muted: #5d695f;
  --accent: #1e6b58;
  --accent-soft: #dbeee7;
  --warning: #a66a1f;
  --danger: #b0443a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.toolbar h1,
.panel-header h2,
.map-copy h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(6rem, 1fr));
  gap: 0.5rem;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  min-width: 6rem;
}

.stats span {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
}

.stats small {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 18rem minmax(22rem, 1fr) 28rem;
  min-height: 0;
}

.town-panel,
.household-panel,
.map-panel {
  min-height: 0;
  border-right: 1px solid var(--line);
}

.household-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-header input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}

.town-list,
.household-list {
  height: calc(100vh - 8.5rem);
  overflow: auto;
  padding: 0.75rem;
}

.town-item,
.household-item {
  width: 100%;
  display: grid;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--surface);
  margin-bottom: 0.6rem;
}

.town-item {
  text-align: left;
}

.town-item strong,
.household-item strong {
  display: block;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.progress {
  height: 0.45rem;
  border-radius: 99px;
  overflow: hidden;
  background: #e6e9e4;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.map-panel {
  padding: 1rem;
}

.map-placeholder {
  position: relative;
  min-height: calc(100vh - 6.5rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef3ef;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.65;
}

.map-copy {
  position: absolute;
  inset: auto 1.25rem 1.25rem 1.25rem;
  max-width: 32rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.map-copy p {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.household-item textarea {
  min-height: 4rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 16rem 1fr;
  }

  .household-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .toolbar,
  .workspace {
    display: block;
  }

  .toolbar {
    padding: 0.9rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 0.8rem;
  }

  .town-list,
  .household-list {
    height: auto;
    max-height: 24rem;
  }
}

