/* =========================================================
   MARKER NORTH - COMMUNITY PAGE
   ========================================================= */

:root {
    --community-bg: #020b14;
    --community-panel: #071522;
    --community-panel-light: #0b1b2a;
    --community-border: #20384d;
    --community-border-soft: rgba(120, 163, 198, 0.18);
    --community-text: #f7f9fc;
    --community-muted: #9db3c7;
    --community-gold: #ffb400;
    --community-green: #42d567;
    --community-blue: #36a2ff;
    --community-purple: #a35cff;
    --community-red: #ff5d68;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--community-bg);
    color: var(--community-text);
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.community-main {
    min-width: 0;
    padding: 22px 24px 28px;
    background: radial-gradient( circle at 75% 10%, rgba(30, 91, 139, 0.11), transparent 32% ), var(--community-bg);
}

.community-page-header {
    margin: 0 0 14px;
    padding: 0 !important;
    min-height: auto !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

    .community-page-header h1 {
        margin: 0;
        color: var(--community-text);
        font-size: 30px;
        line-height: 1.15;
        letter-spacing: -0.5px;
    }

    .community-page-header p {
        margin: 5px 0 0;
        color: var(--community-muted);
        font-size: 14px;
        font-style: italic;
    }

/* =========================================================
   SUMMARY CARDS
   ========================================================= */

.community-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.community-summary-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    min-height: 73px;
    padding: 12px 18px;
    border: 1px solid var(--community-border);
    border-radius: 6px;
    background: linear-gradient( 145deg, rgba(10, 28, 43, 0.98), rgba(6, 20, 32, 0.98) );
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12), inset 0 1px rgba(255, 255, 255, 0.015);
}

.community-summary-icon {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    border-radius: 50%;
    font-size: 21px;
}

    .community-summary-icon.drivers {
        background: rgba(66, 213, 103, 0.16);
        color: var(--community-green);
    }

    .community-summary-icon.hauling {
        background: rgba(54, 162, 255, 0.16);
        color: var(--community-blue);
    }

    .community-summary-icon.groups {
        background: rgba(163, 92, 255, 0.16);
        color: var(--community-purple);
    }

    .community-summary-icon.miles {
        background: rgba(255, 180, 0, 0.16);
        color: var(--community-gold);
    }

.community-summary-card > div:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.community-summary-card span {
    overflow: hidden;
    color: var(--community-muted);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.community-summary-card strong {
    margin-top: 2px;
    color: var(--community-text);
    font-size: 24px;
    line-height: 1;
}

/* =========================================================
   SHARED COMMUNITY PANELS
   ========================================================= */

.community-map-panel,
.community-side-panel,
.community-lower-panel {
    border: 1px solid var(--community-border);
    border-radius: 7px;
    background: linear-gradient( 145deg, rgba(10, 27, 42, 0.98), rgba(5, 18, 29, 0.98) );
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14), inset 0 1px rgba(255, 255, 255, 0.015);
}

.community-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

    .community-panel-heading h2 {
        margin: 0;
        color: var(--community-text);
        font-size: 16px;
        line-height: 1.2;
    }

    .community-panel-heading > div {
        min-width: 0;
    }

        .community-panel-heading > div span {
            display: block;
            margin-top: 4px;
            color: var(--community-muted);
            font-size: 11px;
        }

.community-view-all {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 7px;
    color: var(--community-gold);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

    .community-view-all:hover {
        color: #ffd15a;
    }

/* =========================================================
   MAP AND LIVE SIDEBAR
   ========================================================= */

.community-live-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.45fr) minmax(330px, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.community-map-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

    .community-map-panel > .community-panel-heading {
        min-height: 57px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--community-border-soft);
    }

