/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Rescrape banner ──────────────────────────────────────────── */
.rescrape-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: #2a1f0a; border-bottom: 1px solid #a06a10;
  color: #f5c96a; font-size: 13px;
}
.rescrape-icon { font-size: 16px; flex-shrink: 0; }
.rescrape-msg  { flex: 1; line-height: 1.4; }
.rescrape-action {
  padding: 5px 14px; background: #a06a10; border: none;
  border-radius: 6px; color: #fff; font-family: var(--font);
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.rescrape-action:hover { background: #c08020; }
.rescrape-dismiss {
  background: none; border: none; color: #a06a10; font-size: 16px;
  cursor: pointer; padding: 2px 6px; line-height: 1;
}
.rescrape-dismiss:hover { color: #f5c96a; }
/* push layout down when banner is visible */
body.has-banner .layout { margin-top: 42px; }

:root {
  --bg:       #07080b;
  --bg2:      #0f1117;
  --bg3:      #161b25;
  --bg4:      #1e2535;
  --border:   #262d3d;
  --text:     #d4dae8;
  --text2:    #8a93a8;
  --text3:    #7a84a0;
  --accent:   #ff5a5f;
  --accent2:  #e04045;
  --green:    #2ed573;
  --yellow:   #ffd04b;
  --blue:     #4a9eff;
  --orange:   #ff9f43;
  --font:     'Plus Jakarta Sans', system-ui, sans-serif;
  --radius:   8px;
  --sidebar-w: 240px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }

/* ── Layout ───────────────────────────────────────────────────── */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 14px; gap: 16px; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.brand-icon { font-size: 20px; color: var(--accent); }
.brand-name { font-size: 15px; font-weight: 600; }

.filter-block { display: flex; flex-direction: column; gap: 6px; }
.filter-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); }
.filter-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  background: var(--blue); color: #fff; border-radius: 999px;
  letter-spacing: .04em; min-width: 18px; text-align: center;
}

/* Multi-select checkbox group (zones) */
.filter-checkboxes {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 180px; overflow-y: auto;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 8px;
}
.filter-checkboxes::-webkit-scrollbar       { width: 6px; }
.filter-checkboxes::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.filter-cb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px; cursor: pointer;
  font-size: 12px; color: var(--text2);
  border-radius: 4px;
}
.filter-cb-item:hover { background: var(--bg4); color: var(--text); }
.filter-cb-item input[type=checkbox] {
  width: 13px; height: 13px; accent-color: var(--blue);
  cursor: pointer; flex-shrink: 0;
}
.filter-cb-item.checked { color: var(--text); }

/* Search icon wrap */
.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon-wrap .input-icon {
  position: absolute; left: 10px; color: var(--text3); pointer-events: none;
}
.input-icon-wrap input { padding-left: 30px !important; }

/* Radius slider */
.radius-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.radius-row input[type=range] {
  flex: 1; accent-color: var(--blue); cursor: pointer;
}
.radius-hint { font-size: 11px; color: var(--text3); line-height: 1.4; margin-top: 4px; }

/* Collapsible section (export) */
.filter-details {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.filter-details-summary {
  cursor: pointer; padding: 10px 12px;
  font-size: 12px; font-weight: 600; color: var(--text2);
  list-style: none; user-select: none;
}
.filter-details-summary::-webkit-details-marker { display: none; }
.filter-details-summary:hover { color: var(--text); }
.filter-details[open] .filter-details-summary {
  border-bottom: 1px solid var(--border); color: var(--text);
}
.filter-details-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.filter-block-inner { display: flex; flex-direction: column; gap: 6px; }
.filter-row { display: flex; align-items: center; gap: 6px; }
.filter-sep { color: var(--text3); font-size: 12px; }

.filter-input {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: 13px; padding: 6px 10px;
  width: 80px; outline: none; transition: border-color .15s;
}
.filter-input.wide { width: 100%; }
.filter-input:focus { border-color: var(--accent); }

.filter-select {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: 13px; padding: 6px 10px;
  width: 100%; outline: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--accent); }

