/* Module plans : CSS extrait d'argon-app.css (scripts/extract_module_css.py). Feuille du module : editer ici, avec les variables de static/css/app/tokens.css. */
.plan-markers {
  border-top: 1px solid var(--mv-gray-200);
  padding-top: 0.75rem;
}

.plan-markers-list .badge {
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.plan-markers-list .badge.bg-light {
  background-color: var(--mv-gray-50) !important;
}

/* Animation des badges */
.plan-markers-list .badge {
  transition: all 0.2s ease;
}

.plan-markers-list .badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* MapLibre Markers - Custom Pins */
.marker-pin {
    width: 34px;
    height: 44px;
    position: absolute;
    display: block;
    line-height: 0;
    font-size: 0;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.marker-pin-svg {
    display: block;
    width: 34px;
    height: 44px;
    pointer-events: none;
    position: relative;
}

.marker-pin-icon {
    position: absolute;
    top: 6px;
    left: 17px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    margin-left: -9px;
}

.marker-pin-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.marker-pin-badge {
    position: absolute;
    right: -6px;
    top: -6px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--pin-color, #007aff);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    pointer-events: none;
}

.marker-create-popup .maplibregl-popup-content {
    width: min(320px, calc(100vw - 32px));
    max-width: 320px;
    padding: 1rem;
    overflow: visible;
}

.marker-create-popup .maplibregl-popup-content .form-label {
    margin-bottom: 0.25rem;
}

.marker-create-popup .marker-create-form {
    margin: 0;
}

.marker-create-popup .marker-create-header {
    margin-bottom: 0.75rem;
}

.marker-create-popup .marker-create-field {
    margin-bottom: 0.85rem;
}

.marker-create-popup .marker-type-card {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marker-create-popup #marker-type-grid {
    display: flex;
    flex-wrap: wrap;
}

/* ============================================================
   plan_editor.html
   ============================================================ */

/* Styles spécifiques à l'éditeur de plan */
.plan-editor-sidebar {
    margin-inline: auto;
}

@media (min-width: 992px) {
    .plan-editor-sticky {
        position: sticky;
        top: 1rem;
    }

    .plan-editor-sidebar {
        max-height: calc(100vh - 2rem);
        overflow: auto;
        padding-right: 0.75rem;
    }
}

.plan-editor-accordion .accordion-button {
    font-weight: 600;
}

/* Styles pour l'éditeur de marqueur */
#marker-editor {
    --marker-editor-border: #e6ebf3;
    --marker-editor-muted: #7b8498;
    --marker-editor-title: var(--mv-text-heading);
    --marker-editor-surface: #f8fbff;
}

#marker-editor .marker-editor-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--marker-editor-border);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(31, 63, 114, 0.09);
    overflow: hidden;
    animation: slideIn 0.24s ease-out;
}

.marker-editor-header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--marker-editor-border);
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(8px);
}

.marker-editor-kicker {
    display: block;
    margin-bottom: 0.08rem;
    color: var(--mv-primary);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.marker-editor-title {
    color: var(--marker-editor-title);
    font-size: 0.98rem;
    line-height: 1.35;
}

#marker-editor .marker-editor-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #596780;
    background: #f5f7fb;
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: none;
}

#marker-editor .marker-editor-close:hover,
#marker-editor .marker-editor-close:focus-visible {
    color: var(--mv-text-heading);
    background: #edf2f9;
    border-color: #dbe3ef;
}

.marker-editor-body {
    display: grid;
    gap: 0.65rem;
    min-height: 0;
    padding: 0.75rem;
    background: #f7f9fc;
}

.marker-editor-section {
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--marker-editor-border);
    border-radius: 10px;
}

.marker-editor-section-title {
    margin: 0 0 0.65rem;
    color: var(--mv-primary);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.3;
    text-transform: uppercase;
}

.marker-editor-field + .marker-editor-field,
.marker-editor-field + .marker-editor-switch-row,
.marker-editor-switch-row + .marker-editor-field {
    margin-top: 0.65rem;
}

#marker-editor .form-label {
    margin-bottom: 0.3rem;
    color: var(--marker-editor-title);
    font-size: 0.76rem;
    font-weight: 600;
}

#marker-editor .form-control,
#marker-editor .form-select {
    min-height: 40px;
    padding: 0.48rem 0.7rem;
    color: #4a5261;
    font-size: 0.86rem;
    border-color: #d7dde7;
    border-radius: 8px;
    box-shadow: none;
}

