/* =========================================================
   Roadbook Generator – Planner CSS (stabilní proti theme override)
   Nahraď celý soubor tímto obsahem.
   ========================================================= */

/* 1) Izolace od stylů šablony (Extension/child často přepisuje button/input) */
body.rbg-planner-app-mode .rbg-planner-app,
body.rbg-planner-app-mode .rbg-planner-app * {
  box-sizing: border-box;
}

/* Vypnout “form appearance” jen uvnitř planneru */
body.rbg-planner-app-mode .rbg-planner-app button,
body.rbg-planner-app-mode .rbg-planner-app input,
body.rbg-planner-app-mode .rbg-planner-app select,
body.rbg-planner-app-mode .rbg-planner-app textarea {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
}

/* ✅ FIX: vrať nativní vzhled pro checkbox/radio v UI planneru */
body.rbg-planner-app-mode .rbg-planner-app label.rbg-planner-checkbox input[type="checkbox"],
body.rbg-planner-app-mode .rbg-planner-app label.rbg-planner-checkbox input[type="radio"]{
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
  appearance: auto !important;

  width: 14px;
  height: 14px;
  background: none !important;
}

/* 2) App mód – schovat boční panely a roztáhnout obsah */
body.rbg-planner-app-mode #secondary,
body.rbg-planner-app-mode .sidebar,
body.rbg-planner-app-mode .widget-area,
body.rbg-planner-app-mode aside {
  display: none !important;
}

body.rbg-planner-app-mode .site-content,
body.rbg-planner-app-mode .content-area,
body.rbg-planner-app-mode .site-main,
body.rbg-planner-app-mode .entry-content {
  max-width: 100% !important;
  width: 100% !important;
}

body.rbg-planner-app-mode .entry-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* Schovat “page titles” z různých theme variant (jen v planner módu) */
body.rbg-planner-app-mode h1,
body.rbg-planner-app-mode .entry-title,
body.rbg-planner-app-mode .page-title,
body.rbg-planner-app-mode .post-title,
body.rbg-planner-app-mode .wp-block-post-title,
body.rbg-planner-app-mode .elementor-heading-title {
  display: none !important;
}

body.rbg-planner-app-mode .site-main,
body.rbg-planner-app-mode .content-area,
body.rbg-planner-app-mode .entry-content,
body.rbg-planner-app-mode .page-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* 3) Layout planneru */
.rbg-planner-app {
  width: 100%;
}

.rbg-planner-topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* interní nadpis appky (schovaný – řešili jsme, že to je náš span) */
body.rbg-planner-app-mode .rbg-planner-title {
  display: none !important;
}

.rbg-planner-actions {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

/* Profil + checkbox vedle sebe: uděláme z "Profil" labelu flexibilní prvek */
.rbg-planner-actions .rbg-planner-label:nth-of-type(2) {
  display: grid;
  gap: 6px;
  font-size: 12px;
  flex: 1 1 260px;    /* select zabere řádek */
  min-width: 260px;
}

/* Checkbox se přilepí doprava vedle Profilu (na stejný řádek, pokud je místo) */
.rbg-planner-actions .rbg-planner-checkbox {
  margin-left: auto;
  white-space: nowrap;
}


/* STATUS autosave (Ukládám / Uloženo / Chyba) */
.rbg-planner-save {
  font-size: 12px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  color: rgba(0,0,0,.80);
  white-space: nowrap;
  user-select: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.rbg-planner-save:empty {
  display: none;
}

@keyframes rbgPulse {
  0%   { opacity: .65; }
  50%  { opacity: 1; }
  100% { opacity: .65; }
}

.rbg-planner-save.is-saving {
  animation: rbgPulse 1.1s ease-in-out infinite;
}

.rbg-planner-save.is-error {
  border-color: rgba(200,0,0,.25);
  background: rgba(200,0,0,.05);
  color: rgba(140,0,0,.85);
}

.rbg-planner-body {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 140px);
  align-items: start;
}

.rbg-planner-panel {
  border-right: 1px solid rgba(0,0,0,.08);
  padding: 12px;
  overflow: auto;
}

.rbg-planner-mapwrap {
  position: relative;
  align-self: start;          /* zabrání “natahování” podle levého panelu */
  width: 100%;
}

.rbg-planner-map {
  width: 100%;
  aspect-ratio: 1 / 1.35;     /* ⬅ cca +35% výšky */
  height: auto !important;
  height: 100% !important;
max-height: none !important;

}

/* 4) Form prvky */
.rbg-planner-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.rbg-planner-input,
.rbg-planner-select {
  height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 8px;
  background: #fff;
  color: #111;
  width: 100%;
  box-sizing: border-box;
}

.rbg-planner-checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  user-select: none;
}

