:root {
  --bg-dark: #1a1f2e;
  --bg-panel: #252b3b;
  --bg-header: #161b26;
  --text: #e2e6ef;
  --text-muted: #8b92a6;
  --accent: #4a90d9;
  --accent-hover: #6ba3e8;
  --border: #3a4154;
  --selected: #c44536;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

body.legend-open {
  overflow: hidden;
}

body.info-open {
  overflow: hidden;
}

/* Header: levý blok (název, ovládání) + navigace vpravo */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--bg-header);
  padding: 0.75rem 1.5rem 0.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.5rem 1rem;
}

.header-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* Pravý blok hlavičky: navigace a hned pod ní logo (drží u sebe) */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
  max-width: 100%;
}

.site-logo-link {
  display: inline-block;
  line-height: 0;
  flex-shrink: 0;
}

.site-logo {
  display: block;
  height: 38px;
  width: auto;
  object-fit: contain;
}

.social-share {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
  font-size: 0.75rem;
}

.social-share .share-btn {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.social-share .share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}

.header h1 {
  margin: 0 0 0.4rem 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.header-brand h1 {
  margin: 0;
}

.header-test-badge {
  margin-top: 0.15rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  animation: header-test-badge-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes header-test-badge-pulse {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0.4;
    transform: translateY(1px);
  }
}

.btn-back {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  color: #fff;
  background: transparent;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Přepínač režimu zobrazení (Tabulka / Animace v čase) */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.view-mode-label {
  white-space: nowrap;
}

.view-mode-btn {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.view-mode-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.view-mode-btn.active {
  border-color: var(--selected);
  background: #333347;
  color: #fff;
}

/* Site navigace – odkazy na další stránky */
.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  position: relative;
  overflow-x: hidden;
  max-width: 100%;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav a:hover {
  color: var(--accent);
}

.site-nav a.active {
  color: var(--accent);
  font-weight: 500;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.controls-row label {
  margin-right: 0.25rem;
}

.scale-buttons {
  display: inline-flex;
  gap: 0.25rem;
}

.scale-btn {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.scale-btn.active {
  border-color: var(--selected);
  background: #333347;
  color: #fff;
}

.params-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.35rem 0 0.4rem 0;
  max-width: 100%;
}

.params-row-wrapper {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 0.25rem;
  max-width: 100vw;
}

.params-row-wrapper .params-row {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
}

.params-row,
.params-submenu {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.params-submenu {
  position: relative;
  align-items: center;
  padding-left: 0.35rem;
  border-left: 2px solid var(--border);
}

.params-submenu-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: hidden;
  overflow-y: hidden;
  flex: 1 1 auto;
  min-width: 0;
}

.params-submenu .params-overflow-btn {
  margin-left: auto;
}

.params-submenu .params-overflow-dropdown {
  right: 0;
  left: auto;
}

.params-submenu.hidden {
  display: none !important;
}

.params-row::-webkit-scrollbar,
.params-submenu::-webkit-scrollbar {
  height: 8px;
}

.params-row::-webkit-scrollbar-track,
.params-submenu::-webkit-scrollbar-track {
  background: var(--bg-dark);
  border-radius: 4px;
}

.params-row::-webkit-scrollbar-thumb,
.params-submenu::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* Tlačítko „více“ (tři tečky) pro přetékající skupiny */
.params-overflow-btn {
  flex-shrink: 0;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

/* Globálně vypneme „tři tečky“ overflow menu pro skupiny a submenu –
   na všech šířkách řešíme přetečení jen zalomením / scrollováním. */
.params-overflow-btn,
.site-nav-more {
  display: none !important;
}

.params-overflow-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.params-overflow-btn.hidden {
  display: none !important;
}

.params-overflow-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 20;
  min-width: 10rem;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0.25rem;
  gap: 0.2rem;
}

.params-overflow-dropdown.hidden {
  display: none !important;
}

.params-overflow-dropdown .group-btn,
.params-overflow-dropdown .param-btn {
  flex-shrink: 0;
  text-align: left;
  white-space: nowrap;
}

.group-btn {
  flex-shrink: 0;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.group-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.group-btn.expanded {
  border-color: var(--border);
  background: #2d3447;
  border-bottom: 2px solid var(--selected);
}

.group-btn.has-active {
  border-bottom: 2px solid var(--selected);
}

.group-btn:focus-visible,
.param-btn:focus-visible {
  outline: none;
}

.param-btn {
  flex-shrink: 0;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s, border-color 0.15s;
}


.param-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.param-btn.active {
  border-bottom: 2px solid var(--selected);
  color: #fff;
}

/* Rezervujeme prostor pod fixní hlavičkou (dostatek místa, aby mapa ani sticky řádek tabulky nezalezály) */
main {
  margin-top: 230px;
  padding: 1rem 1.25rem 1.5rem;
  box-sizing: border-box;
  flex: 1 1 auto;
}

/* Statické stránky (podmínky, o nás, kontakty, blog) – odsazení pod fixní hlavičku */
main.page-main {
  margin-top: 6.5rem;
  padding: 1rem 1.5rem 2rem;
  max-width: 60rem;
}

.page-main h2 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.page-main h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.page-main .text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Kontaktní formulář */
.contact-form-section,
.contact-email-section {
  margin-top: 1.5rem;
}

.contact-form {
  max-width: 28rem;
  margin-top: 0.75rem;
}

.contact-form .form-group {
  margin-bottom: 1rem;
}

.contact-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.contact-form textarea {
  resize: vertical;
  min-height: 5rem;
}

.contact-form .btn-submit {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.contact-form .btn-submit:hover {
  background: var(--accent-hover);
}

.form-note,
.email-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-email-section #email-placeholder a {
  color: var(--accent);
  text-decoration: none;
}

.contact-email-section #email-placeholder a:hover {
  text-decoration: underline;
}

.table-container {
  margin-top: 0.25rem;
}

/* --- Režim animace v čase --- */
.animation-container {
  margin-top: 0.75rem;
}

.animation-layout {
  display: inline-flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.animation-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  width: max-content;
}

.animation-map-wrapper {
  position: relative;
  display: inline-block;
}

.animation-image-layers {
  position: relative;
}

.animation-image {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

.animation-map-empty {
  position: absolute;
  inset: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
}

.animation-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.25rem;
}

.animation-timeline-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.animation-btn {
  background: var(--selected);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s, border-color 0.15s, filter 0.15s;
}

.animation-btn:hover {
  filter: brightness(1.15);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Časový slider – vyšší lišta a větší puntík pro lepší viditelnost a ovládání */
.animation-timeline-controls #animationSlider {
  flex: 1 1 auto;
  height: 28px;
  margin: 0;
  padding: 0 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.animation-timeline-controls #animationSlider::-webkit-slider-runnable-track {
  height: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 5px;
}

.animation-timeline-controls #animationSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -6px;
  background: var(--selected);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s, background 0.15s, filter 0.15s;
}

.animation-timeline-controls #animationSlider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  filter: brightness(1.15);
  border-color: rgba(255, 255, 255, 0.6);
}

.animation-timeline-controls #animationSlider::-moz-range-track {
  height: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 5px;
}

.animation-timeline-controls #animationSlider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--selected);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s, background 0.15s, filter 0.15s;
}

