* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #1a1a2e;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

#toolbar {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(20, 20, 40, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 10px 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

#toolbar button,
#toolbar label.file-label {
    background: #2a2a4a;
    color: #e0e0e0;
    border: 1px solid #3a3a5a;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
    white-space: nowrap;
}

#toolbar button:hover,
#toolbar label.file-label:hover {
    background: #3a3a5a;
    border-color: #5a5a8a;
}
#toolbar button:active {
    background: #4a4a6a;
}
#toolbar button.active {
    background: #4a6a9a;
    border-color: #6a8aca;
    color: #fff;
}

#file-input {
    display: none;
}

/* Кнопка 2D/3D: компактная, с подписью текущего режима */
#btn-3d {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
}

#btn-3d .btn-3d-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

#btn-3d.active {
    background: #4a6a9a;
    border-color: #6a8aca;
    color: #fff;
}
#zone-count {
    color: #aaa;
    font-size: 13px;
    min-width: 40px;
    text-align: center;
}
#zoom-display {
    color: #aaa;
    font-size: 13px;
    min-width: 60px;
    text-align: center;
}
.separator {
    width: 1px;
    height: 24px;
    background: #3a3a5a;
    margin: 0 4px;
}

#viewport {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: grab;
}
#viewport.no-map {
    cursor: default;
}
#viewport.dragging {
    cursor: grabbing;
}
#viewport.drawing {
    cursor: crosshair;
}

#map-layer {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
}

/* ---------- 3D-режим ---------- */
/* Сцена лежит отдельным слоем поверх 2D; показывается только в режиме 3D */
#view-3d {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    overflow: hidden;
    background: #1a1a2e;
}

#view-3d.visible {
    display: block;
}

#scene-3d {
    display: block;
    width: 100%;
    height: 100%;
    /* ПКМ задействована под панораму — отключаем выделение и меню */
    cursor: grab;
    touch-action: none;
}

/* В 3D 2D-слой прячем целиком: ни картинка, ни туман, ни DOM-маркеры
   не должны просвечивать сквозь сцену */
#viewport.mode-3d #map-layer {
    display: none;
}

#viewport.mode-3d {
    cursor: default;
}

#viewport.mode-3d.panning-3d #scene-3d {
    cursor: grabbing;
}

/* Панель маркеров остаётся доступной и в 3D: каталог монстров и список
   персонажей нужны для работы с картой в любом режиме. Она лежит поверх
   сцены (z-index выше), поэтому скрывать её не нужно */
#viewport.mode-3d ~ #markers-panel {
    z-index: 7;
}

#map-image {
    display: block;
    image-rendering: auto;
    pointer-events: none;
}
#fog-canvas {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    pointer-events: none;
}
#preview-canvas {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    pointer-events: none;
}

#marker-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#marker-layer .marker-token {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: grab;
    user-select: none;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

#marker-layer .marker-token.dragging {
    cursor: grabbing;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.9));
}

/* Имя маркера во всплывающей подсказке при наведении */
#marker-layer .marker-token .marker-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) scale(var(--tooltip-scale, 1));
    transform-origin: bottom center;
    max-width: 200px;
    padding: 4px 10px;
    background: rgba(15, 15, 30, 0.95);
    border: 1px solid #4a4a7a;
    border-radius: 8px;
    color: #e8e8f5;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

#marker-layer .marker-token:hover .marker-tooltip {
    opacity: 1;
}

/* Стрелочка вниз, к маркеру */
#marker-layer .marker-token .marker-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #4a4a7a;
}

#welcome {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: #888;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

#welcome .icon {
    font-size: 72px;
    opacity: 0.4;
    color: #888;
}
#welcome.hidden {
    display: none;
}

#hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #555;
    font-size: 13px;
    pointer-events: none;
    z-index: 10;
    opacity: 1;
    transition: opacity 1s 3s;
}

#hint.hidden {
    opacity: 0;
}

