.fd-map-page {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.fd-map-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.fd-map-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    font-size: 25px;
    line-height: 1.2;
    font-weight: 950;
}

.fd-map-title-icon,
.fd-map-placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FF7A00;
}

.fd-map-title-icon svg {
    width: 24px;
    height: 24px;
}

.fd-map-subtitle {
    margin-top: 6px;
    color: #6B7280;
    font-size: 14px;
    line-height: 1.45;
}

.fd-map-counters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fd-map-counter {
    min-width: 90px;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    background: #FFFFFF;
}

.fd-map-counter strong {
    display: block;
    color: #111827;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 950;
}

.fd-map-counter span {
    display: block;
    margin-top: 3px;
    color: #6B7280;
    font-size: 11px;
    font-weight: 800;
}

.fd-map-expand-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    background: #FFFFFF;
    color: #374151;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.fd-map-expand-toggle:hover {
    border-color: #FDBA74;
    background: #FFF7ED;
    color: #C2410C;
}

.fd-map-expand-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fd-map-expand-toggle-icon svg {
    width: 17px;
    height: 17px;
}

.fd-map-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
    min-height: 780px;
}

.fd-map-canvas-shell,
.fd-map-side {
    min-width: 0;
    border: 1px solid #E5E7EB;
    border-radius: 22px;
    background: #FFFFFF;
    overflow: hidden;
}

.fd-map-canvas-shell {
    position: relative;
}

.fd-map-page.is-map-expanded .fd-map-workspace {
    grid-template-columns: minmax(0, 1fr);
}

.fd-map-page.is-map-expanded .fd-map-side {
    display: none;
}

.fd-map-selected.is-map-overlay {
    position: absolute;
    right: 16px;
    bottom: 48px;
    z-index: 6;
    width: min(360px, calc(100% - 32px));
    box-sizing: border-box;
    margin: 0;
}

.fd-map-canvas {
    height: 100%;
    min-height: 780px;
    background:
        linear-gradient(rgba(255,255,255,.76), rgba(255,255,255,.76)),
        repeating-linear-gradient(
            0deg,
            #F3F4F6 0,
            #F3F4F6 1px,
            transparent 1px,
            transparent 42px
        ),
        repeating-linear-gradient(
            90deg,
            #F3F4F6 0,
            #F3F4F6 1px,
            transparent 1px,
            transparent 42px
        );
}

.fd-map-canvas-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 7px;
    padding: 24px;
    text-align: center;
    color: #6B7280;
}

.fd-map-canvas-placeholder strong {
    color: #111827;
    font-size: 18px;
}

.fd-map-placeholder-icon svg {
    width: 30px;
    height: 30px;
}

.fd-map-legend {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    max-width: calc(100% - 28px);
    padding: 8px 10px;
    border: 1px solid rgba(229,231,235,.95);
    border-radius: 12px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 26px rgba(15,23,42,.08);
    font-size: 11px;
    font-weight: 800;
    color: #4B5563;
}

.fd-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fd-map-legend i,
.fd-map-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
}

.fd-map-legend .is-ok,
.fd-map-trip-row.is-ok .fd-map-status-dot {
    background: #22C55E;
}

.fd-map-legend .is-stale,
.fd-map-trip-row.is-stale .fd-map-status-dot {
    background: #F59E0B;
}

.fd-map-legend .is-missing,
.fd-map-trip-row.is-missing .fd-map-status-dot,
.fd-map-trip-row.is-old .fd-map-status-dot {
    background: #EF4444;
}

.fd-map-side {
    display: flex;
    flex-direction: column;
}

.fd-map-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 16px 12px;
    border-bottom: 1px solid #F1F5F9;
    color: #111827;
}

.fd-map-side-head span {
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 850;
}

.fd-map-trip-list {
    min-height: 0;
    overflow: auto;
    padding: 7px;
}

