:root {
  --bg-canvas: #f5f2ea;
  --bg-surface: #fcfbf8;
  --bg-well: #eeebe1;
  --bg-well-hover: #e5e1d5;
  --bg-selected: #eaf1ed;

  --ink-primary: #163029;
  --ink-secondary: #395048;
  --ink-muted: #586b64;

  --border-subtle: #dcd7c9;
  --border-strong: #bfb8a6;
  --border-focus: #163029;

  --accent-pine: #1c4a3d;
  --accent-pine-hover: #13352b;
  --accent-pine-soft: #e3eee9;

  /* Distinct restrained status tokens */
  --st-with-table: #1f6a4a;
  --st-with-table-bg: #e7f3ed;
  --st-with-table-border: #a7d2be;

  --st-no-table: #a35214;
  --st-no-table-bg: #fbf0e5;
  --st-no-table-border: #e3bc97;

  --st-closed: #a53328;
  --st-closed-bg: #f9eae8;
  --st-closed-border: #dfaea8;

  --st-unknown: #4b5d69;
  --st-unknown-bg: #eceff2;
  --st-unknown-border: #bcc7cf;

  /* Map cartography */
  --map-water: #e7eeec;
  --map-land: #f9f6ee;
  --map-land-muted: #eeebe2;
  --map-land-active: #fffdf8;
  --map-shore: #788f86;
  --map-shore-active: #3d5b50;
  --map-shore-muted: #aab6b0;
  --map-grid: #d7e0dd;

  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, Cambria, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 3px;
  --radius-md: 5px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent-pine);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
}

/* Strong, consistent focus outlines across all interactive controls */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

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

code,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.app-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100vh;
}

/* Header */
.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink-primary);
}

.header-identity {
  min-width: 0;
}

.product-label {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent-pine);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
}

.site-header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.dataset-meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-pine);
  color: #fcfbf8;
  border-color: var(--accent-pine);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-pine-hover);
  border-color: var(--accent-pine-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-well);
  border-color: var(--ink-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-well);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-subtle {
  background: var(--bg-well);
  color: var(--ink-primary);
  border-color: var(--border-subtle);
  padding: 4px 9px;
  font-size: 12px;
}

.btn-subtle:hover:not(:disabled) {
  background: var(--bg-well-hover);
  border-color: var(--border-strong);
}

.btn-icon {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-strong);
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  font-size: 14px;
  line-height: 1;
}

.btn-icon:hover:not(:disabled) {
  background: var(--bg-well);
}

.text-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-pine);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.text-btn:hover:not(:disabled) {
  color: var(--accent-pine-hover);
}

.text-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: none;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-pine-soft);
  color: var(--accent-pine);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Filter Controls Bar */
.controls-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.8fr) repeat(3, minmax(130px, 1fr)) minmax(145px, 0.95fr) minmax(150px, 1fr) auto;
  gap: 8px 10px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  letter-spacing: 0.01em;
}

.label-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.field input[type="search"],
.field input[type="date"],
.field select {
  width: 100%;
  height: 32px;
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-primary);
}

.field input[type="search"]::placeholder {
  color: #77857f;
}

.field input:hover,
.field select:hover {
  border-color: var(--ink-secondary);
}

.field-actions {
  align-self: end;
}

.field-actions .btn {
  height: 32px;
}

.results-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding-top: 7px;
  border-top: 1px solid var(--border-subtle);
}

.results-summary {
  font-size: 12.5px;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.results-strip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-pine);
  cursor: pointer;
}

/* Loading & Error State Panels */
.state-panel {
  padding: 28px 0;
}

.state-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.state-card-error {
  border-color: var(--st-closed-border);
  border-left: 4px solid var(--st-closed);
}

.state-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 19px;
}

.state-card p {
  margin: 0 0 10px;
  color: var(--ink-secondary);
}

.state-hint {
  font-size: 13px;
  color: var(--ink-muted);
}

.state-actions {
  margin-top: 14px;
}

/* Main 3-column Desktop Workspace */
.workspace {
  display: grid;
  grid-template-columns: 356px minmax(430px, 1fr) 396px;
  gap: 12px;
  align-items: stretch;
  height: calc(100vh - 196px);
  min-height: 540px;
  max-height: 860px;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-well);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-primary);
}

.panel-sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* Room List Panel */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.page-indicator {
  font-size: 12px;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.room-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: start;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background-color 0.1s ease;
}

