/* Ceramics Map - Frontend Styles
 * All selectors prefixed with .ceramics-map-wrap or .cm- to avoid theme conflicts.
 */

.ceramics-map-wrap {
    --cm-primary: #F15A31;
    --cm-primary-light: #ff7a55;
    --cm-accent: #F15A31;
    --cm-accent-hover: #d44a25;
    --cm-surface: #f5f5f5;
    --cm-surface-warm: #f0f0f0;
    --cm-text: #000000;
    --cm-text-muted: #818285;
    --cm-border: #d9d9d9;
    --cm-white: #ffffff;
    --cm-grey-light: #A7A9AC;
    --cm-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --cm-shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --cm-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --cm-radius-sm: 6px;
    --cm-radius-md: 10px;
    --cm-radius-lg: 16px;

    font-family: Arial, Helvetica, sans-serif;
    color: var(--cm-text);
    line-height: 1.5;
    box-sizing: border-box;
}

.ceramics-map-wrap *, .ceramics-map-wrap *::before, .ceramics-map-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Header */
.cm-header {
    background: var(--cm-white);
    color: var(--cm-text);
    border-bottom: 3px solid var(--cm-primary);
    padding: 1rem 0;
    z-index: 100;
    box-shadow: var(--cm-shadow-md);
}

/* Centred inner wrapper - mirrors the theme header (.header-inner: 1200px / 2rem) */
.cm-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Title sits in its own area, full width above the tagline/stats row */
.cm-header-title {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cm-primary);
    text-align: center;
    margin: 0 0 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--cm-border);
}

/* Tagline (left, aligned with logo) + stats (right, aligned with menu) */
.cm-header-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cm-header-tagline {
    font-size: 0.85rem;
    color: var(--cm-text-muted);
    line-height: 1.4;
    max-width: 500px;
    text-align: left;
}

.cm-header-stats {
    display: flex;
    gap: 1.5rem;
    margin-left: auto; /* push stats to the right edge regardless of tagline */
}

.cm-stat {
    text-align: center;
    padding: 0 1rem;
    border-right: 1px solid var(--cm-border);
}

.cm-stat:last-child {
    border-right: none;
}

.cm-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cm-primary);
}

.cm-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cm-text-muted);
}

/* Main Layout */
.cm-main-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    height: calc(100vh - 150px);
    min-height: 600px;
}

/* Sidebar */
.cm-sidebar {
    background: var(--cm-white);
    border-right: 1px solid var(--cm-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cm-search-section {
    padding: 1.25rem;
    border-bottom: 1px solid var(--cm-border);
}

.cm-search-box {
    position: relative;
}

.cm-search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--cm-surface);
}

.cm-search-box input:focus {
    outline: none;
    border-color: var(--cm-primary);
    background: var(--cm-white);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

.cm-search-box input::placeholder {
    color: var(--cm-text-muted);
}

.cm-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 0;
    bottom: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    color: var(--cm-text-muted);
    pointer-events: none;
}

/* Filters */
.cm-filters-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cm-border);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 40%;
}

.cm-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.875rem;
}

.cm-filters-header h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cm-grey-dark);
    font-weight: 700;
    margin: 0;
}

.cm-clear-filters {
    font-size: 0.75rem;
    color: var(--cm-accent);
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
    background: none;
    border: none;
}

.cm-clear-filters:hover {
    opacity: 0.7;
}

.cm-filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.cm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cm-filter-group.cm-full-width {
    grid-column: 1 / -1;
}

.cm-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cm-text);
}

.cm-filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    background: var(--cm-white);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
}

.cm-filter-group select:focus {
    outline: none;
    border-color: var(--cm-primary);
}

/* Multi-select filter */
.cm-multi-filter {
    position: relative;
}

.cm-multi-filter-toggle {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    background: var(--cm-white);
    cursor: pointer;
    text-align: left;
    color: var(--cm-text-muted);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
}

.cm-multi-filter-toggle.cm-has-selection {
    color: var(--cm-text);
    border-color: var(--cm-primary);
}

