:root {
  --red: #b91c1c; --red2: #dc2626; --ink: #1c1917; --muted: #6b6560; --line: #e7e2dc;
  --bg: #faf7f4; --card: #fff; --ok: #15803d; --warn: #b45309;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f5f1ec; --muted: #a8a19a; --line: #3a3532; --bg: #171413; --card: #221e1c; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--red2); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.top { background: linear-gradient(135deg, #7f1d1d, var(--red2)); color: #fff; padding: 14px 0 18px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 20px; }
.tag { margin: 0; opacity: .9; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.lead { margin: 22px 0 8px; font-weight: 600; color: var(--muted); }
.skeleton { padding: 40px 0; text-align: center; color: var(--muted); }

.hero { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--red2); border-radius: 14px; padding: 18px 18px 14px; margin: 12px 0; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.hero.is-live { border-left-color: #ea580c; animation: pulse 2.4s ease-in-out infinite; }
.hero.calm { border-left-color: var(--ok); }
.hero.test { border-left-color: #2563eb; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(234,88,12,.15); } }
.hero .when { font-weight: 700; color: var(--red2); text-transform: none; }
.hero.calm .when { color: var(--ok); }
.hero.test .when { color: #2563eb; }
.hero h1 { font-size: 24px; line-height: 1.25; margin: 6px 0 4px; }
.place { margin: 0 0 8px; color: var(--muted); }
.popis { margin: 10px 0 6px; font-size: 17px; }
.hzs { margin: 6px 0; }

.badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; margin: 2px 6px 2px 0; }
.badge.sdh { background: rgba(185,28,28,.1); color: var(--red2); }
.badge.live { background: rgba(234,88,12,.15); color: #c2410c; }
.badge.none { background: rgba(120,113,108,.14); color: var(--muted); }

.actions { margin: 8px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--bg); font-size: 14px; }
.units { margin: 6px 0; }
.units summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.units ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.units li.me b { color: var(--red2); }
.src { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 14px; }

.refresh { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 26px; min-height: 1em; }
.warn { color: var(--warn); }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -1px; }
@keyframes sp { to { transform: rotate(360deg); } }

.hist h2, .info h2 { margin: 0 0 10px; }
.hist-head { position: sticky; top: 0; background: var(--bg); padding: 10px 0 8px; z-index: 2; border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--red2); border-color: var(--red2); color: #fff; }
.filters2 { display: flex; gap: 8px; margin-top: 8px; }
.filters2 select, .filters2 input { font: inherit; font-size: 15px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.filters2 input { flex: 1; min-width: 0; }
.month { margin: 22px 0 6px; text-transform: capitalize; color: var(--muted); font-size: 14px; letter-spacing: .03em; }
.item { display: grid; grid-template-columns: 74px 1fr; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; }
.item.other { opacity: .82; }
.item.test { border-style: dashed; }
.it-when { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.35; }
.it-when b { font-size: 17px; color: var(--ink); }
.it-body h3 { margin: 0 0 2px; font-size: 17px; }
.it-body p { margin: 4px 0; }

.info { margin: 40px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.info .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.info h3 { font-size: 16px; margin: 6px 0; }
.info ul { padding-left: 18px; }
.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 20px 16px 40px; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .hero h1 { font-size: 21px; }
  .info .grid { grid-template-columns: 1fr; gap: 6px; }
  .item { grid-template-columns: 60px 1fr; gap: 10px; padding: 10px; }
  .tag { font-size: 14px; }
}
