/* Building/apartment/parcel card panel - redesigned to match the navy/gold
   visual system used across Explore/Search/report/home (direct feedback:
   "very poor info and not matching graphics at all") - rounded cards,
   gold accents, icon-style section headers, plus real cadastral value/
   energy-class data (CadastralValue/BuildingEnergyEfficiency) the panel
   didn't surface before. */

#card-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  /* Higher than #map-wrap.is-fullscreen's z-index (60, map-tools.css) -
     otherwise clicking a building/parcel while the map is in fullscreen
     mode opened this panel correctly but rendered it invisibly underneath
     the fullscreen map, making it look like clicking did nothing. */
  background: #fff; box-shadow: -6px 0 28px rgba(16,24,40,.16); z-index: 100;
  display: none; flex-direction: column; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
#card-header {
  padding: 18px 20px; display: flex; align-items: start; justify-content: space-between; gap: 8px;
  background: radial-gradient(420px 180px at 100% -30%, rgba(200,146,46,.28), transparent 60%),
              linear-gradient(135deg, #12293a 0%, #1c3f57 100%);
  flex-shrink: 0;
}
#card-header h3 { margin: 2px 0 0; font-size: 17px; font-weight: 800; line-height: 1.35; color: #fff; }
#card-back {
  cursor: pointer; color: #e0ac4a; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; display: none;
}
#card-back:hover { text-decoration: underline; }
#card-close {
  cursor: pointer; font-size: 20px; color: rgba(255,255,255,.7); line-height: 1; background: none; border: none;
  padding: 2px 4px; border-radius: 6px; flex-shrink: 0;
}
#card-close:hover { background: rgba(255,255,255,.12); color: #fff; }
#card-body { padding: 16px 20px 24px; overflow-y: auto; flex: 1; background: #fafbfc; }

/* Era badge - same 4 colors/labels as Pārskati's pie chart (parskati.css
   ERA_COLORS), so "Padomju sērijveida" etc. means the same thing and looks
   the same everywhere in the product. Sits on the dark header here, so it
   gets a subtle border for contrast instead of blending in. */