.animation-timeline-controls #animationSlider::-moz-range-thumb:hover {
  transform: scale(1.1);
  filter: brightness(1.15);
  border-color: rgba(255, 255, 255, 0.6);
}

.animation-timeline-controls span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.animation-time-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}

.animation-timeline-dates-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  min-height: 0;
}

.animation-timeline-dates-spacer {
  flex-shrink: 0;
  display: inline-block;
}

.animation-timeline-dates {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--bg-panel);
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.animation-timeline-day-segment {
  flex-shrink: 0;
  padding: 0.2rem 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.animation-timeline-day-segment:first-child {
  border-left: none;
}

.animation-sidebar {
  background: var(--bg-panel);
  border-radius: 4px;
  border: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  margin-right: 0.25rem; /* odstup od pravého okraje viewportu */
  min-height: 0;
}

.animation-sidebar-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.animation-presets {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.animation-sidebar-title,
.animation-layer-limit-message,
.animation-opacity-hint {
  flex-shrink: 0;
}

.animation-presets-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.animation-presets-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.animation-preset-btn {
  background: var(--bg-dark);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.animation-preset-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
  color: var(--text);
}

.animation-preset-btn:focus {
  outline: none;
  border-color: var(--accent);
}

.animation-sidebar-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.animation-layer-limit-message {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0.15rem;
  padding: 0.35rem 0.5rem;
  background: rgba(196, 69, 54, 0.12);
  border-left: 3px solid var(--selected);
  border-radius: 0 4px 4px 0;
}

.animation-opacity-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: -0.1rem;
  margin-bottom: 0.35rem;
}

.animation-layer-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Inline legenda a infobox pod seznamem vrstev (režim animace) */
.animation-legend-box,
.animation-info-box {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-dark);
  overflow: hidden;
}