.community-map-frame {
    position: relative;
    flex: 1;
    height: auto;
    min-height: 390px;
    overflow: hidden;
    background: #07131d;
}

    .community-map-frame iframe {
        display: block;
        width: 100%;
        height: 100%;
        border: 0;
    }

    /* Subtle edge treatment over iframe */

    .community-map-frame::after {
        position: absolute;
        inset: 0;
        z-index: 2;
        content: "";
        pointer-events: none;
        box-shadow: inset 0 0 35px rgba(0, 8, 15, 0.28), inset 0 1px rgba(255, 255, 255, 0.02);
    }

.community-map-legend {
    position: absolute;
    bottom: 13px;
    left: 13px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 155px;
    padding: 11px 12px;
    border: 1px solid rgba(116, 151, 180, 0.3);
    border-radius: 5px;
    background: rgba(3, 14, 23, 0.91);
    color: #d7e2eb;
    font-size: 10px;
    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.35);
}

    .community-map-legend strong {
        margin-bottom: 2px;
        color: white;
        font-size: 11px;
    }

    .community-map-legend span {
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .community-map-legend span > i {
            width: 12px;
            text-align: center;
        }

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
}

    .legend-dot.online {
        border: 2px solid #b9f8c9;
        background: var(--community-green);
        box-shadow: 0 0 7px rgba(66, 213, 103, 0.65);
    }

.legend-hauling {
    color: var(--community-blue);
}

.legend-pickup {
    color: var(--community-green);
}

.legend-dropoff {
    color: var(--community-red);
}

.legend-group {
    color: var(--community-purple);
}

/* Detected group overlay */

.detected-group-overlay {
    position: absolute;
    right: 15px;
    bottom: 15px;
    z-index: 5;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-width: 360px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 180, 0, 0.48);
    border-radius: 6px;
    background: rgba(4, 16, 26, 0.93);
    color: white;
    box-shadow: 0 12px 27px rgba(0, 0, 0, 0.4), 0 0 18px rgba(255, 180, 0, 0.07);
}

.detected-group-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(54, 162, 255, 0.18);
    color: var(--community-blue);
    font-size: 18px;
}

.detected-group-overlay > div:nth-child(2) {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.detected-group-overlay strong {
    font-size: 12px;
}

.detected-group-overlay span {
    margin-top: 3px;
    color: var(--community-muted);
    font-size: 10px;
}

.map-group-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 0 13px;
    border: 1px solid var(--community-gold);
    border-radius: 4px;
    color: var(--community-gold);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}

    .map-group-button:hover {
        background: rgba(255, 180, 0, 0.12);
    }

/* =========================================================
   RIGHT-SIDE LIVE PANELS
   ========================================================= */

.community-live-sidebar {
    display: grid;
    grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

.community-side-panel {
    min-width: 0;
    padding: 14px 15px;
}

    .community-side-panel > .community-panel-heading {
        margin-bottom: 9px;
    }

.road-driver-list {
    display: flex;
    flex-direction: column;
}

.road-driver {
    position: relative;
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 67px;
    padding: 8px 35px 8px 0;
    border-bottom: 1px solid var(--community-border-soft);
}

    .road-driver:last-child {
        border-bottom: 0;
    }

.community-driver-avatar {
    position: relative;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
}

    .community-driver-avatar img {
        display: block;
        width: 100%;
        height: 100%;
        border: 2px solid #60809b;
        border-radius: 50%;
        object-fit: cover;
        background: #0b1b2a;
    }

.community-online-dot {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--community-panel);
    border-radius: 50%;
    background: #64748b;
}

.community-online-dot.is-online {
    background: var(--community-green);
}