.room-row:hover {
  background: #f8f6ef;
}

.room-row.is-selected {
  background: var(--bg-selected);
  box-shadow: inset 3px 0 0 var(--accent-pine);
}

.room-row-main {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.room-row-main:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.room-row-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.room-row-sub {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  font-variant-numeric: tabular-nums;
}

.room-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-top: 1px;
}

.room-meta-text {
  font-size: 11.5px;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.unmapped-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 2px;
  padding: 0 5px;
}

.row-shortlist-btn {
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  cursor: pointer;
  white-space: nowrap;
  margin-top: 1px;
}

.row-shortlist-btn:hover {
  background: var(--bg-well);
}

.row-shortlist-btn.is-listed {
  background: var(--accent-pine);
  border-color: var(--accent-pine);
  color: #fcfbf8;
}

.row-shortlist-btn.is-listed:hover {
  background: var(--accent-pine-hover);
}

/* Status Chips (text + shape/color, never decorative) */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  display: inline-block;
}

.status-with-table {
  color: var(--st-with-table);
  background: var(--st-with-table-bg);
  border-color: var(--st-with-table-border);
}

.status-with-table .status-dot {
  background: var(--st-with-table);
  border-radius: 50%;
}

.status-no-table {
  color: var(--st-no-table);
  background: var(--st-no-table-bg);
  border-color: var(--st-no-table-border);
}

.status-no-table .status-dot {
  background: var(--st-no-table);
  transform: rotate(45deg);
  width: 6.5px;
  height: 6.5px;
}

.status-closed {
  color: var(--st-closed);
  background: var(--st-closed-bg);
  border-color: var(--st-closed-border);
}

.status-closed .status-dot {
  background: var(--st-closed);
  border-radius: 1px;
}

.status-unknown {
  color: var(--st-unknown);
  background: var(--st-unknown-bg);
  border-color: var(--st-unknown-border);
}

.status-unknown .status-dot {
  background: transparent;
  border: 2px solid var(--st-unknown);
  border-radius: 50%;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-well);
  font-size: 11.5px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.pagination-compact {
  display: flex;
  gap: 10px;
}

/* Map Panel */
.map-header {
  flex-wrap: wrap;
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 300px;
  background: var(--map-water);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.nyc-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.nyc-map-svg.is-dragging {
  cursor: grabbing;
}

.borough-path {
  fill: var(--map-land);
  stroke: var(--map-shore);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.borough-path.is-active {
  fill: var(--map-land-active);
  stroke: var(--map-shore-active);
  stroke-width: 1.35;
}

.borough-path.is-muted {
  fill: var(--map-land-muted);
  stroke: var(--map-shore-muted);
  stroke-width: 0.85;
}

.graticule-line {
  stroke: var(--map-grid);
  stroke-width: 0.8;
  stroke-dasharray: 3 4;
}

.borough-label {
  fill: #647870;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-anchor: middle;
  pointer-events: none;
}

.borough-label.is-muted {
  opacity: 0.45;
}

.map-marker {
  cursor: pointer;
}

.map-marker .marker-hit {
  fill: transparent;
}

.map-marker .marker-shape {
  transition: transform 0.12s ease;
}

.map-marker:hover .marker-shape,
.map-marker:focus-visible .marker-shape {
  transform: scale(1.25);
}

.map-marker:focus-visible {
  outline: none;
}

.map-marker:focus-visible .marker-focus-ring {
  opacity: 1;
}

.map-marker .marker-focus-ring {
  fill: none;
  stroke: var(--ink-primary);
  stroke-width: 2;
  opacity: 0;
}

.map-marker.is-selected .marker-shape {
  transform: scale(1.32);
}

.map-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  max-width: 260px;
  padding: 7px 10px;
  background: var(--ink-primary);
  color: #fcfbf8;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 3px 10px rgba(22, 48, 41, 0.24);
}

.map-tooltip strong {
  display: block;
  font-size: 12.5px;
  margin-bottom: 2px;
}

.map-tooltip .tt-meta {
  color: #d5e2dc;
  font-size: 11.5px;
}

.map-empty-overlay {
  position: absolute;
  inset: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.map-empty-overlay p {
  margin: 0;
  padding: 8px 14px;
  background: rgba(252, 251, 248, 0.94);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-secondary);
}

.map-legend {
  padding: 8px 12px 9px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.map-summary {
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.35;
}

/* Detail Panel */
.detail-panel {
  overflow-y: auto;
}

.detail-empty {
  margin: auto 0;
}

.detail-content {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-title-group {
  min-width: 0;
}

.detail-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-pine);
}

.detail-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.22;
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}

