/* Real Estate map (07). Built on the product's existing tokens.
 *
 * Status is never colour-only: accuracy and field state are carried by border
 * style plus a word, and an active filter chip gains a check glyph.
 * Type floor is 12px desktop, 11px mobile.
 */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.re-frame { border: 3px solid var(--black); background: var(--ivory); }
.re-classification {
  display: inline-block; border: 2px solid var(--black); padding: .3rem .6rem;
  font-size: 0.75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
}
.re-error { margin: 0; padding: .8rem 1rem; border-left: 5px solid var(--deep-orange); background: var(--wash); }

.re-provenance {
  border-left: 4px solid var(--fire); background: var(--wash); padding: .85rem 1.1rem;
}
.re-provenance h2 { margin: 0 0 .3rem; font-family: var(--heading); font-size: 0.95rem; text-transform: uppercase; }
.re-provenance p { margin: 0; font-size: 0.8rem; color: rgba(30,25,21,.78); }

.re-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 1rem; }
.re-tile {
  display: flex; flex-direction: column; gap: .25rem; min-height: 104px; padding: 9px 10px;
  border: 1px solid rgba(30,25,21,.3); border-top: 4px solid var(--fire);
}
.re-tile-calculated { border-top-color: var(--unknown); }
.re-tile-missing { border-top-color: var(--deep-orange); }
.re-tile-label { font-size: 0.75rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(30,25,21,.78); }
.re-tile strong { font-family: var(--heading); font-size: 1.3rem; line-height: 1.05; }
.re-tile-note { font-size: 0.75rem; color: rgba(30,25,21,.75); }

.re-controls { display: flex; flex-direction: column; gap: .4rem; padding: .75rem 1rem 1rem; }
.re-controls label { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.re-controls input[type="search"] {
  width: 100%; min-width: 0; border: 1px solid rgba(252,251,248,.72); border-radius: 4px;
  background: transparent; color: var(--ivory); padding: .72rem .8rem; font-size: .85rem;
}
.re-controls input[type="search"]::placeholder { color: rgba(252,251,248,.65); }
.re-count { margin: .3rem 0 0; font-size: 0.78rem; color: rgba(252,251,248,.72); }

.re-filter-group { border: 0; margin: 0; padding: .35rem 1rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.re-filter-group legend { font-size: 0.75rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(252,251,248,.75); }
.re-chip {
  border: 1px solid rgba(252,251,248,.55); background: transparent; color: var(--ivory); border-radius: 999px;
  padding: .3rem .7rem; font-size: 0.75rem; letter-spacing: .06em; text-transform: uppercase;
}
.re-chip-active { background: var(--deep-orange); color: var(--ivory); border-color: var(--deep-orange); }

.re-panels {
  display: grid; grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  min-height: 720px; position: relative; border-top: 2px solid var(--black); overflow: hidden;
}
.re-browser-panel {
  min-width: 0; height: 720px; display: flex; flex-direction: column;
  overflow: hidden; background: var(--black); color: var(--ivory); border-right: 2px solid var(--black);
}
.re-browser-head {
  display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start;
  padding: 1.1rem 1rem .35rem;
}
.re-browser-head h2 { margin: 0; font-family: var(--heading); font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase; }
.re-browser-head .re-inline-button { color: var(--ivory); border-color: rgba(252,251,248,.7); }
#re-filters { max-height: 230px; overflow-y: auto; border-top: 1px solid rgba(252,251,248,.16); border-bottom: 1px solid rgba(252,251,248,.16); }
.re-map-panel { width: 100%; min-width: 0; height: 720px; position: relative; background: var(--map-ground); }
.re-map { position: absolute; inset: 0; }
.re-map-state {
  position: absolute; z-index: 6; top: 16px; left: 16px; max-width: 40ch;
  padding: 1rem 1.1rem; background: rgba(30,25,21,.94); color: var(--ivory);
  border-left: 5px solid var(--deep-orange); box-shadow: 0 12px 30px rgba(30,25,21,.24);
}
.re-map-state h3 { margin: 0 0 .4rem; font-family: var(--heading); font-size: 1rem; text-transform: uppercase; }
.re-map-state p { margin: 0; font-size: 0.82rem; color: rgba(252,251,248,.82); }
.re-map-fit {
  position: absolute; z-index: 5; top: 12px; right: 12px; border: 1px solid var(--black);
  border-radius: 3px; background: var(--ivory); color: var(--black); padding: .55rem .75rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(30,25,21,.18);
}
.re-map-footnote {
  position: absolute; z-index: 5; left: 12px; bottom: 42px; margin: 0;
  max-width: 42ch; padding: .4rem .55rem; background: rgba(252,251,248,.94);
  border: 1px solid rgba(30,25,21,.22); font-size: 0.75rem; color: rgba(30,25,21,.78);
}

.re-marker {
  width: 34px; height: 34px; padding: 0; border: 3px solid var(--ivory); background: var(--black);
  border-radius: 999px; box-shadow: 0 3px 10px rgba(30,25,21,.34); cursor: pointer;
}
.re-marker::after { content: ""; display: block; width: 10px; height: 10px; margin: auto; border-radius: 999px; background: var(--fire); }
.re-marker-approximate { border-style: dashed; }
.re-marker-tbd { border-style: dotted; }
.re-marker-selected { width: 44px; height: 44px; border-width: 4px; box-shadow: 0 0 0 4px var(--fire), 0 7px 20px rgba(30,25,21,.4); z-index: 5; }

.re-map .mapboxgl-popup { max-width: 340px !important; }
.re-map .mapboxgl-popup-content {
  min-width: 300px; padding: 0; overflow: hidden; border-radius: 4px;
  background: var(--black); color: var(--ivory); box-shadow: 0 14px 38px rgba(30,25,21,.35);
}
.re-map .mapboxgl-popup-close-button { color: var(--ivory); font-size: 1.35rem; padding: .35rem .55rem; }
.re-map .mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip { border-top-color: var(--black); }
.re-map .mapboxgl-popup-anchor-top .mapboxgl-popup-tip { border-bottom-color: var(--black); }
.re-map .mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--black); }
.re-map .mapboxgl-popup-anchor-right .mapboxgl-popup-tip { border-left-color: var(--black); }
.re-popup-card { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; }
.re-popup-card h3 { max-width: 250px; margin: 0; font-family: var(--heading); font-size: 1rem; line-height: 1.25; text-transform: uppercase; }
.re-popup-card p { margin: 0; font-size: .8rem; color: rgba(252,251,248,.8); }
.re-popup-headline { padding-top: .55rem; border-top: 1px solid rgba(252,251,248,.18); }
.re-popup-open {
  width: 100%; border: 0; border-radius: 3px; background: var(--fire); color: var(--ivory);
  padding: .65rem .8rem; font-family: var(--heading); font-size: .85rem; letter-spacing: .05em; text-transform: uppercase;
}

