:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --ink: #172033;
  --muted: #6b7280;
  --line: #dfe5ee;
  --primary: #e83e83;
  --primary-dark: #b92361;
  --navy: #172033;
  --gold: #e2a92d;
  --shadow: 0 16px 40px rgba(23, 32, 51, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(232,62,131,.09), transparent 30rem),
    radial-gradient(circle at 100% 8%, rgba(23,32,51,.07), transparent 32rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 7px clamp(14px, 3vw, 44px);
  color: #fff;
  background: rgba(23,32,51,.97);
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.22)); }
.brand span { display: grid; gap: 3px; }
.brand strong { font-size: clamp(17px, 1.7vw, 21px); line-height: 1.05; }
.brand small { color: #cbd5e1; font-size: 12px; }
.lang-switch { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.lang-switch button {
  min-width: 42px; padding: 7px 9px; border-radius: 9px; cursor: pointer;
  color: #dce3ef; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); font-weight: 800;
}
.lang-switch button:hover { background: rgba(255,255,255,.14); }
.lang-switch button.is-active { color: #fff; background: var(--primary); border-color: var(--primary); }

.page-shell { width: min(1660px, calc(100% - 24px)); margin: 16px auto 30px; }
.hero-card {
  display: grid; grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.08fr); gap: 18px; align-items: center;
  padding: clamp(8px, 1vw, 11px) clamp(16px, 2vw, 24px); border-radius: 17px; color: #fff; overflow: hidden; position: relative;
  background: linear-gradient(135deg, rgba(23,32,51,.98), rgba(42,55,80,.96)); box-shadow: var(--shadow);
}
.hero-card::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -105px; top: -125px; border-radius: 50%;
  border: 58px solid rgba(232,62,131,.15); pointer-events: none;
}
.hero-copy, .call-search { position: relative; z-index: 1; }
.eyebrow { display: inline-block; margin-bottom: 1px; color: #f5a9c8; font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.hero-copy h1 { margin: 0 0 2px; font-size: clamp(22px, 2.25vw, 30px); line-height: 1.02; }
.hero-copy p { max-width: 680px; margin: 0; color: #d9e1ec; font-size: 12px; line-height: 1.22; }
.call-search label { display: block; margin-bottom: 2px; font-size: 13px; line-height: 1.1; font-weight: 800; }
.search-row { display: flex; gap: 10px; }
.input-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 15px; border-radius: 13px; background: #fff; box-shadow: inset 0 0 0 1px rgba(23,32,51,.12); }
.input-wrap input { width: 100%; min-height: 38px; border: 0; outline: 0; color: var(--ink); background: transparent; text-transform: uppercase; font-size: 19px; font-weight: 900; letter-spacing: .05em; }
.primary-btn, .secondary-btn, .icon-btn {
  border: 0; border-radius: 12px; cursor: pointer; font-weight: 850; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.primary-btn { min-height: 38px; padding: 0 19px; color: #fff; background: var(--primary); box-shadow: 0 8px 20px rgba(232,62,131,.26); white-space: nowrap; }
.primary-btn:hover { background: var(--primary-dark); }
.primary-btn:disabled { cursor: wait; opacity: .7; }
.secondary-btn { padding: 10px 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.secondary-btn:hover { border-color: #b9c3d2; background: #f8fafc; }
.icon-btn { width: 38px; height: 38px; background: #f5f7fa; border: 1px solid var(--line); }

.message { margin: 18px 0; padding: 14px 17px; border-radius: 12px; background: #fff; border-left: 5px solid var(--primary); box-shadow: 0 8px 24px rgba(23,32,51,.08); }
.message.error { border-left-color: #d14343; color: #8c2525; background: #fff6f6; }
.message.loading { border-left-color: var(--gold); }

.results { margin-top: 14px; }
.result-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 9px; }
.result-kicker { color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.result-heading h2 { margin: 2px 0 1px; font-size: clamp(28px, 3vw, 40px); letter-spacing: .02em; }
.matched-calls { color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(210px, 1.45fr); gap: 10px; }
.stat-card { min-height: 74px; padding: 9px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: 10px; border-radius: var(--radius); background: var(--card); box-shadow: 0 8px 26px rgba(23,32,51,.07); border: 1px solid rgba(223,229,238,.9); }
.stat-icon { grid-row: 1 / 3; align-self: center; font-size: 21px; }
.stat-card strong { align-self: end; font-size: 23px; line-height: 1; }
.stat-card small { align-self: start; margin-top: 2px; color: var(--muted); line-height: 1.2; }
.stat-date strong { font-size: 16px; line-height: 1.2; }

.filter-card, .map-card, .list-card, .timeline-card { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 10px 30px rgba(23,32,51,.07); overflow: hidden; }
.filter-card { padding: 8px 12px 9px; }
.filter-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 6px; }
.filter-title button { border: 0; background: transparent; color: var(--primary-dark); cursor: pointer; font-weight: 750; }
.filters-grid { display: grid; grid-template-columns: repeat(4, minmax(125px, .7fr)) minmax(220px, 1.4fr); gap: 11px; }
.filters-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 800; }
.filters-grid select, .filters-grid input, #sortSelect { min-height: 34px; padding: 6px 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; }
.filters-grid select:focus, .filters-grid input:focus, #sortSelect:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,62,131,.12); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(440px, .9fr); gap: 10px; }
.card-header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 13px; border-bottom: 1px solid var(--line); }
.card-header > div { display: grid; gap: 3px; }
.card-header small { color: var(--muted); }
#map { height: clamp(370px, calc(100vh - 486px), 580px); min-height: 370px; background: #dce3e9; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 9px 14px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.dot-once { background: var(--primary); }
.dot-repeat { background: var(--gold); }

.table-wrap { overflow: auto; }
.history-card .table-wrap { height: clamp(370px, calc(100vh - 486px), 580px); min-height: 370px; }
.activated-list-card .table-wrap { max-height: 520px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { position: sticky; top: 0; z-index: 2; padding: 11px 10px; text-align: left; color: #586174; background: #f7f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
td { padding: 10px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.is-selected { background: #fff3f8; }
.ref-link { font-weight: 900; color: var(--primary-dark); text-decoration: none; white-space: nowrap; }
.ref-link:hover { text-decoration: underline; }
.tower-name { min-width: 190px; line-height: 1.3; }
.count-pill { display: inline-flex; min-width: 29px; justify-content: center; padding: 3px 7px; border-radius: 99px; color: #7d5411; background: #fff3d4; font-weight: 900; }
.empty-filtered { padding: 30px; text-align: center; color: var(--muted); }

.timeline-card { margin-top: 10px; }
.history-card .history-wrap { max-height: none; }
.activated-list-card { margin-top: 10px; }
.badge-list { display: flex; flex-wrap: wrap; gap: 4px; }
 .mini-badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 6px; color: #35405a; background: #edf1f7; font-size: 11px; font-weight: 800; }
.colored-badge { color: #fff; background: var(--badge-color); border: 1px solid rgba(255,255,255,.35); text-shadow: 0 1px 1px rgba(0,0,0,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.band-badge[style*="#00d4ff"], .band-badge[style*="#5fa8ff"], .band-badge[style*="#ffd75a"] { color: #102038; text-shadow: none; }
.country-badge, .country-inline { display: inline-flex; align-items: center; gap: 5px; }
.country-badge { padding: 3px 7px; border-radius: 7px; color: #35405a; background: #edf1f7; font-size: 11px; font-weight: 800; }
.country-flag { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; border: 1px solid rgba(23,32,51,.16); box-shadow: 0 1px 2px rgba(23,32,51,.14); vertical-align: middle; flex: 0 0 auto; }
.country-inline .country-flag { width: 18px; height: 12px; }
.country-flag-fallback { font-size: 15px; line-height: 1; }
.data-note { margin: 12px 2px 0; color: var(--muted); font-size: 12px; text-align: right; }
footer { padding: 20px 16px 32px; color: var(--muted); text-align: center; font-size: 12px; }
footer a { color: var(--primary-dark); }

.leaflet-popup-content-wrapper { border-radius: 13px; box-shadow: 0 12px 35px rgba(23,32,51,.18); }
.leaflet-popup-content { margin: 9px 11px 10px; }
.leaflet-container a.leaflet-popup-close-button {
  top: 5px; right: 5px; width: 26px; height: 26px; display: grid; place-items: center;
  padding: 0; border-radius: 50%; color: #536075; background: #f1f4f8; font-size: 21px; font-weight: 500; line-height: 1;
}
.leaflet-container a.leaflet-popup-close-button:hover { color: #fff; background: var(--primary); }
.map-popup { width: min(272px, calc(100vw - 78px)); padding-right: 16px; }
.map-popup h3 { margin: 1px 0 5px; font-size: 15px; line-height: 1.22; }
.map-popup .popup-ref { color: var(--primary-dark); font-size: 12px; font-weight: 900; }
.map-popup p { margin: 5px 0; line-height: 1.3; }
.map-popup .popup-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 7px 0 2px; }
.map-popup .popup-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; color: #4b5563; font-size: 11px; line-height: 1.25; }
.map-popup .popup-meta strong { color: #30394a; }
.map-popup .mini-badge, .map-popup .country-badge { padding: 2px 5px; font-size: 10px; }
.map-popup .country-flag { width: 19px; height: 13px; }
.map-popup .popup-link { display: inline-block; margin-top: 6px; color: var(--primary-dark); font-size: 12px; font-weight: 850; }
.custom-marker { background: transparent; border: 0; }
.marker-pin { display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); box-shadow: 0 5px 13px rgba(0,0,0,.3); background: var(--primary); }
.marker-pin.repeat { background: var(--gold); }
.marker-pin span { transform: rotate(45deg); color: #fff; font-size: 10px; font-weight: 950; }
.marker-pin.marker-once span { display: none; }
.marker-pin.marker-once::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.96); box-shadow: 0 1px 2px rgba(0,0,0,.18); }


@media (min-width: 1181px) and (max-height: 900px) {
  .site-header { min-height: 62px; }
  .page-shell { margin-top: 12px; }
  .hero-card { padding-top: 8px; padding-bottom: 8px; }
  .hero-copy h1 { font-size: clamp(22px, 2.1vw, 29px); }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 70px; padding-top: 8px; padding-bottom: 8px; }
  .filter-card { padding-top: 7px; padding-bottom: 8px; }
}

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-date { grid-column: span 2; }
  .filters-grid { grid-template-columns: repeat(3, 1fr); }
  .text-filter { grid-column: span 2; }
  .content-grid { grid-template-columns: 1fr; }
  .history-card .table-wrap { height: 480px; }
  .activated-list-card .table-wrap { max-height: 520px; }
}
@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .lang-switch { justify-content: flex-start; }
  .page-shell { width: min(100% - 18px, 1540px); margin-top: 12px; }
  .hero-card { grid-template-columns: 1fr; gap: 16px; padding: 18px 17px; }
  .search-row { flex-direction: column; }
  .primary-btn { width: 100%; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-date { grid-column: 1 / -1; }
  .filters-grid { grid-template-columns: repeat(2, 1fr); }
  .text-filter { grid-column: 1 / -1; }
  #map { height: 470px; min-height: 470px; }
  .history-card .table-wrap { height: 470px; min-height: 470px; }
  .activated-list-card .table-wrap { max-height: 470px; }
  .tower-name { min-width: 150px; }
}
@media (max-width: 460px) {
  .brand small { display: none; }
  .brand img { width: 44px; height: 44px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-height: 92px; padding: 12px; }
  .stat-card strong { font-size: 23px; }
  .filters-grid { grid-template-columns: 1fr; }
  .text-filter { grid-column: auto; }
  .heading-actions { width: 100%; }
  .heading-actions .secondary-btn { flex: 1; font-size: 12px; }
  #map { height: 430px; min-height: 430px; }
}


body.modal-open { overflow: hidden; }
.reference-modal[hidden] { display: none; }
.reference-modal { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: clamp(10px, 2vw, 26px); }
.reference-modal__backdrop { position: absolute; inset: 0; background: rgba(10,16,29,.72); backdrop-filter: blur(3px); }
.reference-modal__dialog { position: relative; width: min(1180px, 96vw); height: min(860px, 92vh); display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid rgba(255,255,255,.5); box-shadow: 0 30px 90px rgba(0,0,0,.42); }
.reference-modal__header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px 10px 17px; color: #fff; background: var(--navy); border-bottom: 3px solid var(--primary); }
.reference-modal__header > div:first-child { display: grid; gap: 2px; min-width: 0; }
.reference-modal__header small { color: #cbd5e1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.reference-modal__header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-modal__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.reference-modal__actions .secondary-btn { padding: 8px 11px; font-size: 12px; text-decoration: none; }
.reference-modal__close { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; color: #fff; background: rgba(255,255,255,.09); font-size: 28px; line-height: 1; cursor: pointer; }
.reference-modal__close:hover { background: rgba(255,255,255,.17); }
.reference-modal iframe { width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 620px) {
  .reference-modal { padding: 0; }
  .reference-modal__dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .reference-modal__header { padding-left: 12px; }
  .reference-modal__actions .secondary-btn span { display: none; }
}

/* ========================================================================
   TOTA PORTAL THEME · v2.0
   Official TOTA-inspired palette: deep teal, sky blue, cream, olive and gold.
   This block intentionally overrides the previous visual layer while keeping
   the full responsive layout and all existing functionality unchanged.
   ======================================================================== */
:root {
  --bg: #edf3f1;
  --card: #fffdf6;
  --ink: #12343d;
  --muted: #667b7d;
  --line: #d6e1dd;
  --primary: #0e6c78;
  --primary-dark: #084b58;
  --navy: #083f4b;
  --gold: #d5ae51;
  --gold-dark: #a87c26;
  --sky: #87c8d6;
  --sky-soft: #dff0f1;
  --cream: #f4edd5;
  --olive: #718b2d;
  --shadow: 0 14px 34px rgba(8, 63, 75, .12);
  --radius: 15px;
}

body {
  background:
    radial-gradient(circle at 5% -10%, rgba(135, 200, 214, .28), transparent 31rem),
    radial-gradient(circle at 100% 4%, rgba(213, 174, 81, .14), transparent 28rem),
    linear-gradient(180deg, #f4f8f6 0%, #eaf1ef 100%);
  color: var(--ink);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .22;
  background-image:
    repeating-radial-gradient(circle at 12% 4%, transparent 0 34px, rgba(8,75,88,.07) 35px 36px, transparent 37px 69px),
    linear-gradient(120deg, transparent 0 48%, rgba(255,255,255,.6) 49% 51%, transparent 52% 100%);
  background-size: 470px 470px, 100% 100%;
}

.site-header {
  min-height: 62px;
  padding-top: 5px;
  padding-bottom: 5px;
  color: var(--cream);
  background:
    linear-gradient(90deg, rgba(4,48,59,.99), rgba(10,79,90,.98) 58%, rgba(4,48,59,.99));
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 9px 24px rgba(8,63,75,.20);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: rgba(255,255,255,.35);
}
.site-header { position: relative; }
.brand { gap: 10px; }
.brand img {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.28));
}
.brand strong { color: #fffdf4; letter-spacing: .01em; }
.brand small { color: #c8e3e7; }
.lang-switch button {
  color: #d9edef;
  background: rgba(255,255,255,.07);
  border-color: rgba(244,237,213,.24);
}
.lang-switch button:hover {
  color: #fff;
  background: rgba(255,255,255,.14);
  border-color: rgba(244,237,213,.42);
}
.lang-switch button.is-active {
  color: #17383f;
  background: var(--gold);
  border-color: #e6ca82;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.page-shell { margin-top: 13px; }
.hero-card {
  min-height: 88px;
  padding: 9px 18px;
  border: 1px solid rgba(213,174,81,.62);
  border-radius: 16px;
  background:
    linear-gradient(96deg, rgba(7,63,75,.98) 0%, rgba(10,81,91,.97) 57%, rgba(17,91,99,.95) 100%);
  box-shadow: 0 15px 36px rgba(8,63,75,.18);
}
.hero-card::before {
  content: "";
  position: absolute;
  right: 7%;
  bottom: -30px;
  width: 280px;
  height: 88px;
  border-radius: 50% 50% 0 0;
  background: rgba(113,139,45,.26);
  transform: rotate(-3deg);
  pointer-events: none;
}
.hero-card::after {
  width: 176px;
  height: 176px;
  right: -54px;
  top: -81px;
  border: 35px solid rgba(244,237,213,.13);
}
.eyebrow {
  color: #e7cc86;
  letter-spacing: .19em;
}
.hero-copy h1 {
  color: #fffdf3;
  text-shadow: 0 2px 0 rgba(0,0,0,.08);
}
.hero-copy p { color: #d5e7e8; }
.call-search {
  padding: 7px 8px 8px;
  border: 1px solid rgba(244,237,213,.18);
  border-radius: 13px;
  background: rgba(4,48,59,.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.call-search label { color: #f4edd5; }
.input-wrap {
  border: 1px solid rgba(213,174,81,.62);
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px rgba(8,75,88,.08), 0 4px 12px rgba(0,0,0,.08);
}
.input-wrap:focus-within {
  border-color: #e7c66f;
  box-shadow: 0 0 0 3px rgba(213,174,81,.22), 0 5px 14px rgba(0,0,0,.09);
}
.primary-btn {
  color: #17383f;
  background: linear-gradient(180deg, #e5c46d, #d5ae51);
  border: 1px solid #efd58e;
  box-shadow: 0 8px 20px rgba(5,42,49,.25);
}
.primary-btn:hover {
  color: #092f37;
  background: linear-gradient(180deg, #edd184, #dfba5d);
}
.secondary-btn {
  color: var(--primary-dark);
  background: #fffdf6;
  border-color: #c8d9d5;
  box-shadow: 0 3px 10px rgba(8,63,75,.06);
}
.secondary-btn:hover {
  border-color: var(--gold);
  background: #fff8e5;
}
.icon-btn {
  color: var(--primary-dark);
  background: #edf6f5;
  border-color: #c9dcda;
}
.icon-btn:hover { background: #dff0f1; border-color: var(--sky); }

.message {
  background: #fffdf6;
  border-left-color: var(--gold);
  box-shadow: var(--shadow);
}
.results { margin-top: 11px; }
.result-kicker { color: var(--primary); }
.result-heading h2 { color: var(--primary-dark); }

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 70px;
  border-color: #d6e3df;
  background: linear-gradient(180deg, #fffef9, #fbf8ed);
  box-shadow: 0 8px 22px rgba(8,63,75,.08);
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}
.stat-card:nth-child(2)::before { background: var(--gold); }
.stat-card:nth-child(3)::before { background: var(--sky); }
.stat-card:nth-child(4)::before { background: var(--olive); }
.stat-card:nth-child(5)::before { background: #b98f42; }
.stat-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sky-soft);
  box-shadow: inset 0 0 0 1px rgba(8,75,88,.09);
  font-size: 19px;
}
.stat-card strong { color: var(--primary-dark); }
.stat-card small { color: #718184; }

.filter-card, .map-card, .list-card, .timeline-card {
  border-color: #ccdcd8;
  background: #fffdf8;
  box-shadow: 0 10px 28px rgba(8,63,75,.08);
}
.filter-card {
  border-top: 3px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(244,237,213,.54), rgba(255,253,248,.96) 44%);
}
.filter-title strong { color: var(--primary-dark); }
.filter-title button { color: var(--gold-dark); }
.filter-title button:hover { color: var(--primary-dark); }
.filters-grid label { color: #5c7275; }
.filters-grid select, .filters-grid input, #sortSelect {
  color: var(--ink);
  border-color: #c8d9d5;
  background: #fffef9;
}
.filters-grid select:focus, .filters-grid input:focus, #sortSelect:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(213,174,81,.18);
}

.card-header {
  position: relative;
  color: var(--primary-dark);
  background: linear-gradient(180deg, #f7fbfa, #eef5f3);
  border-bottom-color: #ccddd8;
}
.card-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gold);
}
.card-header strong { letter-spacing: .005em; }
.card-header small { color: #6d8081; }
#map { background: #d9e8e7; }
.map-legend {
  color: #627779;
  background: #faf7e9;
  border-top-color: #dfd7bd;
}
.dot-once { background: var(--primary); }
.dot-repeat { background: var(--gold); }

th {
  color: #f7f1dc;
  background: #0c5662;
  border-bottom-color: #d2b15f;
}
td { border-bottom-color: #e5ece9; }
tbody tr:nth-child(even) { background: rgba(223,240,241,.22); }
tbody tr:hover, tbody tr.is-selected {
  background: #fff4d6;
  box-shadow: inset 4px 0 0 var(--gold);
}
.ref-link { color: var(--primary); }
.ref-link:hover { color: var(--primary-dark); }
.count-pill {
  color: #5f4917;
  background: #f6e7b9;
  border: 1px solid #e3ca83;
}
.country-badge {
  color: #2f5960;
  background: #e6f1ef;
  border: 1px solid #c8dfdc;
}
.data-note { color: #718184; }
footer { color: #6d8081; }
footer a { color: var(--primary); font-weight: 800; }

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(213,174,81,.6);
  box-shadow: 0 14px 38px rgba(8,63,75,.23);
}
.leaflet-popup-tip { background: #fffdf8; }
.leaflet-container a.leaflet-popup-close-button { color: var(--primary-dark); }
.leaflet-container a.leaflet-popup-close-button:hover {
  color: #17383f;
  background: var(--gold);
}
.map-popup .popup-ref, .map-popup .popup-link { color: var(--primary); }
.map-popup .popup-link:hover { color: var(--gold-dark); }
.marker-pin {
  background: var(--primary);
  border-color: #fffdf4;
  box-shadow: 0 5px 14px rgba(4,48,59,.38), 0 0 0 1px rgba(8,63,75,.22);
}
.marker-pin.repeat {
  background: var(--gold);
  box-shadow: 0 5px 14px rgba(91,67,17,.32), 0 0 0 1px rgba(125,90,22,.18);
}
.marker-pin.repeat span { color: #18383d; text-shadow: none; }
.marker-pin.marker-once::after { background: #fff7dc; }

.reference-modal__backdrop { background: rgba(2,37,44,.76); }
.reference-modal__dialog {
  border-color: rgba(213,174,81,.58);
  background: #fffdf8;
}
.reference-modal__header {
  color: #fffdf4;
  background: linear-gradient(90deg, #073e49, #0d6570);
  border-bottom-color: var(--gold);
}
.reference-modal__header small { color: #c8e3e7; }
.reference-modal__close { border-color: rgba(244,237,213,.35); }
.reference-modal__close:hover { color: #17383f; background: var(--gold); }

@media (max-width: 760px) {
  .site-header { border-bottom-width: 3px; }
  .hero-card { background: linear-gradient(145deg, #073e49, #0d6570); }
  .call-search { padding: 6px; }
  .stat-card::before { width: 3px; }
}

/* ========================================================================
   TOTA DESIGN · v3.0
   Unified cream / gold / blue portal styling matching TOTA Mission Control.
   ======================================================================== */
:root {
  --bg: #f6d881;
  --card: #fff9e8;
  --ink: #172941;
  --muted: #687080;
  --line: #e2b55d;
  --primary: #0872df;
  --primary-dark: #0559b8;
  --navy: #172941;
  --gold: #e6a92f;
  --gold-dark: #b7790c;
  --sky: #3f96ee;
  --sky-soft: #eaf5ff;
  --cream: #fff6d5;
  --olive: #4d8d37;
  --shadow: 0 10px 25px rgba(112, 76, 13, .14);
  --radius: 14px;
}

html { background: #e6b24f; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 1%, rgba(255,255,255,.65), transparent 28rem),
    linear-gradient(135deg, #fff9dc 0%, #f5d583 47%, #e1ab48 100%);
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
}
body::before { display: none; }

.site-header {
  width: min(1360px, calc(100% - 24px));
  min-height: 76px;
  margin: 6px auto 0;
  padding: 6px 20px;
  display: grid;
  grid-template-columns: 86px minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  background:
    radial-gradient(circle at 49% 100%, rgba(255,255,255,.72), transparent 42%),
    linear-gradient(180deg, #fff9df 0%, #fbe4a4 100%);
  border: 1px solid #e5af48;
  border-bottom: 1px solid #dca02e;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 20px rgba(121,79,7,.12);
}
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 72px;
  text-decoration: none;
}
.brand-logo img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(70,46,4,.18));
}
.portal-title {
  justify-self: center;
  color: #172941;
  font-size: clamp(24px, 2.25vw, 32px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 #fff;
  white-space: nowrap;
}
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.lang-switch button {
  min-width: 39px;
  padding: 7px 9px;
  border: 1px solid #0872df;
  border-radius: 7px;
  color: #075bb9;
  background: linear-gradient(180deg, #fffef8, #fff4c8);
  box-shadow: 0 2px 5px rgba(31,88,155,.12);
  font-weight: 900;
}
.lang-switch button:hover {
  color: #fff;
  background: #2a86e7;
  border-color: #126ed0;
}
.lang-switch button.is-active {
  color: #fff;
  background: linear-gradient(180deg, #2a87ef, #0868cf);
  border-color: #0868cf;
  box-shadow: 0 5px 12px rgba(8,104,207,.27);
}

.page-shell {
  width: min(1360px, calc(100% - 24px));
  margin: 12px auto 18px;
}
.hero-card {
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(430px, 1.18fr);
  gap: 22px;
  align-items: center;
  padding: 12px 16px;
  color: var(--ink);
  background:
    radial-gradient(circle at 68% 135%, rgba(255,219,113,.27), transparent 32rem),
    linear-gradient(180deg, #fffef8 0%, #fff4d1 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.95);
}
.hero-card::after { display: none; }
.hero-copy, .call-search { position: relative; z-index: auto; }
.eyebrow {
  margin-bottom: 3px;
  color: #73510d;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .16em;
}
.hero-copy h1 {
  margin: 0 0 3px;
  color: #172941;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.05;
  text-shadow: 0 1px 0 #fff;
}
.hero-copy p {
  margin: 0;
  color: #596477;
  font-size: 12px;
  line-height: 1.25;
}
.call-search label {
  margin-bottom: 4px;
  color: #172941;
  font-size: 12px;
  font-weight: 900;
}
.search-row { gap: 9px; }
.input-wrap {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #dca94c;
  border-radius: 10px;
  background: #fffdf7;
  box-shadow: inset 0 1px 4px rgba(138,89,5,.09), 0 0 0 2px rgba(255,224,128,.25);
}
.input-wrap input {
  min-height: 40px;
  color: #172941;
  font-size: 18px;
  letter-spacing: .04em;
}
.input-wrap input::placeholder {
  color: #7b7b75;
  opacity: 1;
  text-transform: none;
  letter-spacing: 0;
}
.primary-btn {
  min-height: 42px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(180deg, #2b8df0 0%, #0868d0 100%);
  border: 1px solid #075bb6;
  border-radius: 9px;
  box-shadow: 0 5px 12px rgba(8,104,207,.24), inset 0 1px 0 rgba(255,255,255,.28);
}
.primary-btn:hover { background: linear-gradient(180deg, #167de5, #055bbd); }
.secondary-btn {
  color: #075ebf;
  background: linear-gradient(180deg, #fffef8, #fff4c8);
  border: 1px solid #2f86df;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(31,88,155,.09);
}
.secondary-btn:hover {
  color: #fff;
  background: #1a7ddd;
  border-color: #0967c7;
}
.icon-btn {
  color: #075ebf;
  background: linear-gradient(180deg, #fffef8, #fff2c1);
  border: 1px solid #2f86df;
  border-radius: 8px;
}

.message {
  color: var(--ink);
  background: #fff9e6;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow);
}
.message.loading { border-left-color: #d89218; }

.results { margin-top: 10px; }
.result-heading {
  margin-bottom: 8px;
  padding: 8px 12px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,244,204,.76));
  border: 1px solid rgba(222,169,72,.72);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.result-kicker { color: #775614; }
.result-heading h2 {
  margin: 1px 0 0;
  color: #172941;
  font-size: clamp(26px, 2.7vw, 36px);
}
.matched-calls { color: #6b7180; }

.stats-grid { gap: 9px; }
.stat-card {
  min-height: 74px;
  padding: 9px 12px;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 15%, rgba(255,255,255,.95), transparent 9rem),
    linear-gradient(180deg, #fffef8, #fff0bd);
  border: 1px solid #e0aa4e;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 #fff, 0 5px 12px rgba(119,78,7,.09);
}
.stat-card:nth-child(1) { border-top: 3px solid #d33c3c; }
.stat-card:nth-child(2) { border-top: 3px solid #e09819; }
.stat-card:nth-child(3) { border-top: 3px solid #0872df; }
.stat-card:nth-child(4) { border-top: 3px solid #3f923f; }
.stat-card:nth-child(5) { border-top: 3px solid #7553b8; }
.stat-card small { color: #667080; }

.filter-card, .map-card, .list-card, .timeline-card {
  border: 1px solid #dfaa4d;
  border-radius: 13px;
  background: linear-gradient(180deg, #fffdf6, #fff6d8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 7px 18px rgba(117,77,8,.11);
}
.filter-card { padding: 9px 12px 10px; }
.filter-title {
  margin-bottom: 7px;
  color: #2a2418;
}
.filter-title button {
  color: #075ebf;
  font-weight: 850;
}
.filters-grid label { color: #6c5d3e; }
.filters-grid select, .filters-grid input, #sortSelect {
  min-height: 35px;
  color: var(--ink);
  border: 1px solid #ddb05d;
  border-radius: 8px;
  background: #fffef8;
  box-shadow: inset 0 1px 3px rgba(124,79,4,.06);
}
.filters-grid select:focus, .filters-grid input:focus, #sortSelect:focus {
  border-color: #1476d5;
  box-shadow: 0 0 0 3px rgba(20,118,213,.14);
}

.content-grid { gap: 10px; }
.card-header {
  min-height: 47px;
  padding: 8px 12px;
  color: #251f13;
  background: linear-gradient(180deg, #fffef7 0%, #fff0bd 100%);
  border-bottom: 1px solid #dfad51;
}
.card-header strong { font-size: 14px; }
.card-header small { color: #6c7180; }
#map { background: #d7e7d5; }
.map-legend {
  color: #6a604d;
  background: #fff3c8;
  border-top: 1px solid #dfad51;
}
.dot-once { background: #0872df; }
.dot-repeat { background: #df9517; }

.table-wrap { background: rgba(255,255,255,.58); }
table { color: #172941; }
th {
  color: #5a4723;
  background: linear-gradient(180deg, #fff7dd, #ffecb3);
  border-bottom: 1px solid #dda94a;
}
td { border-bottom: 1px solid #ecd8aa; }
tbody tr:hover, tbody tr.is-selected { background: #fff0bd; }
.ref-link { color: #075ebf; }
.count-pill {
  color: #6f4605;
  background: #ffe49a;
  border: 1px solid #e8bb54;
}
.empty-filtered { color: #6c7180; }

.mini-badge, .country-badge {
  color: #26384c;
  background: #edf4f8;
  border: 1px solid rgba(7,94,191,.13);
}
.data-note { color: #6e654f; }

.leaflet-popup-content-wrapper {
  background: #fff9e6;
  border: 1px solid #dda94a;
  box-shadow: 0 12px 32px rgba(72,49,8,.24);
}
.leaflet-popup-tip { background: #fff9e6; }
.leaflet-container a.leaflet-popup-close-button {
  color: #075ebf;
  background: #fff0bd;
  border: 1px solid #d9a44a;
}
.leaflet-container a.leaflet-popup-close-button:hover { background: #0872df; }
.map-popup .popup-ref, .map-popup .popup-link { color: #075ebf; }
.marker-pin { background: #0872df; }
.marker-pin.repeat { background: #df9517; }

.reference-modal__backdrop { background: rgba(32, 24, 10, .72); }
.reference-modal__dialog {
  border: 1px solid #e1ae4e;
  background: #fff9e6;
}
.reference-modal__header {
  color: #172941;
  background: linear-gradient(180deg, #fff7d2, #f1c86d);
  border-bottom: 2px solid #0872df;
}
.reference-modal__header small { color: #72571b; }
.reference-modal__close {
  color: #075ebf;
  background: #fff8dc;
  border: 1px solid #1a78d6;
}
.reference-modal__close:hover { color: #fff; background: #0872df; }
.reference-modal iframe { background: #fffdf6; }

footer {
  width: min(1360px, calc(100% - 24px));
  margin: 0 auto 16px;
  padding: 7px 12px;
  color: #4e432e;
  text-align: left;
  background: linear-gradient(180deg, #fff4c6, #f7d77e);
  border: 1px solid #dda94a;
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  font-size: 11px;
}
footer a { color: #075ebf; font-weight: 800; }

@media (min-width: 1181px) and (max-height: 900px) {
  .site-header { min-height: 68px; }
  .brand-logo img { width: 54px; height: 54px; }
  .hero-card { padding-top: 9px; padding-bottom: 9px; }
  .hero-copy h1 { font-size: clamp(20px, 1.8vw, 25px); }
  .stat-card { min-height: 68px; }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 64px 1fr;
    min-height: auto;
    padding: 7px 12px 9px;
  }
  .brand-logo { width: 58px; }
  .brand-logo img { width: 54px; height: 54px; }
  .portal-title { justify-self: start; font-size: clamp(21px, 5vw, 28px); }
  .lang-switch { grid-column: 1 / -1; justify-content: center; }
  .hero-card { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 760px) {
  .site-header { width: calc(100% - 12px); margin-top: 4px; }
  .page-shell, footer { width: calc(100% - 12px); }
  .portal-title { white-space: normal; }
  .lang-switch button { min-width: 38px; padding: 6px 8px; }
  .hero-card { padding: 12px; }
  .result-heading { align-items: flex-start; }
}

@media (max-width: 460px) {
  .portal-title { font-size: 20px; }
  .brand-logo img { width: 48px; height: 48px; }
  .site-header { grid-template-columns: 54px 1fr; }
  .lang-switch { gap: 4px; }
  .lang-switch button { min-width: 34px; padding: 5px 6px; font-size: 12px; }
}

/* ========================================================================
   TOTA DESIGN · v3.2 · BALANCED WIDTH
   Keeps the v3.0 appearance with a balanced desktop width.
   ======================================================================== */
.site-header,
.page-shell,
footer {
  width: min(1580px, calc(100% - 48px));
}

@media (max-width: 760px) {
  .site-header,
  .page-shell,
  footer {
    width: calc(100% - 12px);
  }
}

/* v3.3 – výraznější volací značka operátora */
.result-heading h2#resultCall {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 44px;
  margin: 3px 0 1px;
  padding: 4px 16px 5px;
  color: #ffffff;
  background: linear-gradient(180deg, #2f91ef 0%, #0967c9 100%);
  border: 1px solid #0759ad;
  border-left: 5px solid #e2a92d;
  border-radius: 9px;
  box-shadow:
    0 5px 12px rgba(8, 88, 175, .20),
    inset 0 1px 0 rgba(255,255,255,.30);
  font-size: clamp(29px, 2.8vw, 39px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: .055em;
  text-shadow: 0 1px 2px rgba(0,0,0,.24);
}

@media (max-width: 720px) {
  .result-heading h2#resultCall {
    min-height: 39px;
    padding: 4px 12px;
    font-size: 28px;
  }
}

/* ========================================================================
   TOTA ACTIVATIONS · v3.4
   Jemnější CALL, sjednocené statistiky, seskupování markerů,
   propojení historie s mapou a funkční zvětšení mapy.
   ======================================================================== */

/* CALL zůstává výrazný, ale už nepůsobí jako klikací tlačítko. */
.result-heading h2#resultCall {
  display: inline-block;
  min-height: 0;
  margin: 2px 0 0;
  padding: 2px 18px 4px 13px;
  color: #12325a;
  background: linear-gradient(90deg, rgba(42,135,239,.13), rgba(255,255,255,0) 92%);
  border: 0;
  border-left: 5px solid #1479d8;
  border-bottom: 2px solid #d9a441;
  border-radius: 0 7px 7px 0;
  box-shadow: none;
  font-size: clamp(30px, 2.65vw, 38px);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: .045em;
  text-shadow: 0 1px 0 #fff;
}

/* Všechny statistiky používají shodný TOTA vzhled. */
.stat-card,
.stat-card:nth-child(1),
.stat-card:nth-child(2),
.stat-card:nth-child(3),
.stat-card:nth-child(4),
.stat-card:nth-child(5) {
  border-top: 1px solid #e0aa4e;
}
.stat-card::before,
.stat-card:nth-child(1)::before,
.stat-card:nth-child(2)::before,
.stat-card:nth-child(3)::before,
.stat-card:nth-child(4)::before,
.stat-card:nth-child(5)::before {
  width: 4px;
  background: linear-gradient(180deg, #2588e6, #0868c9);
}
.stat-card .stat-icon {
  color: #12325a;
  background: linear-gradient(180deg, #f8fbff, #e7f2fb);
  border: 1px solid rgba(20,121,216,.18);
}
.stat-card strong { color: #0b5fb6; }

/* Historie reaguje jako aktivní ovládací prvek mapy. */
#historyTableBody tr,
#towerTableBody tr { cursor: pointer; }
#historyTableBody tr.row-pulse,
#towerTableBody tr.row-pulse {
  animation: tota-row-pulse .9s ease-out;
}
@keyframes tota-row-pulse {
  0% { background: #f6cf68; box-shadow: inset 4px 0 0 #0872df; }
  55% { background: #fff0bd; box-shadow: inset 4px 0 0 #0872df; }
  100% { background: transparent; box-shadow: inset 0 0 0 transparent; }
}

/* O něco úspornější štítky v historii. */
.history-card .mini-badge {
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.35;
}

/* TOTA seskupení rozhleden při oddálení mapy. */
.tota-cluster-icon { background: transparent; border: 0; }
.tota-cluster {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 4px solid rgba(255,255,255,.96);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #2f91ef 0%, #0866c7 100%);
  box-shadow:
    0 5px 14px rgba(23,62,108,.34),
    0 0 0 3px rgba(226,169,45,.72);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}
.tota-cluster.cluster-medium {
  background: linear-gradient(180deg, #e8ae2b, #c67c09);
}
.tota-cluster.cluster-large {
  background: linear-gradient(180deg, #1d6f78, #094a55);
}
.marker-flash .marker-pin {
  animation: tota-marker-flash 1.25s ease-out;
}
@keyframes tota-marker-flash {
  0%, 100% { transform: rotate(-45deg) scale(1); filter: none; }
  20% { transform: rotate(-45deg) scale(1.45); filter: drop-shadow(0 0 8px #ffe16a); }
  45% { transform: rotate(-45deg) scale(1.05); }
  68% { transform: rotate(-45deg) scale(1.3); filter: drop-shadow(0 0 6px #ffe16a); }
}

/* Tlačítko ⛶ nyní skutečně otevře mapu přes obrazovku. */
.map-expand-btn span {
  display: block;
  line-height: 1;
  font-size: 19px;
}
body.map-expanded-open { overflow: hidden; }
.map-card.is-map-expanded {
  position: fixed;
  inset: 10px;
  z-index: 4200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin: 0;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 26px 90px rgba(45,31,7,.48);
}
.map-card.is-map-expanded #map {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
}
.map-card.is-map-expanded .map-expand-btn {
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(180deg, #e04a3f, #b92520);
  border-color: #9d211c;
}
.map-card.is-map-expanded .map-expand-btn span { font-size: 25px; }

@media (max-width: 720px) {
  .result-heading h2#resultCall {
    padding: 2px 12px 4px 10px;
    font-size: 28px;
  }
  .map-card.is-map-expanded { inset: 4px; border-radius: 10px; }
}


/* ========================================================================
   TOTA ACTIVATIONS · v3.5
   Oprava: tlačítko mapy znovu přizpůsobí výřez všem bodům (ne fullscreen).
   CALL je čistý a výrazný bez podtržení a vzhledu tlačítka.
   ======================================================================== */

/* Čistý řádek Operátor + CALL. */
.result-heading > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.result-heading .result-kicker {
  flex: 0 0 auto;
  margin: 0;
}
.result-heading h2#resultCall {
  display: inline-block;
  min-height: 0;
  margin: 0;
  padding: 0 0 1px 12px;
  color: #12325a;
  background: transparent;
  border: 0;
  border-left: 4px solid #1479d8;
  border-radius: 0;
  box-shadow: none;
  font-size: clamp(30px, 2.5vw, 38px);
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: .045em;
  text-shadow: 0 1px 0 rgba(255,255,255,.95);
}
.result-heading .matched-calls {
  flex-basis: 100%;
}

/* Tlačítko pouze vrací mapu na všechny zobrazené body. */
.map-expand-btn {
  color: #075ebf;
  background: #fffdf4;
  border-color: #2c86dd;
}
.map-expand-btn:hover {
  color: #fff;
  background: #0872df;
  border-color: #075ebf;
}
.map-expand-btn span {
  font-size: 19px;
}

/* Ruší fullscreen vrstvu zavedenou ve v3.4. */
body.map-expanded-open { overflow: auto; }
.map-card.is-map-expanded {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  margin-top: 10px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(23,32,51,.07);
}
.map-card.is-map-expanded #map {
  height: clamp(370px, calc(100vh - 486px), 580px) !important;
  min-height: 370px !important;
}
.map-card.is-map-expanded .map-expand-btn {
  width: 38px;
  height: 38px;
  color: #075ebf;
  background: #fffdf4;
  border-color: #2c86dd;
}
.map-card.is-map-expanded .map-expand-btn span { font-size: 19px; }

@media (max-width: 720px) {
  .result-heading h2#resultCall {
    padding-left: 10px;
    font-size: 28px;
  }
}


/* ========================================================================
   TOTA ACTIVATIONS · v3.6
   Stabilní zvětšení mapy + klidné vystředění z historie aktivací.
   ======================================================================== */
body.map-expanded-open {
  overflow: hidden !important;
}
body.map-expanded-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4990;
  background: rgba(24, 35, 51, .72);
  backdrop-filter: blur(2px);
}
.map-card.is-map-expanded {
  position: fixed !important;
  inset: 14px !important;
  z-index: 5000 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 2px solid #d99a25 !important;
  border-radius: 14px !important;
  background: #fff9e7 !important;
  box-shadow: 0 28px 90px rgba(20, 29, 44, .52) !important;
}
.map-card.is-map-expanded #map {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}
.map-card.is-map-expanded .card-header {
  min-height: 52px;
}
.map-card.is-map-expanded .map-legend {
  min-height: 36px;
}
.map-card.is-map-expanded .map-expand-btn {
  width: 40px !important;
  height: 40px !important;
  color: #fff !important;
  background: linear-gradient(180deg, #2f91ef 0%, #0866c7 100%) !important;
  border-color: #075ebf !important;
  box-shadow: 0 4px 12px rgba(15, 80, 155, .28) !important;
}
.map-card.is-map-expanded .map-expand-btn:hover {
  background: linear-gradient(180deg, #147bd8 0%, #0758ae 100%) !important;
}
.map-card.is-map-expanded .map-expand-btn span {
  font-size: 22px !important;
}
#historyTableBody tr {
  cursor: pointer;
}
#historyTableBody tr.is-selected td {
  background: #fff0bf !important;
}

@media (max-width: 720px) {
  .map-card.is-map-expanded {
    inset: 5px !important;
    border-radius: 9px !important;
  }
}

/* ========================================================================
   TOTA ACTIVATIONS · v3.7 · VYŠŠÍ KONTRAST TOTA DESIGNU
   Pouze barevné a kontrastní úpravy podle referenčního tota-theme.css.
   Rozložení, rozměry a funkce zůstávají beze změny.
   ======================================================================== */
:root {
  --bg: #cb8f2f;
  --card: #f4e6c1;
  --ink: #102039;
  --muted: #4b4338;
  --line: #b87c20;
  --primary: #075ebd;
  --primary-dark: #0c4f8f;
  --navy: #102039;
  --gold: #d29a27;
  --gold-dark: #8e5c0e;
  --sky: #167bd5;
  --sky-soft: #d8e9f3;
  --cream: #f4e4bd;
  --olive: #197b3b;
  --shadow: 0 12px 30px rgba(76,45,7,.24);
}

html { background: #c88c2e; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(255,244,207,.48), transparent 29%),
    radial-gradient(circle at 84% 6%, rgba(255,225,137,.34), transparent 24%),
    linear-gradient(180deg, #e8c36f 0%, #dba94d 38%, #c88c2e 100%) fixed;
}

.site-header {
  color: var(--ink);
  background:
    radial-gradient(circle at 49% 100%, rgba(255,255,255,.42), transparent 42%),
    linear-gradient(180deg, #f5e7bf 0%, #e7c477 100%);
  border-color: #b97b1e;
  box-shadow: 0 7px 22px rgba(73,43,5,.25), inset 0 1px 0 rgba(255,255,255,.72);
}
.brand-logo img { filter: drop-shadow(0 3px 5px rgba(70,46,4,.26)); }
.portal-title { color: var(--ink); }
.lang-switch button {
  color: #0759a7;
  background: #ead8aa;
  border-color: #1475cb;
  box-shadow: 0 2px 6px rgba(67,42,6,.13);
}
.lang-switch button:hover {
  color: #fff;
  background: linear-gradient(180deg, #2487df, #075ebd);
  border-color: #075ebd;
}
.lang-switch button.is-active {
  color: #fff;
  background: linear-gradient(180deg, #2487df, #075ebd);
  border-color: #075ebd;
  box-shadow: 0 5px 12px rgba(5,91,178,.28);
}

.hero-card {
  color: var(--ink);
  background:
    radial-gradient(circle at 68% 135%, rgba(208,156,48,.24), transparent 32rem),
    linear-gradient(180deg, #f4e6c1 0%, #e9cd91 100%);
  border-color: #b87c20;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.64);
}
.eyebrow { color: #744b09; }
.hero-copy h1 { color: var(--ink); }
.hero-copy p { color: #4b4338; }
.call-search {
  background: rgba(218,183,104,.45);
  border-color: rgba(155,99,20,.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.call-search label { color: var(--ink); }
.input-wrap {
  background: #f8edcf;
  border-color: #b98028;
  box-shadow: inset 0 1px 4px rgba(84,50,7,.13), 0 0 0 2px rgba(214,155,34,.16);
}
.input-wrap:focus-within {
  border-color: #167bd5;
  box-shadow: 0 0 0 3px rgba(22,123,213,.17), 0 5px 14px rgba(73,43,5,.12);
}
.input-wrap input { color: var(--ink); }
.input-wrap input::placeholder { color: #675d4e; }
.primary-btn {
  color: #fff;
  background: linear-gradient(180deg, #2487df, #075ebd);
  border-color: #0753a6;
  box-shadow: 0 6px 14px rgba(5,91,178,.27), inset 0 1px 0 rgba(255,255,255,.22);
}
.primary-btn:hover { background: linear-gradient(180deg, #167bd5, #064f9e); }
.secondary-btn,
.icon-btn,
.map-expand-btn {
  color: #0759a7;
  background: #ead8aa;
  border-color: #1475cb;
  box-shadow: 0 3px 8px rgba(75,45,8,.11);
}
.secondary-btn:hover,
.icon-btn:hover,
.map-expand-btn:hover {
  color: #fff;
  background: linear-gradient(180deg, #2487df, #075ebd);
  border-color: #075ebd;
}

.message {
  color: var(--ink);
  background: #ead39f;
  border-color: #b98432;
  box-shadow: 0 8px 22px rgba(75,45,8,.17);
}
.result-heading {
  background: linear-gradient(180deg, #f4e6c1 0%, #e9cd91 100%);
  border-color: #b87c20;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.60), 0 6px 15px rgba(75,45,8,.13);
}
.result-kicker { color: #68440b; }
.result-heading h2,
.result-heading h2#resultCall { color: var(--ink); }
.matched-calls { color: var(--muted); }

.stat-card,
.stat-card:nth-child(1),
.stat-card:nth-child(2),
.stat-card:nth-child(3),
.stat-card:nth-child(4),
.stat-card:nth-child(5) {
  color: var(--ink);
  background: linear-gradient(180deg, #f3e3bb 0%, #e7c986 100%);
  border-color: #b98128;
  border-top-color: #b98128;
  box-shadow: 0 7px 17px rgba(76,45,7,.17), inset 0 1px 0 rgba(255,255,255,.66);
}
.stat-card::before,
.stat-card:nth-child(1)::before,
.stat-card:nth-child(2)::before,
.stat-card:nth-child(3)::before,
.stat-card:nth-child(4)::before,
.stat-card:nth-child(5)::before {
  background: linear-gradient(180deg, #167bd5, #075ebd);
}
.stat-card .stat-icon {
  color: var(--ink);
  background: #d8e2e5;
  border-color: #b5c5c8;
}
.stat-card strong { color: #075ebd; }
.stat-card small { color: var(--muted); }

.filter-card,
.map-card,
.list-card,
.timeline-card {
  color: var(--ink);
  background: linear-gradient(180deg, #f4e6c1 0%, #e9cd91 100%);
  border-color: #b87c20;
  box-shadow: 0 10px 24px rgba(75,45,8,.19), inset 0 1px 0 rgba(255,255,255,.62);
}
.filter-title { color: var(--ink); }
.filter-title button { color: #075ebd; }
.filters-grid label { color: #514634; }
.filters-grid select,
.filters-grid input,
#sortSelect {
  color: var(--ink);
  background: #f8edcf;
  border-color: #b98028;
  box-shadow: inset 0 1px 3px rgba(84,50,7,.10);
}
.filters-grid select:focus,
.filters-grid input:focus,
#sortSelect:focus {
  border-color: #167bd5;
  box-shadow: 0 0 0 3px rgba(22,123,213,.16);
}

.card-header {
  color: var(--ink);
  background: linear-gradient(180deg, #ead19a 0%, #dcb567 100%);
  border-bottom-color: #a86d17;
}
.card-header::before { background: #075ebd; }
.card-header small { color: #51483c; }
.map-legend {
  color: #4b4338;
  background: #dfc17d;
  border-top-color: #a86d17;
}

.table-wrap { background: #eed8a5; }
table { color: #17283f; }
th {
  color: #18263a;
  background: linear-gradient(180deg, #ead19a, #dcb567);
  border-bottom-color: #a86d17;
  text-shadow: none;
}
td {
  color: #17283f;
  background: #f2e2bc;
  border-bottom-color: rgba(145,91,15,.36);
}
tbody tr:nth-child(even) td { background: #e8cf98; }
tbody tr:hover td,
tbody tr.is-selected td {
  background: #cfe4f5;
  box-shadow: inset 4px 0 0 #075ebd;
}
.ref-link { color: #075ebd; }
.ref-link:hover { color: #0c4f8f; }
.count-pill {
  color: #744900;
  background: #efd475;
  border-color: #b77b14;
}
.empty-filtered,
.data-note,
footer { color: var(--muted); }

.mini-badge,
.country-badge {
  color: #17385e;
  background: #d8e9f3;
  border-color: #8ab5d0;
}
.country-flag { border-color: rgba(63,45,16,.34); }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #f3e3bb;
}
.leaflet-popup-content-wrapper {
  border-color: #b87c20;
  box-shadow: 0 14px 38px rgba(76,45,7,.30);
}
.leaflet-container a.leaflet-popup-close-button {
  color: #075ebd;
  background: #e8ce94;
  border-color: #b87c20;
}
.leaflet-container a.leaflet-popup-close-button:hover {
  color: #fff;
  background: #075ebd;
}
.map-popup .popup-ref,
.map-popup .popup-link { color: #075ebd; }
.map-popup .popup-meta { color: #4b4338; }
.map-popup .popup-meta strong { color: var(--ink); }
.marker-pin { background: #075ebd; }
.marker-pin.repeat { background: #b87513; }
.tota-cluster {
  background: linear-gradient(180deg, #2487df, #075ebd);
  box-shadow: 0 5px 14px rgba(23,62,108,.34), 0 0 0 3px rgba(184,117,19,.75);
}
.tota-cluster.cluster-medium { background: linear-gradient(180deg, #d49a26, #a8660b); }
.tota-cluster.cluster-large { background: linear-gradient(180deg, #17385e, #102039); }

.reference-modal__backdrop { background: rgba(31,22,8,.76); }
.reference-modal__dialog {
  background: #f3e3bb;
  border-color: #b87c20;
}
.reference-modal__header {
  color: var(--ink);
  background: linear-gradient(180deg, #ead19a, #dcb567);
  border-bottom-color: #075ebd;
}
.reference-modal__header small { color: #51483c; }
.reference-modal__close {
  color: #075ebd;
  background: #ead8aa;
  border-color: #1475cb;
}
.reference-modal__close:hover { color: #fff; background: #075ebd; }
.reference-modal iframe { background: #f4e6c1; }

footer {
  background: linear-gradient(180deg, #e8cc8b, #d6aa50);
  border-color: #af741b;
  box-shadow: 0 5px 14px rgba(75,45,8,.13), inset 0 1px 0 rgba(255,255,255,.52);
}
footer a { color: #075ebd; }

body.map-expanded-open::before {
  background: rgba(31,22,8,.75);
}
.map-card.is-map-expanded {
  background: #f3e3bb !important;
  border-color: #b87c20 !important;
  box-shadow: 0 28px 90px rgba(50,29,4,.58) !important;
}
.map-card.is-map-expanded .map-expand-btn {
  color: #fff !important;
  background: linear-gradient(180deg, #2487df, #075ebd) !important;
  border-color: #0753a6 !important;
}
#historyTableBody tr.is-selected td { background: #cfe4f5 !important; }

/* ========================================================================
   TOTA ACTIVATIONS · v3.8
   - oprava svislých modrých pruhů ve vybraném řádku
   - přepínač šesti barevných motivů
   ======================================================================== */

/* Přepínač motivů v hlavičce */
.site-header { overflow: visible; z-index: 1200; }
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}
.theme-switcher { position: relative; flex: 0 0 auto; }
.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #1475cb;
  border-radius: 50%;
  color: #102039;
  background: linear-gradient(180deg, #fff7d7, #ead19a);
  box-shadow: 0 3px 9px rgba(75,45,8,.16), inset 0 1px 0 rgba(255,255,255,.75);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.theme-toggle:hover,
.theme-toggle[aria-expanded="true"] {
  transform: translateY(-1px);
  border-color: #075ebd;
  box-shadow: 0 5px 13px rgba(5,91,178,.25), inset 0 1px 0 rgba(255,255,255,.75);
}
.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 282px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 18px;
  background: rgba(248,250,253,.97);
  box-shadow: 0 22px 55px rgba(13,26,43,.30);
  backdrop-filter: blur(14px);
  z-index: 5000;
}
.theme-menu::before {
  content: "";
  position: absolute;
  right: 13px;
  top: -7px;
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  background: rgba(248,250,253,.97);
  border-left: 1px solid rgba(255,255,255,.62);
  border-top: 1px solid rgba(255,255,255,.62);
}
.theme-menu button {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  padding: 7px 12px;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  color: #17243a;
  background: #f8f9fb;
  box-shadow: 0 2px 7px rgba(19,33,52,.06);
  text-align: left;
  cursor: pointer;
}
.theme-menu button:last-child { margin-bottom: 0; }
.theme-menu button span { font-size: 20px; text-align: center; }
.theme-menu button b { font-size: 16px; font-weight: 900; }
.theme-menu button:hover { background: #edf5ff; border-color: #8bbaf0; }
.theme-menu button.is-active {
  color: #17243a;
  background: #cfe4f5;
  border-color: #2c86ec;
  box-shadow: inset 0 0 0 1px rgba(44,134,236,.24);
}

/* Vybraný řádek: jedna linka na začátku řádku, nikoli v každé buňce. */
tbody tr:hover td { box-shadow: none !important; }
tbody tr.is-selected td,
#historyTableBody tr.is-selected td {
  box-shadow: none !important;
}
tbody tr.is-selected td:first-child,
#historyTableBody tr.is-selected td:first-child {
  box-shadow: inset 4px 0 0 var(--theme-accent, #075ebd) !important;
}

/* Barevné proměnné motivů */
body[data-theme="daylight"] {
  --theme-bg: linear-gradient(180deg,#e8c36f 0%,#dba94d 38%,#c88c2e 100%) fixed;
  --theme-header: linear-gradient(180deg,#f5e7bf 0%,#e7c477 100%);
  --theme-panel: linear-gradient(180deg,#f4e6c1 0%,#e9cd91 100%);
  --theme-panel-soft: #f1dfb4;
  --theme-input: #f8edcf;
  --theme-head: linear-gradient(180deg,#ead19a,#dcb567);
  --theme-even: #e8cf98;
  --theme-line: #b87c20;
  --theme-line-strong: #a86d17;
  --theme-ink: #102039;
  --theme-muted: #4b4338;
  --theme-accent: #075ebd;
  --theme-accent-2: #167bd5;
  --theme-accent-soft: #d8e9f3;
  --theme-gold: #b87513;
  --theme-selected: #efd88e;
  --theme-shadow: 0 12px 30px rgba(76,45,7,.24);
  --theme-footer: linear-gradient(180deg,#e8cc8b,#d6aa50);
}
body[data-theme="radio-blue"] {
  --theme-bg: radial-gradient(circle at 18% 14%,rgba(55,194,255,.16),transparent 27%),radial-gradient(circle at 75% 10%,rgba(55,118,255,.14),transparent 24%),linear-gradient(180deg,#020713 0%,#05152e 48%,#020711 100%) fixed;
  --theme-header: rgba(3,10,24,.88);
  --theme-panel: linear-gradient(180deg,#0d2144,#091a36);
  --theme-panel-soft: #102a55;
  --theme-input: #06142c;
  --theme-head: linear-gradient(180deg,#163765,#102a55);
  --theme-even: #0b2346;
  --theme-line: rgba(106,176,255,.34);
  --theme-line-strong: #2f8cff;
  --theme-ink: #f4f8ff;
  --theme-muted: #90add0;
  --theme-accent: #49c6ff;
  --theme-accent-2: #2f8cff;
  --theme-accent-soft: #17375f;
  --theme-gold: #ffd943;
  --theme-selected: #294b73;
  --theme-shadow: 0 15px 38px rgba(0,0,0,.42);
  --theme-footer: linear-gradient(180deg,#07152f,#020a18);
}
body[data-theme="outdoor"] {
  --theme-bg: radial-gradient(circle at 18% 0%,rgba(117,151,78,.20),transparent 30%),linear-gradient(180deg,#23301f 0%,#101810 58%,#0a100a 100%) fixed;
  --theme-header: linear-gradient(180deg,#283728,#1d2a1d);
  --theme-panel: linear-gradient(180deg,#283728,#1d2a1d);
  --theme-panel-soft: #203022;
  --theme-input: #111c13;
  --theme-head: linear-gradient(180deg,#394a33,#31422d);
  --theme-even: #203022;
  --theme-line: #6f8658;
  --theme-line-strong: #9bd16f;
  --theme-ink: #f1f0df;
  --theme-muted: #b9c3ae;
  --theme-accent: #9bd16f;
  --theme-accent-2: #d1ad59;
  --theme-accent-soft: #2b3b2a;
  --theme-gold: #d1ad59;
  --theme-selected: #30452e;
  --theme-shadow: 0 15px 38px rgba(0,0,0,.36);
  --theme-footer: linear-gradient(180deg,#283728,#172319);
}
body[data-theme="night-ops"] {
  --theme-bg: radial-gradient(circle at 15% 0%,rgba(255,165,47,.11),transparent 30%),linear-gradient(180deg,#101521 0%,#030509 58%,#010205 100%) fixed;
  --theme-header: linear-gradient(180deg,#1b2130,#121722);
  --theme-panel: linear-gradient(180deg,#1b2130,#121722);
  --theme-panel-soft: #171d29;
  --theme-input: #080c13;
  --theme-head: linear-gradient(180deg,#292c36,#202531);
  --theme-even: #171d29;
  --theme-line: #74633f;
  --theme-line-strong: #ffc857;
  --theme-ink: #f4f2e9;
  --theme-muted: #aaa99f;
  --theme-accent: #ffc857;
  --theme-accent-2: #ff7a55;
  --theme-accent-soft: #222834;
  --theme-gold: #ffc857;
  --theme-selected: #292a2b;
  --theme-shadow: 0 16px 42px rgba(0,0,0,.50);
  --theme-footer: linear-gradient(180deg,#171d29,#080c13);
}
body[data-theme="tactical"] {
  --theme-bg: radial-gradient(circle at 17% 0%,rgba(181,191,104,.12),transparent 29%),linear-gradient(180deg,#303326 0%,#161812 58%,#0d0f0b 100%) fixed;
  --theme-header: linear-gradient(180deg,#31362a,#25281f);
  --theme-panel: linear-gradient(180deg,#31362a,#25281f);
  --theme-panel-soft: #2b2f25;
  --theme-input: #191b16;
  --theme-head: linear-gradient(180deg,#414633,#383c2e);
  --theme-even: #2b2f25;
  --theme-line: #7c8060;
  --theme-line-strong: #c5cf77;
  --theme-ink: #efecda;
  --theme-muted: #b7b4a4;
  --theme-accent: #c5cf77;
  --theme-accent-2: #d5aa61;
  --theme-accent-soft: #35392c;
  --theme-gold: #d5aa61;
  --theme-selected: #3b4030;
  --theme-shadow: 0 15px 38px rgba(0,0,0,.40);
  --theme-footer: linear-gradient(180deg,#31362a,#20231c);
}
body[data-theme="ham-classic"] {
  --theme-bg: radial-gradient(circle at 15% 0%,rgba(56,189,248,.18),transparent 31%),linear-gradient(180deg,#172338 0%,#0b1220 58%,#060b14 100%) fixed;
  --theme-header: linear-gradient(180deg,#1e293b,#0f172a);
  --theme-panel: linear-gradient(180deg,#1e293b,#0f172a);
  --theme-panel-soft: #1b2940;
  --theme-input: #101b2f;
  --theme-head: linear-gradient(180deg,#334155,#26364d);
  --theme-even: #1b2940;
  --theme-line: #53657d;
  --theme-line-strong: #38bdf8;
  --theme-ink: #f4f7fb;
  --theme-muted: #b8c4d6;
  --theme-accent: #38bdf8;
  --theme-accent-2: #22c55e;
  --theme-accent-soft: #25364f;
  --theme-gold: #a3e635;
  --theme-selected: #29415c;
  --theme-shadow: 0 15px 38px rgba(0,0,0,.42);
  --theme-footer: linear-gradient(180deg,#1e293b,#0b1220);
}

/* Společná aplikace barevného motivu. */
body[data-theme] {
  color: var(--theme-ink);
  background: var(--theme-bg) !important;
}
body[data-theme] .site-header {
  color: var(--theme-ink);
  background: var(--theme-header) !important;
  border-color: var(--theme-line) !important;
  box-shadow: var(--theme-shadow), inset 0 1px 0 rgba(255,255,255,.18) !important;
}
body[data-theme] .portal-title,
body[data-theme] .hero-copy h1,
body[data-theme] .result-heading h2,
body[data-theme] .result-heading h2#resultCall,
body[data-theme] .filter-title,
body[data-theme] h1,
body[data-theme] h2,
body[data-theme] h3,
body[data-theme] h4 { color: var(--theme-ink) !important; }
body[data-theme] .eyebrow,
body[data-theme] .result-kicker { color: var(--theme-gold) !important; }
body[data-theme] .hero-copy p,
body[data-theme] .matched-calls,
body[data-theme] .card-header small,
body[data-theme] .data-note,
body[data-theme] .empty-filtered,
body[data-theme] .map-legend,
body[data-theme] footer { color: var(--theme-muted) !important; }
body[data-theme] .hero-card,
body[data-theme] .result-heading,
body[data-theme] .stat-card,
body[data-theme] .filter-card,
body[data-theme] .map-card,
body[data-theme] .list-card,
body[data-theme] .timeline-card {
  color: var(--theme-ink) !important;
  background: var(--theme-panel) !important;
  border-color: var(--theme-line) !important;
  box-shadow: var(--theme-shadow), inset 0 1px 0 rgba(255,255,255,.13) !important;
}
body[data-theme] .call-search {
  background: color-mix(in srgb, var(--theme-panel-soft) 75%, transparent) !important;
  border-color: var(--theme-line) !important;
}
body[data-theme] .call-search label,
body[data-theme] .filters-grid label { color: var(--theme-ink) !important; }
body[data-theme] .input-wrap,
body[data-theme] .filters-grid select,
body[data-theme] .filters-grid input,
body[data-theme] #sortSelect {
  color: var(--theme-ink) !important;
  background: var(--theme-input) !important;
  border-color: var(--theme-line) !important;
}
body[data-theme] .input-wrap input { color: var(--theme-ink) !important; }
body[data-theme] .input-wrap input::placeholder,
body[data-theme] .filters-grid input::placeholder { color: var(--theme-muted) !important; }
body[data-theme] .primary-btn,
body[data-theme] .lang-switch button.is-active {
  color: #fff !important;
  background: linear-gradient(180deg,var(--theme-accent-2),var(--theme-accent)) !important;
  border-color: var(--theme-accent) !important;
}
body[data-theme] .lang-switch button,
body[data-theme] .secondary-btn,
body[data-theme] .icon-btn,
body[data-theme] .map-expand-btn {
  color: var(--theme-accent) !important;
  background: var(--theme-panel-soft) !important;
  border-color: var(--theme-accent) !important;
}
body[data-theme] .lang-switch button:hover,
body[data-theme] .secondary-btn:hover,
body[data-theme] .icon-btn:hover,
body[data-theme] .map-expand-btn:hover {
  color: #fff !important;
  background: var(--theme-accent) !important;
}
body[data-theme] .stat-card::before { background: var(--theme-accent) !important; }
body[data-theme] .stat-card strong,
body[data-theme] .ref-link,
body[data-theme] footer a,
body[data-theme] .filter-title button { color: var(--theme-accent) !important; }
body[data-theme] .stat-card small { color: var(--theme-muted) !important; }
body[data-theme] .stat-card .stat-icon {
  color: var(--theme-ink) !important;
  background: var(--theme-accent-soft) !important;
  border-color: var(--theme-line) !important;
}
body[data-theme] .card-header,
body[data-theme] th {
  color: var(--theme-ink) !important;
  background: var(--theme-head) !important;
  border-color: var(--theme-line-strong) !important;
}
body[data-theme] .card-header::before { background: var(--theme-accent) !important; }
body[data-theme] .table-wrap { background: var(--theme-panel-soft) !important; }
body[data-theme] table { color: var(--theme-ink) !important; }
body[data-theme] td {
  color: var(--theme-ink) !important;
  background: var(--theme-panel-soft) !important;
  border-bottom-color: color-mix(in srgb, var(--theme-line) 55%, transparent) !important;
}
body[data-theme] tbody tr:nth-child(even) td { background: var(--theme-even) !important; }
body[data-theme] tbody tr:hover td { background: var(--theme-selected) !important; }
body[data-theme] tbody tr.is-selected td,
body[data-theme] #historyTableBody tr.is-selected td { background: var(--theme-selected) !important; }
body[data-theme] .map-legend {
  background: var(--theme-panel-soft) !important;
  border-color: var(--theme-line-strong) !important;
}
body[data-theme] .mini-badge,
body[data-theme] .country-badge {
  color: var(--theme-ink) !important;
  background: var(--theme-accent-soft) !important;
  border-color: var(--theme-line) !important;
}
body[data-theme] .count-pill {
  color: var(--theme-ink) !important;
  background: color-mix(in srgb, var(--theme-gold) 42%, var(--theme-panel-soft)) !important;
  border-color: var(--theme-gold) !important;
}
body[data-theme] .leaflet-popup-content-wrapper,
body[data-theme] .leaflet-popup-tip,
body[data-theme] .reference-modal__dialog {
  color: var(--theme-ink) !important;
  background: var(--theme-panel) !important;
  border-color: var(--theme-line) !important;
}
body[data-theme] .map-popup .popup-meta,
body[data-theme] .reference-modal__header small { color: var(--theme-muted) !important; }
body[data-theme] .map-popup .popup-ref,
body[data-theme] .map-popup .popup-link { color: var(--theme-accent) !important; }
body[data-theme] .reference-modal__header {
  color: var(--theme-ink) !important;
  background: var(--theme-head) !important;
  border-color: var(--theme-accent) !important;
}
body[data-theme] .reference-modal__close {
  color: var(--theme-accent) !important;
  background: var(--theme-panel-soft) !important;
  border-color: var(--theme-accent) !important;
}
body[data-theme] .marker-pin { background: var(--theme-accent) !important; }
body[data-theme] .marker-pin.repeat { background: var(--theme-gold) !important; }
body[data-theme] .tota-cluster {
  background: linear-gradient(180deg,var(--theme-accent-2),var(--theme-accent)) !important;
  box-shadow: 0 5px 14px rgba(0,0,0,.28), 0 0 0 3px color-mix(in srgb, var(--theme-gold) 75%, transparent) !important;
}
body[data-theme] footer {
  background: var(--theme-footer) !important;
  border-color: var(--theme-line) !important;
}

/* Tmavé motivy potřebují světlé texty i uvnitř štítků a ovládání. */
body[data-theme="night-ops"] .theme-toggle,
body[data-theme="tactical"] .theme-toggle {
  color: var(--theme-ink);
  background: var(--theme-panel-soft);
  border-color: var(--theme-accent);
}
body[data-theme="night-ops"] .colored-badge,
body[data-theme="tactical"] .colored-badge { text-shadow: none; }
body[data-theme="night-ops"] .reference-modal iframe,
body[data-theme="tactical"] .reference-modal iframe { background: #fff; }
body[data-theme="night-ops"] .leaflet-control-layers,
body[data-theme="tactical"] .leaflet-control-layers { color: #17243a; }

@media (max-width: 820px) {
  .site-header { grid-template-columns: 66px minmax(150px,1fr) auto !important; }
  .header-tools { gap: 6px; }
  .theme-toggle { width: 38px; height: 38px; }
  .theme-menu { width: min(282px, calc(100vw - 24px)); right: -2px; }
}
@media (max-width: 620px) {
  .header-tools { grid-column: 1 / -1; justify-content: center; width: 100%; }
  .theme-menu { right: 50%; transform: translateX(50%); }
}
html[data-theme="daylight"] { background: #c88c2e !important; }
html[data-theme="radio-blue"] { background: #10263c !important; }
html[data-theme="outdoor"] { background: #415737 !important; }
html[data-theme="night-ops"] { background: #030b13 !important; }
html[data-theme="tactical"] { background: #151913 !important; }
html[data-theme="ham-classic"] { background: #671a22 !important; }


/* ========================================================================
   TOTA ACTIVATIONS · v4.1
   Adaptivní velká mapa: zachová všechny body, ale neplýtvá šířkou obrazovky.
   ======================================================================== */
body.map-expanded-open {
  overflow: hidden !important;
}
.map-card.is-map-expanded {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  inset: auto !important;
  width: min(var(--expanded-map-width, 1380px), calc(100vw - 24px)) !important;
  height: min(var(--expanded-map-height, calc(100vh - 24px)), calc(100vh - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}
.map-card.is-map-expanded #map {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}
@media (max-width: 720px) {
  .map-card.is-map-expanded {
    width: calc(100vw - 8px) !important;
    height: calc(100vh - 8px) !important;
    max-width: calc(100vw - 8px) !important;
    max-height: calc(100vh - 8px) !important;
  }
}


/* ========================================================================
   TOTA ACTIVATIONS · v4.2
   Velká mapa přes celý monitor + detailní výřez všech viditelných bodů.
   ======================================================================== */
body.map-expanded-open {
  overflow: hidden !important;
}
.map-card.is-map-expanded {
  position: fixed !important;
  inset: 4px !important;
  top: 4px !important;
  right: 4px !important;
  bottom: 4px !important;
  left: 4px !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 5000 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}
.map-card.is-map-expanded #map {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}
@media (max-width: 720px) {
  .map-card.is-map-expanded {
    inset: 2px !important;
    top: 2px !important;
    right: 2px !important;
    bottom: 2px !important;
    left: 2px !important;
  }
}


/* ========================================================================
   TOTA ACTIVATIONS · v4.3
   Fullscreen tight-fit: mapa zůstává přes celý monitor, ale Leaflet používá
   desetinný zoom a minimální okraj, takže body vyplní maximum plochy.
   ======================================================================== */
.map-card.is-map-expanded #map {
  /* Leaflet přepočítává skutečný rozměr; CSS jen garantuje plnou plochu. */
  width: 100% !important;
  height: 100% !important;
}


/* ========================================================================
   TOTA ACTIVATIONS · v4.4
   Rychlá nápověda: automaticky pouze při první návštěvě, ručně přes ?.
   ======================================================================== */
.help-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--theme-accent, #075ebd);
  border-radius: 50%;
  color: var(--theme-accent, #075ebd);
  background: var(--theme-panel-soft, #f1dfb4);
  box-shadow: 0 3px 9px rgba(75,45,8,.16), inset 0 1px 0 rgba(255,255,255,.72);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}
.help-toggle:hover,
.help-toggle[aria-expanded="true"] {
  color: #fff;
  background: var(--theme-accent, #075ebd);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(5,91,178,.25);
}
body.help-open { overflow: hidden; }
.help-modal[hidden] { display: none; }
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 28px);
}
.help-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24,17,7,.66);
  backdrop-filter: blur(3px);
}
.help-modal__dialog {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 24px));
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
  color: var(--theme-ink, #102039);
  border: 1px solid var(--theme-line-strong, #b87c20);
  border-radius: 18px;
  background: var(--theme-panel, linear-gradient(180deg,#f4e6c1,#e9cd91));
  box-shadow: 0 30px 90px rgba(45,27,5,.48), inset 0 1px 0 rgba(255,255,255,.55);
}
.help-modal__header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 10px 18px;
  color: var(--theme-ink, #102039);
  background: var(--theme-head, linear-gradient(180deg,#ead19a,#dcb567));
  border-bottom: 2px solid var(--theme-accent, #075ebd);
}
.help-modal__header > div { display: grid; gap: 2px; min-width: 0; }
.help-modal__header small {
  color: var(--theme-muted, #51483c);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.help-modal__header strong { font-size: 20px; line-height: 1.1; }
.help-modal__close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--theme-accent, #075ebd);
  border-radius: 10px;
  color: var(--theme-accent, #075ebd);
  background: var(--theme-panel-soft, #f1dfb4);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}
.help-modal__close:hover { color: #fff; background: var(--theme-accent, #075ebd); }
.help-modal__body {
  overflow: auto;
  padding: 17px 18px 18px;
  scrollbar-width: thin;
}
.help-modal__intro {
  margin: 0 0 13px;
  color: var(--theme-muted, #51483c);
  font-size: 13px;
  font-weight: 750;
}
.help-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.help-steps li {
  min-height: 45px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--theme-line, #b87c20) 68%, transparent);
  border-radius: 11px;
  background: var(--theme-panel-soft, #f1dfb4);
  font-size: 13px;
  line-height: 1.35;
}
.help-step-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg,var(--theme-accent-2, #167bd5),var(--theme-accent, #075ebd));
  font-size: 12px;
  font-weight: 950;
}
.help-legend {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--theme-line, #b87c20) 72%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--theme-panel-soft, #f1dfb4) 82%, transparent);
}
.help-legend > strong { margin-bottom: 1px; font-size: 13px; }
.help-legend > div {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  color: var(--theme-muted, #51483c);
  font-size: 12px;
  line-height: 1.3;
}
.help-pin {
  width: 20px;
  height: 20px;
  justify-self: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--theme-accent, #075ebd);
  box-shadow: 0 2px 5px rgba(0,0,0,.23);
}
.help-pin-repeat { background: var(--theme-gold, #b87513); }
.help-cluster {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--theme-accent, #075ebd);
  box-shadow: 0 0 0 2px var(--theme-gold, #b87513);
  font-style: normal;
  font-size: 10px;
  font-weight: 950;
}
.help-modal__progress {
  display: none;
  height: 4px;
  transform-origin: left center;
  background: linear-gradient(90deg,var(--theme-accent-2, #167bd5),var(--theme-accent, #075ebd));
}
.help-modal.is-auto .help-modal__progress {
  display: block;
  animation: helpAutoClose 5s linear forwards;
}
@keyframes helpAutoClose { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 820px) {
  .help-toggle { width: 38px; height: 38px; font-size: 20px; }
}
@media (max-width: 560px) {
  .help-modal { padding: 8px; align-items: center; }
  .help-modal__dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  .help-modal__header { min-height: 56px; padding: 8px 9px 8px 13px; }
  .help-modal__header strong { font-size: 18px; }
  .help-modal__close { width: 38px; height: 38px; }
  .help-modal__body { padding: 13px 12px 14px; }
  .help-steps li { grid-template-columns: 27px minmax(0,1fr); padding: 7px 9px; font-size: 12px; }
  .help-step-icon { width: 25px; height: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  .help-modal.is-auto .help-modal__progress { animation: none; transform: scaleX(.5); }
}

/* ======================================================================
   TOTA ACTIVATIONS · SHODNÉ PALETY S TOTA PROFILE
   Pouze hodnoty barevných proměnných. Rozložení a geometrie se nemění.
   ====================================================================== */
body[data-theme="daylight"] {
  --theme-bg: radial-gradient(circle at 16% 0%,rgba(255,236,174,.46),transparent 31%),linear-gradient(180deg,#ddb457 0%,#b8842f 100%) fixed;
  --theme-header: linear-gradient(180deg,#f7e9bd,#d8ae59);
  --theme-panel: linear-gradient(180deg,#f7e9bd,#ead095);
  --theme-panel-soft:#e7ca87;
  --theme-input:#fff8e6;
  --theme-head:#ddb966;
  --theme-even:#ead39a;
  --theme-line:#b87918;
  --theme-line-strong:#965f10;
  --theme-ink:#10213e;
  --theme-muted:#514735;
  --theme-accent:#0868ce;
  --theme-accent-2:#2588e8;
  --theme-accent-soft:#d4e8fb;
  --theme-gold:#b87918;
  --theme-selected:#d4e8fb;
  --theme-shadow:0 14px 34px rgba(79,45,4,.27);
  --theme-footer:linear-gradient(180deg,#ddb966,#b8842f);
}
body[data-theme="outdoor"] {
  --theme-bg:radial-gradient(circle at 18% 0%,rgba(117,151,78,.20),transparent 30%),linear-gradient(180deg,#23301f 0%,#101810 100%) fixed;
  --theme-header:linear-gradient(180deg,#283728,#1d2a1d);
  --theme-panel:linear-gradient(180deg,#283728,#1d2a1d);
  --theme-panel-soft:#2b3b2a;
  --theme-input:#111c13;
  --theme-head:#31422d;
  --theme-even:#203022;
  --theme-line:#6f8658;
  --theme-line-strong:#9aae78;
  --theme-ink:#f1f0df;
  --theme-muted:#b9c3ae;
  --theme-accent:#9bd16f;
  --theme-accent-2:#d1ad59;
  --theme-accent-soft:#30452e;
  --theme-gold:#d1ad59;
  --theme-selected:#30452e;
  --theme-shadow:0 15px 38px rgba(0,0,0,.36);
  --theme-footer:linear-gradient(180deg,#283728,#172319);
}
body[data-theme="night-ops"] {
  --theme-bg:radial-gradient(circle at 15% 0%,rgba(255,165,47,.11),transparent 30%),linear-gradient(180deg,#101521 0%,#030509 100%) fixed;
  --theme-header:linear-gradient(180deg,#1b2130,#121722);
  --theme-panel:linear-gradient(180deg,#1b2130,#121722);
  --theme-panel-soft:#222834;
  --theme-input:#080c13;
  --theme-head:#202531;
  --theme-even:#171d29;
  --theme-line:#74633f;
  --theme-line-strong:#a68b4f;
  --theme-ink:#f4f2e9;
  --theme-muted:#aaa99f;
  --theme-accent:#ffc857;
  --theme-accent-2:#ff7a55;
  --theme-accent-soft:#292a2b;
  --theme-gold:#ffc857;
  --theme-selected:#292a2b;
  --theme-shadow:0 16px 42px rgba(0,0,0,.50);
  --theme-footer:linear-gradient(180deg,#1b2130,#0d121b);
}
body[data-theme="tactical"] {
  --theme-bg:radial-gradient(circle at 17% 0%,rgba(181,191,104,.12),transparent 29%),linear-gradient(180deg,#303326 0%,#161812 100%) fixed;
  --theme-header:linear-gradient(180deg,#31362a,#25281f);
  --theme-panel:linear-gradient(180deg,#31362a,#25281f);
  --theme-panel-soft:#35392c;
  --theme-input:#191b16;
  --theme-head:#383c2e;
  --theme-even:#2b2f25;
  --theme-line:#7c8060;
  --theme-line-strong:#9fa37a;
  --theme-ink:#efecda;
  --theme-muted:#b7b4a4;
  --theme-accent:#c5cf77;
  --theme-accent-2:#d5aa61;
  --theme-accent-soft:#3b4030;
  --theme-gold:#d5aa61;
  --theme-selected:#3b4030;
  --theme-shadow:0 15px 38px rgba(0,0,0,.40);
  --theme-footer:linear-gradient(180deg,#31362a,#20231c);
}
body[data-theme="ham-classic"] {
  --theme-bg:radial-gradient(circle at 15% 0%,rgba(56,189,248,.18),transparent 31%),linear-gradient(180deg,#172338 0%,#0b1220 100%) fixed;
  --theme-header:linear-gradient(180deg,#1e293b,#0f172a);
  --theme-panel:linear-gradient(180deg,#1e293b,#0f172a);
  --theme-panel-soft:#25364f;
  --theme-input:#101b2f;
  --theme-head:#26364d;
  --theme-even:#1b2940;
  --theme-line:#53657d;
  --theme-line-strong:#758aa6;
  --theme-ink:#f4f7fb;
  --theme-muted:#b8c4d6;
  --theme-accent:#38bdf8;
  --theme-accent-2:#22c55e;
  --theme-accent-soft:#29415c;
  --theme-gold:#38bdf8;
  --theme-selected:#29415c;
  --theme-shadow:0 15px 38px rgba(0,0,0,.42);
  --theme-footer:linear-gradient(180deg,#1e293b,#111c30);
}

/* v3.2 – TOTA Activations: zachovat barevné rozlišení pásem a módů.
   Obecná pravidla motivů nesmí přebarvit dynamické badge z app.js. */
body[data-theme] .mini-badge.colored-badge {
  color: #fff !important;
  background: var(--badge-color) !important;
  border-color: rgba(255,255,255,.42) !important;
  text-shadow: 0 1px 1px rgba(0,0,0,.42) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 1px 2px rgba(0,0,0,.18) !important;
}

/* Světlá pásma potřebují tmavý text pro dobrou čitelnost. */
body[data-theme] .band-badge[style*="#00d4ff"],
body[data-theme] .band-badge[style*="#5fa8ff"],
body[data-theme] .band-badge[style*="#ffd75a"],
body[data-theme] .band-badge[style*="#ffa726"] {
  color: #102038 !important;
  text-shadow: none !important;
  border-color: rgba(16,32,56,.35) !important;
}