.animation-legend-box.hidden,
.animation-info-box.hidden {
  display: none;
}

.animation-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.animation-box-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.animation-box-close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.animation-box-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.animation-legend-box-body,
.animation-info-box-body {
  padding: 0.5rem 0.6rem;
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.8rem;
}

.animation-legend-box-body .legend-section,
.animation-info-box-body .info-section {
  margin-bottom: 0.5rem;
}

.animation-legend-box-body .legend-section:last-child,
.animation-info-box-body .info-section:last-child {
  margin-bottom: 0;
}

.animation-group-btn {
  flex-shrink: 0;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.animation-group-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.animation-group-btn.expanded {
  border-bottom: 2px solid var(--border);
  background: #2d3447;
}

.animation-group-btn.has-active {
  border-bottom: 2px solid var(--selected);
}

.animation-group-btn.drag-over {
  outline: 1px dashed var(--accent);
}

.animation-group-panel {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 0.25rem;
  border-left: 2px solid var(--border);
}

.animation-layer-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
}

.animation-layer-row.drag-over {
  outline: 1px dashed var(--accent);
}

.animation-layer-drag-handle {
  flex-shrink: 0;
  cursor: grab;
  color: var(--text-muted);
  padding: 0.25rem 0.15rem;
  font-size: 0.9rem;
  line-height: 1;
  user-select: none;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.animation-layer-drag-handle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.animation-layer-drag-handle:active {
  cursor: grabbing;
}

.animation-layer-row-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.animation-layer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.animation-layer-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.animation-layer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.animation-layer-links .legend-btn {
  padding: 0.1rem 0.35rem;
  font-size: 0.68rem;
}

.animation-layer-links .col-param-info {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.8rem;
}

/* Řádek se skrytou vrstvou – celý řádek ztlumený */
.animation-layer-row.is-layer-hidden {
  opacity: 0.5;
}

.animation-layer-row.is-layer-hidden .animation-layer-name,
.animation-layer-row.is-layer-hidden .animation-layer-order,
.animation-layer-row.is-layer-hidden .animation-layer-opacity-label {
  color: var(--text-muted);
}

/* Tlačítko zapnutí/vypnutí viditelnosti vrstvy (eye toggle) */
.animation-layer-visibility {
  flex-shrink: 0;
  width: 1.6em;
  height: 1.6em;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.animation-layer-visibility:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Vypnutá vrstva: ikona výrazně ztlumená a šedá */
.animation-layer-visibility.is-hidden {
  opacity: 0.35;
  color: var(--text-muted);
}

.animation-layer-visibility.is-hidden:hover {
  opacity: 0.7;
  color: var(--text);
}

.animation-layer-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.animation-layer-toggle {
  flex: 0 0 auto;
  background: var(--bg-dark);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.animation-layer-toggle:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.animation-layer-toggle.active {
  border-bottom: 2px solid var(--selected);
  background: #333347;
}

/* Slider průhlednosti vrstvy – tenký, tlumený, nepřebíjí název */
.animation-layer-opacity {
  flex: 1 1 auto;
  height: 20px;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.animation-layer-controls .animation-layer-opacity::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.animation-layer-controls .animation-layer-opacity::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  background: var(--text-muted);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}

.animation-layer-controls .animation-layer-opacity::-webkit-slider-thumb:hover {
  background: var(--text);
}

.animation-layer-controls .animation-layer-opacity::-moz-range-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.animation-layer-controls .animation-layer-opacity::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--text-muted);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}

.animation-layer-controls .animation-layer-opacity::-moz-range-thumb:hover {
  background: var(--text);
}

.animation-layer-opacity-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

.animation-layer-order {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  white-space: nowrap;
}

.animation-layer-name {
  flex: 1 1 auto;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animation-layer-remove {
  flex: 0 0 auto;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.animation-layer-remove:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.animation-layer-btn {
  background: var(--bg-dark);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.animation-layer-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.animation-layer-btn.active {
  border-bottom: 2px solid var(--selected);
  background: #333347;
}

.animation-layer-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Overflow pro hlavní navigaci (Mapy / Podmínky / ...) */
.site-nav-more {
  flex-shrink: 0;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.site-nav-more.hidden {
  display: none !important;
}

.site-nav-more:hover {
  background: #2d3447;
  border-color: var(--accent);
}

.site-nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 20;
  min-width: 8rem;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0.25rem;
  gap: 0.2rem;
}

.site-nav-dropdown.hidden {
  display: none !important;
}

.site-nav-dropdown a {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.2rem 0.4rem;
}

.site-nav-dropdown a:hover {
  color: var(--accent);
  background: #2d3447;
}

.map-table {
  border-collapse: separate;
  border-spacing: 0.15rem 0.15rem;
  background: var(--bg-dark);
}

.map-table th,
.map-table td {
  padding: 0.1rem 0.1rem;
  vertical-align: middle;
}

.map-table thead th {
  position: sticky;
  top: 230px;
  z-index: 5;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding-top: 0.6rem;
  padding-bottom: 0.35rem;
}

.col-time {
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 0.95rem;
  white-space: nowrap;
  text-align: center;
  padding: 0;
}

thead .col-time {
  position: static;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  width: auto;
}

tbody .col-time {
  position: relative;
  width: 28px;
}

thead .col-time span {
  position: static;
  transform: none;
  transform-origin: initial;
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

tbody .col-time span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  display: block;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 600;
}

.col-param {
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

.col-param-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}

.col-param-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
}

.col-param-title {
  white-space: nowrap;
}

.col-param-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.col-param-info,
.col-param-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.col-param-close:hover {
  background: rgba(196, 69, 54, 0.25);
  border-color: var(--selected);
  color: var(--selected);
}

.col-param-info {
  text-decoration: none;
}

.col-param-info:hover {
  background: #2d3447;
  border-color: var(--accent);
  color: #fff;
}

.col-param-info:focus-visible,
.col-param-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.legend-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.legend-btn:hover {
  background: #2d3447;
  border-color: var(--accent);
  color: #fff;
}

.legend-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.legend-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
}

.legend-panel {
  position: fixed;
  max-width: 380px;
  width: min(380px, 90vw);
  background: var(--bg-panel);
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  padding: 0.75rem 0.9rem 0.85rem;
  z-index: 41;
  border: 1px solid var(--border);
}

.legend-panel.bottom-sheet {
  /* Mobilní legenda může mít v budoucnu odlišný vzhled; zatím zachováváme stejnou
     pozici jako výchozí panel a jen mírně upravujeme stín, aby byla lépe čitelná. */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.legend-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.legend-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.25rem;
  line-height: 1;
}

.legend-close-btn:hover {
  color: #fff;
}

.legend-body {
  font-size: 0.8rem;
  max-height: 60vh;
  overflow-y: auto;
}

.legend-section {
  margin-bottom: 0.6rem;
}

.legend-section:last-child {
  margin-bottom: 0;
}

.legend-colorbar-label {
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.legend-colorbar-bar {
  height: 14px;
  border-radius: 999px;
  background: #444;
  margin-bottom: 0.25rem;
  border: 1px solid var(--border);
}

.legend-colorbar-ticks {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.legend-colorbar-ticks span {
  white-space: nowrap;
}

.legend-symbols-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Srážky za 1h: ikony vedle sebe ve 4 blocích (2×2), legendu to tolik natahuje */
.legend-symbols-list.legend-symbols-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 0.6rem;
}

.legend-symbols-grid .legend-symbol-row {
  align-items: flex-start;
}

.legend-symbol-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-symbol-icon {
  width: 1.4rem;
  text-align: center;
  font-size: 1rem;
}

.legend-symbol-text {
  display: flex;
  flex-direction: column;
}

.legend-symbol-label {
  font-weight: 500;
}

.legend-symbol-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Infobox k vizualizacím (spouštěný přes "i") --- */
.info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
}

.info-panel {
  position: fixed;
  max-width: 420px;
  width: min(420px, 92vw);
  background: var(--bg-panel);
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.8);
  padding: 0.85rem 1rem 0.95rem;
  z-index: 42;
  border: 1px solid var(--border);
}

.info-panel.bottom-sheet {
  left: 50%;
  transform: translateX(-50%);
  bottom: 0.75rem;
  top: auto;
  max-height: 70vh;
}

.info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.info-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.info-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.info-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.info-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.25rem;
  line-height: 1;
}