#marker-editor textarea.form-control {
    min-height: 84px;
    line-height: 1.45;
    resize: vertical;
}

#marker-editor .form-control:focus,
#marker-editor .form-select:focus {
    border-color: #8798ed;
    box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.12);
}

#marker-editor .form-text {
    margin-top: 0.3rem;
    color: var(--marker-editor-muted);
    font-size: 0.69rem;
    line-height: 1.35;
}

.marker-editor-optional {
    margin-left: 0.2rem;
    color: #99a1af;
    font-size: 0.66rem;
    font-weight: 500;
}

.marker-editor-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.7rem;
    background: var(--marker-editor-surface);
    border: 1px solid #e9eef6;
    border-radius: 8px;
}

.marker-editor-switch-row-plain {
    padding: 0;
    background: transparent;
    border: 0;
}

.marker-editor-switch-label,
.marker-editor-switch-help {
    display: block;
}

.marker-editor-switch-label {
    margin: 0;
    color: var(--marker-editor-title);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.marker-editor-switch-help {
    margin-top: 0.08rem;
    color: var(--marker-editor-muted);
    font-size: 0.67rem;
    line-height: 1.3;
}

#marker-editor .form-switch {
    flex: 0 0 auto;
    min-height: 0;
    padding-left: 2.4rem;
}

#marker-editor .form-switch .form-check-input {
    width: 2.05rem;
    height: 1.08rem;
    margin-left: -2.4rem;
    cursor: pointer;
}

.marker-image-control {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    min-height: 58px;
    padding: 0.45rem;
    background: var(--marker-editor-surface);
    border: 1px dashed #cad3e1;
    border-radius: 9px;
}

.marker-image-preview,
.marker-image-empty {
    width: 46px;
    height: 46px;
    border-radius: 7px;
    overflow: hidden;
}

.marker-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marker-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #91a0b5;
    background: #ffffff;
    border: 1px solid var(--mv-gray-200);
}

.marker-image-copy {
    min-width: 0;
}

.marker-image-name,
.marker-image-help {
    display: block;
}

.marker-image-name {
    overflow: hidden;
    color: #4b5870;
    font-size: 0.74rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marker-image-help {
    margin-top: 0.08rem;
    color: var(--marker-editor-muted);
    font-size: 0.64rem;
}

.marker-image-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.1rem;
}

#marker-editor .marker-image-actions .btn {
    padding: 0.34rem 0.55rem;
    font-size: 0.68rem;
    border-radius: 7px;
}

.marker-floor-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.6rem;
}

.marker-floor-list .form-check {
    min-width: 0;
    margin: 0;
}

.marker-floor-list .form-check-label {
    overflow: hidden;
    max-width: 100%;
    color: #596780;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#marker-style-editor {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--marker-editor-border);
}

#marker-style-editor .style-type-tabs {
    margin-bottom: 0.65rem;
}

#marker-style-editor .shape-gallery {
    gap: 0.3rem;
}

#marker-style-editor .shape-gallery__item {
    padding: 0.35rem 0.2rem;
}

.marker-style-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

#marker-editor .marker-style-actions .btn {
    padding: 0.25rem 0;
    font-size: 0.7rem;
}

.marker-editor-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--marker-editor-border);
    border-radius: 0 0 12px 12px;
    backdrop-filter: blur(8px);
}

.marker-editor-status {
    min-width: 0;
    color: var(--marker-editor-muted);
    font-size: 0.68rem;
}

.marker-editor-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-left: auto;
}

@media (min-width: 576px) {
    #marker-editor .marker-editor-card {
        max-height: calc(100vh - 2rem);
    }

    .marker-editor-body {
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    #marker-editor .marker-editor-header {
        flex-direction: row;
        align-items: center;
        text-align: left;
    }

    #marker-editor .marker-editor-header > div {
        flex: 1 1 auto;
        min-width: 0;
    }
}

#marker-editor .marker-editor-footer .btn {
    min-height: 34px;
    padding: 0.38rem 0.72rem;
    font-size: 0.74rem;
    border-radius: 8px;
}

#itineraire-editor .route-editor-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--route-editor-border);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(31, 63, 114, 0.09);
    overflow: hidden;
    animation: slideIn 0.24s ease-out;
}