.road-driver-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .road-driver-details strong {
        overflow: hidden;
        color: white;
        font-size: 12px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .road-driver-details > span {
        overflow: hidden;
        margin-top: 2px;
        color: #b7c6d3;
        font-size: 10px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .road-driver-details small {
        overflow: hidden;
        margin-top: 4px;
        color: var(--community-muted);
        font-size: 9px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

        .road-driver-details small i {
            margin-right: 4px;
        }

.driver-hauling-status {
    position: absolute;
    right: 38px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--community-green);
    font-size: 8px;
}

.driver-map-button {
    position: absolute;
    top: 50%;
    right: 0;
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border: 1px solid #3e7aaa;
    border-radius: 50%;
    color: #8ac8ff;
    font-size: 11px;
    text-decoration: none;
    transform: translateY(-50%);
}

    .driver-map-button:hover {
        border-color: var(--community-blue);
        background: rgba(54, 162, 255, 0.12);
        color: white;
    }

.community-panel-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    color: var(--community-gold);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

    .community-panel-footer-link:hover {
        color: #ffd15a;
    }

/* =========================================================
   LIVE DRIVING GROUPS
   ========================================================= */

.driving-groups-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.driving-group-card {
    display: grid;
    grid-template-columns: 55px minmax(0, 1fr);
    gap: 10px;
    padding: 9px;
    border: 1px solid var(--community-border-soft);
    border-radius: 5px;
    background: rgba(10, 27, 42, 0.64);
}

.driving-group-avatars {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 55px;
    height: 38px;
}

    .driving-group-avatars img {
        position: absolute;
        top: 0;
        width: 35px;
        height: 35px;
        border: 2px solid #142b3e;
        border-radius: 50%;
        object-fit: cover;
        background: #0b1b2a;
    }

        .driving-group-avatars img:first-child {
            left: 0;
            z-index: 2;
        }

        .driving-group-avatars img:nth-child(2) {
            left: 20px;
            z-index: 1;
        }

    .driving-group-avatars span {
        position: absolute;
        right: -2px;
        bottom: -1px;
        z-index: 3;
        display: grid;
        place-items: center;
        width: 22px;
        height: 22px;
        border: 2px solid #142b3e;
        border-radius: 50%;
        background: #243b4e;
        color: white;
        font-size: 8px;
        font-weight: 800;
    }

.driving-group-information {
    min-width: 0;
}

.driving-group-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

    .driving-group-title strong {
        color: white;
        font-size: 11px;
    }

    .driving-group-title span {
        padding: 2px 7px;
        border: 1px solid rgba(163, 92, 255, 0.5);
        border-radius: 10px;
        background: rgba(163, 92, 255, 0.13);
        color: #c795ff;
        font-size: 7px;
        font-weight: 700;
    }

.driving-group-information p {
    overflow: hidden;
    margin: 4px 0 2px;
    color: #c6d4df;
    font-size: 9px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

    .driving-group-information p i {
        margin: 0 3px;
        color: var(--community-gold);
    }

.driving-group-information small {
    display: block;
    color: var(--community-muted);
    font-size: 8px;
}

.driving-group-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 7px;
}

    .driving-group-actions a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 25px;
        padding: 0 7px;
        border: 1px solid #315b7e;
        border-radius: 4px;
        color: #86c6ff;
        font-size: 8px;
        font-weight: 700;
        text-decoration: none;
    }

        .driving-group-actions a:first-child {
            border-color: rgba(255, 180, 0, 0.75);
            color: var(--community-gold);
        }

        .driving-group-actions a:hover {
            background: rgba(54, 162, 255, 0.1);
        }

        .driving-group-actions a:first-child:hover {
            background: rgba(255, 180, 0, 0.1);
        }

/* =========================================================
   LOWER GRID
   ========================================================= */

.community-lower-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1.45fr) minmax(270px, 0.9fr) minmax(360px, 1.25fr);
    gap: 10px;
}

.community-lower-panel {
    min-width: 0;
    padding: 14px 15px;
}

    .community-lower-panel > .community-panel-heading {
        margin-bottom: 10px;
    }

/* =========================================================
   COMMUNITY ACTIVITY
   ========================================================= */

.community-activity-list {
    display: flex;
    flex-direction: column;
}

