:root {
  --bg: #f4f1ea;
  --card: #fffcf7;
  --ink: #1c1917;
  --muted: #6b6560;
  --line: #e7e1d8;
  --accent: #1f6b4a;
  --accent-soft: #e4eee8;
  --amber: #b7791f;
  --amber-soft: #f6ecd9;
  --brick: #9b3a2f;
  --brick-soft: #f3e3df;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 156px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; display: flex; align-items: baseline; gap: 10px; }
h3 { font-size: 16px; font-family: var(--sans); font-weight: 600; margin-top: 1.6em; }
.n { font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
time, .r, .t td, .stat, .kv dd, .bn { font-variant-numeric: tabular-nums; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.muted, .sub { color: var(--muted); }
.sub { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* galvene */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.search { position: relative; flex: 1; display: flex; max-width: 560px; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-right: 0; border-radius: var(--r) 0 0 var(--r); background: #fff; color: var(--ink); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search button { font: inherit; font-weight: 500; padding: 8px 14px; background: var(--accent); color: #fff; border: 0; border-radius: 0 var(--r) var(--r) 0; cursor: pointer; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(28,25,23,.08); z-index: 30; max-height: 60vh; overflow: auto; }
.suggest li a { display: block; padding: 7px 12px; color: var(--ink); }
.suggest li a span { display: block; font-size: 12px; color: var(--muted); }
.suggest li a:hover, .suggest li.active a { background: var(--bg); text-decoration: none; }
.topnav a { color: var(--ink); font-weight: 500; white-space: nowrap; }

/* kartītes */
main { padding: 20px 0 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin-bottom: 16px; }
.hero h1 { margin-bottom: 4px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.intro { padding: 12px 16px 20px; }
.intro h1 { font-size: 34px; max-width: 760px; }
.lead { font-size: 17px; color: var(--muted); max-width: 680px; }
.examples { color: var(--muted); }

.segbar { position: sticky; top: 99px; z-index: 15; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.segnav { display: flex; gap: 4px 20px; padding-top: 10px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.segnav::-webkit-scrollbar { display: none; }
.segnav a { color: var(--ink); font-weight: 500; white-space: nowrap; }
.segnav a .n { margin-right: 6px; }
.segnav a.on { color: var(--accent); }
.segnav a.on .n { color: var(--accent); }
.seg { scroll-margin-top: 80px; }
.src { font-size: 12px; color: var(--muted); margin: 14px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.empty { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); font-size: 14px; margin: 8px 0; }
.empty .src { border: 0; margin: 0; padding: 0; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 20px; margin: 10px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.stat { margin: 6px 0 10px; }

.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px 6px 0; }
.t td { border-bottom: 1px solid var(--line); padding: 8px 8px 8px 0; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; white-space: nowrap; }
.t tr.dim td { opacity: .6; }
.neg { color: var(--brick); }
.down { color: var(--accent); font-weight: 500; }
.up { color: var(--amber); font-weight: 500; }
.hist { font-size: 12px; }

.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); margin: 0 4px 4px 0; white-space: nowrap; }
.pill.ok { color: var(--accent); border-color: #c6dccf; background: var(--accent-soft); }
.pill.warn { color: var(--amber); border-color: #ead6b0; background: var(--amber-soft); }
.pill.bad { color: var(--brick); border-color: #e2c3bd; background: var(--brick-soft); }
.badges { margin: 10px 0 0; }

.plain { padding-left: 18px; margin: 6px 0; }
.plain li { margin: 3px 0; }
.links { font-size: 14px; }
.linkish { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.linkish:hover { text-decoration: underline; }

.energo { display: flex; gap: 14px; align-items: center; margin: 4px 0 14px; }
.eclass { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; font: 600 22px var(--serif); color: #fff; background: var(--muted); flex: none; }
.eclass.c-a, .eclass.c-a\+, .eclass.c-b { background: var(--accent); }
.eclass.c-c, .eclass.c-d { background: var(--amber); }
.eclass.c-e, .eclass.c-f { background: var(--brick); }

.bars { margin: 10px 0; }
.bar { display: grid; grid-template-columns: 120px 1fr 80px; gap: 10px; align-items: center; font-size: 14px; margin: 3px 0; }
.bt { background: var(--bg); height: 8px; border-radius: 4px; overflow: hidden; }
.bt i { display: block; height: 100%; background: var(--accent); opacity: .75; }
.bn { text-align: right; color: var(--muted); }

.results { list-style: none; padding: 0; margin: 10px 0 0; }
.results li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.results li:last-child a { border-bottom: 0; }
.results .rl { display: block; font-weight: 500; }
.results .rs { font-size: 13px; color: var(--muted); }

/* karte ar slāņu paneli */
.mapshell { position: relative; display: grid; grid-template-columns: 300px 1fr; height: 480px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 16px; background: #e9e5dc; }
.mapshell.lp-collapsed { grid-template-columns: 1fr; }
.mapshell.lp-collapsed .lpanel { position: absolute; left: 10px; top: 10px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(28,25,23,.14); }
.mapshell.lp-collapsed .lp-body { display: none; }
.mapshell.lp-collapsed .lp-head { border-bottom: 0; padding: 6px 10px 6px 6px; cursor: pointer; }
.mapshell.lp-collapsed .lp-min { transform: rotate(180deg); }
.vdmap { min-width: 0; height: 100%; }
.lpanel { background: var(--card); border-right: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; min-width: 0; z-index: 2; }
.lp-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--line); }
.lp-ico { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.lp-head b { font-family: var(--serif); font-size: 18px; }
.lp-badge { background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 0 7px; line-height: 19px; font-variant-numeric: tabular-nums; }
.lp-badge.sm { font-size: 11px; line-height: 17px; padding: 0 6px; }
.lp-clear { margin-left: auto; font: 600 13px var(--sans); color: var(--brick); background: none; border: 0; cursor: pointer; padding: 4px; }
.lp-min { font: 16px var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer; padding: 2px 4px; }
.lp-clear[hidden] + .lp-min { margin-left: auto; }
.lp-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.lp-search { margin: 10px 12px 6px; padding: 8px 12px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.lp-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.lp-groups { overflow-y: auto; flex: 1; padding: 2px 0 6px; }
.lp-g { border-bottom: 1px solid var(--line); }
.lp-gh { width: 100%; display: flex; align-items: center; gap: 7px; padding: 9px 14px; background: none; border: 0; cursor: pointer; font: 600 12px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: #8a7f74; text-align: left; }
.lp-gh:hover { color: var(--ink); }
.lp-gh .caret { font-size: 10px; transition: transform .15s; width: 10px; }
.lp-g.open .caret { transform: rotate(90deg); }
.lp-gh .gl { flex: 1; }
.lp-gh .gc { color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.lp-items { display: none; padding: 0 10px 8px 14px; }
.lp-g.open .lp-items { display: block; }
.lp-it { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 14px; cursor: pointer; position: relative; }
.lp-it .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lp-it .il { flex: 1; line-height: 1.3; }
.lp-it .il small { display: block; font-size: 11px; color: var(--amber); }
.lp-it.far .il, .lp-it.far .sw { opacity: .45; }
.lp-it .tg { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lp-it .tgs { width: 34px; height: 20px; border-radius: 99px; background: #ddd6cb; position: relative; flex: none; transition: background .15s; }
.lp-it .tgs::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.lp-it .tg:checked + .tgs { background: var(--accent); }
.lp-it .tg:checked + .tgs::after { transform: translateX(14px); }
.lp-it .tg:focus-visible + .tgs { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.lp-foot select { font: inherit; font-size: 13px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.lp-cb { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.lp-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 0 14px 10px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lp-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lp-legend em { font-style: normal; }
.lp-open { display: none; }
.maplibregl-popup-content { font: 13px/1.45 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 20px rgba(28,25,23,.12); padding: 10px 12px; }
.maplibregl-popup-content b { font-variant-numeric: tabular-nums; }
.maplibregl-popup-content .pm { color: var(--muted); }
.pthumb { display: block; width: 100%; max-height: 120px; object-fit: cover; border-radius: 4px; margin-bottom: 6px; }

/* sadaļu tabi */
.tabs { border-top: 1px solid var(--line); }
.tabs-in { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs-in::-webkit-scrollbar { display: none; }
.tabs a { color: var(--muted); font-weight: 500; font-size: 14px; padding: 9px 12px 8px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:first-child { padding-left: 0; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }

/* sludinājumi */
.filters { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); align-items: center; }
.filters span { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.filters a { color: var(--muted); }
.filters a.on { color: var(--accent); font-weight: 600; }
.filters select { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.pager { display: flex; gap: 18px; justify-content: center; margin: 14px 0 0; color: var(--muted); }

/* kājene */
.foot { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: 13px; }
.sync { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 3px 22px; }
.sync li span { color: var(--ink); font-weight: 500; margin-right: 4px; }
.sync li.warn { color: var(--amber); }
.sync li em { display: block; font-style: normal; font-size: 12px; color: var(--amber); }
.sync li em.run { color: var(--muted); }
.fine { max-width: 760px; }

@media (max-width: 720px) {
  body { font-size: 14px; }
  .top-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  h1 { font-size: 24px; }
  .intro h1 { font-size: 26px; }
  .card { padding: 16px; border-left: 0; border-right: 0; border-radius: 0; margin-left: -16px; margin-right: -16px; }
  .mapshell { grid-template-columns: 1fr; height: 380px; }
  .mapshell .lpanel { position: absolute; left: 8px; top: 8px; bottom: 8px; width: min(300px, calc(100% - 60px)); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(28,25,23,.15); }
  .mapshell.lp-collapsed .lpanel { bottom: auto; width: auto; }
  .segbar { top: 137px; }
  .tabs a { padding: 8px 10px 7px; font-size: 13px; }
  main.addr { display: flex; flex-direction: column; padding-top: 0; }
  main.addr .mapshell { order: -1; }
  main.addr > * { width: 100%; }
  .t { font-size: 13px; display: block; overflow-x: auto; }
  .bar { grid-template-columns: 90px 1fr 64px; }
}

/* Hibrīda karte (NI izkārtojums) — pilnā augstumā */
body.full { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.full .top { position: static; }
.hy { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; }
.hy-top { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px 8px; }
.hy-ai { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hy-ai input { flex: 1; min-width: 240px; font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.btn.sq { padding: 7px 10px; }
.hy-per { margin-left: auto; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.hy-per select, .hy-f select, .hy-f input, .hy-ov select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink); min-width: 0; }
.hy-hint { font-size: 13px; color: var(--muted); padding: 6px 0 0; }
.hy-f { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin-top: 10px; }
.hy-f label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); width: 130px; }
.hy-f label.w2, .hy-f label.pair { width: 170px; }
.hy-f label.pair span { display: flex; gap: 4px; }
.hy-f label.pair span > * { flex: 1; width: 50%; }
.hy-btns { display: flex; gap: 6px; }
.hy-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 200px)); gap: 8px; margin-top: 10px; }
.hy-stats div { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; background: var(--bg); }
.hy-stats b { display: block; font: 600 18px var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.hy-stats span { font-size: 11px; color: var(--muted); }
.hy-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr) minmax(280px, 1fr); }
.hy-col { display: flex; flex-direction: column; min-height: 0; background: var(--card); }
.hy-ss { border-right: 1px solid var(--line); }
.hy-vzd { border-left: 1px solid var(--line); }
.hy-col header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.hy-col header .cnt { color: var(--muted); font-variant-numeric: tabular-nums; }
.hy-col header select { margin-left: auto; font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.hy-bench { margin: 8px 10px 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; }
.hy-list { overflow-y: auto; flex: 1; padding: 6px 10px 20px; }
.hy-list.loading { opacity: .5; }
.hy-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 14px; }
.hy-empty.big { font-size: 15px; line-height: 1.7; }
.ss-item, .vz-item { padding: 9px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; border-radius: 4px; }
.ss-item { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.ss-item:not(:has(img)) { grid-template-columns: 1fr; }
.ss-item img { width: 64px; height: 52px; object-fit: cover; border-radius: 4px; }
.ss-item:hover, .vz-item:hover { background: var(--bg); }
.hl-on { background: var(--accent-soft) !important; outline: 1px solid #c6dccf; }
.si-t { font-weight: 600; font-size: 14px; }
.si-l { font-size: 12px; margin: 1px 0 3px; }
.si-m { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tg { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg.p { color: var(--accent); border-color: #c6dccf; background: var(--accent-soft); font-weight: 600; }
.tg.m { color: #2c5282; border-color: #c9d8ea; background: #eef3f9; }
.tg.a { color: var(--amber); border-color: #ead6b0; background: var(--amber-soft); }
.tg.k { color: #6b46c1; border-color: #ddd3f0; background: #f4f0fb; }
.tg.d { color: var(--muted); }
.tg.down { color: var(--accent); }
.tg.up { color: var(--amber); }
.vt { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.vt.good { background: var(--accent-soft); color: var(--accent); }
.vt.mid { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.vt.bad { background: var(--brick-soft); color: var(--brick); }
.si-h { font-size: 12px; margin-top: 4px; }
.si-deals { margin-top: 4px; font-size: 12px; }
.si-deals div { display: grid; grid-template-columns: 80px 1fr auto auto; gap: 6px; padding: 2px 0; border-bottom: 1px dotted var(--line); font-variant-numeric: tabular-nums; }
.hy-mapcol { position: relative; min-height: 0; }
.hy-map { height: 100%; margin: 0; border: 0; }
.hy-ov { position: absolute; top: 10px; left: 10px; z-index: 3; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 6px 18px rgba(28,25,23,.1); max-width: 260px; }
.hy-ov label { display: flex; gap: 6px; align-items: center; }
.hy-ov-msg { margin: 0; font-size: 12px; color: var(--muted); }
.hy-legend { position: absolute; top: 10px; right: 50px; z-index: 3; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.hy-legend label { display: flex; gap: 6px; align-items: center; }
.dot { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.dot.vzd { background: #b7791f; }
.dot.ss { background: #fffcf7; border: 2px solid #1c1917; }
.hy-map.lp-collapsed .lpanel { top: auto; bottom: 46px; }
.bm-ctrl { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(28,25,23,.12); }
.bm-ctrl button { font: 600 12px var(--sans); padding: 6px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.bm-ctrl button + button { border-left: 1px solid var(--line); }
.bm-ctrl button.on { background: var(--accent); color: #fff; }
/* uznirstošie logi */
.modal { position: fixed; inset: 0; background: rgba(28,25,23,.45); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card); border-radius: 12px; padding: 16px 18px 20px; width: min(460px, 100%); max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-box.wide { width: min(640px, 100%); }
.modal-box header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 16px; }
.modal-x { font-size: 16px; background: none; border: 0; cursor: pointer; color: var(--muted); }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; color: var(--muted); }
.calc label { display: flex; flex-direction: column; gap: 3px; }
.calc input { font: inherit; font-size: 14px; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.calc-out { grid-column: 1 / -1; color: var(--ink); font-size: 14px; padding-top: 4px; }
.best { padding-left: 20px; margin: 6px 0; font-size: 14px; }
.best li { margin: 7px 0; }
@media (max-width: 1000px) {
  body.full { height: auto; overflow: auto; }
  .hy-cols { grid-template-columns: 1fr; }
  .hy-mapcol { height: 60vh; order: -1; }
  .hy-col { max-height: 70vh; }
  .hy-stats { grid-template-columns: 1fr 1fr; }
  .hy-per { margin-left: 0; }
}

/* Uzņēmumu dati */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.co .hero .kv { border-bottom: 0; margin-bottom: 4px; }
.health { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 18px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }
.ring { flex: none; }
.hscore { display: flex; gap: 14px; align-items: center; padding-right: 16px; border-right: 1px solid var(--line); }
.hscore p { margin: 0 0 4px; }
.ring-n { font: 600 24px var(--serif); fill: var(--ink); }
.ring-d { font: 11px var(--sans); fill: var(--muted); }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { border-right: 1px solid var(--line); padding-right: 10px; }
.kpi:last-child { border-right: 0; }
.kpi span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; font: 600 22px var(--serif); font-variant-numeric: tabular-nums; margin: 2px 0; }
.dl { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 16px; }
.chk { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.chk.ok { border-top-color: var(--accent); }
.chk.bad { border-top-color: var(--amber); }
.chk .st { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chk.ok .st { color: var(--accent); }
.chk.bad .st { color: var(--amber); }
.chk b { display: block; margin: 4px 0 2px; }
.chk p { margin: 0; font-size: 13px; color: var(--muted); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.charts h3 { margin-top: 6px; }
.chart { width: 100%; height: auto; }
.chart .axis { stroke: var(--line); }
.chart .bpos { fill: var(--accent); opacity: .8; }
.chart .bneg { fill: var(--brick); opacity: .8; }
.chart text { font: 11px var(--sans); text-anchor: middle; font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--muted); }
.chart .val { fill: var(--ink); font-size: 10px; }
.ratios { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ratio { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--bg); }
.ratio span { display: block; font-size: 12px; color: var(--muted); }
.ratio b { display: block; font: 600 20px var(--serif); font-variant-numeric: tabular-nums; }
.ratio small { color: var(--muted); font-size: 11px; }
.ratio.warn b { color: var(--amber); }
.t.fin tr.strong td { font-weight: 600; }
.mt { margin-top: 22px; }
.owners { display: grid; gap: 12px; }
.own-h { display: flex; justify-content: space-between; gap: 10px; }
.own .bt { margin: 4px 0; }
.ok-line { color: var(--accent); margin: 6px 0; }
.acc { color: var(--accent); }
.bigsearch { display: flex; max-width: 680px; margin: 18px 0 6px; box-shadow: 0 8px 28px rgba(28,25,23,.08); border-radius: 12px; }
.bigsearch input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 14px 18px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: #fff; }
.bigsearch button { font: 600 15px var(--sans); padding: 0 22px; background: var(--accent); color: #fff; border: 0; border-radius: 0 12px 12px 0; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.toplist { padding-left: 22px; margin: 6px 0; }
.toplist li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.toplist li span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13px; }
@media (max-width: 720px) {
  .health { grid-template-columns: 1fr; }
  .hscore { border-right: 0; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(2) { border-right: 0; }
  .charts, .grid2 { grid-template-columns: 1fr; }
}

/* Auto Tirgus */
.warnline { color: var(--amber); margin: 6px 0; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 18px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stats b { display: block; font: 600 22px var(--serif); font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.auto section > h2 { margin-top: 18px; }
.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.acard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); }
.acard:hover { text-decoration: none; border-color: var(--accent); }
.acard img, .acard .noimg { width: 100%; height: 130px; object-fit: cover; background: var(--bg); display: grid; place-items: center; font-size: 28px; }
.ac-b { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.ac-k { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.ac-p s { color: var(--muted); }
.afilters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; align-items: center; }
.afilters input, .afilters select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; width: 110px; }
.afilters select { width: auto; }
.afilters button { font: 600 14px var(--sans); padding: 7px 16px; background: var(--accent); color: #fff; border: 0; border-radius: var(--r); cursor: pointer; }
.chips { display: inline-flex; gap: 10px; flex-wrap: wrap; margin-right: 6px; font-size: 14px; }
.adetail { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.adetail > img { width: 100%; border-radius: var(--r); object-fit: cover; max-height: 240px; }
.adetail .kpi-row { margin: 12px 0; }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .adetail { grid-template-columns: 1fr; }
}

/* Sludinājumi (adify stils) */
.lnav { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 6px 0 8px; font-size: 14px; }
.lnav-g { display: inline-flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.lnav-g.wide { flex-basis: 100%; }
.lnav a { color: var(--muted); }
.lnav a.on { color: var(--accent); font-weight: 600; }
.lnav .cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lblock h2 { margin-top: 20px; }
.litems { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; margin: 8px 0 6px; }
.litem { display: grid; grid-template-columns: 84px 1fr; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; color: var(--ink); font-size: 14px; }
.litem:hover { text-decoration: none; border-color: var(--accent); }
.litem img, .litem .noimg { width: 84px; height: 72px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.litem > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.litem b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lp { font-variant-numeric: tabular-nums; }
.lp s { color: var(--muted); }
.desc { white-space: pre-line; }

/* pogas */
.btn { font: 600 13px var(--sans); padding: 7px 12px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.sm { padding: 4px 9px; font-size: 12px; background: transparent; color: var(--accent); }
.btn.copied { background: var(--accent-soft); color: var(--accent); }
.co-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.co-actions { display: flex; gap: 8px; }
.co-res li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.co-res li a { flex: 1; border-bottom: 0; }
.co-res .rs + .rs { font-size: 12px; }

/* drukāšana: tīrs pārskats bez navigācijas */
@media print {
  @page { margin: 14mm 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 11pt; }
  .top, .tabs, .foot, .crumbs, .noprint, .segbar, .mapshell, .bigsearch, .pager, .lp-open { display: none !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .card { border: 1px solid #ddd; box-shadow: none; break-inside: avoid; margin: 0 0 10px; padding: 12px 14px; }
  .card, .seg { margin-left: 0 !important; margin-right: 0 !important; border-radius: 4px; }
  .t { display: table !important; font-size: 9.5pt; }
  .t td, .t th { padding: 3px 6px 3px 0; }
  .checks { grid-template-columns: repeat(3, 1fr); break-inside: avoid; }
  .charts { grid-template-columns: 1fr 1fr; }
  .health { grid-template-columns: 1fr 2fr; }
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
  .hscore { border-right: 1px solid #ddd; }
  a { color: inherit; text-decoration: none; }
  h1 { font-size: 20pt; } h2 { font-size: 13pt; }
  .co .seg::after { content: ''; }
  .co::after { content: 'Avots: Visi dati (madmax.lv/visidati) — UR, VID, IUB atvērtie dati.'; display: block; font-size: 8pt; color: #777; margin-top: 8px; }
}

/* sākumlapa, kājene, datu kopas */
.home .bigsearch { position: relative; }
.home .bigsearch .suggest { top: 100%; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile b { color: var(--accent); font-family: var(--serif); font-size: 17px; }
.tile span { font-size: 13px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-line { margin: 0 0 4px; color: var(--ink); }
.foot .warn, .dset .warn { color: var(--amber); }
.dsets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dset { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--r); padding: 12px 14px; }
.dset.bad { border-top-color: var(--amber); }
.ds-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ds-h .n { font: 600 18px var(--serif); color: var(--ink); }
.dset .sub { margin: 2px 0 8px; }
.dset dl { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.dset dl div { display: flex; justify-content: space-between; gap: 10px; }
.dset dt { color: var(--muted); }
.dset dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* Auto Tirgus — perekups (AutoWeb) izkārtojums vienotajā stilā */
.aw { padding: 0 0 40px; }
.aw-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; padding-bottom: 12px; max-width: 1280px; }
.aw-head h1 { font-size: 22px; margin: 0; }
.aw-hr { display: flex; align-items: center; gap: 10px; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--accent); font-weight: 700; background: var(--accent-soft); border: 1px solid #c6dccf; border-radius: 99px; padding: 3px 9px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
#aw-cd { font-size: 11px; color: var(--muted); min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.aw-app { display: grid; grid-template-columns: 250px 1fr; gap: 18px; max-width: 1280px; }
.aw-side { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; align-self: start; position: sticky; top: 112px; }
.aw-side h3 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; font-family: var(--sans); }
.aw-side hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.aw-side input, .aw-side select { width: 100%; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.fl { display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.fl input, .fl select { margin-top: 3px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chk-row { display: flex; gap: 12px; flex-wrap: wrap; }
.chk-row label { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.chk-row input { width: auto; }
.aw-search { width: 100%; padding: 10px; font-size: 14px; margin-top: 4px; }
.tl-bar, .sr-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tl-title { font-weight: 700; font-size: 15px; }
.tl-count, .sr-meta { font-size: 12px; color: var(--muted); }
.new-pill { background: var(--accent-soft); color: var(--accent); border: 1px solid #c6dccf; border-radius: 99px; padding: 2px 8px; font-size: 11px; font-weight: 700; display: none; }
.new-pill.show { display: inline-block; }
.tl-input, .tl-select { padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; width: 110px; }
.view-toggle { display: inline-flex; gap: 4px; margin-left: auto; }
.vbtn { background: var(--card); border: 1px solid var(--line); color: var(--muted); border-radius: 7px; padding: 5px 10px; font: 600 12px var(--sans); cursor: pointer; }
.vbtn.on { border-color: var(--accent); color: var(--accent); }
.tl-grid, .sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tl-card, .s-card { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 12px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.tl-card:hover, .s-card:hover { border-color: var(--accent); }
.tl-card.fresh, .tl-row.fresh { animation: freshflash 3s ease-out; }
@keyframes freshflash { 0% { border-color: var(--accent); background: var(--accent-soft); } 100% { border-color: var(--line); background: var(--card); } }
.card-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 7px; background: var(--bg); }
.card-thumb.ph, .tl-row-thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--muted); }
.ct-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.ct-sub, .s-details { font-size: 12px; color: var(--muted); }
.ct-price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ct-price { font: 700 18px var(--serif); font-variant-numeric: tabular-nums; }
.ct-mkt { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-ts { font-size: 11px; color: var(--muted); }
.discount { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); width: fit-content; }
.discount.none { background: var(--bg); color: var(--muted); }
.discount.above { background: var(--brick-soft); color: var(--brick); }
.ct-actions { display: flex; gap: 6px; margin-top: 4px; }
.ct-open, .ct-img { flex: 1; padding: 7px 4px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-align: center; font: 600 12px var(--sans); cursor: pointer; white-space: nowrap; }
.ct-open:hover, .ct-img:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.ct-open.wa { color: #1f8f4e; }
.tl-list { display: flex; flex-direction: column; gap: 8px; }
.tl-row { display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px; cursor: pointer; }
.tl-row:hover { border-color: var(--accent); }
.tl-row-thumb { width: 84px; height: 62px; flex-shrink: 0; object-fit: cover; border-radius: 7px; background: var(--bg); }
.tl-row-body { flex: 1; min-width: 0; }
.tl-row-title { font-weight: 600; font-size: 14px; }
.tl-row-sub { color: var(--muted); font-size: 12px; }
.tl-row-pr { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-top: 3px; font-variant-numeric: tabular-nums; }
.tl-row-time { font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }
.aw .empty { justify-content: center; padding: 30px; }
.modal-box.gal { width: min(860px, 100%); }
.gal-body { position: relative; display: grid; place-items: center; min-height: 300px; background: #111; border-radius: 8px; }
.gal-body img { max-width: 100%; max-height: 70vh; }
.gal-body p { color: #ccc; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.5); color: #fff; border: 0; font-size: 30px; width: 42px; height: 54px; border-radius: 6px; cursor: pointer; }
.gal-nav.prev { left: 8px; } .gal-nav.next { right: 8px; }
.gal-count { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 0; }
@media (max-width: 760px) {
  .aw-app { grid-template-columns: 1fr; }
  .aw-side { position: static; }
  .view-toggle { margin-left: 0; }
}