.cm-multi-filter-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cm-white);
    border: 1.5px solid var(--cm-border);
    border-top: none;
    border-radius: 0 0 var(--cm-radius-sm) var(--cm-radius-sm);
    max-height: 180px;
    overflow-y: auto;
    z-index: 20;
    box-shadow: var(--cm-shadow-md);
}

.cm-multi-filter.cm-open .cm-multi-filter-panel {
    display: block;
}

.cm-multi-filter.cm-open .cm-multi-filter-toggle {
    border-radius: var(--cm-radius-sm) var(--cm-radius-sm) 0 0;
    border-color: var(--cm-primary);
}

.cm-multi-filter-option {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.1s;
}

.cm-multi-filter-option:hover {
    background: var(--cm-surface);
}

.cm-multi-filter-option input {
    margin-right: 0.4rem;
}

/* Active filters */
.cm-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--cm-border);
    overflow: visible;
}

.cm-active-filters:empty {
    display: none;
}

.cm-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    background: var(--cm-primary);
    color: var(--cm-white);
    border-radius: var(--cm-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.cm-filter-tag button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: rgba(255,255,255,0.7);
    padding: 0;
    display: flex;
    transition: color 0.15s;
}

.cm-filter-tag button:hover {
    color: var(--cm-white);
}

/* Results List */
.cm-results-section {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.cm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cm-results-count {
    font-size: 0.85rem;
    color: var(--cm-text-muted);
}

.cm-results-count strong {
    color: var(--cm-text);
    font-weight: 600;
}

/* Organisation Cards */
.cm-org-card {
    background: var(--cm-white);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cm-org-card:hover {
    border-color: var(--cm-primary-light);
    box-shadow: var(--cm-shadow-sm);
}

.cm-org-card.cm-active {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

.cm-org-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.cm-org-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cm-text);
    line-height: 1.3;
}

.cm-org-type-badge {
    flex-shrink: 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 4px;
    white-space: nowrap;
}


.cm-org-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--cm-text-muted);
}

.cm-org-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cm-org-meta-item svg {
    width: 14px;
    height: 14px;
}

.cm-org-description {
    font-size: 0.8rem;
    color: var(--cm-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.65rem;
}

.cm-org-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.cm-org-tag {
    padding: 0.15rem 0.4rem;
    background: var(--cm-surface);
    border-radius: 4px;
    font-size: 0.65rem;
    color: var(--cm-text-muted);
    font-weight: 500;
}

.cm-org-tag.cm-sector { background: #dbeafe; color: #1e40af; }
.cm-org-tag.cm-tech   { background: #dcfce7; color: #166534; }
.cm-org-tag.cm-role   { background: #fef3c7; color: #92400e; }

/* Map Section */
.cm-map-section {
    position: relative;
}

#cm-map {
    height: 100%;
    width: 100%;
    background: var(--cm-surface);
}

.cm-osm-tiles .leaflet-tile-pane {
    filter: saturate(0.3) brightness(1.1) contrast(0.95);
}


/* Custom Markers */
.cm-custom-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cm-custom-marker:hover {
    transform: scale(1.15);
}

/* Org type marker colours are generated dynamically via inline <style> */

/* Marker Clusters */
.ceramics-map-wrap .marker-cluster {
    background: var(--cm-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.ceramics-map-wrap .marker-cluster-small  { width: 36px; height: 36px; }
.ceramics-map-wrap .marker-cluster-medium { width: 44px; height: 44px; }
.ceramics-map-wrap .marker-cluster-large  { width: 52px; height: 52px; }

/* Map Popup */
.ceramics-map-wrap .leaflet-popup-content-wrapper {
    border-radius: var(--cm-radius-lg);
    box-shadow: var(--cm-shadow-lg);
    padding: 0;
    overflow: hidden;
}

.ceramics-map-wrap .leaflet-popup-content {
    margin: 0;
    min-width: 300px;
    max-width: 340px;
}

.ceramics-map-wrap .leaflet-popup-close-button {
    top: 12px !important;
    right: 12px !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 18px !important;
    color: var(--cm-text-muted) !important;
}

.cm-popup-content {
    padding: 1.25rem;
}

.cm-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cm-popup-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cm-text);
    line-height: 1.25;
    font-family: Arial, Helvetica, sans-serif;
}

.cm-popup-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--cm-text-muted);
}

.cm-popup-description {
    font-size: 0.85rem;
    color: var(--cm-text-muted);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.cm-popup-section {
    margin-bottom: 0.875rem;
}

.cm-popup-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cm-text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.cm-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.cm-popup-tag {
    padding: 0.2rem 0.5rem;
    background: var(--cm-surface);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--cm-text);
    font-weight: 500;
}

.cm-popup-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--cm-border);
}

