:root {
  --bg: #f1f5f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1d4ed8;
  --brand-ink: #1e3a8a;
  --accent: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

/* ---- header ---- */
.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 22px 18px;
}
.kicker {
  font-size: 12px;
  letter-spacing: .14em;
  font-weight: 700;
  color: var(--brand);
}
.topbar h1 {
  margin: 6px 0 6px;
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: -.01em;
}
.lede {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.5;
}

.search {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 240px; }
.field.narrow { flex: 0 1 200px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
#go {
  padding: 11px 22px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  height: 44px;
}
#go:hover { background: #1742b8; }
#go:disabled { opacity: .65; cursor: default; }

.examples { margin-top: 12px; font-size: 13px; color: var(--muted); }
.examples .ex {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 11px;
  margin: 0 4px 4px 0;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--brand-ink);
}
.examples .ex:hover { border-color: var(--brand); }

/* ---- layout ---- */
.layout {
  max-width: 1240px;
  margin: 8px auto 0;
  padding: 0 22px 26px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
}

.mapcol { position: relative; }
#map {
  height: 560px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #dbeafe;
  position: sticky;
  top: 16px;
}
@media (max-width: 880px) {
  #map { height: 360px; position: relative; top: 0; }
}

.layerswitch {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 600;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow);
}
.layerswitch button {
  border: none;
  background: transparent;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
}
.layerswitch button.active { background: var(--brand); color: #fff; }
.layerswitch button.toggle { color: var(--brand-ink); }
.layerswitch button.toggle.active { background: #e0e7ff; color: var(--brand-ink); }
.layerswitch .toggle { margin-left: 6px; border-left: 1px solid var(--line); padding-left: 12px; border-radius: 7px; }

/* ---- data column ---- */
.datacol { min-height: 200px; }
.placeholder {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.ph-icon { font-size: 34px; color: #cbd5e1; }
.placeholder p { margin: 10px 0 0; }
.placeholder .hint { font-size: 13px; }

.hidden { display: none !important; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* parcel title */
.parcel-head { margin-bottom: 4px; }
.parcel-head h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.parcel-head .ko { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* valuation hero */
.hero {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border: none;
}
.hero h3 { color: rgba(255, 255, 255, .8); }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.hero .sub { margin-top: 6px; font-size: 13.5px; color: rgba(255,255,255,.92); line-height: 1.5; }
.hero .sub b { font-weight: 700; }
.hero .empty { font-size: 14px; color: rgba(255,255,255,.92); }
.hero .pills { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .pill {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
}

/* namenska raba badge */
.raba-row { display: flex; align-items: center; gap: 12px; }
.raba-badge {
  flex: 0 0 auto;
  min-width: 58px;
  height: 58px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  padding: 0 8px;
  text-align: center;
}
.raba-text .naziv { font-weight: 600; line-height: 1.35; }
.raba-text .delez { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.raba-extra { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.raba-extra .zrow {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--line);
}
.raba-extra .zrow .sif { color: var(--muted); font-variant-numeric: tabular-nums; }
.znone { color: var(--muted); font-size: 13.5px; }

/* attribute grid */
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cell {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
.cell .k { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cell .v { font-size: 17px; font-weight: 700; margin-top: 3px; }
.cell .v small { font-size: 12px; font-weight: 600; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.yes { background: #dcfce7; color: #166534; }
.badge.no { background: #f1f5f9; color: #64748b; }

/* note */
.note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

/* expandable */
details.attrs { margin-top: 4px; }
details.attrs summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink);
  list-style: none;
  padding: 6px 0;
}
details.attrs summary::-webkit-details-marker { display: none; }
details.attrs summary::before { content: "▸ "; }
details.attrs[open] summary::before { content: "▾ "; }
.attr-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.attr-table td { padding: 7px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.attr-table td.k { color: var(--muted); width: 45%; }
.attr-table td.v { font-weight: 600; }

/* acts */
.act {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  margin-bottom: 10px;
}
.act .act-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act .act-name { font-weight: 700; }
.act .veljaven { background: #dcfce7; color: #166534; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.act .act-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.act a.pis {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 9px; font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.act a.pis:hover { text-decoration: underline; }
.act .flag { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* edge labels on map */
.edge-label {
  background: rgba(15, 23, 42, .82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.edge-label::before { display: none; }

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 14px;
}

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 22px 30px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer .noprivate { color: #94a3b8; }

/* neighbour parcel tooltip */
.leaflet-tooltip.parc-tip {
  background: rgba(15, 23, 42, .9);
  color: #fff;
  border: none;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.leaflet-tooltip.parc-tip::before { border-top-color: rgba(15, 23, 42, .9); }

/* hint shown over the map */
.maphint {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 600;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink);
  box-shadow: var(--shadow);
  pointer-events: none;
}

/* leaflet tweaks */
.leaflet-container { border-radius: var(--radius); font: inherit; }