/* ---------- панель маркеров (плавающая) ---------- */
#markers-panel {
    position: fixed;
    left: 16px;
    top: 80px;
    width: 280px;
    /* Панель не вылезает за окно, даже если список монстров
       запросил фиксированную высоту в пять рядов */
    max-height: calc(100vh - 160px);
    max-height: min(calc(100vh - 160px), calc(100dvh - 160px));
    z-index: 6;
    background: rgba(20, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #3a3a5a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-120%);
    transition:
        opacity 0.25s,
        transform 0.25s,
        border-color 0.15s,
        box-shadow 0.15s;
    pointer-events: none;
}

#markers-panel.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Подсветка панели при перетаскивании на неё маркера с карты */
#markers-panel.drop-target {
    border-color: #6a8aca;
    box-shadow:
        0 0 0 2px rgba(106, 138, 202, 0.55),
        0 8px 32px rgba(0, 0, 0, 0.5);
}

#markers-panel h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 16px;
    color: #ccc;
    font-size: 14px;
    border-bottom: 1px solid #3a3a5a;
    margin: 0;
    cursor: move;
    flex-shrink: 0;
}

.marker-panel-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#marker-collapse {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2a2a4a;
    color: #e0e0e0;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        background 0.2s,
        border-color 0.2s;
}

#marker-collapse:hover {
    background: #3a3a5a;
    border-color: #5a5a8a;
}

/* Плавающая иконка свёрнутой панели */
#markers-fab {
    position: fixed;
    left: 16px;
    top: 80px;
    z-index: 6;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    color: #e0e0e0;
    border: 1px solid #3a3a5a;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.15s,
        box-shadow 0.15s;
}

#markers-fab.visible {
    display: flex;
}

#markers-fab:hover {
    background: #3a3a5a;
    border-color: #6a8aca;
    transform: scale(1.06);
}

#markers-fab:active {
    transform: scale(0.96);
}

#markers-fab.drop-target {
    border-color: #6a8aca;
    box-shadow:
        0 0 0 2px rgba(106, 138, 202, 0.55),
        0 6px 20px rgba(0, 0, 0, 0.5);
}

#marker-form {
    padding: 10px 12px;
    border-bottom: 1px solid #3a3a5a;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* Вкладки панели маркеров: персонажи / монстры */
#marker-tabs {
    display: flex;
    border-bottom: 1px solid #3a3a5a;
    flex-shrink: 0;
}

#marker-tabs button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 6px;
    background: #1f1f38;
    color: #888;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
}

#marker-tabs button:hover {
    background: #2a2a4a;
    color: #ccc;
}

#marker-tabs button.active {
    background: #2a2a4a;
    color: #e0e0e0;
    border-bottom-color: #6a8aca;
}

#marker-tabs button .bi {
    flex-shrink: 0;
}

/* Вкладка монстров и список персонажей взаимоисключающие */
#markers-panel.monsters-active #marker-form,
#markers-panel.monsters-active #markers-list {
    display: none;
}

#markers-panel #monsters-list {
    display: none;
}

/* Список монстров фиксируем по высоте в пять рядов плитки:
   примерно 5 * (плитка + отступ) + внутренние отступы.
   Всё, что не помещается, прокручивается внутри блока. */
#monsters-list {
    flex: 1;
    min-height: 0;
    height: calc(5 * 100px + 16px);
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: #4a4a6a #1f1f38;
}

#monsters-list::-webkit-scrollbar {
    width: 8px;
}

#monsters-list::-webkit-scrollbar-track {
    background: #1f1f38;
    border-radius: 4px;
}

#monsters-list::-webkit-scrollbar-thumb {
    background: #4a4a6a;
    border-radius: 4px;
}

#monsters-list::-webkit-scrollbar-thumb:hover {
    background: #6a8aca;
}

/* Поиск по каталогу монстров: виден только на вкладке монстров */
#monster-search-row {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #3a3a5a;
    flex-shrink: 0;
}

#markers-panel.monsters-active #monster-search-row {
    display: flex;
}

#monster-search-row .bi-search {
    color: #6a8aca;
    font-size: 13px;
    flex-shrink: 0;
}

#monster-search {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    background: #1f1f38;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

#monster-search:focus {
    border-color: #6a8aca;
}