.btn-apply {
  background: var(--blue); color: #fff; border: none; border-radius: var(--radius);
  padding: 8px 14px; font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-apply:hover { background: #2e87e8; }

.btn-reset {
  background: transparent; color: var(--text2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 14px; font-family: var(--font);
  font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s;
}
.btn-reset:hover { border-color: var(--text2); color: var(--text); }

.sidebar-stats { margin-top: auto; font-size: 12px; color: var(--text3); padding-top: 12px; border-top: 1px solid var(--border); }

/* ── Main ─────────────────────────────────────────────────────── */
.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Tabs ─────────────────────────────────────────────────────── */
.tabs-strip {
  display: flex; background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 16px; flex-shrink: 0;
}
.tab-btn {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text2); cursor: pointer; font-family: var(--font); font-size: 13px;
  font-weight: 500; padding: 14px 16px 12px; transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; flex: 1; overflow: hidden; }
.tab-panel.active { display: flex; flex-direction: column; }

/* ── Map tab ─────────────────────────────────────────────────── */
#tab-map { position: relative; }
#map { flex: 1; width: 100%; }

/* ── Detail panel ─────────────────────────────────────────────── */
.detail-panel {
  position: absolute; top: 0; right: -400px; width: 380px; height: 100%;
  background: var(--bg2); border-left: 1px solid var(--border);
  z-index: 1000; display: flex; flex-direction: column;
  transition: right .25s ease; overflow-y: auto;
}
.detail-panel.open { right: 0; }

.detail-close {
  position: absolute; top: 10px; right: 12px;
  background: rgba(7,8,11,.7); border: none; color: var(--text2);
  font-size: 18px; cursor: pointer; z-index: 2; border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
}
.detail-close:hover { color: var(--text); background: rgba(255,90,95,.2); }

.detail-img-wrap { width: 100%; height: 200px; overflow: hidden; flex-shrink: 0; position: relative; }
.detail-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.detail-img-overlay {
  position: absolute; bottom: 8px; right: 10px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
  backdrop-filter: blur(4px);
}
.detail-img-overlay.occ-high { background: rgba(255,90,95,.85); color: #fff; }
.detail-img-overlay.occ-mid  { background: rgba(255,159,67,.85); color: #fff; }
.detail-img-overlay.occ-low  { background: rgba(46,213,115,.85); color: #000; }

.detail-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  background: var(--bg4); border: 1px solid var(--border); border-radius: 20px;
  color: var(--yellow); font-size: 10px; font-weight: 600; padding: 3px 10px;
  text-transform: uppercase; letter-spacing: .05em;
}
.detail-title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.detail-meta { font-size: 13px; color: var(--text2); display: flex; flex-direction: column; gap: 4px; }
.detail-meta span { display: flex; align-items: center; gap: 6px; }
.detail-link { display: inline-block; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.detail-link:hover { text-decoration: underline; }

.detail-open-full {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; box-sizing: border-box;
  padding: 10px 16px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; text-decoration: none;
  border-radius: var(--radius); border: none; cursor: pointer;
  transition: opacity .15s; font-family: var(--font);
}
.detail-open-full:hover { opacity: .85; }

.detail-section { display: flex; flex-direction: column; gap: 8px; }
.detail-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3); padding-bottom: 4px; border-bottom: 1px solid var(--border);
}

/* ── Calendar grid ────────────────────────────────────────────── */
.calendar-grid { display: flex; flex-direction: column; gap: 4px; }
.cal-cell {
  display: grid; grid-template-columns: 60px 1fr 38px 90px;
  align-items: center; gap: 6px; padding: 4px 6px;
  border-radius: 4px; background: var(--bg3);
}
.cal-month { font-size: 11px; font-weight: 600; color: var(--text2); }
.cal-bar-wrap { background: var(--border); border-radius: 2px; height: 5px; overflow: hidden; }
.cal-bar { height: 100%; border-radius: 2px; transition: width .3s; }
.cal-cell.occ-high .cal-bar { background: var(--accent); }
.cal-cell.occ-mid  .cal-bar { background: var(--orange); }
.cal-cell.occ-low  .cal-bar { background: var(--green); }
.cal-pct { font-size: 12px; font-weight: 700; text-align: right; }
.cal-cell.occ-high .cal-pct { color: var(--accent); }
.cal-cell.occ-mid  .cal-pct { color: var(--orange); }
.cal-cell.occ-low  .cal-pct { color: var(--green); }
.cal-nights { font-size: 10px; color: var(--text3); }
.calendar-note { font-size: 10px; color: var(--text3); font-style: italic; }

/* ── Price calendar ────────────────────────────────────────────── */
.price-cal-legend {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 9px; color: var(--text3); margin-bottom: 2px;
}
.pcl-item { display: flex; align-items: center; gap: 3px; }
.pcl-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pcl-cheap { background: var(--green); }
.pcl-mid   { background: var(--orange); }
.pcl-dear  { background: var(--accent); }

.price-cal-months { display: flex; flex-direction: column; gap: 18px; }
.price-cal-month-hd {
  font-size: 11px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px;
}
.price-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.price-cal-dow {
  font-size: 9px; font-weight: 600; color: var(--text3);
  text-align: center; padding: 3px 0;
}
.price-cal-day {
  border-radius: 4px; min-height: 40px; padding: 3px 1px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; overflow: hidden;
}
.price-cal-day.pcd-empty    { background: transparent; pointer-events: none; }
.price-cal-day.pcd-blank    { background: var(--bg3); opacity: .22; }
.price-cal-day.pcd-unavail  { background: var(--bg3); opacity: .35; }
.price-cal-day.pcd-avail-np { background: var(--bg3); }
.price-cal-day.pcd-cheap { background: rgba(46,213,115,.15); }
.price-cal-day.pcd-mid   { background: rgba(255,159,67,.15);  }
.price-cal-day.pcd-dear  { background: rgba(255,90,95,.15);   }
.pcd-num   { font-size: 8px; color: var(--text3); line-height: 1; }
.pcd-price {
  font-size: 10px; font-weight: 700; line-height: 1;
  white-space: nowrap; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; text-align: center;
}
.price-cal-day.pcd-cheap .pcd-price { color: var(--green);  }
.price-cal-day.pcd-mid   .pcd-price { color: var(--orange); }
.price-cal-day.pcd-dear  .pcd-price { color: var(--accent); }
.pcd-nights { font-size: 8px; color: var(--text3); line-height: 1; }

/* ── Leaflet cluster icon ──────────────────────────────────────── */
.cluster-icon {
  width: 36px; height: 36px;
  background: rgba(255,90,95,.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  border: 2px solid rgba(255,255,255,.3);
}

/* ── Listing dot markers (no inline style needed) ──────────────── */
.marker-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
}
/* Zone palette — must mirror ZONE_COLORS in app.js */
.marker-z0 { background: #ff5a5f; }
.marker-z1 { background: #4a9eff; }
.marker-z2 { background: #2ed573; }
.marker-z3 { background: #ffd04b; }
.marker-z4 { background: #c67aff; }
.marker-z5 { background: #ff9f43; }
.marker-z6 { background: #00d2d3; }
.marker-z7 { background: #ff6b81; }
.marker-z8 { background: #48dbfb; }
.marker-z9 { background: #1dd1a1; }
/* Competition mode distance tiers */
.marker-comp-near { background: #ff5a5f; }
.marker-comp-mid  { background: #ff9f43; }
.marker-comp-far  { background: #ffd04b; }

/* ── Price samples table ──────────────────────────────────────── */
.samples-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.samples-table th {
  background: var(--bg3); color: var(--text3); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.samples-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text2); }

/* ── Occupancy pills ──────────────────────────────────────────── */
.occ-pill {
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700;
  display: inline-block;
}
.occ-pill.occ-high { background: rgba(255,90,95,.15); color: var(--accent); }
.occ-pill.occ-mid  { background: rgba(255,159,67,.15); color: var(--orange); }
.occ-pill.occ-low  { background: rgba(46,213,115,.15); color: var(--green); }

/* ── Property details (PDP) ───────────────────────────────────── */
.prop-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.prop-flag {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border);
}
.flag-fav   { background: rgba(255,208,75,.12); color: var(--yellow); border-color: rgba(255,208,75,.3); }
.flag-super { background: rgba(46,213,115,.12);  color: var(--green);  border-color: rgba(46,213,115,.3); }
.flag-type  { background: var(--bg4); color: var(--text2); }
.flag-cap   { background: var(--bg4); color: var(--text2); }

.prop-overview { display: flex; flex-wrap: wrap; gap: 6px; }
.prop-chip {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 20px;
  font-size: 12px; color: var(--text2); padding: 3px 10px;
}

.highlight-list { display: flex; flex-direction: column; gap: 6px; }
.highlight-chip {
  background: var(--bg3); border-radius: var(--radius);
  padding: 7px 10px; display: flex; flex-direction: column; gap: 2px;
}
.hl-title { font-size: 12px; font-weight: 600; color: var(--text); }
.hl-sub   { font-size: 11px; color: var(--text3); }

.amenity-section { display: flex; flex-direction: column; gap: 10px; }
.amenity-group-title {
  font-size: 11px; font-weight: 600; color: var(--text2); margin-bottom: 5px;
}
.amenity-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.amenity-item {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 11px; color: var(--text2); padding: 3px 9px;
}

.rating-detail { display: flex; flex-direction: column; gap: 5px; }
.rating-row { display: grid; grid-template-columns: 100px 1fr 30px; align-items: center; gap: 8px; }
.rating-label { font-size: 11px; color: var(--text2); }
.rating-bar-wrap { background: var(--border); border-radius: 2px; height: 4px; overflow: hidden; }
.rating-bar { height: 100%; background: var(--blue); border-radius: 2px; }
.rating-val { font-size: 11px; font-weight: 600; color: var(--blue); text-align: right; }

.prop-description {
  font-size: 12px; color: var(--text2); line-height: 1.6;
  background: var(--bg3); border-radius: var(--radius); padding: 8px 10px;
}
.prop-host {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--bg3); border-radius: var(--radius);
}
.host-label { font-size: 11px; color: var(--text3); }
.host-name  { font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Table tab ────────────────────────────────────────────────── */
.table-wrap { flex: 1; overflow: auto; }
#listings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#listings-table th {
  background: var(--bg3); color: var(--text2); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px;
  text-align: left; position: sticky; top: 0; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; white-space: nowrap;
}
#listings-table th:hover { color: var(--text); }
#listings-table th.sort-asc::after  { content: " ▲"; font-size: 9px; }
#listings-table th.sort-desc::after { content: " ▼"; font-size: 9px; }
#listings-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
#listings-table tr:hover td { background: var(--bg3); }
#listings-table a { color: var(--accent); text-decoration: none; font-size: 12px; font-weight: 600; }
#listings-table a:hover { text-decoration: underline; }
.td-title { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.zone-chip {
  background: var(--bg4); border-radius: 4px; color: var(--blue);
  font-size: 11px; font-weight: 600; padding: 2px 8px; white-space: nowrap;
}
.rating-star { color: var(--yellow); margin-right: 3px; }

/* ── Shared chart wrappers (fiche panel) ─────────────────────── */
.chart-wrap { width: 100%; height: 220px; overflow: hidden; position: relative; }
.chart-wrap canvas { display: block; }
.fiche-wrap { height: 150px; }

/* ── Details tab ─────────────────────────────────────────────── */
#tab-details { display: none; overflow-y: auto; }
#tab-details.active { display: block; }

.det-layout {
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px; max-width: 1020px; margin: 0 auto;
}

.det-selector-bar {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
}
.det-selector-field { display: flex; flex-direction: column; gap: 5px; }
#det-listing-search { margin-bottom: 2px; }
.det-selector-listing { flex: 1; min-width: 260px; }
.det-ext-link {
  padding: 7px 14px; background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--blue); font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap; align-self: flex-end; transition: background .15s;
}
.det-ext-link:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.det-empty {
  display: flex; align-items: center; justify-content: center;
  height: 220px; color: var(--text3); font-size: 14px;
}

.det-header-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.det-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.det-title { font-size: 16px; font-weight: 600; line-height: 1.35; }

.det-kpi-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.det-kpi {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 80px;
}
.det-kpi-val   { font-size: 15px; font-weight: 700; }
.det-kpi-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }

.det-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.det-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.det-card-title { font-size: 14px; font-weight: 600; }

.det-chart-wrap { width: 100%; height: 190px; position: relative; }
.det-chart-bar  { height: 155px; }

.det-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .det-two-col { grid-template-columns: 1fr; } }

.det-table-wrap { overflow-x: auto; }
.det-price-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.det-price-table th {
  text-align: left; padding: 6px 12px; color: var(--text3);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.det-price-table td   { padding: 7px 12px; border-bottom: 1px solid var(--border); }
.det-price-table tr:last-child td { border-bottom: none; }
.det-price-table tr:hover td { background: var(--bg3); }
.tbl-muted { color: var(--text2); }

.ph-gran-group {
  display: flex; align-items: center; gap: 2px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px; align-self: flex-end;
}
.ph-gran-btn {
  padding: 4px 10px; background: transparent; border: none;
  border-radius: calc(var(--radius) - 2px); color: var(--text2);
  font-family: var(--font); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background .12s, color .12s;
}
.ph-gran-btn:hover { color: var(--text); }
.ph-gran-btn--active {
  background: var(--bg4); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ── Scraper tab ─────────────────────────────────────────────── */
#tab-scraper { display: none; }
#tab-scraper.active { display: flex; overflow: hidden; }

.scraper-layout { display: flex; flex: 1; overflow: hidden; }

.scraper-controls {
  width: 300px; min-width: 300px; background: var(--bg2);
  border-right: 1px solid var(--border); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 16px; overflow-y: auto;
}
.section-title { font-size: 14px; font-weight: 600; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); }
.bbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bbox-grid .filter-input { width: 100%; }
.btn-row { display: flex; gap: 8px; }

.btn-run {
  background: var(--green); color: #000; border: none; border-radius: var(--radius);
  padding: 9px 18px; font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; flex: 1; transition: opacity .15s;
}
.btn-run:hover { opacity: .85; }
.btn-run:disabled { opacity: .4; cursor: default; }

.btn-stop {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius);
  padding: 9px 18px; font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; flex: 1; transition: opacity .15s;
}
.btn-stop:hover { opacity: .85; }
.btn-stop:disabled { opacity: .35; cursor: default; }

.status-bar {
  font-size: 12px; color: var(--text3); padding: 8px 12px;
  background: var(--bg3); border-radius: var(--radius); border: 1px solid var(--border);
}
.scraper-logs { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.logs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text2); flex-shrink: 0;
}
.btn-clear-log {
  background: transparent; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text3); cursor: pointer; font-family: var(--font); font-size: 11px; padding: 3px 8px;
}
.btn-clear-log:hover { color: var(--text); border-color: var(--text3); }
.log-output {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 12px; line-height: 1.7; color: var(--text2); white-space: pre-wrap; word-break: break-all;
}
.log-line-error { color: #ff6b6b; }
.log-line-done  { color: var(--green); }
.log-line-warn  { color: var(--yellow); }

/* ── Config tab ───────────────────────────────────────────────── */
#tab-config { display: none; }
#tab-config.active { display: flex; overflow: hidden; }

.config-layout {
  flex: 1; overflow-y: auto; padding: 24px 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.cfg-section {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.cfg-section-title {
  font-size: 13px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cfg-field { display: flex; flex-direction: column; gap: 5px; }
.cfg-field.wide { grid-column: 1 / -1; }
.cfg-field label { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cfg-field input,
.cfg-field select {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: 13px; padding: 7px 10px; outline: none;
  transition: border-color .15s;
}
.cfg-field input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.cfg-field input:focus, .cfg-field select:focus { border-color: var(--accent); }

/* Zone cards */
.zone-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.zone-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.zone-card-handle {
  cursor: grab; color: var(--text3); font-size: 18px; line-height: 1;
  padding: 0 2px; flex-shrink: 0; user-select: none;
}
.zone-card-handle:hover  { color: var(--text2); }
.zone-card-handle:active { cursor: grabbing; }
.zone-card.zone-dragging { opacity: 0.35; }
.zone-drop-indicator {
  height: 2px; background: var(--accent); border-radius: 2px;
  margin: 3px 0; pointer-events: none;
}
.zone-field-label {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 2px;
  outline: none;
  transition: all 0.2s ease;
}
.zone-field-label:hover { border-bottom-color: var(--text3); background: rgba(255,255,255,0.05); }
.zone-field-label:focus { border: 1px solid var(--accent); background: var(--bg2); }
.zone-toggle {
  background: var(--bg4); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text2); cursor: pointer; font-family: var(--font); font-size: 11px; padding: 3px 8px;
}
.zone-toggle.enabled { color: var(--green); border-color: var(--green); }
.zone-delete { background: transparent; border: none; color: var(--text3); cursor: pointer; font-size: 16px; padding: 2px 4px; }
.zone-delete:hover { color: var(--accent); }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.zone-field { display: flex; flex-direction: column; gap: 4px; }
.zone-field label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.zone-field input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: var(--font); font-size: 12px; padding: 5px 8px; outline: none;
}
.zone-field input[type=checkbox] { width: 16px; height: 16px; margin-top: 4px; accent-color: var(--accent); }
.zone-field input:focus { border-color: var(--accent); }

.btn-add-zone {
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  color: var(--blue); cursor: pointer; font-family: var(--font); font-size: 12px; font-weight: 600; padding: 4px 10px;
}
.btn-add-zone:hover { border-color: var(--blue); }

/* ── Zone folders (config panel) ──────────────────────────────── */
.zone-folder {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.zone-folder-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg3);
}
.zone-folder-icon { font-size: 14px; flex-shrink: 0; }
.zone-folder-name {
  flex: 1;
  background: transparent; border: none;
  border-bottom: 1px dashed var(--border);
  color: var(--text); font-weight: 700; font-size: 13px;
  font-family: var(--font);
  outline: none; padding: 2px 4px;
}
.zone-folder-name:focus { border-bottom-color: var(--accent); }
.zone-folder-collapse,
.zone-folder-add,
.zone-folder-delete {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text2); cursor: pointer; font-family: var(--font);
  font-size: 11px; padding: 2px 8px; flex-shrink: 0;
}
.zone-folder-collapse:hover,
.zone-folder-add:hover     { color: var(--text1); border-color: var(--text3); }
.zone-folder-delete:hover  { color: var(--accent); border-color: var(--accent); }
.zone-folder-body {
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg2);
}
.zone-folder-body .zone-card { margin-bottom: 0; }
/* Min-height ensures an empty body is reachable as a drop target */
.zone-folder-body:empty { min-height: 36px; }
/* Visual highlight when dragging over a folder header */
.zone-folder.folder-drop-hover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ── Filter folder groups ──────────────────────────────────────── */
.filter-folder-group { margin-bottom: 4px; }
.filter-folder-header {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 4px;
  cursor: pointer; user-select: none;
  font-size: 12px; font-weight: 600; color: var(--text2);
  background: var(--bg3); margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.filter-folder-header:hover { background: var(--bg4); color: var(--text1); }
.filter-folder-header.some-checked { color: var(--orange); }
.filter-folder-header.all-checked  { color: var(--green); }
.filter-folder-icon { font-size: 12px; flex-shrink: 0; }
.filter-folder-name { flex: 1; }
.filter-folder-chevron {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 11px; padding: 0 2px;
  line-height: 1; flex-shrink: 0; font-family: var(--font);
  transition: color .15s;
}
.filter-folder-chevron:hover { color: var(--text1); }
.filter-folder-items {
  padding-left: 10px;
  border-left: 2px solid var(--border);
  margin-left: 4px;
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 4px;
}
.filter-folder-sep {
  height: 1px; background: var(--border); margin: 4px 0;
}

.cfg-actions {
  display: flex; align-items: center; gap: 14px;
  position: sticky; bottom: 0; z-index: 10;
  background: var(--bg); padding: 12px 0 8px;
  border-top: 1px solid var(--border); margin-top: 4px;
}
.btn-save-cfg {
  background: var(--green); color: #000; border: none; border-radius: var(--radius);
  padding: 10px 24px; font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.btn-save-cfg:hover { opacity: .85; }
.cfg-save-msg { font-size: 13px; }

/* ── Focus ring (keyboard nav) ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible {
  outline: none; /* inputs use border-color instead */
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ── Leaflet ──────────────────────────────────────────────────── */
.leaflet-container { background: #0a0d14; }
.leaflet-popup-content-wrapper {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.leaflet-popup-content { color: var(--text); font-family: var(--font); font-size: 13px; margin: 12px 14px; }
.leaflet-popup-tip { background: var(--bg2); }
.leaflet-popup-close-button { color: var(--text2) !important; }

@media (max-width: 700px) { .sidebar { display: none; } }

/* ── Price sample label ───────────────────────────────────────── */
.det-sample-label {
  font-size: 11px; color: var(--text3); background: var(--bg4);
  padding: 3px 8px; border-radius: 10px; margin-left: auto;
}

/* ── My-property map markers ──────────────────────────────────── */
.my-prop-marker {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; line-height: 1; font-weight: 700;
  border: 3px solid rgba(255,255,255,.85);
}

/* ── My-property config cards ─────────────────────────────────── */
.cfg-add-prop-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.cfg-section-hint {
  font-size: 11px; color: var(--text3); font-weight: 400; margin-left: 8px;
}
.my-prop-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 8px;
  transition: border-color .15s;
}
.my-prop-card:hover { border-color: var(--blue); }
.my-prop-header { display: flex; align-items: center; gap: 8px; }
.my-prop-color-input {
  width: 30px; height: 30px; padding: 2px; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; background: none; flex-shrink: 0;
}
.my-prop-label { flex: 1; }
.my-prop-delete {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 13px; padding: 4px 8px; line-height: 1;
  flex-shrink: 0;
}
.my-prop-delete:hover { color: var(--accent); }
.my-prop-url-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.my-prop-id   { font-size: 11px; color: var(--text3); flex: 1; }
.my-prop-link { font-size: 12px; color: var(--blue); text-decoration: none; }
.my-prop-link:hover { text-decoration: underline; }

/* ── Competition inline mode ──────────────────────────────────── */

/* Sidebar selector label */
.comp-mode-label { color: var(--yellow) !important; }

/* Hidden competition columns — shown when table has .comp-mode */
.comp-col { display: none; }
#listings-table.comp-mode .comp-col { display: table-cell; }

/* Direct-competitor row highlight */
.comp-direct td { background: rgba(255,159,67,.06) !important; }
.comp-direct td:first-child { border-left: 3px solid var(--orange); }
#listings-table tr:hover.comp-direct td { background: rgba(255,159,67,.12) !important; }

/* Delta badges (used in table comp-col and comp-strip) */
.comp-delta     { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.comp-delta-pos { background: rgba(46,213,115,.15); color: #2ed573; }
.comp-delta-neg { background: rgba(255,90,95,.15);  color: #ff5a5f; }

/* Competition stats strip (between tabs nav and tab panel) */
.comp-strip {
  display: flex; align-items: center; gap: 0;
  background: var(--bg2); border-bottom: 2px solid var(--orange);
  flex-shrink: 0; overflow-x: auto; flex-wrap: nowrap;
}
.comp-strip-body {
  display: flex; align-items: center; gap: 0; flex: 1;
  padding: 0 4px;
}
.comp-strip-prop {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 16px; min-width: 120px;
}
.comp-strip-prop-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.comp-strip-prop-id   { font-size: 10px; color: var(--text3); }
.comp-strip-sep {
  width: 1px; background: var(--border); align-self: stretch; margin: 6px 0; flex-shrink: 0;
}
.comp-strip-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 18px; min-width: 90px;
}
.comp-strip-val  { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 5px; }
.comp-strip-lbl  { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.comp-strip-warn { font-size: 11px; color: var(--yellow); padding: 8px 12px; }
.comp-strip-close {
  background: none; border: none; color: var(--text3); font-size: 14px;
  cursor: pointer; padding: 8px 14px; flex-shrink: 0; align-self: stretch;
  display: flex; align-items: center;
}
.comp-strip-close:hover { color: var(--accent); }

/* ── New property flags ───────────────────────────────────────── */
.prop-flag.flag-instant { background: rgba(74,158,255,.15); color: #4a9eff; }
.prop-flag.flag-city    { background: rgba(138,147,168,.12); color: var(--text2); }

/* ── Host card ────────────────────────────────────────────────── */
.det-host-name { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 10px; }
.det-host-stat { display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.det-host-stat:last-child { border-bottom: none; }
.det-host-stat-label { color: var(--text3); }

/* ── Bedroom pills ────────────────────────────────────────────── */
.bed-pills { display: flex; gap: 5px; }
.bed-pill {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 20px;
  color: var(--text2); cursor: pointer; font-family: var(--font);
  font-size: 12px; font-weight: 600; padding: 4px 11px;
  transition: background .15s, border-color .15s, color .15s;
}
.bed-pill:hover  { border-color: var(--blue); color: var(--blue); }
.bed-pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Scraper map & overlays ─────────────────────────────────────── */
.smap-toolbar { display: flex; gap: 5px; margin-bottom: 6px; }
.smap-btn {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text2); cursor: pointer;
  font-family: var(--font); font-size: 11px; font-weight: 600; padding: 5px 8px;
  transition: background .15s, border-color .15s, color .15s;
}
.smap-btn:hover   { border-color: var(--blue); color: var(--blue); }
.smap-btn.active  { background: var(--blue); border-color: var(--blue); color: #fff; }
.smap-btn:disabled { opacity: .45; cursor: default; }

/* ── Scraper tab ─────────────────────────────────────────────────── */
#tab-scraper { display: none; }
#tab-scraper.active { display: flex; flex-direction: column; overflow: hidden; }

.scraper-layout { display: flex; flex: 1; overflow: hidden; background: var(--bg1); }

.scraper-controls {
  width: 280px; padding: 20px; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 18px; overflow-y: auto; flex-shrink: 0;
}
.scraper-controls .section-title { font-size: 14px; font-weight: 700; color: var(--text1); margin: 0; }
.scraper-controls .form-group { display: flex; flex-direction: column; gap: 6px; }
.scraper-controls .form-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }

.bbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn-row { display: flex; gap: 10px; }
.btn-run, .btn-stop, .btn-update-all, .btn-scrape-my-props {
  flex: 1; padding: 9px 12px; border: none; border-radius: var(--radius);
  font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; transition: opacity .15s;
}
.btn-run { background: var(--blue); color: #fff; }
.btn-run:hover { opacity: .85; }
.btn-stop { background: var(--red); color: #fff; }
.btn-stop:not(:disabled):hover { opacity: .85; }
.btn-stop:disabled { opacity: .3; cursor: default; }

.btn-update-all { background: var(--orange); color: #fff; }
.btn-update-all:hover { opacity: .85; }
.btn-update-all:disabled { opacity: .3; cursor: default; }

.btn-scrape-my-props { background: var(--purple); color: #fff; margin-top: 8px; }
.btn-scrape-my-props:hover { opacity: .85; }
.btn-scrape-my-props:disabled { opacity: .3; cursor: default; }

.status-bar {
  margin-top: auto; padding: 12px; background: var(--bg3); border-radius: var(--radius);
  font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 8px;
}
.status-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); }
.status-indicator.active { background: var(--blue); box-shadow: 0 0 8px var(--blue); animation: pulse 1.5s infinite; }
.status-indicator.error { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes pulse { 0% { opacity: .6; } 50% { opacity: 1; } 100% { opacity: .6; } }

.scraper-right { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.scraper-map-panel { flex: 1; display: flex; flex-direction: column; position: relative; border-bottom: 1px solid var(--border); }
.smap-header {
  padding: 10px 14px; background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.smap-title { font-size: 12px; font-weight: 700; color: var(--text2); }
#scraper-map { flex: 1; width: 100%; background: var(--bg3); }

.scraper-logs { height: 300px; display: flex; flex-direction: column; background: var(--bg1); flex-shrink: 0; }
.logs-header {
  padding: 8px 14px; background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; color: var(--text3);
}
.btn-clear-log {
  background: transparent; border: 1px solid var(--border); color: var(--text3);
  padding: 2px 8px; border-radius: 4px; font-size: 10px; cursor: pointer; transition: color .15s;
}
.btn-clear-log:hover { color: var(--text1); }

/* Multi-console container */
.consoles-container { flex: 1; overflow-y: auto; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 0; }

.run-console {
  flex: 0 0 340px; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); min-width: 0;
}
.run-console:last-child { border-right: none; }

.console-header {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; background: var(--bg2); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.console-zone { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }

.console-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.console-dot.running { background: var(--green); box-shadow: 0 0 5px var(--green); animation: pulse 1.4s infinite; }
.console-dot.done    { background: var(--text3); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.console-btn-stop, .console-btn-close {
  background: transparent; border: none; cursor: pointer; font-size: 10px;
  padding: 1px 5px; border-radius: 3px; color: var(--text3); transition: color .15s, background .15s;
}
.console-btn-stop:hover  { color: var(--red); background: rgba(255,80,80,.12); }
.console-btn-close:hover { color: var(--text); background: var(--bg4); }

.console-log {
  flex: 1; margin: 0; padding: 8px 10px; overflow-y: auto;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace; font-size: 10px;
  color: var(--text2); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}

.log-output {
  flex: 1; margin: 0; padding: 12px; overflow-y: auto;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace; font-size: 11px; color: var(--text2); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}
.log-line.info { color: var(--text2); }
.log-line.warn { color: var(--orange); }
.log-line.error { color: var(--red); }
.log-line.success { color: var(--green); }

.smap-hint { font-size: 11px; color: var(--text3); margin-top: 5px; min-height: 15px; line-height: 1.4; text-shadow: 0 1px 2px #000; }

/* ── Zone Occupancy tab ───────────────────────────────────────── */
#tab-zones { display: none; }
#tab-zones.active { display: flex; flex-direction: column; overflow: hidden; }

.zo-layout { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.zo-controls {
  padding: 14px 20px; background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px; flex-shrink: 0;
}
.zo-control-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.zo-control-field { display: flex; flex-direction: column; gap: 5px; }

.zo-btn-show {
  background: var(--blue); color: #fff; border: none; border-radius: var(--radius);
  padding: 9px 18px; font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .15s; align-self: flex-end;
}
.zo-btn-show:hover { opacity: .85; }

.zo-btn-export {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 16px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s;
  align-self: flex-end;
}
.zo-btn-export:hover { border-color: var(--accent); color: var(--accent); }
.zo-btn-export:disabled { opacity: .45; cursor: not-allowed; }

.zo-summary {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--text2); min-height: 20px;
}
.zo-sum-sep { color: var(--border); }

.zo-grid {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.zo-empty {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--text3); font-size: 14px; text-align: center;
}

.zo-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; transition: border-color .15s;
}
.zo-card:hover { border-color: var(--blue); }

.zo-rank { font-size: 11px; font-weight: 600; color: var(--text3); min-width: 28px; text-align: center; }

.zo-occ-badge { font-size: 14px !important; font-weight: 700; min-width: 54px; text-align: center; padding: 6px 10px !important; }

.zo-info { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.zo-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zo-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text2); }

.zo-occ-bar-wrap { background: var(--border); border-radius: 2px; height: 4px; overflow: hidden; }
.zo-occ-bar { height: 100%; border-radius: 2px; }
.zo-occ-bar.occ-high { background: var(--accent); }
.zo-occ-bar.occ-mid  { background: var(--orange); }
.zo-occ-bar.occ-low  { background: var(--green); }

.zo-months { display: flex; align-items: flex-end; gap: 2px; height: 32px; margin-top: 2px; }
.zo-mbar   { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; height: 100%; }
.zo-mbar-fill { width: 100%; border-radius: 1px 1px 0 0; min-height: 1px; }
.zo-mbar-fill.occ-high { background: var(--accent); }
.zo-mbar-fill.occ-mid  { background: var(--orange); }
.zo-mbar-fill.occ-low  { background: var(--green); }
.zo-mbar-label { font-size: 8px; color: var(--text3); margin-top: 2px; line-height: 1; }

.zo-link {
  color: var(--blue); text-decoration: none; font-size: 15px; font-weight: 600;
  padding: 5px 9px; border-radius: 6px; flex-shrink: 0; transition: background .15s;
}
.zo-link:hover { background: rgba(74,158,255,.15); }

/* ── Policy / house rules ─────────────────────────────────────── */
.det-policy-text { font-size: 13px; color: var(--text2); line-height: 1.6; }
.house-rule-item { padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text2); }
.house-rule-item:last-child { border-bottom: none; }
