.tfm-footprint-map {
    --tfm-accent: #2f8fd3;
    --tfm-panel: rgba(255, 255, 255, 0.92);
    --tfm-panel-strong: #ffffff;
    --tfm-text: #1f2937;
    --tfm-muted: #6b7280;
    --tfm-border: #b7c5d0;
    --tfm-land: #eef3f7;
    --tfm-visited-area: #cfe3f3;
    --tfm-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
    color: var(--tfm-text);
    margin: 1.5rem 0;
}

.tfm-map-shell {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9));
    border: 1px solid var(--tfm-border);
    border-radius: 8px;
    height: var(--tfm-height, 620px);
    min-height: 320px;
    overflow: hidden;
    position: relative;
}

.tfm-map {
    height: 100%;
    width: 100%;
}

.tfm-map-status,
.tfm-region-count,
.tfm-controls,
.tfm-legend {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: var(--tfm-panel);
    border: 1px solid var(--tfm-border);
    position: absolute;
    z-index: 2;
}

.tfm-map-status {
    border-radius: 8px;
    font-size: 0.78rem;
    left: 12px;
    line-height: 1.4;
    max-width: calc(100% - 78px);
    padding: 0.48rem 0.65rem;
    top: 12px;
}

.tfm-map-status strong {
    color: var(--tfm-text);
    font-weight: 600;
}

.tfm-map-status button {
    background: transparent;
    border: 0;
    color: var(--tfm-accent);
    cursor: pointer;
    margin-left: 0.55rem;
    padding: 0;
}

.tfm-region-count {
    align-items: center;
    border-radius: 8px;
    bottom: 12px;
    display: flex;
    gap: 0.48rem;
    line-height: 1.4;
    padding: 0.5rem 0.65rem;
    right: 12px;
}

.tfm-region-count[hidden] {
    display: none;
}

.tfm-region-count strong {
    color: var(--tfm-text);
    font-size: 0.82rem;
    font-weight: 600;
}

.tfm-region-count span {
    color: var(--tfm-muted);
    font-size: 0.76rem;
}

.tfm-region-count button {
    background: transparent;
    border: 0;
    color: var(--tfm-accent);
    cursor: pointer;
    font-size: 0.74rem;
    padding: 0;
}

.tfm-controls {
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    right: 12px;
    top: 12px;
}

.tfm-controls button {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--tfm-border);
    color: var(--tfm-text);
    cursor: pointer;
    display: flex;
    font-size: 1rem;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 34px;
}

.tfm-controls button:last-child {
    border-bottom: 0;
}

.tfm-controls button:hover {
    background: rgba(15, 23, 42, 0.06);
}

.tfm-legend {
    align-items: center;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0 8px 0 0;
    bottom: 0;
    color: var(--tfm-muted);
    display: flex;
    gap: 0.8rem;
    font-size: 0.72rem;
    left: 0;
    padding: 0.55rem 0.7rem;
}

.tfm-legend span {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
}

.tfm-legend i {
    background: var(--tfm-land);
    border: 1px solid var(--tfm-border);
    display: inline-block;
    height: 9px;
    width: 9px;
}

.tfm-legend .tfm-legend-visited {
    background: var(--tfm-accent);
    border-color: var(--tfm-accent);
}

.tfm-list {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1rem 0.1rem 0.8rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.tfm-list[hidden] {
    display: none;
}

.tfm-card {
    background: var(--tfm-panel-strong);
    border: 1px solid var(--tfm-border);
    border-radius: 8px;
    cursor: pointer;
    flex: 0 0 220px;
    min-height: 74px;
    overflow: hidden;
    scroll-snap-align: start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tfm-card[data-clickable="0"] {
    cursor: default;
}

.tfm-card:hover,
.tfm-card:focus-visible {
    border-color: color-mix(in srgb, var(--tfm-accent) 46%, var(--tfm-border));
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.tfm-card[data-clickable="0"]:hover {
    border-color: var(--tfm-border);
    box-shadow: none;
    transform: none;
}

.tfm-card-media {
    aspect-ratio: 4 / 3;
    background: var(--tfm-land);
    overflow: hidden;
    position: relative;
}

.tfm-card-media img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tfm-card-nav {
    align-items: center;
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 1rem;
    height: 26px;
    justify-content: center;
    line-height: 1;
    opacity: 0.92;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: background 0.18s ease, opacity 0.18s ease;
    width: 26px;
    z-index: 2;
}

.tfm-card-media:hover .tfm-card-nav,
.tfm-card-nav:focus-visible {
    opacity: 1;
}

.tfm-card-nav:hover {
    background: rgba(15, 23, 42, 0.72);
}

.tfm-card-nav-prev {
    left: 8px;
}

.tfm-card-nav-next {
    right: 8px;
}
.tfm-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    padding: 0.7rem;
}

.tfm-card-title {
    color: var(--tfm-text);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.tfm-card-meta,
.tfm-card-desc,
.tfm-empty {
    color: var(--tfm-muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.tfm-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tfm-empty {
    background: var(--tfm-panel-strong);
    border: 1px dashed var(--tfm-border);
    border-radius: 8px;
    flex: 1 0 100%;
    padding: 1rem;
    text-align: center;
}

.tfm-tooltip-card {
    box-sizing: border-box;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    min-width: 150px;
    overflow: hidden;
    padding: 0.55rem;
    white-space: normal;
    width: 184px;
}

.tfm-tooltip-card strong {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.tfm-tooltip-card span {
    color: #64748b;
    font-size: 0.7rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.tfm-tooltip-card p {
    color: #475569;
    font-size: 0.7rem;
    line-height: 1.45;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.tfm-tooltip-text-only {
    min-width: 110px;
}

.tfm-tooltip-gallery {
    background: #eef2f7;
    border-radius: 6px;
    height: 108px;
    margin: 0 0 0.2rem;
    overflow: hidden;
    width: 100%;
}

.tfm-tooltip-gallery img {
    display: block;
    height: 108px;
    object-fit: cover;
    width: 100%;
}

@media (prefers-color-scheme: dark) {
    .tfm-footprint-map {
        --tfm-panel: rgba(23, 31, 42, 0.86);
        --tfm-panel-strong: #111827;
        --tfm-text: #e5e7eb;
        --tfm-muted: #9ca3af;
        --tfm-border: #415163;
        --tfm-land: #243142;
        --tfm-visited-area: #254963;
        --tfm-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    }

    .tfm-map-shell {
        background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.92));
    }
}

@media (max-width: 640px) {
    .tfm-footprint-map {
        margin: 1rem 0;
    }

    .tfm-map-shell {
        height: min(var(--tfm-height, 620px), 520px);
    }

    .tfm-card {
        flex-basis: 76vw;
    }
}

