:root {
  color-scheme: light;
  --ink: #202123;
  --muted: #6e6e80;
  --faint: #8e8ea0;
  --line: #e5e5e5;
  --line-soft: #ececf1;
  --surface: #ffffff;
  --surface-soft: #f7f7f8;
  --surface-quiet: #f4f4f6;
  --accent: #10a37f;
  --accent-soft: #e6f5ef;
  --danger: #b42318;
  --sidebar-bg: #202123;
  --sidebar-panel: #2a2b32;
  --sidebar-line: #34353b;
  --sidebar-text: #c5c5d2;
  --sidebar-faint: #8e8ea0;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
}

button,
select,
input {
  font: inherit;
}

button {
  font-family: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #0e8f6f;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d9d9e3;
  border-radius: 8px;
  border: 3px solid #fff;
}

.primary-button {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 11px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.subtle-button {
  font-weight: 500;
}

/* ---------- Auth gate ---------- */

.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  padding: 20px;
}

.auth-card {
  width: min(360px, 100%);
  background: var(--sidebar-panel);
  border: 1px solid var(--sidebar-line);
  border-radius: 16px;
  padding: 28px;
  color: var(--sidebar-text);
  text-align: center;
}

.auth-icon {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 6px;
}

.auth-card strong {
  display: block;
  font-size: 18px;
  color: #fff;
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 13px;
  color: var(--sidebar-faint);
  margin: 0 0 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--sidebar-faint);
}

.auth-form input {
  background: #1c1d22;
  border: 1px solid var(--sidebar-line);
  border-radius: 9px;
  padding: 10px 12px;
  color: #fff;
}

/* ---------- App shell ---------- */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}

.sidebar {
  width: 260px;
  flex: none;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 18px;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.brand-city {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sidebar-faint);
  margin-left: auto;
  letter-spacing: 0.08em;
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sidebar-faint);
}

.brief-card {
  background: var(--sidebar-panel);
  border: 1px solid var(--sidebar-line);
  border-radius: 12px;
  padding: 13px 14px;
}

.brief-card .section-label {
  margin-bottom: 9px;
}

.brief-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--sidebar-text);
  line-height: 1.3;
}

.brief-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brief-line .bullet {
  color: var(--accent);
}

.brief-line.negative {
  color: var(--sidebar-faint);
}

.brief-line.negative .bullet {
  color: #6e6e80;
}

.nav-block .section-label {
  margin: 0 6px 8px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  background: transparent;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item.active {
  background: var(--sidebar-line);
  color: #fff;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.nav-dot.outline {
  background: transparent;
  border: 1px solid #5c5d67;
}

.nav-item-label {
  flex: 1;
}

.nav-item-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sidebar-faint);
}

.nav-divider {
  height: 1px;
  background: var(--sidebar-line);
  margin: 0 6px;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.connector-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connector-status {
  font-size: 11.5px;
  color: var(--sidebar-faint);
  margin: 0;
  line-height: 1.4;
}

.scan-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--sidebar-line);
  background: var(--sidebar-panel);
  color: #fff;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.scan-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.scan-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.gmail-setup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11.5px;
  color: var(--sidebar-faint);
  background: var(--sidebar-panel);
  border: 1px solid var(--sidebar-line);
  border-radius: 9px;
  padding: 10px;
}

.gmail-setup a {
  color: var(--accent);
}

.gmail-setup label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gmail-setup input {
  background: #1c1d22;
  border: 1px solid var(--sidebar-line);
  border-radius: 7px;
  padding: 7px 9px;
  color: #fff;
  font-size: 12px;
}

.inbox-state {
  font-size: 11px;
  color: var(--sidebar-faint);
}

.source-glyphs {
  display: flex;
  gap: 6px;
  padding: 0 6px;
}

.source-glyph {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-panel);
  border: 1px solid;
}