/* 5) Řádky tlačítek (režimy + akce) */
.rbg-planner-btnrow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.rbg-planner-btnrow + .rbg-planner-btnrow {
  grid-template-columns: repeat(2, 1fr);
}

/* 6) Tlačítka – klíčová část (theme často schovává text; tady to tvrdě přebijeme) */
.rbg-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.18);
  background: #fff;
  cursor: pointer;
  font-weight: 700;

  /* DŮLEŽITÉ: text viditelný vždy (ne až po kliknutí) */
  color: #111 !important;
  font-size: 14px !important;
  line-height: 1.1 !important;
  text-align: center !important;

  /* Theme “icon button” hacky */
  text-indent: 0 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;

  /* stabilní vykreslení */
  display: inline-flex;
  align-items: center;
  justify-content: center;

  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* Kdyby šablona schovávala text přes vnořený span */
.rbg-btn * {
  color: inherit !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-size: inherit !important;
  line-height: inherit !important;
  text-indent: 0 !important;
}

/* Některé šablony přidávají pseudo-elementy k buttonům */
.rbg-btn::before,
.rbg-btn::after {
  content: none !important;
  display: none !important;
}

/* plná šířka v gridu */
.rbg-planner-btnrow .rbg-btn {
  width: 100%;
}

/* aktivní režim */
.rbg-btn.is-active {
  outline: none;
  border-color: #007cba;
  background: #eef6fc;
  color: #007cba !important;
}

/* doplňkové stavy */
.rbg-secondary { opacity: .85; }
.rbg-danger { border-color: rgba(200,0,0,.35); }

/* 7) Sekce a seznamy */
.rbg-planner-section {
  margin-top: 14px;
}

.rbg-planner-section-title {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  opacity: .85;
}

.rbg-planner-list {
  display: grid;
  gap: 6px;
}

.rbg-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  color: #111;
}

.rbg-item small {
  opacity: .7;
}

/* 8) Delete tlačítko (×) – jen u bodů/waypointů (NE u tras Koncepty/Finále) */
body.rbg-planner-app-mode .rbg-planner-app #rbg-points-list .rbg-btn.rbg-danger,
body.rbg-planner-app-mode .rbg-planner-app #rbg-wpts-list .rbg-btn.rbg-danger {
  color: #b00020 !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 12px !important;

  background: #fff !important;
}

/* pojistka: "Smazat" musí zůstat normální tlačítko (trasy + záznamy jízd) */
body.rbg-planner-app-mode .rbg-planner-app .rbg-planner-list .rbg-route-item .rbg-btn.rbg-danger,
body.rbg-planner-app-mode .rbg-planner-app .rbg-planner-item--recorded .rbg-btn.rbg-danger {
  width: 100% !important;
  height: 36px !important;
  padding: 0 12px !important;
  font-size: 14px !important;
  line-height: 1.1 !important;
  border-radius: 10px !important;
}

/* ODESLANÉ finální trasy (JS přidává .is-sent, když r.sent_at existuje) */
body.rbg-planner-app-mode .rbg-planner-app .rbg-planner-list .rbg-route-item.is-sent{
  background: #f6eddc;        /* písková */
  border-color: #e7d5b5;
}