.community-activity-item {
    display: grid;
    grid-template-columns: 36px 43px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 57px;
    padding: 7px 0;
    border-bottom: 1px solid var(--community-border-soft);
}

    .community-activity-item:last-child {
        border-bottom: 0;
    }

.activity-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 14px;
}

    .activity-icon.achievement {
        background: rgba(66, 213, 103, 0.15);
        color: var(--community-green);
    }

    .activity-icon.safety {
        background: rgba(163, 92, 255, 0.15);
        color: var(--community-purple);
    }

    .activity-icon.mileage {
        background: rgba(54, 162, 255, 0.15);
        color: var(--community-blue);
    }

    .activity-icon.group {
        background: rgba(255, 180, 0, 0.15);
        color: var(--community-gold);
    }

.community-activity-item time {
    color: var(--community-muted);
    font-size: 10px;
    font-weight: 500;
}

.community-activity-item p {
    margin: 0;
    color: var(--community-text);
    font-size: 12px;
    line-height: 1.5;
}

    .community-activity-item p strong {
        color: white;
        font-size: 12px;
        font-weight: 700;
    }

.community-activity-item:nth-child(2) p strong {
    color: #c28aff;
}

.community-activity-item:nth-child(3) p strong {
    color: #78c1ff;
}

.community-activity-item:nth-child(4) p strong {
    color: var(--community-gold);
}

.community-activity-item p span {
    display: block;
    color: var(--community-muted);
}

/* =========================================================
   DISCOVER DRIVERS
   ========================================================= */

.discover-driver-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.discover-driver-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 56px;
    padding: 7px 8px;
    border: 1px solid var(--community-border-soft);
    border-radius: 5px;
    background: rgba(10, 27, 42, 0.6);
}

    .discover-driver-card .community-driver-avatar {
        width: 39px;
        height: 39px;
    }

    .discover-driver-card > div:nth-child(2) {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .discover-driver-card strong {
        overflow: hidden;
        color: white;
        font-size: 10px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .discover-driver-card span {
        overflow: hidden;
        margin-top: 2px;
        color: #c0ced9;
        font-size: 8px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .discover-driver-card small {
        overflow: hidden;
        margin-top: 3px;
        color: var(--community-muted);
        font-size: 7px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

        .discover-driver-card small i {
            margin-right: 3px;
        }

    .discover-driver-card > a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 27px;
        padding: 0 9px;
        border: 1px solid var(--community-gold);
        border-radius: 4px;
        color: var(--community-gold);
        font-size: 8px;
        font-weight: 700;
        text-decoration: none;
    }

        .discover-driver-card > a:hover {
            background: rgba(255, 180, 0, 0.1);
        }

/* =========================================================
   COMMUNITY MILESTONE
   ========================================================= */

.community-milestone-panel {
    position: relative;
}

.milestone-main {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 11px;
}

.milestone-icon {
    display: grid;
    place-items: center;
    width: 65px;
    height: 65px;
    flex: 0 0 65px;
    border: 2px solid var(--community-gold);
    border-radius: 50%;
    background: rgba(255, 180, 0, 0.1);
    color: var(--community-gold);
    font-size: 28px;
    box-shadow: 0 0 15px rgba(255, 180, 0, 0.12);
}

.milestone-copy {
    min-width: 0;
}

.milestone-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

    .milestone-value strong {
        color: white;
        font-size: 30px;
        line-height: 1;
    }

    .milestone-value span {
        color: #d8e2eb;
        font-size: 14px;
    }

.milestone-copy p {
    margin: 7px 0 0;
    color: var(--community-muted);
    font-size: 10px;
}

.milestone-progress {
    height: 10px;
    margin-top: 17px;
    overflow: hidden;
    border-radius: 20px;
    background: #172b3b;
}

    .milestone-progress span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient( 90deg, #ed9900, #ffbf1d );
        box-shadow: 0 0 9px rgba(255, 180, 0, 0.35);
    }

.milestone-percentage {
    margin-top: 5px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-align: right;
}

.milestone-statistics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--community-border-soft);
}

    .milestone-statistics > div {
        display: grid;
        grid-template-columns: 26px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 7px;
        min-width: 0;
        padding: 0 10px;
        border-right: 1px solid var(--community-border-soft);
    }

        .milestone-statistics > div:first-child {
            padding-left: 0;
        }

        .milestone-statistics > div:last-child {
            padding-right: 0;
            border-right: 0;
        }

    .milestone-statistics i {
        grid-row: 1 / 3;
        align-self: center;
        color: var(--community-green);
        font-size: 21px;
    }

    .milestone-statistics > div:nth-child(2) i {
        color: var(--community-blue);
    }

    .milestone-statistics > div:nth-child(3) i {
        color: var(--community-purple);
    }

    .milestone-statistics span {
        overflow: hidden;
        color: var(--community-muted);
        font-size: 7px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .milestone-statistics strong {
        margin-top: 2px;
        color: white;
        font-size: 11px;
    }

/* =========================================================
   CAPS SIGNATURE
   ========================================================= */

.community-caps-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    padding: 17px 20px 2px;
    color: var(--community-muted);
    text-align: center;
}

.community-caps-icon {
    display: grid;
    place-items: center;
    color: var(--community-gold);
    font-size: 18px;
}

.community-caps-signature > div:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 9px;
}