.source-immowelt { border-color: #d75a17; color: #e0703a; }
.source-immoscout24 { border-color: #2f6fd6; color: #5a92e8; }
.source-kleinanzeigen { border-color: #3f8f2f; color: #6aa84f; }
.source-wggesucht { border-color: #c47d18; color: #d99a3a; }

.lang-switch {
  display: flex;
  background: var(--sidebar-panel);
  border: 1px solid var(--sidebar-line);
  border-radius: 9px;
  padding: 3px;
  margin: 0 6px;
}

.lang-button {
  flex: 1;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 6px;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-text);
}

.lang-button.active {
  background: var(--accent);
  color: #fff;
}

/* ---------- Main pane ---------- */

.main-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.main-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px 26px 15px;
  border-bottom: 1px solid var(--line-soft);
  gap: 16px;
  flex-wrap: wrap;
}

.main-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.main-count {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--faint);
  font-weight: 400;
}

.plz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  vertical-align: 3px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
}

.fresh-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fresh-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 13px;
  width: 240px;
}

.search-icon {
  color: var(--faint);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  flex: 1;
  color: var(--ink);
}

.sort-select {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 12.5px;
  color: var(--muted);
}

.filter-toggle {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 11px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
}

.filter-toggle[aria-expanded="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-popover {
  position: absolute;
  top: 70px;
  right: 26px;
  z-index: 30;
  width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(20, 20, 30, 0.14);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.source-filter-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.source-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
  color: var(--muted);
}

.source-filter-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.date-slicer-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-slicer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.date-slicer-track {
  position: relative;
  height: 24px;
}

.date-slicer-input {
  position: absolute;
  top: 8px;
  left: 0;
  width: 100%;
}

.date-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.date-preset {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--muted);
}

.date-preset.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Listing column ---------- */