/* volitelné: ať je "Odesláno" ještě víc pasivní */
body.rbg-planner-app-mode .rbg-planner-app .rbg-planner-list .rbg-route-item.is-sent .rbg-btn[disabled]{
  opacity: .65;
  cursor: not-allowed;
}

/* 9) Hints */
.rbg-planner-hint {
  margin-top: 14px;
  font-size: 12px;
  opacity: .75;
  line-height: 1.35;
}

/* 10) Modal */
.rbg-modal[hidden] { display:none; }
.rbg-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 16px;
}

.rbg-modal-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.rbg-modal-title {
  font-weight: 800;
  font-size: 16px;
}

.rbg-modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
}

/* 11) Responsivní režim */
@media (max-width: 980px) {
  .rbg-planner-body {
    grid-template-columns: 1fr;
  }
  .rbg-planner-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(0,0,0,.08);
  }
  .rbg-planner-map {
    height: calc(100vh - 220px);
  }
}
/* ===== Planner: hlavní nadpis aplikace ===== */
body.rbg-planner-app-mode .rbg-planner-title {
  display: block !important;      /* teď už ho chceme vidět */
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin: 8px 0 12px;
  color: #111;
}
body.rbg-planner-app-mode .rbg-planner-topbar {
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin-bottom: 8px;
}
/* CSP fix: pokud je delete tlačítko prázdné (blokovaná ikona), zobraz × přes CSS */
body.rbg-planner-app-mode .rbg-planner-app .rbg-btn.rbg-danger:empty::before {
  content: "×";
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

/* =========================================================
   Tulipy – paleta v topbaru (kompaktní mřížka)
   ========================================================= */

.rbg-tulips-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: #fff;

  width: 100%;        /* ⬅ důležité */
  max-width: none;    /* ⬅ důležité */
}

.rbg-tulips-palette__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}

.rbg-tulips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 52px);
  gap: 8px;
  align-items: start;
}

/* jedna tulipa – malá a konzistentní */
.rbg-tulip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 52px;
  height: 52px;

  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  background: #fafafa;

  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.rbg-tulip:hover {
  background: #fff;
}

/* ikonka uvnitř */
.rbg-tulip img {
  max-width: 34px;
  max-height: 34px;
  width: auto;
  height: auto;
  display: block;
}

/* číslo tulipy */
.rbg-tulip__no {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
}

.rbg-tulip__empty {
  font-size: 11px;
  opacity: .6;
}
/* FIX: Tulipy vedle sebe + zalamování do dalších řad */
.rbg-planner-topbar .rbg-planner-brand {
  flex: 1 1 auto;
  min-width: 320px;
}

.rbg-planner-topbar .rbg-tulips-palette {
  width: 100%;
  max-width: none;
}

.rbg-planner-topbar .rbg-tulips-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, 52px);
  gap: 8px;
}
/* Zvýraznění nadpisu "Moje trasy" v levém panelu */
.rbg-planner-panel > .rbg-planner-section:first-child .rbg-planner-section-title {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 12px;
}
/* === Tulipy: zvětšení + popis při hoveru === */

.rbg-tulip {
	position: relative;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	z-index: 1;
}

.rbg-tulip:hover {
	transform: scale(2.6);
	z-index: 20;
	box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}

/* Tooltip s popisem tulipy */
.rbg-tulip::after {
	content: attr(data-note);
	position: absolute;
	left: 50%;
	top: 100%;
	transform: translateX(-50%);
	margin-top: 6px;

	background: rgba(0,0,0,0.85);
	color: #fff;
	font-size: 12px;
	line-height: 1.3;
	padding: 4px 8px;
	border-radius: 6px;

	white-space: nowrap;
	pointer-events: none;
	opacity: 0;

	transition: opacity 0.12s ease;
}

.rbg-tulip:hover::after {
	opacity: 1;
}
/* Tlačítka Otevřít / Smazat vedle sebe v položce trasy */
.rbg-planner-list .rbg-btn + .rbg-btn { margin-left: 10px; }
/* Recorded rides: tlačítka musí být ve flex řádku jako nahoře */
.rbg-planner-item__actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.rbg-tulip.is-selected{
  outline: 2px solid #000;
  outline-offset: 2px;
}