.community-caps-signature strong {
    color: var(--community-text);
    font-size: 11px;
}

    .community-caps-signature strong span {
        color: var(--community-gold);
        letter-spacing: 0.7px;
    }

.community-caps-signature small {
    color: var(--community-muted);
    font-size: 9px;
    font-style: italic;
}

/* =========================================================
   PAGE-SPECIFIC SHARED COMPONENT FIXES
   ========================================================= */

.community-main + * {
    min-width: 0;
}

.dashboard-page .dashboard-logo img {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
}

.dashboard-page .header-avatar img,
.dashboard-page .sidebar-driver-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
}

    .dashboard-sidebar .sidebar-driver-card {
        margin-top: 34px;
    }

    .dashboard-sidebar .sidebar-sign-out {
        margin-top: 14px;
    }

/* =========================================================
   RESPONSIVE LAYOUT
   ========================================================= */

@media (max-width: 1550px) {

    .community-main {
        padding-right: 17px;
        padding-left: 17px;
    }

    .community-live-grid {
        grid-template-columns: minmax(0, 2fr) minmax(310px, 1fr);
    }

    .community-lower-grid {
        grid-template-columns: minmax(330px, 1.3fr) minmax(255px, 0.85fr) minmax(330px, 1.1fr);
    }

    .community-map-frame {
        height: 370px;
        min-height: 370px;
    }
}