.fd-map-trip-row {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 9px;
    align-items: flex-start;
    margin: 0;
    padding: 11px 10px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.fd-map-trip-row:hover,
.fd-map-trip-row.is-selected {
    background: #F8FAFC;
}

.fd-map-trip-row-main {
    min-width: 0;
}

.fd-map-trip-number {
    color: #111827;
    font-size: 14px;
    font-weight: 950;
}

.fd-map-trip-route {
    margin-top: 3px;
    overflow: hidden;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fd-map-trip-place {
    margin-top: 4px;
    overflow: hidden;
    color: #374151;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fd-map-selected {
    margin: auto 7px 7px;
    padding: 15px;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 12px 32px rgba(15,23,42,.08);
}

.fd-map-selected-title {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #111827;
    font-size: 17px;
    font-weight: 950;
}

.fd-map-selected-route {
    margin-top: 5px;
    color: #6B7280;
    font-size: 12px;
}

.fd-map-selected-place {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    color: #111827;
    font-size: 13px;
    font-weight: 850;
}

.fd-map-selected-place svg,
.fd-map-selected-title svg {
    width: 17px;
    height: 17px;
}

.fd-map-selected-meta {
    margin-top: 6px;
    color: #6B7280;
    font-size: 11px;
}

.fd-map-selected-actions {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.fd-map-selected-action {
    display: inline-flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid #FF7A00;
    border-radius: 11px;
    background: #FF7A00;
    color: #FFFFFF;
    padding: 0 14px;
    text-decoration: none;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.fd-map-quick-status {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.fd-map-quick-status[hidden],
.fd-map-selected-actions[hidden] {
    display: none;
}

.fd-map-quick-status-label {
    display: grid;
    gap: 6px;
    color: #374151;
    font-size: 11px;
    font-weight: 900;
}

.fd-map-quick-status-label input {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid #D1D5DB;
    border-radius: 11px;
    padding: 0 11px;
    background: #FFFFFF;
    color: #111827;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.fd-map-quick-status-label input:focus {
    border-color: #FF7A00;
    box-shadow: 0 0 0 3px rgba(255,122,0,.12);
}

.fd-map-quick-status-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.fd-map-quick-status-cancel,
.fd-map-quick-status-submit {
    min-height: 38px;
    box-sizing: border-box;
    border-radius: 10px;
    padding: 0 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.fd-map-quick-status-cancel {
    border: 1px solid #D1D5DB;
    background: #FFFFFF;
    color: #374151;
}

.fd-map-quick-status-submit {
    border: 1px solid #FF7A00;
    background: #FF7A00;
    color: #FFFFFF;
}

.fd-map-quick-status-submit:disabled {
    opacity: .65;
    cursor: wait;
}

.fd-map-quick-status-result {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 850;
}

.fd-map-quick-status-result.is-pending {
    border: 1px solid #BFDBFE;
    background: #EFF6FF;
    color: #1D4ED8;
}

.fd-map-quick-status-result.is-success {
    border: 1px solid #BBF7D0;
    background: #ECFDF3;
    color: #14804A;
}

.fd-map-quick-status-result.is-error {
    border: 1px solid #FECACA;
    background: #FEF2F2;
    color: #B91C1C;
}

.fd-map-loading,
.fd-map-empty {
    padding: 28px 16px;
    color: #9CA3AF;
    text-align: center;
    font-size: 13px;
}

.fd-map-error {
    padding: 12px 14px;
    border: 1px solid #FECACA;
    border-radius: 14px;
    background: #FEF2F2;
    color: #991B1B;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 980px) {
    .fd-map-workspace {
        grid-template-columns: 1fr;
    }

    .fd-map-side {
        max-height: 440px;
    }

    .fd-map-canvas,
    .fd-map-workspace {
        min-height: 480px;
    }
}

@media (max-width: 640px) {
    .fd-map-head {
        display: grid;
    }

    .fd-map-counters {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fd-map-counter {
        min-width: 0;
    }

    .fd-map-expand-toggle {
        grid-column: 1 / -1;
    }

    .fd-map-canvas,
    .fd-map-workspace {
        min-height: 410px;
    }

    .fd-map-legend {
        gap: 8px;
    }
}