.rbg-wpt-label{
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #000;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  margin: 0;
  padding: 0;
}
/* Leaflet: přepínač vrstev – lepší čitelnost v rámci WP theme */
.leaflet-control-layers {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.20);
  padding: 8px 10px;
}

/* =========================================================
   FIX: viditelné označení vybrané mapové vrstvy
   ========================================================= */
#rbg-map .leaflet-control-layers input[type="radio"]{
  -webkit-appearance: radio !important;
  -moz-appearance: radio !important;
  appearance: radio !important;
  accent-color: #000;     /* barva tečky */
  width: 14px;
  height: 14px;
}

.leaflet-control-layers label {
  font-size: 14px;
  line-height: 1.25;
}

.leaflet-control-layers-overlays,
.leaflet-control-layers-separator {
  display: none; /* máme jen base layers, overlays zatím nepotřebujeme */
}

/* Planner: tlačítko "Moje roadbooky" nad "Moje trasy" */
.rbg-planner-actions--toplink {
	margin-bottom: 10px;
}

.rbg-planner-actions--toplink .rbg-btn {
	width: 100%;
	text-align: center;
}
/* --- Planner: lišta režimů nad mapou --- */
.rbg-planner-mapwrap{
	display:flex;
	flex-direction:column;
}

.rbg-planner-mapbar{
	background: rgba(255,255,255,0.96);
	border: 1px solid rgba(0,0,0,0.12);
	border-radius: 12px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.12);
	padding: 10px 12px;
	margin: 10px 10px 8px 10px;
}

.rbg-planner-mapbar .rbg-planner-section{
	margin: 0;
	padding: 0;
	border: 0;
}

.rbg-planner-mapbar .rbg-planner-section-title{
	margin: 0 0 6px 0;
	font-size: 14px;
}

.rbg-planner-mapbar .rbg-planner-btnrow{
	margin-top: 8px;
}

.rbg-planner-map{
	flex: 1 1 auto;
	min-height: 520px;
}
/* Mapbar: Profil terénu jako druhý blok v jednom rámečku */
.rbg-planner-mapbar .rbg-planner-profile-row{
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px dashed rgba(0,0,0,0.15);
	display: flex;
	gap: 14px;
	align-items: center;
	flex-wrap: wrap;
}

.rbg-planner-mapbar .rbg-planner-profile-row .rbg-planner-label{
	margin: 0;
}

.rbg-planner-mapbar .rbg-planner-profile-row .rbg-planner-select{
	max-width: 220px;
}
/* === Mapbar: kompaktní toolbar režimů === */
/* === Mapbar: režimy v jedné řadě (4+2 tlačítka) a legenda pod nimi === */

/* Sekce "Režim" v mapbaru: děti řídíme přes flex + order */
.rbg-planner-mapbar .rbg-planner-section {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding-bottom: 0;
}

/* Nadpis vždy na celou šířku */
.rbg-planner-mapbar .rbg-planner-section-title {
	flex: 0 0 100%;
	margin: 0;
}

/* První hint ("Vyber režim...") necháme pod nadpisem */
.rbg-planner-mapbar .rbg-planner-section .rbg-planner-hint:first-of-type {
	order: 1;
	flex: 0 0 100%;
	margin: 0 0 2px 0;
	font-size: 12px;
	opacity: .75;
}

/* Oba řádky tlačítek dáme do jedné řady vedle sebe */
.rbg-planner-mapbar .rbg-planner-btnrow {
	order: 2;
	display: flex;
	gap: 10px;
	margin: 0;
	width: auto;          /* zrušíme „plnou šířku“ */
	flex: 1 1 0;          /* oba bloky se rozdělí podle místa */
}

/* Tlačítka uvnitř řádku: stejné výšky, kompaktní */
.rbg-planner-mapbar .rbg-planner-btnrow .rbg-btn {
	flex: 1 1 0;
	min-width: 120px;
	height: 38px;
	padding: 0 12px;
	white-space: nowrap;
}