.info-close-btn:hover {
  color: #fff;
}

.info-body {
  font-size: 0.82rem;
  max-height: 60vh;
  overflow-y: auto;
  line-height: 1.45;
}

.info-section {
  margin-bottom: 0.6rem;
}

.info-section:last-child {
  margin-bottom: 0;
}

.info-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.info-summary {
  color: var(--text);
}

.info-list {
  list-style: disc;
  padding-left: 1.1rem;
  margin: 0.1rem 0 0;
}

.info-list li {
  margin-bottom: 0.15rem;
}

.info-list li:last-child {
  margin-bottom: 0;
}

.cell-map {
  background: var(--bg-panel);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.cell-map img {
  display: block;
}

.cell-map.placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.loading,
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* Blog – timeline / roadmap */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 1.5rem;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.2rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.timeline-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.1rem;
}

.timeline-perex {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.timeline-details {
  margin-top: 0.5rem;
}

.timeline-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
}

.timeline-details[open] summary {
  margin-bottom: 0.5rem;
}

.timeline-details p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responzivita – úzké obrazovky (tablet / malý desktop) */
@media (max-width: 900px) {
  .animation-layout {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
  }

  .animation-main {
    width: 100%;
    max-width: 100%;
  }

  .animation-map-wrapper {
    max-width: 100%;
  }

  .animation-sidebar {
    margin-right: 0;
    margin-top: 0.5rem;
  }
}