.content-row {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.listing-column {
  flex: 1 1 460px;
  min-width: 360px;
  max-width: 560px;
  overflow: auto;
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.listing-row {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
}

.listing-row.selected {
  background: #f2fbf8;
  border-color: var(--accent);
}

.listing-score {
  flex: none;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.listing-score-value {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.listing-score-value strong {
  font-size: 29px;
  font-weight: 700;
  line-height: 0.9;
}

.listing-score-value span {
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 2px;
}

.factor-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.factor-bar {
  width: 4px;
  height: 18px;
  background: var(--line-soft);
  border-radius: 2px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.factor-bar-fill {
  width: 100%;
  border-radius: 2px;
}

.listing-divider {
  width: 1px;
  background: var(--line-soft);
  margin: 0 16px;
}

.listing-main {
  flex: 1;
  min-width: 0;
}

.listing-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.listing-area {
  font-size: 18px;
  font-weight: 600;
}

.best-match-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.listing-addr {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.listing-price {
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
}

.listing-price-suffix {
  font-size: 11.5px;
  color: var(--faint);
}

.listing-price-row .sep {
  color: #d9d9e3;
}

.listing-price-row .detail {
  font-size: 13px;
  color: var(--muted);
}

.listing-price-row .permsq {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
}

.listing-poi-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 11px;
}

.poi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #343541;
  background: var(--surface-quiet);
  border-radius: 7px;
  padding: 4px 9px;
  white-space: nowrap;
}

.poi-chip.mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}

.poi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.listing-side {
  flex: none;
  width: 106px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  justify-content: center;
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.market-label {
  font-size: 11.5px;
  font-weight: 600;
}

.listing-sources {
  display: flex;
  gap: 4px;
}

.source-badge-mini {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  border: 1px solid;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seen-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--faint);
  font-size: 13.5px;
}

/* ---------- Map ---------- */

.map-column {
  flex: 1 1 520px;
  min-width: 300px;
  position: relative;
  /* z-index: 0 traps Leaflet's internal pane z-indexes (200-1000) in this column's own
     stacking context so the detail drawer (z-index 20) can paint over the map edge. */
  z-index: 0;
  background: #eef0f2;
  border-left: 1px solid var(--line-soft);
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
}

.leaflet-div-icon,
.casa-pin {
  background: transparent;
  border: none;
}

.leaflet-container {
  font-family: var(--font-body);
  background: #eef0f2;
}

/* Suppress the UA focus rectangle when PLZ polygons are clicked with the mouse. */
path.leaflet-interactive:focus:not(:focus-visible) {
  outline: none;
}

.leaflet-control-attribution {
  font-size: 9px;
  color: #a8a8b3;
  background: rgba(255, 255, 255, 0.7);
}

.map-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1000;
  display: flex;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 11px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
}

.legend-diamond {
  color: var(--ink);
}

.legend-mask {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px dashed #9d9eab;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.85) 50%);
}

.plz-tooltip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 3px 8px;
}

.legend-square {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1.5px solid var(--accent);
}

/* ---------- Detail drawer ---------- */

.detail-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 560px;
  max-width: 100%;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 40px rgba(20, 20, 30, 0.1);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-header .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.drawer-close {
  border: none;
  background: var(--surface-quiet);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.photo-hero,
.photo-thumb,
.photo-more {
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, #f0f0f3, #f0f0f3 9px, #e8e8ee 9px, #e8e8ee 18px);
}

.photo-hero {
  grid-column: 1 / span 2;
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}

.photo-hero span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #a8a8b3;
}

.photo-thumb {
  height: 82px;
}

.photo-more {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.drawer-title-row strong {
  font-size: 25px;
  font-weight: 700;
}

.drawer-addr {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 4px;
}

.approx-note {
  color: #b08c3e;
}

.mismatch-note {
  margin-top: 8px;
  font-size: 12px;
  color: #925e12;
  background: #fdf3e2;
  border: 1px solid #f0dcb4;
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-block;
}

.drawer-price-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 16px;
}

.drawer-price-row strong {
  font-size: 34px;
  font-weight: 700;
}

.drawer-price-row span {
  font-size: 13px;
  color: var(--faint);
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.drawer-tag {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-quiet);
  border-radius: 7px;
  padding: 5px 10px;
}

.drawer-tag.mono {
  font-family: var(--font-mono);
}

.drawer-panel {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px;
}

.drawer-panel.quiet {
  background: var(--surface-soft);
  border-color: var(--line-soft);
  padding: 14px 16px;
  margin-top: 18px;
}

.drawer-panel .section-label {
  color: var(--faint);
  margin-bottom: 10px;
}

.poi-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.poi-row + .poi-row {
  margin-top: 11px;
}

.poi-row .name {
  flex: 1;
  font-size: 14px;
  color: #343541;
}

.poi-row .minutes {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.poi-row .mode {
  font-size: 11px;
  color: var(--faint);
  width: 78px;
  text-align: right;
}

.why-score-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.score-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.score-ring-inner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.why-score-head .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.why-score-head .subtitle {
  font-size: 12px;
  color: var(--faint);
  margin-top: 2px;
}

.factor-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.factor-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.factor-row .label {
  width: 60px;
  font-size: 12px;
  color: var(--muted);
}

.factor-track {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: var(--line-soft);
  overflow: hidden;
}

.factor-track-fill {
  height: 100%;
  border-radius: 4px;
}

.factor-row .pct {
  width: 26px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

.src-count-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.src-lowest-note {
  font-size: 12px;
  color: var(--accent);
  margin-top: 3px;
}

.src-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.src-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.src-row.lowest {
  background: var(--accent-soft);
  border-color: #bfe6d8;
}

.src-row .badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.src-row .name {
  flex: 1;
  font-size: 13px;
  color: #343541;
}

.src-row .price {
  font-size: 15px;
  font-weight: 700;
}

.src-row a {
  font-size: 12px;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.feature-chip {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-quiet);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
}

.drawer-desc {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.drawer-footer {
  border-top: 1px solid var(--line-soft);
  padding: 15px 20px;
  background: #fff;
}

.stage-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 13px;
}

.stage-button {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: 8px;
  cursor: pointer;
}

.stage-button.active {
  color: #fff;
}

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

.drawer-action-icon {
  width: 46px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- Toast ---------- */

.status-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: min(560px, calc(100vw - 40px));
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
  }

  .content-row {
    flex-direction: column;
  }

  .listing-column,
  .map-column {
    max-width: none;
    flex: none;
  }

  .map-column {
    height: 360px;
  }

  .detail-drawer {
    width: 100%;
  }
}