.era-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 3px 9px 3px 7px; border-radius: 20px; margin-top: 8px; color: #fff; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset;
}
.era-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.85); }
.era-badge.era-0 { background: #b08968; }
.era-badge.era-1 { background: #7d8597; }
.era-badge.era-2 { background: #4a7c95; }
.era-badge.era-3 { background: #1f5c85; }

/* Property-kind pill (Zeme/Ēka/Dzīvoklis) - identical markup/colors to
   explore.css's .kind-tag so a "kind" badge means the same thing and looks
   the same whether it's seen on an Explore card, the Explore table view, or
   a Search results row. */
.kind-tag {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 4px; color: #fff;
}
.kind-tag.land { background: #4a8a6f; }
.kind-tag.building { background: #2c4770; }
.kind-tag.premises { background: #b8683f; }

/* Straight to the full report - this panel is deliberately a compact
   summary, not a second copy of the extensive report (energoefektivitāte,
   NĪN/investīciju kalkulatori, apkaimes reitings, karte all live there). */
.card-report-link {
  display: block; text-align: center; padding: 10px; margin-bottom: 16px; border-radius: 10px;
  background: linear-gradient(135deg, #e0ac4a, #9c7020); color: #1a1204; font-weight: 700; font-size: 13px;
  text-decoration: none; box-shadow: 0 3px 10px rgba(200,146,46,.3);
}
.card-report-link:hover { filter: brightness(1.06); }

/* Hero price stats - the number someone actually opened the card to see,
   shown first and large instead of buried under building facts. */
.hero-stats {
  display: flex; gap: 18px; background: #fff;
  border: 1px solid #e6e9ee; border-radius: 14px; padding: 14px 16px; margin-bottom: 6px; flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(16,24,40,.05);
}
.hero-stats .stat-value { font-weight: 800; font-size: 18px; color: #12293a; }
.hero-stats .stat-label { font-size: 10.5px; color: #8a94a3; text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.hero-stats-meta { font-size: 11.5px; color: #8a94a3; margin: 6px 0 16px; }

.section-title {
  display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: #12293a; margin: 22px 0 10px; letter-spacing: .03em;
}
.section-title:first-child { margin-top: 0; }
.section-title .count-pill {
  background: #eef0f3; color: #8a94a3; font-weight: 700; font-size: 10.5px; padding: 1px 7px; border-radius: 10px;
}

/* Icon + heading pattern - same hand-drawn line-icon set/technique as the
   property report's section titles (report.css), reused here so a
   "Par ēku"/"Sludinājumi" heading looks the same whether it's seen in the
   compact card panel or the full report. No emoji (premium product). */
.section-title[data-icon]::before {
  content: ''; display: inline-block; width: 15px; height: 15px; flex-shrink: 0;
  background: #9c7020;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.section-title[data-icon="building"]::before { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjQiIHk9IjMiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxOCIvPjxsaW5lIHgxPSI0IiB5MT0iOSIgeDI9IjIwIiB5Mj0iOSIvPjxsaW5lIHgxPSI0IiB5MT0iMTUiIHgyPSIyMCIgeTI9IjE1Ii8+PGxpbmUgeDE9IjEwIiB5MT0iMjEiIHgyPSIxMCIgeTI9IjE1Ii8+PGxpbmUgeDE9IjE0IiB5MT0iMjEiIHgyPSIxNCIgeTI9IjE1Ii8+PC9zdmc+Cg=="); mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjQiIHk9IjMiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxOCIvPjxsaW5lIHgxPSI0IiB5MT0iOSIgeDI9IjIwIiB5Mj0iOSIvPjxsaW5lIHgxPSI0IiB5MT0iMTUiIHgyPSIyMCIgeTI9IjE1Ii8+PGxpbmUgeDE9IjEwIiB5MT0iMjEiIHgyPSIxMCIgeTI9IjE1Ii8+PGxpbmUgeDE9IjE0IiB5MT0iMjEiIHgyPSIxNCIgeTI9IjE1Ii8+PC9zdmc+Cg=="); }
.section-title[data-icon="chart"]::before { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik00IDIwVjEwTTEwIDIwVjRNMTYgMjBWMTQiLz48L3N2Zz4K"); mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik00IDIwVjEwTTEwIDIwVjRNMTYgMjBWMTQiLz48L3N2Zz4K"); }
.section-title[data-icon="home"]::before { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0zIDExbDktOCA5IDgiLz48cGF0aCBkPSJNNSAxMHYxMGgxNFYxMCIvPjwvc3ZnPgo="); mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0zIDExbDktOCA5IDgiLz48cGF0aCBkPSJNNSAxMHYxMGgxNFYxMCIvPjwvc3ZnPgo="); }
.section-title[data-icon="list"]::before { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjIxIiB5Mj0iNiIvPjxsaW5lIHgxPSI4IiB5MT0iMTIiIHgyPSIyMSIgeTI9IjEyIi8+PGxpbmUgeDE9IjgiIHkxPSIxOCIgeDI9IjIxIiB5Mj0iMTgiLz48bGluZSB4MT0iMyIgeTE9IjYiIHgyPSIzLjAxIiB5Mj0iNiIvPjxsaW5lIHgxPSIzIiB5MT0iMTIiIHgyPSIzLjAxIiB5Mj0iMTIiLz48bGluZSB4MT0iMyIgeTE9IjE4IiB4Mj0iMy4wMSIgeTI9IjE4Ii8+PC9zdmc+Cg=="); mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjIxIiB5Mj0iNiIvPjxsaW5lIHgxPSI4IiB5MT0iMTIiIHgyPSIyMSIgeTI9IjEyIi8+PGxpbmUgeDE9IjgiIHkxPSIxOCIgeDI9IjIxIiB5Mj0iMTgiLz48bGluZSB4MT0iMyIgeTE9IjYiIHgyPSIzLjAxIiB5Mj0iNiIvPjxsaW5lIHgxPSIzIiB5MT0iMTIiIHgyPSIzLjAxIiB5Mj0iMTIiLz48bGluZSB4MT0iMyIgeTE9IjE4IiB4Mj0iMy4wMSIgeTI9IjE4Ii8+PC9zdmc+Cg=="); }

.restricted-note { background: #fdf1d8; border: 1px solid #f0dba8; color: #7a5709; padding: 9px 11px; border-radius: 10px; font-size: 12.5px; margin-bottom: 12px; }
.trust-note { color: #9aa3b0; font-size: 11px; margin-top: 4px; }

/* Fact chips - scannable pills, wrapped in a soft card. */
.fact-chips { display: flex; flex-wrap: wrap; gap: 7px; background: #fff; border: 1px solid #eef0f3; border-radius: 12px; padding: 10px 12px; box-shadow: 0 2px 10px rgba(16,24,40,.04); }
.fact-chip { display: flex; align-items: center; font-size: 12.5px; color: #333; white-space: nowrap; }

.meta { color: #8a94a3; font-size: 11.5px; }

.stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stats-row .stat-value { font-weight: 700; font-size: 15px; color: #16202c; }
.stats-row .stat-value.warn-value { color: #c0392b; }
.stats-row .stat-value.rent { color: #0a7a4e; }
.stats-row .stat-label { font-size: 11px; color: #8a94a3; margin-top: 2px; }

/* Real cadastral value / energy-class tiles - same data the property
   report shows (see apps.properties.models.CadastralValue/
   BuildingEnergyEfficiency), as a small stat row directly under the
   building/apartment fact chips. */
.cadastral-facts { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eef0f3; }
.stats-row .stat-value[class*="energy-class-"] {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px;
  padding: 1px 9px; border-radius: 6px; color: #fff; font-size: 14px;
}
.stat-value.energy-class-a-plus { background: #0a7a4e; }
.stat-value.energy-class-a { background: #2f9e5c; }
.stat-value.energy-class-b { background: #7cb342; }
.stat-value.energy-class-c { background: #c8a838; }
.stat-value.energy-class-d { background: #d98a2b; }
.stat-value.energy-class-e { background: #d9642b; }
.stat-value.energy-class-f { background: #c0392b; }

/* Listing activity - days on market / price-change count / price-drop %,
   plus a step chart of price over time (see card.js::renderListingActivity).
   Step, not a smoothed line - price is flat between changes, then jumps. */
.listing-activity { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef0f3; }
.activity-chart { width: 100%; height: 44px; display: block; margin-bottom: 6px; }
.activity-chart-line { fill: none; stroke: #9c7020; stroke-width: 2; }
.activity-chart circle { fill: #9c7020; }

/* Deal rows - soft cards so each sale reads as a distinct, clickable item. */
.deal-row {
  padding: 11px 13px; margin-bottom: 7px; border-radius: 11px; cursor: pointer; font-size: 13px;
  background: #fff; border: 1px solid #eef0f3; box-shadow: 0 2px 8px rgba(16,24,40,.04);
  transition: box-shadow .12s, border-color .12s, transform .12s;
}
.deal-row:hover { box-shadow: 0 4px 14px rgba(16,24,40,.09); border-color: #e0ac4a; transform: translateY(-1px); }
.deal-row .price { font-weight: 700; font-size: 14px; color: #16202c; }
.deal-row .meta { color: #8a94a3; font-size: 11.5px; margin-top: 3px; }

.listing-item {
  background: #fff; border: 1px solid #eef0f3; border-radius: 12px; padding: 13px; margin-bottom: 9px; font-size: 13px;
  box-shadow: 0 2px 8px rgba(16,24,40,.04);
}
.listing-status { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #4b5768; }
.underpriced-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; font-size: 10.5px;
  font-weight: 700; background: #e6f6ec; color: #0a7a4e; cursor: help;
}
.listing-btn {
  background: linear-gradient(135deg, #e0ac4a, #9c7020); color: #1a1204; padding: 6px 14px; border-radius: 8px; font-size: 12px;
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.listing-btn:hover { filter: brightness(1.06); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 9px; }
.photo-grid img { width: 100%; height: 74px; object-fit: cover; border-radius: 8px; }
.photo-grid-more { display: flex; align-items: center; justify-content: center; background: #eef0f3; border-radius: 8px; font-size: 11px; color: #4b5768; font-weight: 600; }

.empty-note { color: #8a94a3; font-size: 12.5px; padding: 6px 0; }