.route-editor-header {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--route-editor-border);
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(8px);
}

.route-editor-header > div {
    flex: 1 1 auto;
    min-width: 0;
}

.route-editor-kicker {
    display: block;
    margin-bottom: 0.08rem;
    color: var(--mv-primary);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.route-editor-title {
    overflow: hidden;
    color: var(--route-editor-title);
    font-size: 0.98rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#itineraire-editor .route-editor-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #596780;
    background: #f5f7fb;
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: none;
}

#itineraire-editor .route-editor-close:hover,
#itineraire-editor .route-editor-close:focus-visible {
    color: var(--mv-text-heading);
    background: #edf2f9;
    border-color: #dbe3ef;
}

.route-editor-body {
    display: grid;
    gap: 0.65rem;
    min-height: 0;
    padding: 0.75rem;
    background: #f7f9fc;
}

.route-editor-section {
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--route-editor-border);
    border-radius: 10px;
}

.route-editor-section-title {
    margin: 0 0 0.65rem;
    color: var(--mv-primary);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.3;
    text-transform: uppercase;
}

.route-editor-field + .route-editor-field {
    margin-top: 0.65rem;
}

.route-editor-optional {
    margin-left: 0.2rem;
    color: #99a1af;
    font-size: 0.66rem;
    font-weight: 500;
}

.route-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#itineraire-editor .route-mode-switch .btn {
    min-height: 36px;
    margin: 0;
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 0;
}

#itineraire-editor .route-mode-switch .btn:first-of-type {
    border-radius: 8px 0 0 8px;
}

#itineraire-editor .route-mode-switch .btn:last-of-type {
    border-radius: 0 8px 8px 0;
}

.route-poi-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.route-poi-help {
    display: block;
    margin-top: 0.05rem;
    color: var(--route-editor-muted);
    font-size: 0.65rem;
}

.route-count-badge {
    flex: 0 0 auto;
    padding: 0.22rem 0.45rem;
    color: #5368d7;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.2;
    background: #eef1ff;
    border-radius: 999px;
}

.route-poi-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

#itineraire-editor .route-poi-toolbar .btn {
    padding: 0.28rem 0.5rem;
    font-size: 0.66rem;
    border-radius: 7px;
}

.route-poi-list {
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid #e7ecf3;
    border-radius: 8px;
}

.route-gpx-import {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem;
    background: var(--route-editor-surface);
    border: 1px dashed #cad3e1;
    border-radius: 9px;
}

.route-gpx-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #7281a0;
    background: #ffffff;
    border: 1px solid var(--mv-gray-200);
    border-radius: 7px;
}

.route-gpx-copy {
    min-width: 0;
}

.route-gpx-title,
.route-gpx-help {
    display: block;
}

.route-gpx-title {
    color: #4b5870;
    font-size: 0.72rem;
    font-weight: 600;
}

.route-gpx-help {
    overflow: hidden;
    margin-top: 0.05rem;
    color: var(--route-editor-muted);
    font-size: 0.63rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-gpx-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#itineraire-editor .route-gpx-actions .btn {
    padding: 0.3rem 0.48rem;
    font-size: 0.65rem;
    border-radius: 7px;
}

.route-floor-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.6rem;
}

.route-floor-list .form-check {
    min-width: 0;
    margin: 0;
}

.route-floor-list .form-check-label {
    overflow: hidden;
    max-width: 100%;
    color: #596780;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-style-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(70px, 0.7fr) minmax(0, 1fr);
    gap: 0.5rem;
}

#itineraire-editor .route-style-grid .form-control-color {
    width: 100%;
}

.route-editor-footer {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--route-editor-border);
    border-radius: 0 0 12px 12px;
    backdrop-filter: blur(8px);
}

.route-editor-feedback {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.45rem;
}

.route-stats {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.route-stats span {
    padding: 0.2rem 0.4rem;
    color: #5368d7;
    font-size: 0.65rem;
    background: #eef1ff;
    border-radius: 6px;
}

.route-editor-status {
    color: var(--route-editor-muted);
    font-size: 0.67rem;
    line-height: 1.25;
}

.route-editor-status.is-error {
    color: #ea2c53;
}

.route-editor-footer-actions,
.route-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.route-editor-footer-actions {
    margin-left: auto;
}

#itineraire-editor .route-editor-footer .btn {
    min-height: 34px;
    padding: 0.36rem 0.62rem;
    font-size: 0.71rem;
    border-radius: 8px;
}