@media (max-width: 1300px) {

    .community-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .community-live-grid {
        grid-template-columns: 1fr;
    }

    .community-live-sidebar {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .community-lower-grid {
        grid-template-columns: 1fr 1fr;
    }

    .community-milestone-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1000px) {

    .community-main {
        padding: 18px 14px 26px;
    }

    .community-lower-grid {
        grid-template-columns: 1fr;
    }

    .community-milestone-panel {
        grid-column: auto;
    }
}

@media (max-width: 850px) {

    .community-live-sidebar {
        grid-template-columns: 1fr;
    }

    .community-map-frame {
        height: 340px;
        min-height: 340px;
    }

    .detected-group-overlay {
        right: 10px;
        bottom: 10px;
        grid-template-columns: 38px minmax(0, 1fr);
        min-width: 0;
        width: calc(100% - 190px);
    }

        .detected-group-overlay .map-group-button {
            grid-column: 1 / -1;
        }
}

@media (max-width: 700px) {

    .community-summary-grid {
        grid-template-columns: 1fr;
    }

    .community-page-header h1 {
        font-size: 26px;
    }

    .community-map-panel > .community-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .community-map-frame {
        height: 310px;
        min-height: 310px;
    }

    .community-map-legend {
        display: none;
    }

    .detected-group-overlay {
        width: calc(100% - 20px);
    }

    .milestone-statistics {
        grid-template-columns: 1fr;
        gap: 10px;
    }

        .milestone-statistics > div {
            padding: 0;
            border-right: 0;
        }
}

@media (max-width: 480px) {

    .community-main {
        padding-right: 10px;
        padding-left: 10px;
    }

    .community-summary-card {
        min-height: 66px;
    }

    .community-side-panel,
    .community-lower-panel {
        padding-right: 11px;
        padding-left: 11px;
    }

    .road-driver {
        grid-template-columns: 42px minmax(0, 1fr);
        padding-right: 32px;
    }

    .driver-hauling-status {
        display: none;
    }

    .driving-group-card {
        grid-template-columns: 1fr;
    }

    .discover-driver-card {
        grid-template-columns: 39px minmax(0, 1fr);
    }

        .discover-driver-card > a {
            grid-column: 1 / -1;
        }

    .milestone-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .community-caps-signature {
        align-items: center;
        flex-direction: column;
    }
}

/* Alpha state: compact live-community status cards */

.community-live-sidebar {
    grid-template-rows: auto auto;
    align-content: start;
}

.community-side-panel {
    min-height: 0;
}

.community-empty-state {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    padding: 8px 0 4px;
}

.community-empty-icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(54, 162, 255, 0.45);
    border-radius: 50%;
    background: rgba(54, 162, 255, 0.12);
    color: var(--community-blue);
    font-size: 16px;
}

    .community-empty-icon.convoy {
        border-color: rgba(163, 92, 255, 0.5);
        background: rgba(163, 92, 255, 0.12);
        color: var(--community-purple);
    }

.community-empty-state strong {
    color: white;
    font-size: 13px;
}

.community-empty-state p {
    grid-column: 2;
    margin: 3px 0 0;
    color: var(--community-muted);
    font-size: 11px;
    line-height: 1.45;
}

.activity-route {
    margin-top: 3px;
    color: var(--community-text);
    font-size: 13px;
    font-weight: 700;
}

.activity-route {
    color: var(--community-gold);
    font-weight: 700;
}

    .activity-route i {
        margin: 0 4px;
    }

.activity-status {
    margin-left: 8px;
    color: var(--community-muted);
    font-size: 10px;
}

/* =========================================================
   COMMUNITY RECORDS
   ========================================================= */

.community-records-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.community-record-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
    padding: 14px;
    border: 1px solid var(--community-border-soft);
    border-radius: 6px;
    background: rgba(10, 27, 42, 0.60);
    text-align: center;
}

    .community-record-card:nth-child(1) i {
        color: var(--community-gold);
    }

    .community-record-card:nth-child(2) i {
        color: var(--community-green);
    }

    .community-record-card:nth-child(3) i {
        color: var(--community-blue);
    }

    .community-record-card:nth-child(4) i {
        color: var(--community-purple);
    }

    .community-record-card span {
        color: var(--community-muted);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    .community-record-card strong {
        margin: 4px 0;
        color: white;
        font-size: 40px;
        line-height: 1;
        font-weight: 800;
    }

    .community-record-card small {
        color: var(--community-muted);
        font-size: 10px;
    }

/* =========================================================
   LIVE CONVOY PULSE
   ========================================================= */

.convoy-pulse-state {
    margin-bottom: 10px;
}

.convoy-status-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 8px 0 10px;
}

    .convoy-status-metrics span {
        display: grid;
        gap: 2px;
        min-height: 46px;
        align-content: center;
        padding: 7px 8px;
        border: 1px solid var(--community-border-soft);
        border-radius: 5px;
        background: rgba(10, 27, 42, 0.62);
        color: var(--community-muted);
        font-size: 8px;
        text-align: center;
        text-transform: uppercase;
    }

    .convoy-status-metrics strong {
        color: white;
        font-size: 17px;
        line-height: 1;
    }