.detail-location {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.siblings-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  background: var(--bg-well);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.siblings-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.siblings-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sibling-btn {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  cursor: pointer;
}

.sibling-btn:hover {
  background: var(--bg-well-hover);
}

.sibling-btn.is-current {
  background: var(--accent-pine);
  border-color: var(--accent-pine);
  color: #fcfbf8;
}

.detail-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px 10px;
  background: #f8f6ef;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.detail-age-note {
  font-size: 12px;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.detail-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.fact-item dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 1px;
}

.fact-item dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}

.detail-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.block-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.detail-block h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-primary);
}

.inline-threshold {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.inline-threshold select {
  height: 24px;
  padding: 0 6px;
  font-size: 11.5px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-primary);
}

.verify-checklist {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reasons-box {
  padding: 8px 10px;
  background: var(--bg-well);
  border-left: 3px solid var(--accent-pine);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.reasons-box h4 {
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
}

.reasons-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--ink-primary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-count {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.transition-summary {
  margin: 0;
  padding: 7px 9px;
  background: #f8f6ef;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.history-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.history-table th,
.history-table td {
  padding: 6px 7px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.history-table th {
  background: var(--bg-well);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.history-table tr:last-child td {
  border-bottom: none;
}

.history-change-note {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--accent-pine);
  font-weight: 600;
}

/* Empty States */
.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--ink-secondary);
}

.empty-state h3,
.empty-state h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink-primary);
}

.empty-state p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-muted);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Footer Disclosure */
.site-footer {
  margin-top: 2px;
}

.disclosure {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.disclosure summary {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
  list-style-position: outside;
}

.disclosure summary:hover {
  background: var(--bg-well);
}

.disclosure-body {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  gap: 16px 24px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.disclosure-col h3 {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-primary);
}

.disclosure-col ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.source-intro {
  margin: 0 0 6px;
}

.source-links a {
  color: var(--accent-pine);
  font-weight: 600;
  text-underline-offset: 2px;
}

.source-links a:hover {
  color: var(--accent-pine-hover);
}

/* Checklist Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 48, 41, 0.32);
  z-index: 90;
}

.checklist-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 96vw);
  background: var(--bg-surface);
  border-left: 2px solid var(--ink-primary);
  box-shadow: -8px 0 24px rgba(22, 48, 41, 0.18);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.checklist-drawer[hidden],
.drawer-backdrop[hidden] {
  display: none;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-well);
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
}

.drawer-export-note {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8f6ef;
}

.drawer-export-note p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-secondary);
}

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

.drawer-breakdown {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
}

.drawer-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-item-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-item-title {
  all: unset;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}

.drawer-item-title:hover {
  color: var(--accent-pine);
  text-decoration-color: var(--accent-pine);
}

.drawer-item-title:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.drawer-item-sub {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Medium Desktop (2-column: sidebar list + stacked map/detail) */
@media (max-width: 1319px) {
  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .field-search {
    grid-column: span 2;
  }

  .workspace {
    grid-template-columns: minmax(270px, 0.86fr) minmax(365px, 1.48fr) minmax(345px, 1fr);
    height: calc(100vh - 245px);
  }
}

@media (max-width: 1090px) {
  .workspace {
    grid-template-columns: 350px minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    max-height: none;
  }

  .list-panel {
    grid-row: 1 / span 2;
    max-height: 980px;
  }

  .map-stage {
    min-height: 410px;
    height: 440px;
  }
}

/* Tablet & Mobile Stack */
@media (max-width: 900px) {
  .app-shell {
    padding: 10px 12px 16px;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .site-header h1 {
    font-size: 22px;
  }

  .header-actions {
    justify-content: flex-start;
  }

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

  .field-search {
    grid-column: span 2;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .list-panel {
    grid-row: auto;
    max-height: 420px;
  }

  .map-stage {
    min-height: 320px;
    height: 360px;
  }

  .disclosure-body {
    grid-template-columns: 1fr;
  }
}

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

  .field-search {
    grid-column: auto;
  }

  .detail-facts {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