/* Druhý hint (legenda "Start = ...") dáme až POD tlačítka */
.rbg-planner-mapbar .rbg-planner-section .rbg-planner-hint:last-of-type {
	order: 3;
	flex: 0 0 100%;
	margin: 4px 0 0 0;
	font-size: 12px;
	opacity: .75;
	line-height: 1.25;
}

/* Na užších šířkách dovolíme zalomení tlačítek (jinak by přetékala) */
@media (max-width: 1100px) {
	.rbg-planner-mapbar .rbg-planner-btnrow {
		flex: 0 0 100%;
	}
}
/* === Mapbar: 6 stejných tlačítek v jedné řadě === */

/* Kontejner pro tlačítka – 6 stejných sloupců */
.rbg-planner-mapbar .rbg-planner-btnrow {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 10px;
	width: 100%;
	margin: 0;
}

/* Všechna tlačítka stejně velká */
.rbg-planner-mapbar .rbg-btn {
	height: 40px;
	padding: 0 12px;
	font-size: 14px;
	white-space: nowrap;
}

/* Na menších šířkách dovolíme zalomení do 2 řad (3 + 3) */
@media (max-width: 1100px) {
	.rbg-planner-mapbar .rbg-planner-btnrow {
		grid-template-columns: repeat(3, 1fr);
	}
}
/* --- RBG alert banner (limit, kritické chyby) --- */
.rbg-alert{
	margin: 12px 0 16px;
	border: 2px solid #b91c1c;
	background: #fff5f5;
	border-radius: 14px;
	padding: 14px;
}

.rbg-alert__inner{
	display: flex;
	gap: 12px;
	align-items: flex-start;
	justify-content: space-between;
}

.rbg-alert__message{
	font-size: 16px;
	line-height: 1.35;
	font-weight: 700;
	color: #7f1d1d;
}

.rbg-alert__close{
	border: 0;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 6px;
	color: #7f1d1d;
}
.rbg-btn.rbg-success {
  background: #e7f6ed;
  border: 1px solid #2e7d32;
  color: #1b5e20;
  font-weight: 700;
}
.rbg-btn.rbg-success:hover {
  background: #d7f0e2;
}
/* Zvýraznění nadpisů sekcí Koncepty / Finále / Záznamy jízd v levém panelu */
#rbg-drafts-title,
#rbg-finals-title,
#rbg-recorded-title {
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 10px;
  margin-top: 14px;
  margin-bottom: 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

/* Záznamy jízd – položka (stejný styl jako .rbg-route-item v Koncepty/Finále) */
.rbg-planner-item--recorded {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  color: #111;
}

.rbg-planner-item--recorded .rbg-planner-item__body {
  min-width: 0;
  flex: 1 1 auto;
}