.route-action-icon {
    margin-right: 0.2rem;
    vertical-align: text-bottom;
}

.plan-route-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    z-index: 9999;
    padding: 0.65rem 0.9rem;
    color: #1f6b45;
    font-size: 0.78rem;
    font-weight: 600;
    background: #e9f8f0;
    border: 1px solid #bfe8d1;
    border-radius: 9px;
    box-shadow: 0 10px 24px rgba(31, 63, 114, 0.14);
    transform: translateX(-50%);
}

@media (min-width: 576px) {
    #itineraire-editor .route-editor-card {
        max-height: calc(100vh - 2rem);
    }

    .route-editor-body {
        overflow-y: auto;
    }
}

@media (max-width: 575px) {
    .route-editor-body {
        padding: 0.6rem;
    }

    .route-editor-section {
        padding: 0.65rem;
    }

    .route-gpx-import {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .route-gpx-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .route-editor-footer-actions {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .marker-editor-body {
        padding: 0.6rem;
    }

    .marker-editor-section {
        padding: 0.65rem;
    }

    .marker-image-control {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .marker-image-preview,
    .marker-image-empty {
        width: 42px;
        height: 42px;
    }

    .marker-image-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* Styles pour les popups personnalisées */
.marker-preview-popup .maplibregl-popup-content {
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.marker-preview-popup .maplibregl-popup-close-button {
    font-size: 20px;
    padding: 5px 10px;
}

/* ─── Plan Image Module — library picker ─────────────────────────── */
.plan-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.plan-lib-card { cursor: pointer; border: 2px solid transparent; border-radius: 6px; overflow: hidden; transition: border-color .15s; background: var(--mv-gray-50); }
.plan-lib-card:hover { border-color: var(--mv-gray-500); }
.plan-lib-card.selected { border-color: var(--mv-primary); }
.plan-lib-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.plan-lib-card-name { font-size: 10px; padding: 3px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(0,0,0,.04); color: var(--mv-gray-600); }

/* ─── Plan Editor — accordion restyle (inspired by editors v2) ───── */
.plan-editor-accordion { --pe-acc-border: #e6ebf3; --pe-acc-bg: #f8fbff; --pe-acc-bg-open: #eef5ff; --pe-acc-title: #2d3b55; --pe-acc-title-open: #1f3f72; }
.plan-editor-accordion .accordion-item {
    border: 1px solid var(--pe-acc-border) !important;
    border-radius: 12px !important;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(31, 63, 114, 0.05);
    margin-bottom: 10px;
    overflow: hidden;
}
.plan-editor-accordion .accordion-button {
    background: linear-gradient(180deg, #fbfdff 0%, var(--pe-acc-bg) 100%);
    color: var(--pe-acc-title);
    font-weight: 600;
    font-size: 0.93rem;
    border: 0;
    box-shadow: none;
}
.plan-editor-accordion .accordion-button:not(.collapsed) {
    background: linear-gradient(180deg, #f5f9ff 0%, var(--pe-acc-bg-open) 100%);
    color: var(--pe-acc-title-open);
    box-shadow: inset 0 -1px 0 rgba(31, 63, 114, 0.08);
}
.plan-editor-accordion .accordion-button:focus {
    box-shadow: 0 0 0 2px rgba(0, 85, 255, 0.15);
}
.plan-editor-accordion .accordion-button::after {
    width: 14px;
    height: 14px;
    background-size: 14px;
    opacity: 0.75;
}
.plan-editor-accordion .accordion-body {
    padding-top: 0.95rem;
    padding-bottom: 1rem;
    border-top: 1px solid rgba(31, 63, 114, 0.06);
}

.plan-editor-sidebar .accordion:not(.plan-editor-accordion) .accordion-item {
    border: 1px solid #e8edf5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(34, 61, 98, 0.05);
}

.plan-editor-sidebar .accordion:not(.plan-editor-accordion) .accordion-button {
    background: #f8fbff;
    color: var(--mv-text-heading);
    font-size: 0.88rem;
    font-weight: 600;
}

.plan-editor-sidebar .accordion:not(.plan-editor-accordion) .accordion-button:not(.collapsed) {
    background: #edf4ff;
    color: #1f3f72;
}

.plan-editor-sidebar .accordion:not(.plan-editor-accordion) .accordion-body {
    border-top: 1px solid rgba(31, 63, 114, 0.08);
}

/* ─── Plan Image UX helpers ───────────────────────────────────────── */
.plan-source-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-source-switch .btn { border-radius: 999px; padding: 0.35rem 0.8rem; font-size: 0.78rem; }
.plan-image-viewer-img {
    max-height: calc(100vh - 110px);
    max-width: calc(100vw - 40px);
    object-fit: contain;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
    background: #101820;
}

@media (max-width: 767px) {
    .plan-editor-accordion .accordion-item { border-radius: 10px !important; }
    .plan-editor-accordion .accordion-button { font-size: 0.9rem; }
}

/* ==================================================================
 * Marker style editor — interface d'edition (galerie, apercu, onglets)
 *
 * Le RENDU des marqueurs vit dans static/css/marker_style.css, charge par
 * shared/reuse/_maplibre.html : renderMarkerElement() ne pose que des
 * variables --marker-*, et une page carte qui ne charge pas cette feuille
 * affiche des pins de taille nulle. Les regles ci-dessous, elles, ne servent
 * qu'aux ecrans d'edition, qui chargent Argon de toute facon.
 * ================================================================== */

/* Mini-aperçu live dans le panneau d'édition */
.marker-preview-canvas {
    width: 100%;
    aspect-ratio: 1.6 / 1;
    background: #f4f6fb;
    border: 1px solid #e6e9f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.marker-preview-canvas::after {
    /* Petit repère discret au centre */
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    pointer-events: none;
}
.shape-gallery__item .marker-shape {
    --marker-size: 24px;
    --marker-color: #007aff;
    --marker-border-color: #ffffff;
    --marker-border-width: 2px;
}

/* Compactage des controles dans l'éditeur de style */
.marker-style-editor .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}
.marker-style-editor .form-control,
.marker-style-editor .form-select {
    font-size: 0.85rem;
}

/* Cartographie Historiz : gestion des marqueurs et composition de guides. */
.marker-manager-map {
  width: 100%;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--mv-gray-200);
  border-radius: .75rem;
}

@media (max-width: 767.98px) {
  .marker-manager-map { min-height: 320px; }
}

/* Plan editor: visit/type groups and collective pin controls. */
.plan-marker-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.plan-marker-toolbar > .btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; white-space: nowrap; margin-left: auto; }
.plan-marker-mode { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.plan-marker-mode-label { font-size: 12px; color: var(--mv-text); white-space: nowrap; }
.plan-marker-mode .btn-group .btn { font-size: 12px; padding: 6px 10px; box-shadow: none; }
.plan-marker-mode .btn-check:checked + .btn { background: #5269e8; border-color: #5269e8; color: #fff; }
.plan-marker-mode:disabled .btn { opacity: .6; pointer-events: none; }
.plan-default-style-card .card-header { user-select: none; }
.plan-default-style-card .card-header[aria-expanded="true"] > svg { transform: rotate(180deg); }
.plan-default-style-card .card-header > svg { transition: transform .15s ease; flex: 0 0 auto; }
.plan-marker-isolated { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 10px; border-radius: 8px; background: #eef2ff; color: var(--mv-text-heading); font-size: 12px; }
.plan-marker-numbering-notice { padding: 8px 10px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #ffe3a3; background: #fff8e6; color: var(--mv-text-heading); font-size: 12px; line-height: 1.45; }
.plan-marker-numbering-notice .btn-link { font-size: 12px; font-weight: 600; text-transform: none; }
.plan-marker-group { margin-bottom: 10px; border: 1px solid #e5e9f0; border-radius: 10px; overflow: hidden; background: #fff; }
.plan-marker-group > summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; background: #f8f9fc; list-style: none; }
.plan-marker-group > summary::-webkit-details-marker { display: none; }
.plan-marker-group > summary::after { content: '+'; color: var(--mv-text-muted); width: 14px; text-align: center; flex: 0 0 14px; }
.plan-marker-group[open] > summary::after { content: '–'; }
.plan-marker-group-heading { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.plan-marker-group-heading small, .plan-marker-group-label small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--mv-text); font-size: 11px; }
.plan-marker-group-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; line-height: 1.5; background: #e9ecf3; color: var(--mv-text); }
.plan-marker-group-badge.is-custom { background: #e3e8ff; color: #3b4ec1; }
.plan-marker-group-badge.is-mixed { background: #fff2d6; color: #9a6b00; }
.plan-marker-group-preview { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; }
.plan-marker-group-tools { display: flex; flex-shrink: 0; gap: 4px; }
.plan-marker-group-tool { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; margin: 0; border: 1px solid var(--mv-gray-300); border-radius: 8px; background: #fff; color: var(--mv-text); box-shadow: none; }
.plan-marker-group-tool svg { width: 15px; height: 15px; }
.plan-marker-group-tool:hover { background: #eef2ff; color: #3b4ec1; border-color: #c9d2ff; }
.plan-marker-group-tool.is-primary { background: #5269e8; border-color: #5269e8; color: #fff; }
.plan-marker-group-tool.is-primary:hover { background: #3f55d1; border-color: #3f55d1; color: #fff; }
.plan-marker-group-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #f0f2f6; }
.plan-marker-row-pin { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 26px; }
.plan-marker-group-label { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.plan-marker-row-actions { display: flex; flex-shrink: 0; }
.plan-marker-row-actions .btn { width: 30px; height: 32px; padding: 3px; margin: 0; }
.plan-marker-row-actions svg { width: 17px; height: 17px; }
.plan-marker-group-editor { padding: 12px; border: 1px solid #cfd7ed; border-radius: 10px; margin-bottom: 12px; background: #fff; }
.plan-marker-group > .plan-marker-group-editor { border: 0; border-top: 1px solid #e5e9f0; border-bottom: 1px solid #e5e9f0; border-radius: 0; margin: 0; background: #fbfcff; }
.plan-marker-group-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plan-marker-group-editor-actions .btn { margin: 0; }
.plan-marker-group-hidden { display: none !important; }
/* Module plans : CSS extrait d'argon-app.css (scripts/extract_module_css.py). Feuille du module : editer ici, avec les variables de static/css/app/tokens.css. */
.itinerary-poi-row {
    display: grid;
    grid-template-columns: 28px 34px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 0.65rem;
    min-height: 54px;
    border-color: var(--mv-gray-200);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.itinerary-poi-row:hover {
    background-color: var(--mv-gray-50);
    border-color: #b8d7ff;
}

.itinerary-poi-row:focus {
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(0, 122, 255, 0.18);
}

.itinerary-poi-row.is-selected {
    background-color: var(--mv-primary-50);
    border-color: #007aff;
}

.itinerary-poi-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.itinerary-poi-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--mv-gray-400);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: #fff;
}

.itinerary-poi-row.is-selected .itinerary-poi-check {
    border-color: #007aff;
    background-color: #007aff;
}

.itinerary-poi-order {
    min-width: 28px;
    height: 24px;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mv-gray-100);
    color: var(--mv-gray-500);
    font-size: 0.75rem;
    font-weight: 700;
}

.itinerary-poi-row.is-selected .itinerary-poi-order {
    background-color: #007aff;
    color: #fff;
}

.itinerary-poi-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.itinerary-poi-title {
    color: var(--mv-text-heading);
    font-size: 0.875rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.itinerary-poi-meta {
    color: var(--mv-text-muted);
    font-size: 0.75rem;
}

.itinerary-poi-drag {
    color: var(--mv-gray-400);
    cursor: grab;
    display: inline-flex;
    justify-content: center;
}

.itinerary-poi-drag:active {
    cursor: grabbing;
}

.itinerary-poi-row.is-selected .itinerary-poi-drag {
    color: #007aff;
}

@media (max-width: 575.98px) {
    .itinerary-poi-row {
        grid-template-columns: 26px 30px minmax(0, 1fr) 22px;
        gap: 0.5rem;
    }
}

#itineraire-editor .itinerary-poi-row {
    grid-template-columns: 24px 30px minmax(0, 1fr) 20px;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.45rem 0.55rem;
    border-width: 0 0 1px;
    border-radius: 0;
}

#itineraire-editor .itinerary-poi-row:last-child {
    border-bottom: 0;
}

#itineraire-editor .itinerary-poi-check {
    width: 20px;
    height: 20px;
}

#itineraire-editor .itinerary-poi-order {
    min-width: 25px;
    height: 21px;
    font-size: 0.68rem;
}

#itineraire-editor .itinerary-poi-title {
    font-size: 0.76rem;
}

#itineraire-editor .itinerary-poi-meta {
    font-size: 0.65rem;
}