/* Responzivita – mobil */
@media (max-width: 768px) {
  :root {
    /* Výška hlavičky (název + badge + režim + meta) – aby mapa nezalezála za ni */
    --mobile-header-height: 7.5rem;
  }

  .header {
    padding: 0.25rem 0.5rem;
    gap: 0.25rem 0.5rem;
  }

  .site-logo {
    height: 28px;
  }

  .header h1 {
    font-size: 0.9rem;
  }

  .header-brand {
    margin-bottom: 0.2rem;
  }

  .header-meta {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
  }

  .view-mode-toggle {
    margin: 0.2rem 0 0.15rem 0;
    font-size: 0.8rem;
  }

  /* Na mobilu celý řádek kroků/měřítka skrytý (krok jde do hamburgeru, měřítko ne) */
  .controls-row {
    display: none !important;
  }

  .params-wrap-in-header {
    display: none !important;
  }

  .scale-btn,
  .group-btn,
  .param-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    min-height: 2.5rem;
  }

  /* Hamburger ikona přes vizualizaci – pravý horní roh obsahu */
  .header-nav-toggle {
    position: fixed;
    top: var(--mobile-header-height, 3.5rem);
    right: 0.5rem;
    z-index: 21;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-panel);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .header-nav-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .header-nav-toggle[aria-expanded="true"] {
    border-color: var(--accent);
    background: #2d3447;
  }

  .header-right {
    position: relative;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .header-nav-panel {
    display: none;
    position: fixed;
    top: calc(var(--mobile-header-height, 3.5rem) + 2.75rem + 0.25rem);
    right: 0.5rem;
    left: auto;
    margin-top: 0;
    flex-direction: column;
    align-items: stretch;
    min-width: 16rem;
    max-width: calc(100vw - 1rem);
    max-height: 85vh;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 20;
    overflow: hidden;
  }

  .header.header-nav-open .header-nav-panel {
    display: flex;
  }

  .header-nav-panel-header {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  .header-nav-panel-close {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-nav-panel-close:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #2d3447;
  }

  .header-nav-step-section {
    flex-shrink: 0;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  .header-nav-step-section .controls-row-step {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
  }

  .header-nav-step-section label {
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  .header-nav-step-section .scale-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .header-nav-params-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
  }

  .header-nav-panel .site-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.35rem;
    flex-shrink: 0;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  .header-nav-panel .site-nav a {
    padding: 0.25rem 0.15rem;
    border-radius: 4px;
  }

  .header-nav-panel .site-nav a:hover {
    background: #2d3447;
  }

  .header-nav-panel .site-nav-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
    pointer-events: none;
    user-select: none;
  }

  .header-nav-panel-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 0.75rem 0.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .header-nav-panel-footer .site-logo {
    height: 28px;
    width: auto;
  }

  .header-nav-panel-footer .social-share {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .header-nav-params-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
  }

  /* Hlavní menu i submenu na jednom řádku, při přetečení horizontální scroll */
  .header-nav-params .params-row-wrapper {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
  }

  .header-nav-params .params-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    margin-bottom: 0.15rem;
    flex: 0 0 auto;
  }

  .header-nav-params .params-submenu {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
  }

  .header-nav-params .params-submenu-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
  }

  /* Stránka přesně do výšky viewportu, bez zbytečného scrollu */
  html {
    height: 100%;
    overflow: hidden;
  }

  body {
    height: 100%;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  main {
    margin-top: var(--mobile-header-height);
    flex: 1 1 0%;
    min-height: 0;
    height: calc(100vh - var(--mobile-header-height));
    height: calc(100dvh - var(--mobile-header-height));
    max-height: calc(100vh - var(--mobile-header-height));
    max-height: calc(100dvh - var(--mobile-header-height));
    padding: 0.75rem 0 0.5rem 0;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  #content {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Viditelný kontejner (animace) vyplní výšku */
  #content > .animation-container:not(.hidden) {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-top: 0;
    overflow: hidden;
  }

  /* Na mobilu tabulka: 20 % měřítko, sloupce/řádky jdou mimo viewport, scroll */
  #content > .table-container:not(.hidden) {
    flex: 1 1 0%;
    min-height: 0;
    margin-top: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    zoom: 0.2;
    width: 100%;
  }

  .animation-container {
    margin-top: 0;
  }

  .animation-layout {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Mezera nad mapou, aby horní okraj a text nebyly pod hlavičkou */
  .animation-main {
    flex: 0 0 auto;
    padding-top: 0.5rem;
  }

  .animation-sidebar {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Box s vrstvami vyplní zbývající prostor a scrolluje uvnitř */
  .animation-sidebar-scroll {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  main.page-main {
    margin-top: var(--mobile-header-height);
    height: auto;
    min-height: calc(100vh - var(--mobile-header-height));
    padding: 0.75rem 0.5rem 1.5rem;
  }

  .map-table thead th {
    top: var(--mobile-header-height);
  }

  /* V tabulce na mobilu sticky vůči scrollovacímu kontejneru (zoom 20 %) */
  .table-container .map-table thead th {
    top: 0;
  }

  /* Legenda na mobilu vždy uprostřed okna */
  .legend-panel {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    max-height: 85vh;
  }

  /* Na mobilu žádné „tři tečky“ – jen scroll */
  .params-overflow-btn,
  .site-nav-more {
    display: none !important;
  }

  .params-row-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .params-row-wrapper .params-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Větší slider a thumb pro časovou osu (lepší dotyk) */
  .animation-timeline-controls #animationSlider {
    height: 36px;
  }

  .animation-timeline-controls #animationSlider::-webkit-slider-runnable-track {
    height: 12px;
  }

  .animation-timeline-controls #animationSlider::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
    margin-top: -7px;
  }

  .animation-timeline-controls #animationSlider::-moz-range-thumb {
    width: 26px;
    height: 26px;
  }

  /* Presety a vrstvy – větší plocha na dotyk */
  .animation-preset-btn {
    padding: 0.45rem 0.75rem;
    min-height: 2.5rem;
  }

  .animation-layer-row {
    min-height: 2.75rem;
  }

  .animation-layer-row .animation-layer-drag-handle,
  .animation-layer-row .legend-btn,
  .animation-layer-row .col-param-info,
  .animation-layer-row .animation-layer-remove {
    min-width: 2.25rem;
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Ikona vrstev v pravém rohu nad mapou */
  .animation-map-wrapper {
    position: relative;
  }

  .mobile-layers-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 5;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-panel);
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .mobile-layers-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #2d3447;
  }

  /* Overlay s nastavením vrstev */
  .mobile-params-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0;
  }

  .mobile-params-overlay.hidden {
    display: none !important;
  }

  .mobile-params-panel {
    width: 100%;
    max-width: 22rem;
    height: 100%;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-params-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .mobile-params-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
  }

  .mobile-params-close {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-params-close:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #2d3447;
  }

  .mobile-params-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-params-body .params-row-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-params-body .params-row {
    flex-wrap: wrap;
  }
}

/* Na desktopu skrýt mobilní ikonu vrstev */
.mobile-layers-toggle {
  display: none;
}

@media (min-width: 769px) {
  .header-nav-toggle {
    display: none;
  }

  .header-nav-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: static;
    margin: 0;
    min-width: 0;
    max-width: none;
    max-height: none;
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
    gap: 0.35rem;
  }

  .header-nav-panel .site-nav {
    flex-direction: row;
    border-bottom: none;
    padding: 0;
    gap: 0.5rem 0.75rem;
  }

  .header-nav-panel-header {
    display: none;
  }

  .header-nav-step-section {
    display: none;
  }

  .header-nav-params-section {
    display: none;
  }

  .header-nav-panel .site-nav-sep {
    display: none;
  }

  .header-nav-panel-footer {
    margin-top: 0;
    padding: 0;
    border-top: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
  }

  .header-nav-panel-footer .site-logo {
    height: 38px;
  }
}

/* Site footer – copyright (přilepený ke spodku stránky) */
.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  text-align: center;
  color: #fff;
  font-size: 0.875rem;
}
.site-footer-copyright {
  margin: 0;
}
.site-footer a {
  color: #fff;
  text-decoration: underline;
}