.rbg-planner-item--recorded .rbg-planner-item__title--recorded {
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.rbg-planner-item--recorded .rbg-planner-item__meta {
  font-size: 12px;
  opacity: .75;
  margin-top: 3px;
}

.rbg-planner-item--recorded .rbg-planner-item__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Malá tlačítka GPX / ✕ */
.rbg-btn--sm {
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

/* === Route list items: 2 rows (title+meta) + (buttons) === */
.rbg-planner-list .rbg-route-item{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* řádek 1: název vlevo, meta vpravo */
.rbg-planner-list .rbg-route-item .rbg-item-left{
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.rbg-planner-list .rbg-route-item .rbg-item-title{
  font-weight: 700;
  line-height: 1.2;
  min-width: 0;
  word-break: break-word;
}

/* meta (čas / stav) doprava na stejný řádek */
.rbg-planner-list .rbg-route-item .rbg-item-left small{
  margin-left: auto;
  opacity: .75;
  white-space: nowrap;
}
/* řádek 2: tlačítka v jedné řadě (3 sloupce) – stabilní proti theme override */
.rbg-planner-list .rbg-route-item .rbg-item-actions{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

/* tlačítka vyplní svůj sloupec, ne celý řádek */
.rbg-planner-list .rbg-route-item .rbg-item-actions .rbg-btn{
  width: 100% !important;
  display: inline-flex !important;
  justify-content: center;
  white-space: nowrap;
}

/* na úzkém panelu 2 sloupce, aby se text nemačkal */
@media (max-width: 380px){
  .rbg-planner-list .rbg-route-item .rbg-item-actions{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* FORCE: route item buttons grid (override theme) */
.rbg-planner-list .rbg-route-item .rbg-item-actions{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.rbg-planner-list .rbg-route-item .rbg-item-actions > button,
.rbg-planner-list .rbg-route-item .rbg-item-actions > .rbg-btn{
  width: 100% !important;
  display: inline-flex !important;
  justify-content: center !important;
  white-space: nowrap !important;
  margin: 0 !important;
}
/* FORCE layout for route items (HTML has buttons directly inside item) */
.rbg-planner-list .rbg-route-item{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-areas:
    "left left"
    "b1   b2"
    "b3   b4" !important;
  gap: 8px !important;
  align-items: start !important;
}

/* left block spans full width (row 1) */
.rbg-planner-list .rbg-route-item .rbg-item-left{
  grid-area: left !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.rbg-planner-list .rbg-route-item .rbg-item-left small{
  margin-left: auto !important;
  opacity: .75 !important;
  white-space: nowrap !important;
}

/* buttons are direct children -> place them into row 2 columns */
.rbg-planner-list .rbg-route-item > .rbg-btn:nth-of-type(1){ grid-area: b1 !important; }
.rbg-planner-list .rbg-route-item > .rbg-btn:nth-of-type(2){ grid-area: b2 !important; }
.rbg-planner-list .rbg-route-item > .rbg-btn:nth-of-type(3){ grid-area: b3 !important; }
.rbg-planner-list .rbg-route-item > .rbg-btn:nth-of-type(4){ grid-area: b4 !important; }

/* make buttons fill their grid cell */
.rbg-planner-list .rbg-route-item > .rbg-btn{
  width: 100% !important;
  display: inline-flex !important;
  justify-content: center !important;
  white-space: nowrap !important;
  margin: 0 !important;
}
/* Zarovnání checkboxu s textem v planneru */
label.rbg-planner-checkbox{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

label.rbg-planner-checkbox input[type="checkbox"]{
  margin: 0;
  transform: translateY(1px);
}
.rbg-credits-hint {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0.9;
}
.rbg-credits-hint a {
  text-decoration: underline;
}
/* Map container musí být referenční bod pro absolutní pozicování */
#rbg-map {
  position: relative;
}
/* Kontejner mapy jako referenční blok */
#rbg-map {
  position: relative;
}
/* Layer switcher: fixed, top bude řídit JS */
#rbg-map .leaflet-control-layers {
  position: fixed !important;
  right: 16px !important;
  z-index: 9999 !important;
}

/* zruš default marginy */
#rbg-map .leaflet-top.leaflet-right .leaflet-control {
  margin: 0 !important;
}


/* =========================================================
   Planner mód: zmenšit zápatí (Theme Freesia + obecné selektory)
   ========================================================= */

body.rbg-planner-app-mode #colophon,
body.rbg-planner-app-mode footer,
body.rbg-planner-app-mode .site-footer,
body.rbg-planner-app-mode #footer {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
}

/* Často největší viník: widgets / site-info */
body.rbg-planner-app-mode #colophon .footer-widgets,
body.rbg-planner-app-mode .site-footer .footer-widgets,
body.rbg-planner-app-mode #footer .footer-widgets {
  padding: 0 !important;
  margin: 0 !important;
}

/* Ten řádek s textem */
body.rbg-planner-app-mode #colophon .site-info,
body.rbg-planner-app-mode .site-footer .site-info,
body.rbg-planner-app-mode #footer .site-info {
  padding: 6px 0 !important;   /* tady si případně dej 4px */
  margin: 0 !important;
  line-height: 1.2 !important;
  font-size: 13px !important;
}

/* =========================================================
   APP režim planneru: levý panel má vlastní scroll,
   pravá mapa je přes celou výšku viewportu
   ========================================================= */

:root {
  /* výška, kterou planner "zajede" pod horní hlavičku webu */
  --rbg-planner-overlap: 90px;  /* začni 90px, typicky 60–140px */
  --rbg-planner-offset: 0px;
}


/* v planner módu nechceme scroll celé stránky */
html body.rbg-planner-app-mode {
  height: 100%;
  overflow: hidden;
}

body.rbg-planner-app-mode .rbg-planner-body {
  height: calc(100vh + var(--rbg-planner-overlap) - var(--rbg-planner-offset));
  min-height: 0;
}


/* levý panel scrolluje */
body.rbg-planner-app-mode .rbg-planner-panel {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* pravá část se musí NATÁHNOUT, ne "start" */
body.rbg-planner-app-mode .rbg-planner-mapwrap {
  align-self: stretch;   /* přepíše původní align-self:start */
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* mapa přes celou výšku wrapperu (zrušíme aspect-ratio omezení v app módu) */
body.rbg-planner-app-mode .rbg-planner-map,
body.rbg-planner-app-mode #rbg-map {
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}

/* =========================================================
   FIX: vrať šipku dropdownu u "Profil terénu"
   ========================================================= */
body.rbg-planner-app-mode .rbg-planner-app select{
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
  appearance: auto !important;
  background-image: none !important;
  padding-right: 26px; /* místo pro šipku */
}

/* =========================================================
   Rozbalovací karty tras (Koncepty / Finále)
   ========================================================= */

.rbg-route-card {
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: #111;
  overflow: hidden;
}

.rbg-route-card.is-current {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.20);
}

/* Header — vždy viditelný, klikatelný */
.rbg-route-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}

.rbg-route-card__header:hover {
  background: rgba(0,0,0,.04);
}

.rbg-route-card__title {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rbg-route-card__meta {
  opacity: .65;
  white-space: nowrap;
}

.rbg-route-card__chevron {
  font-size: 16px;
  line-height: 1;
  color: #666;
  transition: transform .15s;
  flex-shrink: 0;
}

.rbg-route-card.is-open .rbg-route-card__chevron {
  transform: rotate(180deg);
}

/* Tělo — skryté, animované rozbalení */
.rbg-route-card__body {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.rbg-route-card.is-open .rbg-route-card__body {
  display: flex;
}

/* Malá verze tlačítek uvnitř karet */
.rbg-btn--sm {
  font-size: 12px !important;
  padding: 4px 10px !important;
  height: auto !important;
  min-height: 28px !important;
  border-radius: 8px !important;
}

/* Zelené tlačítko "Do katalogu" */
.rbg-btn.rbg-catalog {
  background: #059669;
  border-color: #047857;
  color: #fff;
}
.rbg-btn.rbg-catalog:hover:not([disabled]) {
  background: #047857;
}

/* Pojistka: rbg-danger v kartě zůstane normální (ne ikona ×) */
body.rbg-planner-app-mode .rbg-planner-app .rbg-route-card .rbg-btn.rbg-danger {
  width: auto !important;
  height: auto !important;
  min-height: 28px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

/* ── Guest banner (demo / nepřihlášený režim) ─────────────────────────── */
.rbg-guest-banner {
  background: #fffbe6;
  border: 1px solid #f0c14b;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rbg-guest-banner p {
  margin: 0;
  font-size: 13px;
  color: #444;
  line-height: 1.4;
}
.rbg-guest-banner .rbg-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* ── Login overlay (přes mapu, po kliknutí hosta) ─────────────────────── */
.rbg-login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rbg-login-overlay__box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 340px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.rbg-login-overlay__close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
}
.rbg-login-overlay__close:hover { color: #000; }
.rbg-login-overlay__box p {
  margin: 0;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}
.rbg-login-overlay__box .rbg-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}
