[hidden] { display: none !important; }
/* ===== Barvy: Tiffany blue ===== */
:root {
  --bg: #f3f7f7; --panel: #ffffff; --panel2: #f6fafa; --text: #10201f; --muted: #627675; --line: #dfe9e8;
  --accent: #0abab5; --accent-ink: #078c88; --accent-soft: #e3f6f5; --accent-grad: linear-gradient(135deg, #0abab5, #3fd3c6);
  --st-new: #0a8f8a; --st-old: #6fd1cb; --st-seen: #cdeeeb; --seen-ring: #e11d48; --ring: #ffffff;
  --good: #16a34a; --warn: #ca8a04; --bad: #dc2626;
  --shadow: 0 1px 2px rgba(10, 40, 40, .05), 0 6px 20px rgba(10, 40, 40, .06);
  --shadow-lg: 0 10px 40px rgba(10, 40, 40, .14);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #0c1214; --panel: #131b1e; --panel2: #182326; --text: #e5f1f0; --muted: #8ea4a2; --line: #233236;
  --accent: #2fd0c8; --accent-ink: #5fe0d8; --accent-soft: #123334;
  --st-new: #2fd0c8; --st-old: #1f8f8a; --st-seen: #1b4a48; --seen-ring: #fb7185; --ring: #0c1214;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--text); background: var(--bg); display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type=search], input[type=number], input[type=time], input[type=text], input[type=password], input[type=url], select, textarea {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { accent-color: var(--accent); }
a { color: var(--accent-ink); }
.muted { color: var(--muted); }
small { color: var(--muted); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ===== horní lišta ===== */
.top { position: relative; height: 60px; flex: none; display: flex; align-items: center; gap: 22px; padding: 0 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1100; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16.5px; letter-spacing: -.3px; white-space: nowrap; }
.brand b { color: var(--accent-ink); }
.brand .ver { font-weight: 500; font-size: 11px; color: var(--muted); margin-left: 2px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-grad); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(10, 186, 181, .35); }
.logo svg { width: 20px; fill: #fff; }
.tabs { display: flex; gap: 4px; background: var(--panel2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 650; }
.tabs button.on { background: var(--panel); color: var(--accent-ink); box-shadow: var(--shadow); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status .spin { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; overflow: hidden; z-index: 5; }
.progress i { display: block; height: 100%; background: var(--accent-grad); transition: width .6s; }
.progress.indet i { animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { margin-left: -30%; } to { margin-left: 100%; } }
.user { font-size: 12.5px; padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; font-weight: 650; white-space: nowrap; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-weight: 650; transition: border-color .15s, background .15s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent-grad); border-color: transparent; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; }
.btn.icon { width: 36px; padding: 6px 0; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* ===== nabídky: filtry | seznam | mapa ===== */
.view { flex: 1; min-height: 0; }
.offers { display: grid; grid-template-columns: 290px 400px minmax(0, 1fr); position: relative; overflow: hidden; }
.offers > * { min-width: 0; }
.filters { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.search input { width: 100%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.filters .card { box-shadow: none; background: var(--panel2); padding: 10px 12px; }
.target { display: flex; gap: 10px; align-items: center; }
.target input[type=number] { width: 60px; padding: 3px 6px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); padding: 4px 10px; border-radius: 99px; cursor: pointer; font-size: 12.5px; user-select: none; transition: background .15s; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .7; margin-left: 3px; font-size: 11px; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.toggles label { padding: 2px 0; cursor: pointer; font-size: 13px; white-space: nowrap; }
.toggles label b { color: var(--accent-ink); font-weight: 700; }
.group { border-top: 1px solid var(--line); padding-top: 8px; }
.group > summary { cursor: pointer; font-weight: 750; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); list-style: none; display: flex; justify-content: space-between; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: "▾"; }
.group:not([open]) > summary::after { content: "▸"; }
.group .badge-n { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 10.5px; margin-left: 6px; }
.f { padding: 7px 0 3px; }
.f .lbl { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.f .lbl .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f .lbl .u { color: var(--muted); font-size: 11.5px; }
.f .lbl .i { cursor: pointer; color: var(--muted); font-size: 11px; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); display: inline-grid; place-items: center; flex: none; }
.f .lbl .i:hover { color: var(--accent-ink); border-color: var(--accent); }
.f .lbl .x { cursor: pointer; color: var(--muted); }
.f .help { font-size: 11.5px; color: var(--muted); margin: -2px 0 5px; }
.f.active .lbl .name { color: var(--accent-ink); font-weight: 650; }
.f .rng { display: flex; gap: 6px; align-items: center; }
.f .rng input { width: 100%; padding: 5px 8px; }
.f .opts { display: flex; flex-wrap: wrap; gap: 5px; max-height: 150px; overflow-y: auto; }
.f .opts .chip { font-size: 12px; padding: 3px 8px; }
.add { width: 100%; }

.list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.list-head { padding: 10px 14px; display: flex; flex-wrap: wrap; row-gap: 8px; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.list-head strong { white-space: nowrap; }
.list-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.list-tools select { padding: 5px 8px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); color: var(--text); padding: 5px 11px; font-size: 13px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--accent); color: #fff; }
.cards { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.lc { display: grid; grid-template-columns: 116px 1fr; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--st-old);
  border-radius: var(--radius); padding: 8px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.lc.st-new { border-left-color: var(--st-new); }
.lc.st-seen { border-left-color: var(--st-seen); }
.lc.st-seen .pr, .lc.st-seen .ti { opacity: .78; }
.lc:hover { box-shadow: var(--shadow); border-top-color: var(--accent); border-right-color: var(--accent); border-bottom-color: var(--accent); }
.lc.sel { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.lc.inactive { opacity: .55; }
.lc .ph { width: 116px; height: 90px; border-radius: 10px; background: var(--panel2) center/cover no-repeat; position: relative; }
.lc .ph .dot { position: absolute; left: 6px; top: 6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.lc .pr { font-weight: 800; font-size: 16px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.lc .pr .m2 { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 6px; }
.lc .ti { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc .lo { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fact { font-size: 11.5px; padding: 2px 7px; border-radius: 7px; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.tag { font-size: 10.5px; font-weight: 750; padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.tag.new { background: var(--st-new); color: #fff; }
.tag.seen { background: var(--st-seen); color: var(--accent-ink); }
.tag.down { background: #fee2e2; color: #991b1b; } .tag.dup { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
[data-theme="dark"] .tag.down { background: #7f1d1d; color: #fecaca; }
[data-theme="dark"] .tag.new { color: #06201f; }
.more { text-align: center; padding: 8px; }

.mapwrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--panel2); }
.legend { position: absolute; left: 12px; bottom: 22px; z-index: 500; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; max-width: 240px; }
.legend .t { font-weight: 750; margin-bottom: 4px; }
.legend .r { display: flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.legend .ring { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: #cbd5d4; flex: none; }
.legend hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.route-info { position: absolute; left: 56px; top: 12px; z-index: 500; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px; max-width: 320px; }
.route-info .x { float: right; cursor: pointer; color: var(--muted); margin-left: 8px; }
.sel-marker { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--text), 0 4px 12px rgba(0, 0, 0, .35); position: relative; }
.sel-marker::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 3px solid var(--accent); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.leaflet-container { font: inherit; }
.leaflet-tooltip { border-radius: 8px; }
.stop-tt { font-size: 11px; padding: 2px 5px; }
[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.9) saturate(.55); }

/* ===== detail ===== */
.detail { position: absolute; top: 0; right: 0; bottom: 0; width: 540px; max-width: 100%; z-index: 1000; background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); overflow-y: auto; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.detail .close { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 20px; cursor: pointer; z-index: 3; }
.gallery { position: relative; height: 290px; background: var(--panel2) center/cover no-repeat; }
.gallery .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 18px; cursor: pointer; }
.gallery .prev { left: 10px; } .gallery .next { right: 10px; }
.gallery .cnt { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.d-in { padding: 18px 20px 30px; }
.d-in h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.3px; }
.d-state { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; margin-bottom: 6px; }
.d-state .tag { margin-left: 0; }
.d-state a { cursor: pointer; }
.d-price { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 4px; flex-wrap: wrap; }
.d-price .p { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.actions a { text-decoration: none; }
.sec { margin-top: 18px; }
.sec h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin: 0 0 8px; }
.kv { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv > div { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 650; }
.commute { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel2); }
.cbox .big { font-size: 22px; font-weight: 800; color: var(--accent-ink); }
.cbox .sub { font-size: 12px; color: var(--muted); }
.cbox.full { grid-column: 1 / -1; }
.deps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dep { font-size: 11.5px; padding: 2px 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.dep.best { border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.desc { white-space: pre-wrap; opacity: .9; max-height: 220px; overflow: hidden; }
.desc.open { max-height: none; }
textarea { width: 100%; }

/* ===== stránky ===== */
.page { overflow-y: auto; padding: 22px 28px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { position: sticky; top: 0; background: var(--panel2); font-size: 12px; color: var(--muted); font-weight: 700; cursor: pointer; }
.tbl tr:hover td { background: var(--accent-soft); cursor: pointer; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 16px; }
.settings-grid .span2 { grid-column: 1 / -1; }
.settings-grid h3 { margin: 0 0 6px; }
.settings-grid h4 { margin: 16px 0 6px; font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.row input[type=number] { width: 120px; }
.checks label { display: block; padding: 2px 0; }
.catbox { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 6px 0; background: var(--panel2); }
.catrow { display: grid; grid-template-columns: 24px 1fr 120px 120px; gap: 8px; align-items: center; }
.catrow input[type=number] { width: 100%; }
.kinds { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 2px 32px; font-size: 13px; }
.kinds label { white-space: nowrap; cursor: pointer; }
.regbox { border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; overflow: hidden; }
.regbox > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; background: var(--panel2); }
.regbox > summary::-webkit-details-marker { display: none; }
.regbox > summary .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.regbox .dists { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 12px; font-size: 13px; }
.urls .row input { flex: 1; min-width: 260px; }
.rule { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.rule input[type=number], .rule .val { width: 160px; }
.rule .mv { display: inline-flex; flex-direction: column; }
.rule .mv button { border: 1px solid var(--line); background: var(--panel); width: 26px; height: 15px; line-height: 10px; font-size: 10px; cursor: pointer; padding: 0; }
.rule .mv button:first-child { border-radius: 6px 6px 0 0; } .rule .mv button:last-child { border-radius: 0 0 6px 6px; border-top: 0; }
.rule input[type=color], #setColorMissing { width: 42px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel); }
.swatch-label { min-width: 160px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--panel); padding: 10px 16px; border-radius: 12px; z-index: 2000; box-shadow: var(--shadow-lg); }

/* ===== tabulkový režim: mapa nahoře, tabulka pod ní ===== */
.offers.tablemode { grid-template-columns: 290px minmax(0, 1fr); grid-template-rows: minmax(260px, 42%) 1fr; }
.offers.tablemode .filters { grid-row: 1 / 3; grid-column: 1; }
.offers.tablemode .mapwrap { grid-row: 1; grid-column: 2; border-bottom: 1px solid var(--line); }
.offers.tablemode .list { grid-row: 2; grid-column: 2; border-right: 0; min-height: 0; }
.offers.tablemode .cards { display: none; }
.offers.tablemode .legend { bottom: 12px; font-size: 11px; padding: 6px 8px; }
.tablewrap { overflow: auto; flex: 1; min-height: 0; }
.tbl.lt th { white-space: normal; min-width: 64px; max-width: 140px; vertical-align: bottom; line-height: 1.25; user-select: none; z-index: 2; }
.tbl.lt th .u { font-weight: 400; opacity: .7; }
.tbl.lt th .rm { margin-left: 6px; opacity: 0; color: var(--muted); }
.tbl.lt th:hover .rm { opacity: .8; }
.tbl.lt th.sorted { color: var(--accent-ink); }
.tbl.lt td { padding: 6px 10px; font-variant-numeric: tabular-nums; }
.tbl.lt td.n { text-align: right; }
.tbl.lt td:first-child { box-shadow: inset 5px 0 0 var(--st-old); padding-left: 12px; }
.tbl.lt tr.st-new td:first-child { box-shadow: inset 5px 0 0 var(--st-new); }
.tbl.lt tr.st-seen td:first-child { box-shadow: inset 5px 0 0 var(--st-seen); }
.tbl.lt tr.st-seen td { color: var(--muted); }
.tbl.lt tr.sel td { background: var(--accent-soft); color: var(--text); }
.tbl.lt td .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }
.tbl.lt th select { font-size: 12px; padding: 2px 4px; max-width: 140px; }
.mobile-only { display: none; }

@media (max-width: 1250px) { .offers { grid-template-columns: 260px 340px minmax(0, 1fr); } .offers.tablemode { grid-template-columns: 260px minmax(0, 1fr); } }

/* ===== mobil / iPhone ===== */
@media (max-width: 820px) {
  .top { height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand { font-size: 15px; } .brand .ver { display: none; }
  .tabs { order: 3; width: 100%; justify-content: space-between; } .tabs button { flex: 1; }
  .status { max-width: 46vw; }
  #btnUpdate { display: none; }
  .mobile-only { display: inline-block; }
  .offers, .offers.tablemode { display: flex; flex-direction: column; }
  .offers .mapwrap { flex: none; height: 42vh; order: 1; }
  .offers .list { flex: 1; order: 2; border-right: 0; }
  .offers.tablemode .cards { display: none; }
  .filters { position: fixed; inset: 0; z-index: 1500; transform: translateX(-100%); transition: transform .25s; padding-top: max(14px, env(safe-area-inset-top)); }
  .filters.open { transform: none; }
  .detail { position: fixed; inset: 0; width: 100%; z-index: 1600; padding-bottom: env(safe-area-inset-bottom); }
  .settings-grid { grid-template-columns: 1fr; }
  .page { padding: 14px; }
  .catrow { grid-template-columns: 24px 1fr 90px 90px; }
  .lc { grid-template-columns: 96px 1fr; } .lc .ph { width: 96px; height: 78px; }
  .legend { display: none; }
}

/* průběh aktualizace */
.status { cursor: pointer; } .status .more-i { font-size: 10px; }
.btn.stop { border-color: #e11d48; color: #e11d48; }
.upd-panel { position: absolute; right: 18px; top: 62px; width: 560px; max-width: calc(100vw - 20px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; z-index: 1300; font-size: 13px; }
.upd-panel .up-h { display: flex; justify-content: space-between; }
.up-t { width: 100%; border-collapse: collapse; }
.up-t th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.up-t td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.up-t td.n { text-align: right; font-variant-numeric: tabular-nums; }
.mini { height: 4px; background: var(--panel2); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--accent-grad); }

/* body na mapě: viděné s okem, dražby čtverec */
.mk { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #111; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); color: #fff; font-size: 11px; line-height: 1; }
.mk.new { border-color: #fff; }
.mk svg { width: 12px; height: 12px; fill: #fff; filter: drop-shadow(0 0 1px rgba(0,0,0,.8)); }
.mk.auction { width: 20px; height: 20px; border-radius: 5px; border: 2.5px solid #f59e0b; transform: rotate(0deg); }
.mk.lg { display: inline-grid; width: 14px; height: 14px; background: #94a3b8; border-width: 1.5px; font-size: 9px; vertical-align: -3px; flex: none; }
.mk.lg svg { width: 10px; height: 10px; }
.tag.auction { background: #f59e0b; color: #1a1205; }

/* přeskládání bloků v detailu */
.sec h3 { display: flex; align-items: center; gap: 6px; cursor: grab; user-select: none; }
.sec h3 .grip { color: var(--line); letter-spacing: -2px; font-size: 13px; }
.sec h3:hover .grip { color: var(--accent); }
.sec h3 .mvs { margin-left: auto; display: inline-flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.sec:hover h3 .mvs { opacity: 1; }
.sec h3 .mvs button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; font-size: 9px; padding: 1px 5px; cursor: pointer; color: var(--muted); }
.sec.dragging { opacity: .4; }
.sec.over { box-shadow: 0 -3px 0 var(--accent); }
@media (hover: none) { .sec h3 .mvs { opacity: 1; } }

.stlegend { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.stlegend span { display: inline-flex; align-items: center; gap: 4px; }
.stlegend i { width: 5px; height: 13px; border-radius: 2px; display: inline-block; }
.stlegend .s-new { background: var(--st-new); } .stlegend .s-old { background: var(--st-old); } .stlegend .s-seen { background: var(--st-seen); border: 1px solid var(--line); }

/* semafor a skóre */
.fact.sem { font-weight: 700; border: 0; }
.sem-a { background: #d1fae5 !important; color: #065f46; } .sem-b { background: #e3f6f5 !important; color: #0b6b67; }
.sem-c { background: var(--panel2) !important; color: var(--muted); } .sem-d { background: #ffedd5 !important; color: #9a3412; } .sem-e { background: #fee2e2 !important; color: #991b1b; }
[data-theme="dark"] .sem-a { background: #064e3b !important; color: #a7f3d0; } [data-theme="dark"] .sem-d { background: #7c2d12 !important; color: #fed7aa; } [data-theme="dark"] .sem-e { background: #7f1d1d !important; color: #fecaca; }
.fact.score { background: var(--accent-soft); color: var(--accent-ink); font-weight: 750; border-color: transparent; }
.semline { font-size: 12.5px; color: var(--muted); margin: 4px 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.relisted { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; margin: 8px 0; }
[data-theme="dark"] .relisted { background: #2a1a0b; border-color: #7c2d12; }
.links { margin-top: 0; }

/* porovnání */
.lc .ph .cmp { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 10.5px; padding: 1px 6px 1px 3px; border-radius: 6px; display: flex; align-items: center; gap: 3px; opacity: 0; transition: opacity .15s; }
.lc:hover .ph .cmp, .lc .ph .cmp:has(input:checked) { opacity: 1; }
.lc .ph .cmp input { margin: 0; width: 12px; height: 12px; }
.cmpbox { margin: 0 4px 0 0; vertical-align: -2px; }
.cmpbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1400; background: var(--panel); border: 1px solid var(--accent); box-shadow: var(--shadow-lg); border-radius: 14px; padding: 8px 12px; display: flex; gap: 8px; align-items: center; }
.modal-bg { position: fixed; inset: 0; background: rgba(5, 20, 20, .45); z-index: 2500; display: grid; place-items: center; padding: 20px; }
.modal { position: relative; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 20px 22px; max-width: min(1100px, 96vw); max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 12px; }
.modal .close { position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--panel2); font-size: 18px; cursor: pointer; }
.cmp-t th { vertical-align: top; white-space: normal; min-width: 180px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); cursor: default; }
.cmp-t td { white-space: normal; } .cmp-t td.k { color: var(--muted); }
.cmp-t td.best { background: #d1fae5; color: #065f46; font-weight: 700; }
[data-theme="dark"] .cmp-t td.best { background: #064e3b; color: #a7f3d0; }
.cmp-t tr:hover td { background: inherit; cursor: default; }
.cph { height: 110px; border-radius: 10px; background: var(--panel2) center/cover no-repeat; margin-bottom: 6px; }

/* uložená hledání */
.searches { display: flex; flex-direction: column; gap: 4px; }
.searches .sh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.srch { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; border-top: 1px dashed var(--line); }
.srch .nm { flex: 1; cursor: pointer; color: var(--accent-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch .tag { margin-left: 0; }
.srch .bell, .srch .x { cursor: pointer; font-size: 12px; } .srch .bell:not(.on) { opacity: .5; } .srch .x { color: var(--muted); }

/* kreslení oblasti */
.drawctl a { font-size: 15px; line-height: 30px; text-align: center; }
.drawctl a.on { background: var(--accent); }
.leaflet-container.drawing { cursor: crosshair; }

/* hodnocení, checklist, fotky, financování */
.rate { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.stars .star { font-size: 24px; color: var(--line); cursor: pointer; transition: color .1s; } .stars .star.on { color: #f59e0b; }
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.checklist { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ci { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ci:last-child { border-bottom: 0; }
.tri { display: inline-flex; gap: 3px; }
.tri button { width: 28px; height: 24px; border: 1px solid var(--line); background: var(--panel); border-radius: 7px; cursor: pointer; font-weight: 800; color: var(--muted); }
.tri button.on.ok { background: #16a34a; color: #fff; border-color: #16a34a; } .tri button.on.warn { background: #f59e0b; color: #fff; border-color: #f59e0b; } .tri button.on.bad { background: #dc2626; color: #fff; border-color: #dc2626; }
.photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.photos img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }
.addph { width: 84px; height: 64px; border: 1.5px dashed var(--line); border-radius: 8px; display: grid; place-items: center; text-align: center; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.fin { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-bottom: 8px; font-size: 13px; }
.fin label { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.fin input { width: 110px; } .fin select { width: 110px; }
.finout .kv { margin-top: 4px; }
.warnline { color: #b45309; font-size: 12.5px; }
.small-ol { padding-left: 18px; margin: 4px 0 8px; font-size: 12.5px; }
.row.sc span { flex: 1; } .row.sc input { width: 140px; } .row.sc b { width: 14px; text-align: right; }
.leaflet-control-layers { border-radius: 12px !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; }
[data-theme="dark"] .leaflet-control-layers, [data-theme="dark"] .leaflet-bar a { background: var(--panel); color: var(--text); }
@media (max-width: 820px) { .pc, .fin { grid-template-columns: 1fr; } .cmpbar { bottom: 10px; } }

input[type=range] { accent-color: var(--accent); }

.contactbox { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; margin: 10px 0; }
.contactbox > summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); list-style: none; }
.contactbox > summary::-webkit-details-marker { display: none; }
.contactbox textarea { margin-top: 6px; background: var(--panel); }
a.bm { display: inline-block; padding: 3px 10px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; }
#cTpl { font-family: inherit; }
.votes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.neg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.neg > div { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; background: var(--panel2); }
.neg b { font-size: 19px; color: var(--accent-ink); }
.why { margin: 8px 0 4px; padding-left: 18px; font-size: 13px; }
.spark { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; flex-wrap: wrap; }
.risks { display: flex; flex-direction: column; gap: 4px; }
.risk { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; }
.risk.r-bad { background: #fef2f2; border-color: #fecaca; } .risk.r-ok { background: var(--panel2); }
[data-theme="dark"] .risk.r-bad { background: #3a1414; border-color: #7f1d1d; }
.aitext { white-space: pre-wrap; font-size: 13px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.tripnum { width: 22px; height: 22px; border-radius: 50%; background: #0abab5; color: #fff; font-weight: 800; font-size: 12px; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* ===== uživatelé ===== */
.user { cursor: pointer; }
.popmenu { position: fixed; z-index: 3000; min-width: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.popmenu .pm-title { font-weight: 700; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.popmenu button { text-align: left; background: none; border: 0; padding: 8px 8px; border-radius: 8px; cursor: pointer; }
.popmenu button:hover { background: var(--accent-soft); }
.popmenu label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; cursor: pointer; }
.mwho { color: var(--accent-ink); font-size: 12px; cursor: pointer; }
.fact.favby { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.online { color: var(--good); font-weight: 600; }
.invbox { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }
.invbox input { width: 100%; }
.invbox .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card.locked { opacity: .62; }
#uTable select { padding: 4px 8px; }
