/* map.css (вынесенные стили из <style>...</style>) */

:root {
  --bulma-skeleton-background: var(--bulma-border);
  --bulma-skeleton-radius: var(--bulma-radius-small);
  --bulma-skeleton-block-min-height: 4.5em;
  --bulma-skeleton-lines-gap: 0.75em;
  --bulma-skeleton-line-height: 0.75em;
  overflow-y: hidden;
  --bulma-block-spacing: 0em;
  --bulma-checkbox-border-color: #3273dc;
  --bulma-checkbox-checked-bg: #e84c3d;
  --bulma-checkbox-hover-bg: #f5f9ff;
}

.checkbox input[type="checkbox"] {
  border-color: var(--bulma-checkbox-border-color);
}

.checkbox input[type="checkbox"]:checked {
  background-color: var(--bulma-checkbox-checked-bg);
  border-color: var(--bulma-checkbox-checked-bg);
}

body {
  height: 100vh;
  margin: 0;
}

::selection {
  background: #809778;
}

#map {
  height: 100%;
}

#sidebar {
  position: absolute;
  top: 1px;
  right: 0px;
  padding: 5px;
  z-index: 1000;
  
}

/* 2x2 для верхних селектов */
.select-group{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:4px;

  /* растянуть содержимое ячеек */
  align-items: stretch;
  justify-items: stretch;
}

/* чтобы Bulma-select занимал всю ячейку */
.select-group .field,
.select-group .control{
  width:100%;
  height:100%;
}

.select-group .select{
  width:100%;
}

.select-group .select select{
  width:100%;
}

#dataWindow option.long-window { color: #888; }

.cbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px;
}

.vesbox-group { 
  display: grid;
  grid-template-columns: 22fr 2fr;
  gap: 4px;
}

.vesbox-subgroup { 
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
}

.vessel-list-item {
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.10);
}

.vessel-list-item + .vessel-list-item {
  margin-top: 6px;
}

.vessel-list-item.is-point-selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.28), 0 4px 12px rgba(15, 23, 42, 0.16);
}

.vessel-list-item .vesbox-group {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 24px;
  margin: 0 0 5px;
  padding: 0 28px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
}

.vessel-list-item .vesbox-group img {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.vessel-toggle-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 75%;
  margin: 0 auto;
}

.vessel-mini-toggle {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.vessel-mini-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.vessel-mini-toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 4px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.vessel-mini-toggle:hover span {
  border-color: #64748b;
  color: #334155;
}

.vessel-mini-toggle input:focus-visible + span {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.vessel-mini-toggle input:checked + span {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.22);
}

.info0,
.info1 {
  box-sizing: border-box;
  width: 300px;
  max-width: calc(100vw - 10px);
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.10);
  margin-bottom: 10px;
  font-size: 12px;
}

.ves_list {
  border-radius: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 10px;
  font-size: 14px;
  width:100%;
  
  height: auto;
  max-height: 400;  
  overflow: auto;
  resize: vertical;
  
}

.dot {
  border-radius: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 10px;
  font-size: small;
}

/* Основной контейнер попапа */
.leaflet-popup {
  max-width: 400px;
  font-family: Arial, sans-serif;
}

/* Белая рамка (обертка) вокруг контента */
.leaflet-popup-content-wrapper {
  border-radius: 8px; /* Скругление углов самого окошка */
  padding: 0;         /* Убираем лишние отступы, если управляем ими в content */
  box-shadow: 0 3px 14px rgba(0,0,0,0.2); /* Красивая тень */
}

/* Контент (текст) внутри попапа */
.leaflet-popup-content {
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 15px; /* Задаем отступы текста от краев окна */
  color: #333;       /* Цвет текста */
}

/* Треугольник-указатель внизу окна */
.leaflet-popup-tip {
  /* Цвет должен совпадать с фоном content-wrapper (обычно белый) */
  background: #ffffff; 
  border-radius: 0; /* Треугольник обычно не скругляют, но можно оставить как есть */
  box-shadow: none; /* Убираем лишние тени от самого треугольника */
}

.leaflet-popup-content-wrapper {
  border-radius: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  font-size: 12px;
  min-height: 110px;
  opacity: 1;
}

/* подписи координатной сетки */
.grid-label {
  color: #666;
  font-size: 10px;
  line-height: 12px;
  background: rgba(255,255,255,0.55);
  border-radius: 4px;
  padding: 0 3px;
  border: 1px solid rgba(0,0,0,0.12);
  white-space: nowrap;
  pointer-events: none;
}

