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

* {
  box-sizing: border-box;
}

body.construction-body {
  margin: 0;
  min-height: 100vh;
  background: #eef3f5;
}

button {
  font: inherit;
}

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

.construction-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid #d6e0e6;
  background: #fbfcfd;
  padding: 14px 18px;
}

.home-link {
  color: #28516c;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.home-link:hover,
.home-link:focus {
  text-decoration: underline;
}

.title-block {
  min-width: 0;
}

.title-block h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.title-block p {
  margin: 4px 0 0;
  color: #526372;
  font-size: 0.95rem;
}

.topbar-links,
.construction-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: #28516c;
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-links a:hover,
.topbar-links a:focus {
  text-decoration: underline;
}

.status-pill {
  min-width: 78px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c5d2dc;
  border-radius: 999px;
  background: #fff;
  color: #475766;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.loading {
  color: #365f91;
  border-color: #b8cce6;
  background: #eff6ff;
}

.status-pill.ready {
  color: #1f6c46;
  border-color: #b8d7c5;
  background: #eef9f2;
}

.status-pill.stale {
  color: #8a5a18;
  border-color: #e4ce9e;
  background: #fff8e7;
}

.status-pill.error {
  color: #8a2727;
  border-color: #e2b3b3;
  background: #fff1f1;
}

.refresh-button,
.day-button {
  min-height: 38px;
  border: 1px solid #c8d5dd;
  border-radius: 8px;
  background: #fff;
  color: #17242c;
  cursor: pointer;
  font-weight: 850;
}

.refresh-button {
  padding: 0 12px;
}

.refresh-button:hover,
.refresh-button:focus,
.day-button:hover,
.day-button:focus {
  border-color: #6f8799;
  background: #eef5f8;
  outline: none;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid #d6e0e6;
  background: #d6e0e6;
}

.summary-bar > div {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 2px;
  background: #fff;
  padding: 10px 16px;
}

.metric-label {
  color: #637381;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.summary-bar strong {
  font-size: 1.35rem;
  line-height: 1;
}

.construction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 450px);
  min-height: 620px;
  height: calc(100vh - 135px);
}

.construction-map {
  height: 100%;
  min-height: 0;
  background: #d7e0e4;
}

.construction-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #c8d5dd;
  background: #fff;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e0e7ec;
  padding: 14px 16px;
}

.section-kicker {
  margin: 0 0 3px;
  color: #6a7782;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.day-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 6px;
}

.day-button {
  padding: 0 10px;
  color: #33424f;
}

.day-button.active {
  border-color: #28516c;
  background: #28516c;
  color: #fff;
}

.source-block {
  border-bottom: 1px solid #e0e7ec;
  padding: 12px 16px;
  color: #5d6b78;
  font-size: 0.9rem;
  line-height: 1.35;
}

.source-block div + div {
  margin-top: 4px;
}

.summary-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-bottom: 1px solid #e0e7ec;
  background: #e0e7ec;
}

.summary-lists section {
  min-width: 0;
  background: #fff;
  padding: 12px 16px;
}

.summary-lists h3 {
  margin: 0 0 8px;
  color: #4c5a66;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.count-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #2a3742;
  font-size: 0.86rem;
}

.count-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.count-list span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-list strong {
  font-size: 0.86rem;
}

.construction-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.construction-item {
  border-bottom: 1px solid #edf1f4;
}

.construction-button {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 0;
  background: #fff;
  color: inherit;
  cursor: pointer;
  padding: 12px 16px;
  text-align: left;
}

.construction-button:hover,
.construction-button:focus {
  background: #f4f8fa;
  outline: none;
}

.kind-chip {
  min-width: 72px;
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.kind-chip.permit {
  background: #365f91;
}

.kind-chip.closure {
  background: #b64b2a;
}

.kind-chip.parking {
  background: #5f4935;
}

.kind-chip.tree {
  background: #2f6f53;
}

.construction-title {
  display: block;
  color: #17242c;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.25;
}

.construction-detail {
  display: block;
  margin-top: 4px;
  color: #596877;
  font-size: 0.84rem;
  line-height: 1.35;
}

.empty-list {
  padding: 18px 16px;
  color: #697784;
}

.construction-popup {
  min-width: 230px;
}

.construction-popup h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.construction-popup dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
  font-size: 0.86rem;
}

.construction-popup dt {
  color: #687583;
  font-weight: 850;
}

.construction-popup dd {
  margin: 0;
  color: #1f2c36;
}

.construction-popup a {
  color: #28516c;
  font-weight: 850;
}

@media (max-width: 940px) {
  .construction-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-links,
  .construction-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .construction-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .construction-map {
    min-height: 54vh;
  }

  .construction-panel {
    border-left: 0;
    border-top: 1px solid #c8d5dd;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .construction-topbar {
    padding: 12px;
  }

  .summary-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-lists {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .construction-map {
    min-height: 48vh;
  }
}