.re-list { width: 100%; min-height: 0; flex: 1; overflow-y: auto; }
.re-open-selected {
  flex: 0 0 auto; width: calc(100% - 1.6rem); margin: .7rem .8rem .8rem; border: 0; border-radius: 3px;
  background: var(--fire); color: var(--ivory); padding: .7rem .8rem; font-family: var(--heading);
  font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; cursor: pointer;
}
.re-open-selected[hidden] { display: none; }
.re-row {
  display: flex; gap: .6rem; width: 100%; text-align: left; padding: 11px 13px;
  border: 0; border-bottom: 1px solid rgba(252,251,248,.16); border-left: 5px solid transparent;
  background: transparent; color: var(--ivory); cursor: pointer;
}
.re-row:hover { background: rgba(252,251,248,.06); }
.re-row-selected { border-left-color: var(--fire); background: rgba(246,87,0,.17); }
.re-row-main { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.re-row-name { font-family: var(--heading); font-size: 0.95rem; text-transform: uppercase; }
.re-row-meta, .re-row-owner { font-size: 0.75rem; color: rgba(252,251,248,.72); }
.re-row-figure { text-align: right; display: flex; flex-direction: column; }
.re-row-figure strong { font-family: var(--heading); font-size: 0.9rem; }
.re-row-figure span { font-size: 0.75rem; color: rgba(252,251,248,.72); }
.re-row .re-tag { color: var(--ivory); border-color: rgba(252,251,248,.7); }
.re-dot { width: 13px; height: 13px; margin-top: .3rem; border: 2px solid var(--ivory); border-radius: 999px; }
.re-dot-approximate { border-style: dashed; }
.re-dot-tbd { border-style: dotted; }
.re-triage { margin-left: .4rem; border: 1px solid var(--deep-orange); padding: 0 .3rem; font-size: 0.75rem; text-transform: uppercase; }

.re-drawer {
  position: absolute; z-index: 20; top: 0; right: 0; bottom: 0; width: min(480px, calc(100% - 320px));
  scroll-margin-top: 68px;
  overflow-y: auto; background: var(--ivory); border: 0; border-left: 2px solid var(--black);
  box-shadow: -14px 0 34px rgba(30,25,21,.26);
}
.re-drawer-head { background: var(--black); color: var(--ivory); padding: 1rem; }
.re-drawer-head h2 { margin: .5rem 0 .3rem; font-family: var(--heading); font-size: 1.6rem; text-transform: uppercase; }
.re-drawer-head p { margin: 0 0 .25rem; font-size: 0.78rem; color: rgba(252,251,248,.86); }
.re-drawer-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
/* On the charcoal header, ink-coloured borders and text would vanish. */
.re-drawer-head .re-tag,
.re-drawer-head .re-inline-button { color: var(--ivory); border-color: var(--ivory); }
.re-drawer-note { font-size: 0.75rem; }
.re-alert { background: var(--wash); border-left: 5px solid var(--deep-orange); padding: .7rem 1rem; font-size: 0.8rem; }
.re-section { padding: .9rem 1rem; }
.re-section header { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-bottom: 2px solid var(--black); padding-bottom: .3rem; margin-bottom: .5rem; }
.re-section h3 { margin: 0; font-family: var(--heading); font-size: 0.95rem; text-transform: uppercase; }
.re-section header span { font-size: 0.75rem; color: rgba(30,25,21,.78); text-align: right; }
.re-section-note { margin: .5rem 0 0; padding: .5rem .6rem; background: var(--panel-tint); font-size: 0.76rem; white-space: pre-line; }

.re-field { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; }
.re-field-label { width: 132px; flex: 0 0 132px; font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(30,25,21,.78); }
.re-field-body { flex: 1; }
.re-field-value { font-size: 0.78rem; white-space: pre-line; }
.re-field-missing { color: rgba(30,25,21,.75); }
.re-field-note { margin: .2rem 0 0; font-size: 0.75rem; color: rgba(30,25,21,.78); }
.re-conflicts { margin: .3rem 0 0; padding-left: 1rem; }
.re-conflicts li { font-size: 0.75rem; }
.re-conflicts span { display: block; color: rgba(30,25,21,.78); font-size: 0.75rem; }
.re-conflicts em { display: block; color: rgba(30,25,21,.78); font-size: 0.75rem; font-style: normal; }

/* Border style, not colour, carries the meaning. */
.re-tag { display: inline-block; border: 1px solid var(--black); padding: 0 .35rem; font-size: 0.75rem; letter-spacing: .08em; text-transform: uppercase; }
.re-tag-recorded { border-style: solid; }
.re-tag-missing { border-style: dashed; }
.re-tag-qualified { border-style: dotted; }
.re-tag-calculated { border-style: dotted; }
.re-tag-conflict { border-style: double; border-width: 3px; }
.re-tag-overdue { border-style: double; border-width: 3px; }
.re-tag-exact { border-style: solid; }
.re-tag-approximate { border-style: dashed; }
.re-tag-tbd { border-style: dotted; }

.re-date { padding: .45rem 0; border-bottom: 1px solid rgba(30,25,21,.14); font-size: 0.76rem; display: flex; flex-direction: column; gap: .1rem; }
.re-date-overdue { border-left: 5px solid var(--deep-orange); padding-left: .5rem; }
.re-date-status { font-size: 0.75rem; color: rgba(30,25,21,.78); }

.re-empty { padding: 1.2rem; font-size: 0.82rem; }
.re-browser-panel .re-empty { color: var(--ivory); }
.re-inline-button { border: 1px solid var(--black); background: transparent; padding: .35rem .7rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .08em; }
.re-inline-button-filled { background: var(--deep-orange); color: var(--ivory); border-color: var(--deep-orange); }
.re-drawer-actions { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.re-view-switch { display: none; gap: .45rem; padding: 0 1rem 1rem; }
.re-view-switch button {
  min-height: 44px; border: 1px solid var(--black); background: transparent; padding: .5rem 1rem;
  font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase;
}
.re-view-switch button.re-view-active { background: var(--black); color: var(--ivory); }
.re-frame[data-filters-open="false"] #re-filters { display: none; }

.re-frame :focus-visible { outline: 3px solid var(--fire); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .re-row { transition: none; }
}

@media (max-width: 700px) {
  /* Single column, no horizontal overflow at 390. Type floor 11px. */
  .re-summary { grid-template-columns: repeat(2, 1fr); }
  .re-panels { display: block; min-height: 0; position: relative; }
  .re-browser-panel { width: 100%; height: 560px; border-right: 0; }
  .re-map-panel { width: 100%; min-width: 0; height: 560px; border-right: 0; border-bottom: 2px solid var(--black); }
  .re-frame[data-panel="list"] .re-map-panel { display: none; }
  .re-frame[data-panel="map"] .re-browser-panel { display: none; }
  .re-view-switch { display: flex; gap: .35rem; }
  .re-view-switch button { flex: 1; }
  .re-chip { min-height: 34px; font-size: 0.72rem; }
  .re-drawer { inset: 0; width: 100%; border-left: 0; }
  .re-field-label { width: 108px; flex-basis: 108px; font-size: 0.7rem; }
  .re-tile-label, .re-tile-note, .re-tag, .re-row-meta, .re-row-owner,
  .re-section header span, .re-field-note, .re-conflicts span, .re-conflicts em,
  .re-map-footnote, .re-date-status, .re-triage { font-size: 0.7rem; }
  .re-map-footnote {
    left: 4px; bottom: 42px; max-width: calc(100% - 8px); padding: .3rem;
  }
  .re-map .mapboxgl-popup-content { min-width: 260px; max-width: 320px; }
  .re-map-fit { top: 8px; right: 8px; }
  .re-inline-button { min-height: 36px; }
}