/* кнопка в select-group — чтобы по высоте совпадала с select */
.select-group .button.is-fullwidth {
  width: 100%;
  height: var(--bulma-control-height); /*40px;*/  
}

.coordinate-marker-label {
  padding: 4px 7px;
  border: 1px solid rgba(85, 85, 153, 0.55);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #202044;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.16);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Элементы info0 в размерах кнопок info1 */
.info0.select-group {
  gap: 6px;
}

.info0.select-group .field {
  min-width: 0;
  margin: 0;
}

.info0 .button.is-fullwidth,
.info0 .select,
.info0 .select select,
.info0 .input {
  height: 34px;
  min-height: 34px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

.info0 .button.is-fullwidth {
  justify-content: center;
  padding-left: 34px;
  padding-right: 34px;
  text-align: center;
}

.info0 .control.has-icons-left .icon {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.info0 .control.has-icons-left .select select {
  padding-left: 34px;
  padding-right: 34px;
}

.info0 .select select,
.info0 .input {
  text-align: center;
  text-align-last: center;
}

.info0 .date-inputs-row {
  gap: 6px;
  margin-top: 0;
}



.leaflet-control-zoom .leaflet-control-zoom-text {
  width: 30px;
  height: 24px;
  line-height: 24px;
  border-bottom: 1px solid #ccc;
  background: #fff;
  color: #333;
  font: 600 12px/24px Arial, Helvetica, sans-serif;
  text-align: center;
  cursor: default;
  user-select: none;
}

.nautical-ruler-control a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #17465d;
  font: 800 10px/30px Arial, Helvetica, sans-serif;
  text-decoration: none;
}

.nautical-distance-label {
  padding: 3px 6px;
  border: 1px solid #087ea8;
  border-radius: 4px;
  background: rgba(255, 255, 255, .92);
  color: #075579;
  box-shadow: 0 2px 6px rgba(0, 59, 92, .2);
  font: 700 11px/1.2 Arial, Helvetica, sans-serif;
}

.nautical-distance-label::before { display: none; }

.map-theme-control {
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22) !important;
}

.map-theme-toggle {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font: 800 10px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.map-theme-toggle:hover,
.map-theme-toggle.is-active {
  border-color: #00a8e8;
  background: #0077a8;
  color: #fff;
}

body.marinetraffic-theme {
  --mt-navy: #003b5c;
  --mt-blue: #0077a8;
  --mt-cyan: #00a8e8;
  --mt-border: #c9d7df;
  --mt-surface: rgba(255, 255, 255, 0.94);
  font-family: Arial, Helvetica, sans-serif;
}

body.marinetraffic-theme .info0,
body.marinetraffic-theme .info1,
body.marinetraffic-theme .ves_list,
body.marinetraffic-theme .dot {
  border: 1px solid var(--mt-border);
  border-radius: 4px;
  background: var(--mt-surface);
  box-shadow: 0 2px 8px rgba(0, 59, 92, 0.16);
  color: var(--mt-navy);
}

body.marinetraffic-theme .vessel-list-item {
  border-color: #d8e3e9;
  border-radius: 4px;
  background: #fff;
}

body.marinetraffic-theme .vessel-mini-toggle span,
body.marinetraffic-theme .map-filter-button {
  border-color: var(--mt-border);
  border-radius: 3px;
  background: #f5f8fa;
  color: var(--mt-navy);
  box-shadow: none;
}

body.marinetraffic-theme .vessel-mini-toggle input:checked + span,
body.marinetraffic-theme .map-filter-button.is-active,
body.marinetraffic-theme .map-filter-button[aria-pressed="true"] {
  border-color: var(--mt-blue);
  background: var(--mt-blue);
  color: #fff;
}

body.marinetraffic-theme .leaflet-bar {
  border: 0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 59, 92, 0.22);
}

body.marinetraffic-theme .leaflet-bar a,
body.marinetraffic-theme .leaflet-control-zoom .leaflet-control-zoom-text {
  border-color: var(--mt-border);
  background-color: #fff;
  color: var(--mt-navy);
}

body.marinetraffic-theme .leaflet-bar a:hover {
  background-color: #e9f5fa;
  color: var(--mt-blue);
}

body.marinetraffic-theme .map-theme-toggle {
  border-color: var(--mt-cyan);
  background: var(--mt-blue);
  color: #fff;
}

.mt-navigation {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 1200;
  display: none;
  width: 48px;
  overflow: hidden;
  flex-direction: column;
  border-left: 4px solid #087ea8;
  background: #082f49;
  color: #e6f4f8;
  box-shadow: -3px 0 12px rgba(2, 24, 38, 0.24);
  transition: width .2s ease;
}

body.marinetraffic-theme .mt-navigation {
  display: flex;
}

.mt-navigation:hover,
.mt-navigation.is-pinned {
  width: 200px;
}

.mt-navigation__brand {
  position: relative;
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: #06283d;
}

.mt-navigation__logo,
.mt-navigation__item > i {
  display: flex;
  width: 32px;
  min-width: 32px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.mt-navigation__logo {
  height: 42px;
  color: #4dd0e1;
  font-size: 21px;
}

.mt-navigation__brand-text {
  display: flex;
  min-width: 108px;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
}

.mt-navigation__brand-text b { font-size: 13px; }
.mt-navigation__brand-text small { color: #9fc5d4; font-size: 10px; }

.mt-navigation__pin {
  position: absolute;
  top: 6px;
  right: 5px;
  display: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b9d7e2;
  cursor: pointer;
}

.mt-navigation:hover .mt-navigation__pin,
.mt-navigation.is-pinned .mt-navigation__pin { display: block; }
.mt-navigation__pin:hover { background: rgba(255,255,255,.12); color: #fff; }
.mt-navigation__pin[aria-pressed="true"] i { transform: rotate(45deg); }

.mt-navigation__items {
  flex: 1;
  padding: 8px 6px;
}

.mt-navigation__footer {
  padding: 6px;
  border-top: 1px solid rgba(181, 216, 229, .2);
}

.mt-navigation__item {
  display: flex;
  width: 100%;
  height: 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  padding: 0 2px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #dceef5;
  font: 500 13px/1 Arial, Helvetica, sans-serif;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.mt-navigation__item span { opacity: 0; transition: opacity .12s ease; }
.mt-navigation:hover .mt-navigation__item span,
.mt-navigation.is-pinned .mt-navigation__item span { opacity: 1; }

.mt-navigation__item:hover {
  background: rgba(77, 208, 225, .14);
  color: #fff;
}

.mt-navigation__item.is-active {
  background: #087ea8;
  color: #fff;
}

.mt-navigation__item.is-open {
  background: rgba(77, 208, 225, .22);
  color: #fff;
}

body.marinetraffic-theme #sidebar { display: none; }
body.marinetraffic-theme .leaflet-right { right: 48px; transition: right .2s ease; }
body.marinetraffic-theme:has(.mt-navigation.is-pinned) .leaflet-right { right: 200px; }
body.marinetraffic-theme:has(.mt-navigation.is-pinned) .mt-flyout { right: 200px; }

.mt-flyout {
  position: fixed;
  top: 0;
  right: 48px;
  z-index: 1190;
  display: none;
  width: 320px;
  max-width: calc(100vw - 48px);
  height: 100vh;
  overflow: hidden;
  border-left: 1px solid #c9d7df;
  background: rgba(247, 250, 252, .98);
  color: #12384b;
  box-shadow: -4px 0 16px rgba(2, 24, 38, .2);
}

body.mt-flyout-vessels #mtVesselsFlyout,
body.mt-flyout-layers #mtLayersFlyout,
body.mt-flyout-settings #mtSettingsFlyout { display: flex; flex-direction: column; }

.mt-flyout__header {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #d8e3e9;
  background: #fff;
  color: #082f49;
}

.mt-flyout__header button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #456979;
  font-size: 22px;
  cursor: pointer;
}

.mt-flyout__header button:hover { background: #e5f3f8; color: #087ea8; }
.mt-flyout__content { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.mt-flyout__subtitle { margin: 12px 2px 6px; color: #5d7784; font-size: 11px; font-weight: 700; text-transform: uppercase; }

.mt-vessel-controls {
  flex: 0 0 auto;
  padding: 8px 8px 0;
  border-bottom: 1px solid #d8e3e9;
  background: #f7fafc;
}

body.marinetraffic-theme .mt-vessel-controls .info1 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 0 0 8px;
}

body.marinetraffic-theme .mt-vessel-controls .map-filter-button {
  min-height: 30px;
  padding: 4px 3px;
  gap: 4px;
  font-size: 10px;
}

#mtVesselsFlyout .mt-flyout__content {
  display: flex;
  overflow: hidden;
}

body.marinetraffic-theme #mtVesselsFlyout .ves_list {
  flex: 1;
  min-height: 0;
  height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.mt-settings-slot .info0 {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.marinetraffic-theme .mt-settings-slot .mt-duplicate-navigation {
  display: none;
}

body.marinetraffic-theme .mt-settings-slot .info0.select-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body.marinetraffic-theme .mt-settings-slot .field,
body.marinetraffic-theme .mt-settings-slot .control,
body.marinetraffic-theme .mt-settings-slot .select {
  min-width: 0;
  width: 100%;
  margin: 0;
}

body.marinetraffic-theme .mt-settings-slot .button,
body.marinetraffic-theme .mt-settings-slot .select select,
body.marinetraffic-theme .mt-settings-slot .input {
  width: 100%;
  height: 34px;
  min-height: 34px;
  border: 1px solid #d3e0e6;
  border-radius: 4px;
  background: #fff;
  color: #173f52;
  box-shadow: none;
  font-size: 11px;
  font-weight: 500;
}

body.marinetraffic-theme .mt-settings-slot .select select {
  padding-left: 6px !important;
  padding-right: 30px !important;
  text-align: center !important;
  text-align-last: center !important;
}

body.marinetraffic-theme .mt-settings-slot .button:hover,
body.marinetraffic-theme .mt-settings-slot .select select:hover,
body.marinetraffic-theme .mt-settings-slot .input:hover {
  border-color: #4ba9c5;
  background: #edf8fb;
}

body.marinetraffic-theme .mt-settings-slot .button.is-link {
  border-color: #087ea8;
  background: #087ea8;
  color: #fff;
}

body.marinetraffic-theme .mt-settings-slot .control.has-icons-left .icon {
  width: 32px;
  height: 34px;
  color: #527887;
  font-size: 11px;
}

body.marinetraffic-theme .mt-settings-slot .date-inputs-row {
  gap: 6px;
  margin-top: 0;
}

body.marinetraffic-theme .mt-flyout .ves_list,
body.marinetraffic-theme .mt-flyout .info1 {
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.mt-layer-list { display: grid; gap: 4px; }
.mt-layer-item {
  min-height: 34px;
  padding: 6px 22px 6px 6px;
  border: 1px solid #d3e0e6;
  border-radius: 4px;
  background: #fff;
  color: #173f52;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}
.mt-layer-item:hover { border-color: #4ba9c5; background: #edf8fb; }
.mt-layer-item.is-active { border-color: #087ea8; background: #087ea8; color: #fff; }

.mt-menu-highlight {
  animation: mt-menu-highlight 1.2s ease;
}

@keyframes mt-menu-highlight {
  0%, 100% { box-shadow: inherit; }
  35% { box-shadow: 0 0 0 3px rgba(0, 168, 232, .65), 0 4px 16px rgba(0, 59, 92, .3); }
}

@media (max-width: 700px) {
  .mt-navigation:hover,
  .mt-navigation.is-pinned { width: 176px; }
  body.marinetraffic-theme:has(.mt-navigation.is-pinned) .leaflet-right { right: 48px; }
  body.marinetraffic-theme:has(.mt-navigation.is-pinned) .mt-flyout { right: 48px; }
  .mt-flyout { right: 48px; width: calc(100vw - 48px); }
}

/* Единая тёмная поверхность интерфейса MarineTraffic. */
body.marinetraffic-theme {
  --mt-dark-950: #061923;
  --mt-dark-900: #082631;
  --mt-dark-850: #0d303d;
  --mt-dark-800: #123b49;
  --mt-dark-border: #245363;
  --mt-dark-text: #e3f0f4;
  --mt-dark-muted: #93b2bd;
  --mt-dark-accent: #19a9d1;
}

body.marinetraffic-theme .mt-navigation {
  border-left-color: var(--mt-dark-accent);
  background: var(--mt-dark-950);
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .mt-navigation__brand,
body.marinetraffic-theme .mt-navigation__footer {
  border-color: var(--mt-dark-border);
  background: #04151d;
}

body.marinetraffic-theme .mt-flyout {
  border-left-color: var(--mt-dark-border);
  background: var(--mt-dark-900);
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .mt-flyout__header {
  border-bottom-color: var(--mt-dark-border);
  background: var(--mt-dark-950);
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .mt-flyout__header button {
  color: var(--mt-dark-muted);
}

body.marinetraffic-theme .mt-flyout__header button:hover {
  background: var(--mt-dark-800);
  color: #fff;
}

body.marinetraffic-theme .mt-flyout__subtitle {
  color: var(--mt-dark-muted);
}

body.marinetraffic-theme .mt-vessel-controls {
  border-bottom-color: var(--mt-dark-border);
  background: var(--mt-dark-950);
}

body.marinetraffic-theme .mt-flyout .ves_list,
body.marinetraffic-theme .mt-flyout .info0,
body.marinetraffic-theme .mt-flyout .info1 {
  background: transparent;
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .mt-flyout .vessel-list-item {
  border-color: var(--mt-dark-border);
  background: var(--mt-dark-850);
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .mt-flyout .vessel-list-item:hover {
  border-color: #39758a;
  background: var(--mt-dark-800);
}

body.marinetraffic-theme .mt-flyout .vessel-list-item.is-point-selected {
  border-color: var(--mt-dark-accent);
  background: rgba(25, 169, 209, .2);
  box-shadow: 0 0 0 2px rgba(25, 169, 209, .22);
}

body.marinetraffic-theme .mt-flyout .vessel-mini-toggle span,
body.marinetraffic-theme .mt-flyout .map-filter-button,
body.marinetraffic-theme .mt-layer-item,
body.marinetraffic-theme .mt-settings-slot .button,
body.marinetraffic-theme .mt-settings-slot .select select,
body.marinetraffic-theme .mt-settings-slot .input {
  border-color: var(--mt-dark-border);
  background: var(--mt-dark-850);
  color: var(--mt-dark-text);
  box-shadow: none;
}

body.marinetraffic-theme .mt-flyout .vessel-mini-toggle:hover span,
body.marinetraffic-theme .mt-flyout .map-filter-button:hover,
body.marinetraffic-theme .mt-layer-item:hover,
body.marinetraffic-theme .mt-settings-slot .button:hover,
body.marinetraffic-theme .mt-settings-slot .select select:hover,
body.marinetraffic-theme .mt-settings-slot .input:hover {
  border-color: #3f8096;
  background: var(--mt-dark-800);
  color: #fff;
}

body.marinetraffic-theme .mt-flyout .vessel-mini-toggle input:checked + span,
body.marinetraffic-theme .mt-flyout .map-filter-button.is-active,
body.marinetraffic-theme .mt-flyout .map-filter-button[aria-pressed="true"],
body.marinetraffic-theme .mt-layer-item.is-active,
body.marinetraffic-theme .mt-settings-slot .button.is-link {
  border-color: var(--mt-dark-accent);
  background: #087fa5;
  color: #fff;
}

body.marinetraffic-theme .mt-settings-slot .control.has-icons-left .icon {
  color: var(--mt-dark-muted);
}

body.marinetraffic-theme .mt-settings-slot select option {
  background: var(--mt-dark-900);
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .mt-flyout * {
  scrollbar-color: #315e6e var(--mt-dark-950);
}

body.marinetraffic-theme .leaflet-left .leaflet-bar {
  border: 1px solid var(--mt-dark-border);
  background: var(--mt-dark-950);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .38);
}

body.marinetraffic-theme .leaflet-left .leaflet-bar a,
body.marinetraffic-theme .leaflet-left .leaflet-control-zoom-text {
  border-color: var(--mt-dark-border);
  background-color: var(--mt-dark-850);
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .leaflet-left .leaflet-bar a:hover {
  background-color: var(--mt-dark-800);
  color: #fff;
}

/* Спрайты Leaflet.draw изначально чёрные: инверсия делает их светлыми. */
body.marinetraffic-theme .leaflet-left .leaflet-draw-toolbar a {
  background-color: #edf5f7;
  filter: invert(1) hue-rotate(180deg);
}

body.marinetraffic-theme .leaflet-left .leaflet-draw-toolbar a:hover {
  background-color: #d9eef4;
}

.vessel-card-menu {
  position: fixed;
  z-index: 3000;
  display: none;
  min-width: 235px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .24);
}

.vessel-card-menu.is-open { display: block; }

.vessel-card-menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  color: #1e3a4a;
  font: 500 12px/1.25 Arial, Helvetica, sans-serif;
  text-align: left;
  cursor: pointer;
}

.vessel-card-menu button:last-child { border-bottom: 0; }
.vessel-card-menu button:hover { background: #edf8fb; color: #087fa5; }
.vessel-card-menu button i { width: 16px; color: #4b7180; text-align: center; }
.vessel-card-menu button:disabled { cursor: wait; opacity: .65; }

/* Инвертируется только подложка «Серая»; маркеры и треки не затрагиваются. */
.inverted-gray-map-tiles {
  filter: grayscale(1) invert(1) brightness(5.5) contrast(.76);
}

body.marinetraffic-theme .vessel-card-menu {
  border-color: var(--mt-dark-border);
  background: var(--mt-dark-900);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .46);
}

body.marinetraffic-theme .vessel-card-menu button {
  border-bottom-color: var(--mt-dark-border);
  color: var(--mt-dark-text);
}

body.marinetraffic-theme .vessel-card-menu button:hover {
  background: var(--mt-dark-800);
  color: #fff;
}

body.marinetraffic-theme .vessel-card-menu button i { color: var(--mt-dark-accent); }
