/* Estate map page shell. The canvas itself is styled by the bundled estate-flow.css; this file
   only lays out the page around it. The map is the point, so it gets the whole viewport minus the
   header and a stats strip. */

.estate-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "banner banner"
    "stats  stats"
    "canvas detail";
  gap: var(--sp-2, 12px);
  height: calc(100vh - var(--header-h, 60px));
  padding: var(--sp-2, 12px);
  box-sizing: border-box;
}

.estate-main > #banner { grid-area: banner; }
.estate-main > #banner:empty { display: none; }

.estate-stats {
  grid-area: stats;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1, 8px);
}

.estate-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 108px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
}

.estate-stat-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.estate-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.estate-canvas {
  grid-area: canvas;
  position: relative;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--bg);
  overflow: hidden;
}

.estate-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 13px;
}

.estate-detail {
  grid-area: detail;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
}

.estate-detail h2 {
  margin: 4px 0 6px;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.estate-detail-kind {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.estate-detail-id {
  display: block;
  margin-bottom: 10px;
  font-size: 10.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.estate-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.estate-detail-metrics li {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--chip-bg, rgba(127, 140, 170, 0.14));
  font-size: 11px;
  color: var(--muted);
}

.estate-detail-metrics span { font-weight: 700; color: var(--text); }

.estate-detail-attrs {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  margin: 0 0 10px;
  font-size: 11.5px;
}

.estate-detail-attrs dt { color: var(--muted); }
.estate-detail-attrs dd { margin: 0; overflow-wrap: anywhere; }

.estate-detail-hint {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.estate-host-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.estate-host-list li {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.estate-host-list li:last-child { border-bottom: 0; }

.estate-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.estate-badge {
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--muted);
}

.estate-badge.is-warn { border-color: #f59e0b; color: #f59e0b; }

@media (max-width: 1100px) {
  .estate-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "banner" "stats" "canvas" "detail";
    height: auto;
  }
  .estate-canvas { height: 70vh; }
  .estate-detail { max-height: 50vh; }
}
