#cidades-map {
    height: calc(100vh - 240px);
    min-height: 480px;
    border-radius: .5rem;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06);
}

/* Halo dot com anel pulsante sutil. Quando hover/ativo, pulso fica
   mais forte e o núcleo aumenta. */
.cidade-pin {
    width: 22px;
    height: 22px;
    position: relative;
    background: radial-gradient(circle at 30% 30%, #818cf8 0%, #4f46e5 70%);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, .12),
        0 2px 6px rgba(0, 0, 0, .3);
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
}

.cidade-pin::before {
    /* anel pulsante — só ativa em hover/active. Pulsar em N pins ao
       mesmo tempo trava o compositor (Firefox chega a ficar branco). */
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, .7);
    opacity: 0;
    pointer-events: none;
}

@keyframes cidadePulse {
    0%   { transform: scale(.7); opacity: .9; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Hover: pin maior + pulso ativo */
.leaflet-marker-icon:hover .cidade-pin {
    transform: scale(1.25);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, .15),
        0 4px 12px rgba(0, 0, 0, .4);
    z-index: 1000;
}
.leaflet-marker-icon:hover .cidade-pin::before {
    animation: cidadePulse 1.6s ease-out infinite;
}

/* Estado ativo (popup aberto): cor laranja, escala maior, sem animação
   ─ chama atenção sem ficar piscando. */
.leaflet-marker-icon.cidade-pin-active .cidade-pin {
    background: radial-gradient(circle at 30% 30%, #fbbf24 0%, #ea580c 70%);
    transform: scale(1.35);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, .15),
        0 0 0 6px rgba(234, 88, 12, .25),
        0 4px 12px rgba(0, 0, 0, .35);
}
.leaflet-marker-icon.cidade-pin-active .cidade-pin::before {
    animation: none;
    opacity: 0;
}

/* ─────────────────────────────────────────────────────────────
   Card de intro (topo da página) — barra de acento à esquerda
   e fundo levemente tintado. Substitui o card cinza padrão.
   ───────────────────────────────────────────────────────────── */
.cidades-intro {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .7rem 1rem .7rem .85rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border-left: 4px solid #6366f1;
    border-radius: .5rem;
    color: #4338ca;
    font-size: .85rem;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(99, 102, 241, .08);
}
.cidades-intro > i {
    font-size: 1.05rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   Painel lateral — card sem borda, sombra suave, header com
   gradiente indigo, corpo em off-white com leve tom azulado.
   ───────────────────────────────────────────────────────────── */
.cidades-painel-card {
    border: none !important;
    border-radius: .75rem !important;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08),
                0 1px 3px rgba(15, 23, 42, .04);
}

.cidades-painel-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .85rem 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #818cf8 100%);
    color: #fff;
}
.cidades-painel-header-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.cidades-painel-titulo {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: #fff;
}