.convoy-solo-list {
    display: grid;
    gap: 7px;
}

.convoy-driver-mini {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--community-border-soft);
    border-radius: 5px;
    background: rgba(10, 27, 42, 0.58);
}

    .convoy-driver-mini > div:last-child {
        display: grid;
        min-width: 0;
        gap: 2px;
    }

    .convoy-driver-mini strong {
        overflow: hidden;
        color: #ffffff;
        font-size: 11px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .convoy-driver-mini span {
        overflow: hidden;
        color: #c1cfda;
        font-size: 9px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .convoy-driver-mini small {
        overflow: hidden;
        color: var(--community-muted);
        font-size: 8px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

.live-convoy-card {
    border-color: rgba(255, 180, 0, 0.35);
    background: linear-gradient( 145deg, rgba(255, 180, 0, 0.07), rgba(10, 27, 42, 0.72) );
}

.live-convoy-card .driving-group-information {
    display: grid;
    gap: 5px;
}

.driving-group-title span.active {
    border-color: rgba(66, 213, 103, 0.45);
    background: rgba(66, 213, 103, 0.12);
    color: var(--community-green);
}

.driving-group-title span.possible {
    border-color: rgba(255, 180, 0, 0.48);
    background: rgba(255, 180, 0, 0.11);
    color: var(--community-gold);
}

.driving-group-title span.regrouping {
    border-color: rgba(104, 180, 255, 0.48);
    background: rgba(49, 156, 255, 0.11);
    color: #8bc9ff;
}

.driving-group-title span.moving,
.convoy-driver-motion.moving {
    border-color: rgba(66, 213, 103, 0.48);
    background: rgba(66, 213, 103, 0.12);
    color: var(--community-green);
}

.driving-group-title span.stopped,
.convoy-driver-motion.stopped {
    border-color: rgba(177, 190, 202, 0.42);
    background: rgba(177, 190, 202, 0.1);
    color: #b8cad8;
}

.driving-group-title span.mixed,
.convoy-driver-motion.mixed {
    border-color: rgba(91, 181, 255, 0.48);
    background: rgba(91, 181, 255, 0.1);
    color: #80ccff;
}

.convoy-live-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    padding: 6px 0;
}

.convoy-live-metrics span {
    color: var(--community-muted);
    font-size: 8px;
}

.convoy-live-metrics strong {
    color: #eaf6ff;
    font-size: 9px;
}

.convoy-formation-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid rgba(56, 114, 154, 0.35);
    padding-top: 7px;
}

.convoy-formation-heading strong {
    color: #ebf7ff;
    font-size: 9px;
}

.convoy-formation-heading span {
    color: #74bee9;
    font-size: 7px;
    text-align: right;
}

.convoy-formation-list {
    display: grid;
    gap: 3px;
}

.convoy-formation-row {
    display: grid;
    grid-template-columns: 19px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    border: 1px solid rgba(52, 106, 145, 0.36);
    border-radius: 4px;
    background: rgba(3, 15, 26, 0.43);
    padding: 3px 5px;
}

.convoy-formation-position {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 180, 0, 0.16);
    color: var(--community-gold);
    font-size: 8px;
    font-weight: 900;
}

.convoy-formation-driver {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.convoy-formation-driver strong {
    overflow: hidden;
    color: #f4fbff;
    font-size: 9px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.convoy-formation-driver small,
.convoy-driver-spacing {
    color: #8caec4;
    font-size: 7px;
    white-space: nowrap;
}

.convoy-driver-motion {
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 7px;
    font-weight: 800;
    padding: 2px 4px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .convoy-formation-row {
        grid-template-columns: 19px minmax(0, 1fr) auto;
    }

    .convoy-driver-spacing {
        grid-column: 2 / -1;
    }
}
}