#monster-search::placeholder {
    color: #666;
}

#monster-search-clear {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
}

#monster-search-clear:hover {
    background: #2a2a4a;
    color: #e0e0e0;
}

#monster-search-clear:disabled {
    opacity: 0.3;
    cursor: default;
    background: transparent;
    color: #888;
}

/* Ширина панели 280px, внутри списка — padding 8px с каждой стороны,
   значит на колонки остаётся ~248px. Минимум 76px с зазором 6px даёт
   три колонки в ряду (3 * 76 + 2 * 6 = 240), как было изначально */
#markers-panel.monsters-active #monsters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
    align-content: start;
}

#monsters-list .monsters-empty {
    grid-column: 1 / -1;
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 16px 8px;
}

#monsters-list .monster-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Без этого строки grid растягиваются по высоте самой высокой плитки */
    align-self: start;
    gap: 4px;
    /* Высота плитки — часть расчёта высоты списка выше.
       При 11px/14px имя в две строки занимает 28px:
       6 + 48 + 4 + 28 + 6 = 92px. */
    height: 94px;
    /* Панель может ужать список на низких окнах */
    flex-shrink: 0;
    padding: 6px 4px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: grab;
    font-size: 11px;
    color: #ccc;
    transition: all 0.15s;
}

#monsters-list .monster-item:hover {
    background: #2a2a4a;
    border-color: #4a4a6a;
}

#monsters-list .monster-item.dragging {
    opacity: 0.4;
}

#monsters-list .monster-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    /* Тот же вид, что и у маркера на карте (.marker-token): картинка
       заполняет круг без letterbox, без рамки и фона, с тенью */
    object-fit: fill;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

/* Имя показываем целиком: переносим на вторую строку и только
   совсем длинное имя обрезаем с многоточием */
#monsters-list .monster-name {
    width: 100%;
    text-align: center;
    /* line-height обязательно в px: от него считается высота двух строк
       и запас внутри плитки фиксированной высоты */
    font-size: 11px;
    line-height: 14px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

#marker-size-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #3a3a5a;
    flex-shrink: 0;
}

#marker-size-row .marker-size-label {
    flex: 1;
    color: #aaa;
    font-size: 12px;
    white-space: nowrap;
}

#marker-size-row button {
    width: 30px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2a2a4a;
    color: #e0e0e0;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
}

#marker-size-row button:hover {
    background: #3a3a5a;
    border-color: #5a5a8a;
}

#marker-size-row button:active {
    background: #4a4a6a;
}

#marker-name {
    width: 100%;
    padding: 7px 9px;
    background: #1a1a2e;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
}

#marker-name:focus {
    outline: none;
    border-color: #6a8aca;
}

#marker-actions-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.marker-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    gap: 6px;
    background: #2a2a4a;
    color: #e0e0e0;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.2s,
        border-color 0.2s;
}

.marker-file-label .bi,
#marker-add .bi {
    flex-shrink: 0;
}

.marker-file-label > span,
#marker-add > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marker-file-label:hover {
    background: #3a3a5a;
    border-color: #5a5a8a;
}

#marker-file-input {
    display: none;
}

#marker-preview {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #4a4a6a;
    display: none;
    pointer-events: none;
}

#marker-preview.visible {
    display: block;
}

#marker-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    gap: 6px;
    white-space: nowrap;
    background: #2a5a3a;
    color: #d8f0e0;
    border: 1px solid #3a7a4a;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

#marker-add:hover {
    background: #3a6a4a;
}

#markers-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

#markers-list .markers-empty {
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 16px 8px;
}

#markers-list .marker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: grab;
    font-size: 13px;
    color: #ccc;
    transition: all 0.15s;
}

#markers-list .marker-item:hover {
    background: #2a2a4a;
    border-color: #4a4a6a;
}

#markers-list .marker-item.dragging {
    opacity: 0.4;
}

#markers-list .marker-thumb {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #4a4a6a;
    flex-shrink: 0;
    background: #1a1a2e;
    pointer-events: none;
}

#markers-list .marker-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#markers-list .marker-delete {
    background: none;
    border: none;
    color: #844;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

