/* ============================================================
   Industrial Atlas UK — styles.css
   Matter-of-fact, legible, functional.
   Font: IBM Plex Sans / IBM Plex Mono
   ============================================================ */

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #ece9e2;
}

a { color: #1a3a5c; text-decoration: none; }
a:hover { text-decoration: underline; color: #0f2338; }

/* ---- Layout skeleton ---------------------------------------- */
body { display: flex; flex-direction: column; }

#app-header {
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 16px;
  background: #1c1c1c;
  color: #f0ede6;
  flex-shrink: 0;
  border-bottom: 1px solid #000;
  z-index: 1000;
}

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

.brand-mark {
  display: flex;
  align-items: center;
  opacity: 0.78;
  flex-shrink: 0;
  color: #f0ede6;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-country {
  font-weight: 400;
  opacity: 0.6;
}

.mode-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.mode-btn {
  padding: 4px 11px;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 2px;
  color: #b8b4ae;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.mode-btn:hover { background: #2e2e2e; color: #f0ede6; border-color: #666; }
.mode-btn.active { background: #393939; color: #fff; border-color: #777; }

.base-switcher {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.base-btn {
  padding: 4px 11px;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 2px;
  color: #b8b4ae;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.base-btn:hover,
.base-btn.active { background: #333; color: #f0ede6; border-color: #666; }

#app-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ---- Sidebars ----------------------------------------------- */
.sidebar {
  background: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}

#sidebar-left {
  width: 270px;
  border-right: 1px solid #d4d0c8;
  display: flex;
  flex-direction: column;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

#sidebar-right {
  width: 298px;
  border-left: 1px solid #d4d0c8;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  padding: 8px 14px;
  border-bottom: 1px solid #ece9e4;
  position: relative;
}

.section-heading {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
}

/* ---- Search ------------------------------------------------- */
.search-wrapper {
  display: flex;
  gap: 4px;
}

#search-input {
  flex: 1;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #d4d0c8;
  border-radius: 2px;
  font-family: inherit;
  font-size: 13px;
  background: #faf9f7;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}

#search-input:focus {
  border-color: #888;
  background: #fff;
}

#search-btn {
  height: 32px;
  width: 36px;
  background: #2c2c2c;
  border: none;
  border-radius: 2px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.1s;
}

#search-btn:hover { background: #484848; }

.suggestions {
  list-style: none;
  background: #fff;
  border: 1px solid #d4d0c8;
  border-top: none;
  border-radius: 0 0 2px 2px;
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 999;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.suggestions li {
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid #f0ede8;
  line-height: 1.35;
  color: #333;
}

.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover { background: #f5f3ef; }

/* ---- Quick area presets ------------------------------------ */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.preset-btn {
  padding: 5px 8px;
  background: #f7f5f1;
  border: 1px solid #d4d0c8;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  color: #1a1a1a;
  line-height: 1.3;
  transition: background 0.1s, border-color 0.1s;
}

.preset-btn:hover { background: #ece8e0; border-color: #b0aca4; }

/* ---- Filters ----------------------------------------------- */
.filter-list { display: flex; flex-direction: column; gap: 1px; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s;
}

.filter-row:hover { background: #f7f5f1; }

.filter-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #1a3a5c;
  flex-shrink: 0;
}

.filter-label {
  font-size: 13px;
  color: #1a1a1a;
  user-select: none;
}

.filter-label.tag {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11.5px;
  color: #3a3a3a;
}

/* ---- Tool buttons ----------------------------------------- */
.tools-section { display: flex; flex-direction: column; gap: 5px; }

.btn-tool {
  width: 100%;
  padding: 6px 10px;
  background: #f7f5f1;
  border: 1px solid #d4d0c8;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}

.btn-tool:hover { background: #ece8e0; border-color: #aaa; }
.btn-tool:active { background: #e0dcd4; }

/* ---- Run dock --------------------------------------------- */
.run-dock {
  padding: 12px 14px 14px;
  border-top: 2px solid #dedad4;
  background: #fff;
  flex-shrink: 0;
}

.btn-run {
  width: 100%;
  height: 42px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-run:hover:not(:disabled) { background: #a93226; }
.btn-run:active:not(:disabled) { background: #922b21; }

.btn-run:disabled {
  background: #c8c4bc;
  color: #eae8e4;
  cursor: not-allowed;
}

.run-hint {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin-top: 5px;
  min-height: 16px;
}

/* ---- Map --------------------------------------------------- */
#map-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* ---- Inset navigator (Leaflet custom control) -------------- */
.navigator-control {
  background: #fff;
  border: 1px solid #c8c4bc;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  overflow: hidden;
  width: 192px;
  user-select: none;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 9px;
  background: #2c2c2c;
  color: #f0ede6;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-collapse-btn {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  font-family: inherit;
}

.nav-collapse-btn:hover { color: #fff; }

#inset-map {
  width: 190px;
  height: 236px;
  display: block;
}

/* ---- Region overlay labels --------------------------------- */
.region-label {
  background: transparent;
  border: none;
  pointer-events: none;
}

.region-label span {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #2c2c2c;
  white-space: nowrap;
  text-shadow:
    0  1px 2px rgba(255,255,255,0.9),
    0 -1px 2px rgba(255,255,255,0.9),
    1px 0   2px rgba(255,255,255,0.9),
   -1px 0   2px rgba(255,255,255,0.9);
}

/* ---- Right panels ----------------------------------------- */
.panel {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.panel[hidden] { display: none; }

.panel-body {
  padding: 16px;
  flex: 1;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid #ece9e4;
  flex-shrink: 0;
}

.panel-header h3 {
  font-size: 13px;
  font-weight: 600;
}

.panel-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  font-family: inherit;
}

.panel-close:hover { color: #1a1a1a; }

.panel-back {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 12px;
  color: #1a3a5c;
  cursor: pointer;
  padding: 0;
}

.panel-back:hover { text-decoration: underline; }

/* Welcome panel */
#panel-welcome {
  flex: 1;
  justify-content: space-between;
}

#panel-welcome h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.panel-intro {
  font-size: 13px;
  color: #444;
  margin-bottom: 14px;
  line-height: 1.55;
}

.how-to {
  padding-left: 18px;
  margin-bottom: 18px;
}

.how-to li {
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
  line-height: 1.45;
}

.legend { margin-top: 4px; }

.legend-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #333;
  margin-bottom: 5px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-swatch {
  width: 22px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 2px;
}

.osm-credit {
  padding: 10px 16px;
  font-size: 11px;
  color: #aaa;
  border-top: 1px solid #ece9e4;
  flex-shrink: 0;
}

/* Results panel */
.results-summary {
  padding: 9px 14px;
  background: #f7f5f1;
  border-bottom: 1px solid #ece9e4;
  font-size: 12px;
  color: #555;
  line-height: 1.6;
  flex-shrink: 0;
}

.results-summary strong { color: #1a1a1a; }

.results-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid #f0ede8;
  cursor: pointer;
  transition: background 0.1s;
}

.result-item:hover { background: #f7f5f1; }

.result-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  display: inline-block;
}

.result-name {
  font-size: 12px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.35;
}

.result-type {
  font-size: 11px;
  color: #999;
  margin-top: 1px;
}

/* Feature panel */
.feature-content {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.feature-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
  color: #1a1a1a;
}

.feature-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 12px;
}

.feature-coords {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #999;
  margin-bottom: 14px;
}

.feature-tags { margin-bottom: 14px; }

.feature-tags-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 7px;
}

.tag-row {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  margin-bottom: 3px;
  word-break: break-all;
  line-height: 1.4;
}

.tag-key { color: #8aabbc; }
.tag-eq  { color: #ccc; margin: 0 1px; }
.tag-val { color: #2d4a2d; }

.feature-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.feature-link {
  display: block;
  padding: 6px 11px;
  background: #f7f5f1;
  border: 1px solid #d4d0c8;
  border-radius: 2px;
  font-size: 12px;
  color: #1a3a5c;
  transition: background 0.1s;
}

.feature-link:hover { background: #ece8e0; text-decoration: none; }

.feature-link-edit { color: #5c3a00; border-color: #c8a060; }
.feature-link-edit:hover { background: #fdf5e6; }

/* Analysis panel */
.analysis-content {
  padding: 14px;
  flex: 1;
  overflow-y: auto;
}

.analysis-note {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
  line-height: 1.5;
}

.analysis-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0ede8;
  font-size: 13px;
}

.analysis-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-count {
  font-weight: 600;
  font-size: 15px;
  font-family: 'IBM Plex Mono', monospace;
  color: #1a1a1a;
}

.analysis-total { border-bottom: 2px solid #1a1a1a; font-weight: 600; }

.analysis-section-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #888;
  padding: 10px 0 4px;
}

.analysis-highlight {
  margin-top: 8px;
  padding: 7px 10px;
  background: #f5f0e8;
  border-left: 3px solid #c06820;
  font-size: 11px;
  font-weight: 500;
  color: #5a3010;
  border-radius: 0 3px 3px 0;
}

/* ---- Loading bar ------------------------------------------ */
#loading-bar {
  position: fixed;
  top: 46px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 2000;
}

#loading-bar-fill {
  height: 100%;
  background: #c0392b;
  width: 0;
  transition: width 0.4s ease;
}

/* ---- Toast ------------------------------------------------ */
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1c1c;
  color: #f0ede6;
  padding: 8px 18px;
  border-radius: 3px;
  font-size: 13px;
  z-index: 3000;
  white-space: nowrap;
  pointer-events: none;
  max-width: 80vw;
  white-space: normal;
  text-align: center;
}

/* ---- Marker icon ------------------------------------------ */
.ind-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.75);
  font-weight: 700;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* Cluster overrides — keep them neutral */
.marker-cluster-small       { background-color: rgba(160,185,200,0.7); }
.marker-cluster-small div   { background-color: rgba(100,145,170,0.8); }
.marker-cluster-medium      { background-color: rgba(200,175,100,0.7); }
.marker-cluster-medium div  { background-color: rgba(175,140,60,0.8); }
.marker-cluster-large       { background-color: rgba(210,120,100,0.7); }
.marker-cluster-large div   { background-color: rgba(180,80,60,0.8); }
.marker-cluster             { border-radius: 50%; }
.marker-cluster div {
  border-radius: 50%;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: #fff;
}

/* ---- Leaflet draw overrides ------------------------------- */
.leaflet-draw-toolbar a { background-color: #fff; }

/* ---- Sort button ------------------------------------------ */
.btn-sort {
  padding: 3px 8px;
  background: #f7f5f1;
  border: 1px solid #d4d0c8;
  border-radius: 2px;
  font-family: inherit;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}

.btn-sort:hover  { background: #ece8e0; }
.btn-sort.active { background: #1c1c1c; color: #fff; border-color: #1c1c1c; }

/* ---- Score badge in results list -------------------------- */
.result-score-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  width: 32px;
  height: 32px;
  border: 2px solid;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: default;
}

/* ---- Opportunity score panel (feature detail) ------------- */
.score-panel {
  border-left: 4px solid #888;
  border-radius: 0 3px 3px 0;
  background: #faf9f7;
  padding: 11px 12px;
  margin-bottom: 14px;
}

.score-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.score-block {
  text-align: center;
  flex-shrink: 0;
}

.score-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

.score-conf-num {
  font-size: 22px;
  color: #888 !important;
}

.score-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #aaa;
  margin-top: 2px;
}

.score-band-block {
  flex: 1;
  min-width: 100px;
  padding-top: 2px;
}

.score-band {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 3px;
}

.score-context-note {
  font-size: 10px;
  color: #aaa;
  font-style: italic;
}

.score-signals {
  border-top: 1px solid #e8e4dc;
  padding-top: 8px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.signal-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.4;
}

.signal-arrow {
  font-size: 9px;
  flex-shrink: 0;
  width: 10px;
}

.signal-delta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  width: 28px;
  flex-shrink: 0;
  text-align: right;
}

.signal-text {
  color: #333;
  flex: 1;
}

.signal-pos .signal-arrow,
.signal-pos .signal-delta { color: #2d6a4f; }

.signal-neg .signal-arrow,
.signal-neg .signal-delta { color: #a82820; }

.score-extra-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.score-conf-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.4;
}

.badge-voa        { background: #2c3a4a; color: #8fb0c8; }
.badge-ch         { background: #2d4820; color: #8fc870; }
.badge-ch-neutral { background: #3a3a28; color: #b8b870; }

.score-disclaimer {
  margin-top: 8px;
  font-size: 10px;
  color: #bbb;
  font-style: italic;
  line-height: 1.4;
  border-top: 1px solid #e8e4dc;
  padding-top: 6px;
}

/* ---- Lifecycle pills (sidebar filter rows + result items) - */
.coverage-warning {
  margin-top: 8px;
  padding: 6px 9px;
  background: #2c1a00;
  border-left: 3px solid #c8780c;
  color: #e0a050;
  border-radius: 0 3px 3px 0;
  font-style: normal;
}

.coverage-warning strong { color: #f0c070; }

.section-note {
  font-size: 11px;
  color: #999;
  margin: -4px 0 8px;
  line-height: 1.4;
}

/* ---- Collapsible sidebar sections ------------------------- */
.section-toggle-btn {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-chevron {
  margin-left: auto;
  font-size: 9px;
  opacity: 0.55;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.sidebar-section.collapsed .section-chevron { transform: rotate(-90deg); }

.sidebar-section.collapsed .filter-list,
.sidebar-section.collapsed .section-note:not(.coverage-warning) { display: none; }

/* ---- Filter sub-heading ----------------------------------- */
.filter-subhead {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c0bbb5;
  padding: 6px 6px 2px;
}
.filter-subhead:first-child { padding-top: 0; }

/* ---- Tools grid (2-col) ----------------------------------- */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 4px;
}

/* ---- 2-column legend -------------------------------------- */
.legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
}

/* ---- OSM tag collapse toggle ------------------------------ */
.tags-toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #aaa;
  cursor: pointer;
  display: inline;
  margin-left: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  vertical-align: middle;
}
.tags-toggle:hover { color: #666; }

.lifecycle-row {
  align-items: center;
}

.lifecycle-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.lp-abandoned {
  background: #3d1a0a;
  color: #f4b088;
  border: 1px solid #7a3010;
}

.lp-disused {
  background: #1a1a3d;
  color: #9898e8;
  border: 1px solid #30307a;
}

.lp-vacant {
  background: #1a3d20;
  color: #88c89a;
  border: 1px solid #2d7040;
}

/* Inline pill in result-name row */
.result-name .lifecycle-pill {
  margin-left: 6px;
  vertical-align: middle;
  font-size: 8px;
}

/* ---- Score threshold + lifecycle chips (results panel) ---- */
.score-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 12px 4px;
  border-bottom: 1px solid #ece8e0;
}

.score-chip {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border: 1px solid #d4d0c8;
  border-radius: 11px;
  background: #f7f5f1;
  color: #555;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
}

.score-chip:hover { background: #ece8e0; }

.score-chip.active {
  background: #1c1c1c;
  color: #f0ede6;
  border-color: #1c1c1c;
}

.score-chip.lc-chip.active {
  background: #3d1a0a;
  color: #f4b088;
  border-color: #7a3010;
}

/* ---- Size chips (area filter row in results panel) --------- */
.size-chips { border-top: none; padding-top: 2px; }

.size-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 7px;
  border: 1px solid #d4d0c8;
  border-radius: 11px;
  background: #f7f5f1;
  color: #666;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
}
.size-chip:hover { background: #ece8e0; }
.size-chip.active {
  background: #1c4a8a;
  color: #dde8f8;
  border-color: #1c4a8a;
}

/* ---- Result item meta line (type + area) ------------------- */
.result-meta {
  font-size: 11px;
  color: #999;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.result-area {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6a8aaa;
  background: #eef3f8;
  border: 1px solid #c8d8e8;
  border-radius: 3px;
  padding: 0 4px;
  white-space: nowrap;
}

/* ---- Feature detail area badge ----------------------------- */
.feature-area-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: #1c4a8a;
  background: #eef3f8;
  border: 1px solid #b8ccdf;
  border-radius: 4px;
  padding: 1px 7px;
  margin: 3px 0 0 2px;
}

/* ---- Share actions row (property page + postcard) ---------- */
.share-actions {
  display: flex;
  gap: 6px;
  margin: 14px 0;
}

.btn-share-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px;
  background: #f7f5f1;
  border: 1px solid #d4d0c8;
  border-radius: 3px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #1a3a5c;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.01em;
  transition: background 0.15s;
  cursor: pointer;
}
.btn-share-page:hover { background: #ece8e0; text-decoration: none; color: #1a3a5c; }
.btn-share-map { background: #1c4a8a; color: #dde8f8; border: 1px solid #1c4a8a; }
.btn-share-map:hover { background: #163a6e; color: #dde8f8; border-color: #163a6e; }

/* ---- Create Postcard button (feature detail panel) --------- */
.btn-postcard {
  flex: 1;
  display: block;
  margin: 0;
  padding: 10px 10px;
  background: #1c1c1c;
  color: #f0ede6;
  border: none;
  border-radius: 3px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.btn-postcard:hover { background: #2e2e2e; }

/* ---- Lifecycle filter row: pill right-aligned -------------- */
.lifecycle-row .filter-label { flex: 1; }

/* ---- Postcard modal overlay ------------------------------- */
.postcard-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
}

.postcard-scale-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 16px 80px rgba(0,0,0,0.8);
  flex-shrink: 0;
}

.postcard-modal-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.postcard-modal-btn {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 22px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  background: rgba(255,255,255,0.07);
  color: #f0ede6;
  cursor: pointer;
  transition: background 0.15s;
}
.postcard-modal-btn:hover    { background: rgba(255,255,255,0.15); }
.postcard-modal-btn:disabled { opacity: 0.5; cursor: default; }
.postcard-modal-btn.pc-primary { background: #c0392b; border-color: #c0392b; }
.postcard-modal-btn.pc-primary:hover { background: #a93226; }

/* ---- Postcard card: 1200x630 ----------------------------- */
.postcard {
  width: 1200px;
  height: 630px;
  position: relative;
  overflow: hidden;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #fff;
  box-sizing: border-box;
  background: #0d1208;
}

/* Layer 1 — live Leaflet map (full bleed) */
.pc-map-layer {
  position: absolute;
  inset: 0;
}
#pc-leaflet-map {
  width: 1200px;
  height: 630px;
}

/* Layer 2 — export-only vector bg */
.pc-export-bg {
  position: absolute;
  inset: 0;
}
.pc-export-bg svg { display: block; }

/* TOP STRIP — full width, brand + type badge */
.pc-top-strip {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 54px;
  background: rgba(0,0,0,0.86);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.pc-top-brand {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #ccc;
}

.pc-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pc-top-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #888;
  letter-spacing: 0.04em;
  flex: 1;
  text-align: center;
}

.pc-sb-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 3px;
  color: #fff;
}

/* SIDEBAR — semi-transparent, between strips */
.pc-sidebar {
  position: absolute;
  top: 54px;
  right: 0;
  width: 320px;
  height: 480px;
  z-index: 499;
  background: rgba(0,0,0,0.80);
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.pc-sb-body {
  flex: 1;
  padding: 18px 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}

.pc-sb-name {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.pc-sb-address {
  font-size: 14px;
  color: #ccc;
  line-height: 1.5;
  flex-shrink: 0;
}

.pc-sb-rule {
  height: 1px;
  background: rgba(255,255,255,0.10);
  flex-shrink: 0;
  margin: 2px 0;
}

.pc-sb-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.pc-sb-tag-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.4;
}

.pc-sb-tag-key {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
  min-width: 70px;
}

.pc-sb-tag-val {
  font-size: 14px;
  color: #e8e8e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pc-sb-designations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pc-sb-designation {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(200,150,12,0.18);
  color: #c8960c;
  letter-spacing: 0.03em;
}

.pc-sb-signals {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.pc-sb-signal {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.35;
  flex-shrink: 0;
}

.pc-sb-sig-delta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
}

.pc-sb-sig-text {
  font-size: 13px;
  color: #bbb;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-sb-sig-pos .pc-sb-sig-delta { color: #5cb87a; }
.pc-sb-sig-neg .pc-sb-sig-delta { color: #e06060; }
.pc-sb-minimap {
  flex-shrink: 0;
  height: 132px;
  border-top: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}
#pc-minimap {
  width: 320px;
  height: 132px;
}


/* BOTTOM STRIP — score, band, bar, coords, OSM ref */
.pc-bottom-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 96px;
  background: rgba(0,0,0,0.90);
  z-index: 500;
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 20px;
  box-sizing: border-box;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.pc-bs-score {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.pc-bs-score-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 68px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.pc-bs-score-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-bs-band {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1;
}

.pc-bs-bar-wrap {
  height: 5px;
  width: 120px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  overflow: hidden;
}

.pc-bs-bar {
  height: 5px;
  border-radius: 3px;
}

.pc-bs-conf {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #999;
  letter-spacing: 0.03em;
}

.pc-bs-location {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.pc-bs-coords {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: #e0e0e0;
  letter-spacing: 0.04em;
}

.pc-bs-osmref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: #888;
  letter-spacing: 0.02em;
}

.pc-bs-attr {
  font-size: 11px;
  color: #666;
}

/* Raw OSM tag chips — bottom strip middle */
.pc-bs-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
  align-content: center;
  min-width: 0;
  overflow: hidden;
  max-height: 72px;
}

.pc-bs-tag-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #bbb;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 2px;
  padding: 2px 6px;
  white-space: nowrap;
  line-height: 1.4;
}

.pc-bs-tag-lc {
  color: #f0a060;
  background: rgba(180,80,20,0.18);
  border-color: rgba(180,80,20,0.35);
}

/* ---- File:// warning banner ------------------------------- */
#file-warning {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4000;
  background: #fff3cd;
  border-top: 2px solid #e6a817;
  padding: 9px 16px;
  font-size: 12px;
  color: #5a4000;
  line-height: 1.5;
}

#file-warning code {
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(0,0,0,0.08);
  padding: 1px 5px;
  border-radius: 2px;
}

#file-warning a { color: #1a3a5c; }

/* ---- Mobile ----------------------------------------------- */
.mobile-fab { display: none; }

@media (max-width: 820px) {
  #sidebar-left,
  #sidebar-right {
    position: fixed;
    top: 46px;
    bottom: 0;
    z-index: 500;
    width: min(300px, 85vw);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: 2px 0 16px rgba(0,0,0,0.2);
  }

  #sidebar-left  { left: 0; transform: translateX(-100%); }
  #sidebar-right { right: 0; left: auto; transform: translateX(100%); }
  #sidebar-left.open  { transform: translateX(0); }
  #sidebar-right.open { transform: translateX(0); }

  .mode-nav { display: none; }

  .mobile-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 18px;
    width: 46px;
    height: 46px;
    background: #1c1c1c;
    color: #f0ede6;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 450;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  }

  .mobile-fab-left  { left: 14px; }
  .mobile-fab-right { right: 14px; }
}

@media (max-width: 520px) {
  #app-header { padding: 0 10px; gap: 10px; }
  .base-switcher { display: none; }
}

/* ---- Planning overlays ---------------------------------------- */

.coverage-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: #2c3a4a;
  color: #8fb0c8;
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
}

.section-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: #2c4a2c;
  color: #8fc88f;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

.plan-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Listed building diamond markers */
.plan-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  border-radius: 2px;
}

.plan-marker span {
  display: block;
  transform: rotate(-45deg);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 7px;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

.plan-marker.lm-grade1  { background: #c8960c; }
.plan-marker.lm-grade2s { background: #b07020; }
.plan-marker.lm-grade2  { background: #7a5a18; }
.plan-marker.lm-default { background: #555; border-radius: 50%;
  /* suppress diamond style for non-listed point overlays */
}

/* ---- Companies House panel ------------------------------------ */

.companies-section {
  margin-top: 12px;
  border-top: 1px solid #e0ddd6;
  padding-top: 10px;
}

.ch-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ch-count {
  font-size: 10px;
  font-weight: 500;
  color: #aaa;
  letter-spacing: 0;
  text-transform: none;
}

.ch-loading {
  font-size: 11px;
  color: #aaa;
  font-style: italic;
  padding: 4px 0;
}

.ch-empty {
  font-size: 11px;
  color: #aaa;
  padding: 4px 0;
}

.ch-error { color: #b05050; }

.ch-officers {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
}

.ch-officer {
  font-size: 10px;
  color: #555;
  white-space: nowrap;
}

.ch-officer-role {
  font-size: 9px;
  color: #999;
  text-transform: capitalize;
}

.ch-note {
  font-size: 10px;
  color: #aaa;
  font-style: italic;
  margin-bottom: 6px;
}

.ch-item {
  padding: 6px 0;
  border-bottom: 1px solid #f0ede6;
}

.ch-item:last-child { border-bottom: none; }

.ch-item.ch-industrial .ch-name { color: #8B4513; }

.ch-item-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.ch-name {
  font-size: 12px;
  font-weight: 500;
  color: #1a3a5c;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-status {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ch-active   { background: #e6f4ec; color: #2d6a4f; }
.ch-dissolved { background: #fceaea; color: #8B2020; }
.ch-other    { background: #f0f0f0; color: #666; }

.ch-item-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.ch-sic-chip {
  font-size: 9px;
  font-weight: 600;
  background: #f0e8d8;
  color: #7a5020;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

.ch-since {
  font-size: 10px;
  color: #aaa;
}

/* ---- VOA Business Rates panel --------------------------------- */

.voa-section {
  margin-top: 10px;
  border-top: 1px solid #e0ddd6;
  padding-top: 10px;
}

.voa-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.voa-source {
  font-size: 9px;
  font-weight: 600;
  background: #2a3a4a;
  color: #8ab0d0;
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 0;
  text-transform: none;
}

.voa-count {
  font-size: 10px;
  font-weight: 500;
  color: #aaa;
  letter-spacing: 0;
  text-transform: none;
}

.voa-loading, .voa-empty {
  font-size: 11px;
  color: #aaa;
  font-style: italic;
  padding: 2px 0;
}

.voa-error { color: #b05050; }

.voa-item {
  padding: 5px 0;
  border-bottom: 1px solid #f0ede6;
}

.voa-item:last-child { border-bottom: none; }

.voa-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.voa-label {
  font-size: 12px;
  font-weight: 600;
  color: #2c2c2c;
}

.voa-rv {
  font-size: 11px;
  font-weight: 500;
  color: #1a3a5c;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
}

.voa-band {
  font-size: 10px;
  color: #7a5020;
  margin-top: 1px;
}

.voa-addr {
  font-size: 10px;
  color: #aaa;
  margin-top: 1px;
}

/* ---- VOA Gap Finder --------------------------------------- */

.btn-gap-finder { border-color: #c8780c; color: #c8780c; }
.btn-gap-finder.active {
  background: #c8780c;
  color: #fff;
  border-color: #c8780c;
}

.voa-gap-pin {
  border-radius: 3px;
  transform: rotate(45deg);
  background: #d4820a;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.5);
  cursor: pointer;
}
.voa-gap-pin:hover { background: #ff9900; }

/* Gap panel */
.gap-content {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.gap-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.gap-stat {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  background: #f7f5f1;
  border-radius: 4px;
}

.gap-stat-n {
  display: block;
  font-size: 22px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.1;
}

.gap-stat-missing { color: #c06820; }
.gap-stat-matched { color: #2d6a4f; }

.gap-stat-l {
  display: block;
  font-size: 10px;
  color: #888;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gap-note {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
  line-height: 1.5;
  font-style: italic;
}

.gap-more {
  font-size: 10px;
  color: #aaa;
  padding: 8px 0 4px;
  text-align: center;
}

.gap-list {
  list-style: none;
  padding: 0; margin: 0;
}

.gap-item {
  padding: 8px 6px;
  border-bottom: 1px solid #f0ede8;
  cursor: pointer;
}
.gap-item:hover { background: #faf8f4; }

.gap-item-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gap-pin-dot {
  width: 9px; height: 9px;
  background: #d4820a;
  border-radius: 2px;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.gap-pc {
  font-weight: 600;
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  flex: 1;
}

.gap-rv {
  font-size: 11px;
  color: #666;
  font-family: 'IBM Plex Mono', monospace;
}

.gap-item-meta {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
  padding-left: 16px;
}

/* Gap detail panel */
.gap-detail-box {
  margin: 12px 0;
  border: 1px solid #e0ddd6;
  border-radius: 4px;
  overflow: hidden;
}

.gap-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 11px;
  border-bottom: 1px solid #f0ede8;
  font-size: 12px;
}
.gap-detail-row:last-child { border-bottom: none; }

.gap-detail-key { color: #888; }
.gap-detail-val { font-weight: 500; }
.gap-missing    { color: #c06820; }

.gap-action-note {
  font-size: 11px;
  color: #666;
  line-height: 1.5;
  padding: 8px 10px;
  background: #fdf5e6;
  border-left: 3px solid #c8780c;
  border-radius: 0 3px 3px 0;
  margin-bottom: 12px;
}

/* ---- Card format picker ----------------------------------- */
.card-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-picker-modal {
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 20px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-picker-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 4px;
}

.card-picker-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #252525;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
  width: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
}
.card-picker-opt:hover { background: #2e2e2e; border-color: #555; }

.cpo-thumb {
  background: #111;
  border: 1px solid #444;
  border-radius: 2px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.cpo-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
}
.cpo-thumb-wide      { width: 52px; height: 28px; }
.cpo-thumb-square    { width: 34px; height: 34px; }
.cpo-thumb-landscape { width: 52px; height: 29px; }

.cpo-name {
  font-size: 13px;
  font-weight: 600;
  color: #f0ede6;
  margin-bottom: 2px;
  display: block;
}

.cpo-desc {
  font-size: 10.5px;
  color: #555;
  display: block;
}

.card-picker-cancel {
  background: none;
  border: 1px solid #2e2e2e;
  border-radius: 3px;
  color: #555;
  font-size: 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  padding: 7px;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
  transition: color 0.1s, border-color 0.1s;
}
.card-picker-cancel:hover { color: #aaa; border-color: #555; }

.card-message-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  border-radius: 3px;
  color: #f0ede6;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 11px;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.card-message-input:focus { border-color: #555; }
.card-message-input::placeholder { color: #444; }

.cpo-msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.cpo-msg-actions .card-picker-cancel {
  flex: 1;
  margin-top: 0;
}

.cpo-create {
  flex: 2;
  background: #2a4a2a;
  border: 1px solid #3a6a3a;
  border-radius: 3px;
  color: #a8d4a8;
  font-size: 13px;
  font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.cpo-create:hover { background: #335a33; border-color: #4a8a4a; }

/* ---- Property page notes panel --------------------------- */
#prop-layout {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  max-width: 1160px;
  margin: 28px auto 48px;
  padding: 0 16px;
}

#prop-col-card {
  flex: 0 0 560px;
  min-width: 0;
}

#prop-col-notes {
  flex: 1;
  min-width: 260px;
  position: sticky;
  top: 66px;
}

.notes-panel {
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 4px;
  overflow: hidden;
}

.notes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}

.notes-panel-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #bbb;
}

.btn-save-page {
  font-size: 11px;
  font-weight: 500;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #f0ede6;
  background: #1c1c1c;
  border: none;
  border-radius: 2px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}
.btn-save-page:hover { background: #333; }
.btn-save-page:disabled { opacity: 0.5; cursor: default; }

.notes-body { padding: 10px 14px 14px; }

.notes-input {
  width: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f7f5f1;
  border: 1px solid #d4d0c8;
  border-radius: 3px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 76px;
  outline: none;
  transition: border-color 0.1s;
  display: block;
  box-sizing: border-box;
}
.notes-input:focus { border-color: #9aabbc; background: #fff; }
.notes-input::placeholder { color: #bbb; }

.btn-add-note {
  margin-top: 6px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #1a3a5c;
  background: #f7f5f1;
  border: 1px solid #d4d0c8;
  border-radius: 2px;
  padding: 6px 14px;
  cursor: pointer;
  width: 100%;
  transition: background 0.1s;
}
.btn-add-note:hover { background: #ece8e0; }

.notes-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.note-item {
  background: #f7f5f1;
  border: 1px solid #ece9e4;
  border-radius: 3px;
  padding: 9px 11px;
}

.note-item-time {
  font-size: 9.5px;
  color: #bbb;
  font-family: 'IBM Plex Mono', monospace;
  margin-bottom: 4px;
}

.note-item-text {
  font-size: 12.5px;
  color: #333;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.notes-empty {
  font-size: 11.5px;
  color: #ccc;
  font-style: italic;
  text-align: center;
  padding: 18px 0 6px;
}

@media (max-width: 940px) {
  #prop-layout { flex-direction: column; }
  #prop-col-card { flex: none; width: 100%; }
  #prop-col-notes { position: static; width: 100%; }
}