.cm-popup-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: var(--cm-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.ceramics-map-wrap .cm-popup-btn-primary,
.ceramics-map-wrap .cm-popup-btn-primary:visited {
    background: var(--cm-accent);
    color: var(--cm-white);
    border: none;
}

.ceramics-map-wrap .cm-popup-btn-primary:hover {
    background: var(--cm-accent-hover);
    color: var(--cm-white);
    text-decoration: none;
}

.ceramics-map-wrap .cm-popup-btn-secondary,
.ceramics-map-wrap .cm-popup-btn-secondary:visited {
    background: var(--cm-white);
    color: var(--cm-text);
    border: 1.5px solid var(--cm-border);
}

.ceramics-map-wrap .cm-popup-btn-secondary:hover {
    border-color: var(--cm-primary);
    color: var(--cm-primary);
    text-decoration: none;
}

.ceramics-map-wrap .leaflet-popup-tip-container {
    display: none;
}

/* Map Legend */
.cm-map-legend {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    background: var(--cm-white);
    padding: 1rem 1.25rem;
    border-radius: var(--cm-radius-md);
    box-shadow: var(--cm-shadow-md);
    z-index: 1000;
    font-size: 0.75rem;
}

.cm-legend-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cm-text-muted);
    margin-bottom: 0.625rem;
    font-weight: 600;
}

.cm-legend-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1rem;
}

.cm-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cm-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Legend dot colours are generated dynamically via inline <style> */

/* Empty State */
.cm-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--cm-text-muted);
}