.cidades-painel-corpo {
    background: linear-gradient(180deg, #f8faff 0%, #f3f5fc 100%);
    padding: 1rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Empty state — ícone grande centralizado, mais convidativo */
.cidades-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #64748b;
}
.cidades-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #6366f1;
    box-shadow: inset 0 0 0 4px rgba(99, 102, 241, .08);
}
.cidades-empty-text {
    font-size: .85rem;
    line-height: 1.45;
    max-width: 240px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────
   Cabeçalho de categoria — chip tintado com a cor da categoria,
   ícone em círculo sólido à esquerda, contagem em pill à direita.
   ───────────────────────────────────────────────────────────── */
#cidades-painel .categoria-titulo {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .65rem;
    border-radius: .5rem;
    background: var(--cat-bg, #f1f5f9);
    margin: .85rem 0 .5rem;
    font-weight: 600;
    color: var(--cat-fg, #1e293b);
}
#cidades-painel .categoria-titulo:first-child { margin-top: 0; }

#cidades-painel .categoria-icone {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cat-color, #6b7280);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
#cidades-painel .categoria-label {
    flex: 1 1 auto;
    font-size: .88rem;
}
#cidades-painel .categoria-count {
    flex-shrink: 0;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    color: var(--cat-color, #1e293b);
    font: 700 .72rem/1.5 system-ui, sans-serif;
    text-align: center;
}

/* Cores por categoria — mesmas usadas nos pins (consistência visual) */
#cidades-painel .categoria-escritores    { --cat-color:#ef4444; --cat-fg:#7f1d1d; --cat-bg:#fef2f2; }
#cidades-painel .categoria-tradutores    { --cat-color:#16a34a; --cat-fg:#14532d; --cat-bg:#f0fdf4; }
#cidades-painel .categoria-organizadores { --cat-color:#3b82f6; --cat-fg:#1e3a8a; --cat-bg:#eff6ff; }
#cidades-painel .categoria-adaptadores   { --cat-color:#f59e0b; --cat-fg:#78350f; --cat-bg:#fffbeb; }
#cidades-painel .categoria-editoras      { --cat-color:#a855f7; --cat-fg:#581c87; --cat-bg:#faf5ff; }

/* ─── Lista de autores ─────────────────────────────────────── */
#cidades-painel ul.categoria-itens {
    list-style: none;
    padding: 0;
    margin: 0 0 .25rem .25rem;
}
#cidades-painel .autor-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem .5rem;
    border-radius: .375rem;
    line-height: 1.3;
    transition: background .12s ease;
}
#cidades-painel .autor-item:hover {
    background: rgba(99, 102, 241, .08);
}
#cidades-painel .autor-item a {
    color: #1f2937;
    text-decoration: none;
    font-size: .88rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#cidades-painel .autor-item:hover a { color: #4338ca; }
#cidades-painel .autor-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

/* ─── Editoras ─────────────────────────────────────────────── */
#cidades-painel .editora-item {
    padding: .55rem .65rem;
    margin-bottom: .35rem;
    background: #fff;
    border-radius: .5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06),
                inset 0 0 0 1px rgba(168, 85, 247, .12);
}
#cidades-painel .editora-item:last-child { margin-bottom: 0; }
#cidades-painel .editora-item .editora-nome {
    display: block;
    font-weight: 600;
    color: #581c87;
    text-decoration: none;
    font-size: .9rem;
    margin-bottom: .35rem;
}
#cidades-painel .editora-item .editora-nome:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Scrollbar discreto */
.cidades-painel-corpo::-webkit-scrollbar { width: 8px; }
.cidades-painel-corpo::-webkit-scrollbar-track { background: transparent; }
.cidades-painel-corpo::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, .25);
    border-radius: 4px;
}
.cidades-painel-corpo::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, .5);
}

/* Grid de capas ───────────────────────────────────────────── */
#cidades-painel .obras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: .35rem;
    margin-top: .35rem;
}
#cidades-painel .obras-grid a {
    display: block;
    aspect-ratio: 2/3;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .25rem;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease;
}
#cidades-painel .obras-grid a:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
#cidades-painel .obras-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Capa "gerada" para obras sem depiction — mesmo estilo do show.blade.php
   (fundo escuro, ícone no topo, título no centro, autor no rodapé), porém
   compactado para caber no thumbnail do grid (~60-80px). */
#cidades-painel .obras-grid .sem-capa {
    width: 100%;
    height: 100%;
    background: #212529;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: .25rem .2rem;
    text-align: center;
    line-height: 1.1;
}
#cidades-painel .obras-grid .sem-capa .sc-icon {
    font-size: 1.4rem;
    opacity: .8;
    line-height: 1;
}
#cidades-painel .obras-grid .sem-capa .sc-titulo {
    font-size: .55rem;
    font-weight: 600;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
#cidades-painel .obras-grid .sem-capa .sc-autor {
    font-size: .5rem;
    color: rgba(255, 255, 255, .65);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