#markers-list .marker-delete:hover {
    color: #f44;
}

/* ---------- панель областей ---------- */
#zones-panel {
    position: fixed;
    right: 0;
    top: 80px;
    bottom: 0;
    width: 240px;
    z-index: 5;
    background: rgba(20, 20, 40, 0.92);
    backdrop-filter: blur(8px);
    border-left: 1px solid #3a3a5a;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s;
}

#zones-panel.visible {
    transform: translateX(0);
}

#zones-panel h3 {
    padding: 14px 16px 10px;
    color: #ccc;
    font-size: 14px;
    border-bottom: 1px solid #3a3a5a;
    margin: 0;
}

/* Глобальный выбор цвета */
#global-color-row {
    padding: 8px 16px;
    border-bottom: 1px solid #3a3a5a;
    display: flex;
    align-items: center;
    gap: 10px;
}

#global-color-row label {
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

#global-color-row input[type="color"] {
    width: 28px;
    height: 22px;
    padding: 0;
    border: 1px solid #4a4a6a;
    border-radius: 4px;
    background: #1a1a2e;
    cursor: pointer;
}

#zones-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

#zones-list .zone-item {
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #aaa;
    border: 1px solid transparent;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

#zones-list .zone-item .zone-color {
    width: 20px;
    height: 18px;
    padding: 0;
    border: 1px solid #4a4a6a;
    border-radius: 3px;
    background: #1a1a2e;
    cursor: pointer;
    flex-shrink: 0;
}

#zones-list .zone-item .zone-color::-webkit-color-swatch-wrapper {
    padding: 0;
}
#zones-list .zone-item .zone-color::-webkit-color-swatch {
    border: none;
}

#zones-list .zone-item:hover {
    background: #2a2a4a;
    border-color: #4a4a6a;
}
#zones-list .zone-item.selected {
    background: #3a4a6a;
    border-color: #6a8aca;
    color: #fff;
}
#zones-list .zone-item .zone-idx {
    color: #666;
    font-size: 11px;
    white-space: nowrap;
}
#zones-list .zone-item .zone-state {
    font-size: 12px;
    flex: 1;
}

#zones-list .zone-item .zone-delete {
    background: none;
    border: none;
    color: #844;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

#zones-list .zone-item .zone-delete:hover {
    color: #f44;
}

/* ---------- окно обрезки маркера ---------- */
#marker-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 15, 0.75);
    backdrop-filter: blur(3px);
}

#marker-crop-modal.visible {
    display: flex;
}

#marker-crop-dialog {
    width: 324px;
    max-width: calc(100vw - 32px);
    background: rgba(20, 20, 40, 0.98);
    border: 1px solid #3a3a5a;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #ccc;
}

#marker-crop-dialog h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #ddd;
}

#marker-crop-stage {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid #6a8aca;
    background: repeating-conic-gradient(#1a1a2e 0% 25%, #242440 0% 50%) 50% /
        20px 20px;
    cursor: grab;
    touch-action: none;
}

#marker-crop-stage.dragging {
    cursor: grabbing;
}

#marker-crop-image {
    position: absolute;
    left: 0;
    top: 0;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

#marker-crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 14px;
}

#marker-crop-zoom-row input[type="range"] {
    flex: 1;
    accent-color: #6a8aca;
}

#marker-crop-hint {
    margin: 0;
    font-size: 12px;
    color: #777;
    text-align: center;
}

#marker-crop-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

#marker-crop-actions button {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #3a3a5a;
    background: #2a2a4a;
    color: #e0e0e0;
    transition:
        background 0.2s,
        border-color 0.2s;
}

#marker-crop-actions button:hover {
    background: #3a3a5a;
    border-color: #5a5a8a;
}

#marker-crop-apply {
    background: #2a5a3a;
    border-color: #3a7a4a;
    color: #d8f0e0;
}

#marker-crop-apply:hover {
    background: #3a6a4a;
    border-color: #4a8a5a;
}

/* ---------- иконки ---------- */
.icon-img {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    image-rendering: pixelated;
}
.icon-hint {
    opacity: 0.4;
}