.cm-empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.cm-empty-state h4 {
    font-size: 0.95rem;
    color: var(--cm-text);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.cm-empty-state p {
    font-size: 0.85rem;
}

/* Scrollbar */
.cm-results-section,
.cm-filters-section {
    scrollbar-width: auto; /* Firefox - full-width bar */
    scrollbar-color: var(--cm-text-muted) var(--cm-surface);
}

.cm-results-section::-webkit-scrollbar,
.cm-filters-section::-webkit-scrollbar {
    width: 16px;
}

.cm-results-section::-webkit-scrollbar-track,
.cm-filters-section::-webkit-scrollbar-track {
    background: var(--cm-surface);
}

.cm-results-section::-webkit-scrollbar-thumb,
.cm-filters-section::-webkit-scrollbar-thumb {
    background: var(--cm-text-muted);
    border-radius: 6px;
    border: 2px solid var(--cm-surface);
}

.cm-results-section::-webkit-scrollbar-thumb:hover,
.cm-filters-section::-webkit-scrollbar-thumb:hover {
    background: var(--cm-text);
}

/* Mobile panel hidden on desktop */
.cm-mobile-panel {
    display: none;
}

/* Responsive */
@media (max-width: 900px) {
    .cm-main-container {
        grid-template-columns: 1fr;
        grid-template-rows: 60vh auto;
        height: auto;
        min-height: auto;
    }

    .cm-sidebar {
        order: 2;
        border-right: none;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .cm-results-section {
        max-height: 300px;
        overflow-y: auto;
        flex: 0 0 auto;
    }

    .cm-map-section {
        order: 1;
        display: flex;
        flex-direction: column;
    }

    /* Map fills the space left by the legend strip above it */
    #cm-map {
        order: 1;
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    .cm-header-title {
        font-size: 1.5rem;
    }

    .cm-header-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }

    .cm-header-tagline {
        font-size: 0.8rem;
        max-width: none;
        text-align: center;
    }

    .cm-header-stats {
        margin-left: 0; /* re-centre when stacked */
    }

    .cm-header-stats {
        display: flex;
        gap: 1rem;
    }

    .cm-stat {
        padding: 0 0.5rem;
    }

    .cm-stat-number {
        font-size: 1.1rem;
    }

    .cm-stat-label {
        font-size: 0.55rem;
    }

    .cm-filters-grid {
        grid-template-columns: 1fr;
    }

    /* Collapsible filters on mobile */
    .cm-filters-header h3 {
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .cm-filters-chevron {
        display: inline-block;
        width: 0;
        height: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 5px solid var(--cm-text-muted);
        transition: transform 0.2s ease;
    }

    .cm-filters-section.cm-filters-collapsed .cm-filters-chevron {
        transform: rotate(-90deg);
    }

    .cm-filters-section.cm-filters-collapsed .cm-active-filters,
    .cm-filters-section.cm-filters-collapsed .cm-filters-grid {
        display: none;
    }

    .cm-filters-section.cm-filters-collapsed .cm-clear-filters {
        display: none;
    }

    .cm-filters-section.cm-filters-collapsed {
        padding-bottom: 0.75rem;
    }

    /* Legend as a static full-width strip above the map */
    .cm-map-legend {
        position: static;
        order: 0; /* sits above #cm-map (order: 1) */
        bottom: auto;
        left: auto;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--cm-border);
        padding: 0.6rem 1rem;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .cm-legend-title {
        width: 100%; /* title on its own line above the dots */
        margin-bottom: 0.4rem;
    }

    .cm-legend-items {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem 0.9rem;
    }

    /* Hide leaflet popups on mobile - use bottom panel instead */
    .ceramics-map-wrap .leaflet-popup {
        display: none !important;
    }

    /* Mobile bottom panel for org details */
    .cm-mobile-panel {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--cm-white);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        border-radius: var(--cm-radius-lg) var(--cm-radius-lg) 0 0;
        z-index: 10000;
        max-height: 60vh;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateY(100%);
        transition: transform 0.25s ease;
        pointer-events: none;
    }

    .cm-mobile-panel.cm-panel-open {
        transform: translateY(0);
        pointer-events: auto;
    }

    .cm-mobile-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 1rem 1rem 0.5rem;
        position: sticky;
        top: 0;
        background: var(--cm-white);
    }

    .cm-mobile-panel-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--cm-text-muted);
        cursor: pointer;
        padding: 0;
        line-height: 1;
        flex-shrink: 0;
    }

    .cm-mobile-panel-body {
        padding: 0 1rem 1rem;
        overflow-x: hidden;
        word-wrap: break-word;
    }

    .cm-mobile-panel-body .cm-popup-name {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }

    .cm-mobile-panel-body .cm-popup-meta {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
        color: var(--cm-text-muted);
    }

    .cm-mobile-panel-body .cm-popup-description {
        font-size: 0.8rem;
        color: var(--cm-text-muted);
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }

    .cm-mobile-panel-body .cm-popup-section {
        margin-bottom: 0.5rem;
    }

    .cm-mobile-panel-body .cm-popup-section-title {
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--cm-text-muted);
        font-weight: 600;
        margin-bottom: 0.3rem;
    }

    .cm-mobile-panel-body .cm-popup-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .cm-mobile-panel-body .cm-popup-tag {
        padding: 0.2rem 0.4rem;
        background: var(--cm-surface);
        border-radius: 4px;
        font-size: 0.7rem;
        color: var(--cm-text-muted);
        font-weight: 500;
    }

    .cm-mobile-panel-body .cm-popup-footer {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--cm-border);
    }

    .cm-mobile-panel-body .cm-popup-btn {
        flex: 1;
        padding: 0.5rem;
        border-radius: var(--cm-radius-sm);
        font-size: 0.8rem;
        font-weight: 600;
        text-align: center;
        text-decoration: none;
    }
}
