/* Barre d'affichage : même présentation que les pictogrammes de la fenêtre de droite (pastilles rondes sur bande blanche). */
.global-prefs-bar {
    background: #fff;
    color: #288eaf;
    padding: 5px 10px;
    height: 48px;
    box-sizing: border-box;
    margin: 0 0 12px 0;
    border: 1px solid #d5dbe1;
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    font-size: 0.9rem;
}

.prefs-icons { display: flex; gap: 6px; align-items: center; }

.prefs-icon-btn {
    background: #fff; border: 2px solid #288eaf; color: #288eaf; padding: 0;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.prefs-icon-btn:hover { background: #e8f4f8; }

.icon-box { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; background: transparent; position: relative; box-sizing: border-box; }
.icon-box.compact-icon::after { content: ''; position: absolute; top: 5px; left: 2px; right: 2px; height: 3px; background: currentColor; }
.icon-box.level1-icon::before { content: ''; position: absolute; top: 2px; left: 2px; right: 2px; height: 2px; background: currentColor; }
.icon-box.level1-icon::after { content: ''; position: absolute; bottom: 2px; left: 2px; right: 2px; height: 2px; background: currentColor; }
.icon-box.level2-icon::before { content: ''; position: absolute; top: 3px; left: 2px; right: 2px; height: 1px; background: currentColor; }
.icon-box.level2-icon::after { content: ''; position: absolute; bottom: 3px; left: 2px; right: 2px; height: 1px; background: currentColor; }

/* Renseignements du voyage et informations complémentaires : sous la bannière, sur toute la largeur. */
.trip-header-host:empty { display: none; }
.trip-header-host { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
body.mobile-pane-side .trip-header-host { display: none; }

/* Saisie du voyage : même filet arrondi que les fenêtres de gauche et de droite. */
.trip-summary-box {
    box-sizing: border-box; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 26px;
    border: 1px solid #d3dae1; border-radius: 28px; padding: 12px 26px; background: #fff; color: #29445f; font-size: 0.95rem;
}
.trip-summary-box > span { display: inline-flex; align-items: center; gap: 7px; }
.trip-summary-box svg { flex: 0 0 auto; color: #288eaf; }
body.dark-mode .trip-summary-box { border-color: #333c47; background: #222832; color: #c3ccd6; }
.trip-edit-box {
    box-sizing: border-box; border: 1px solid #d3dae1; border-radius: 28px; padding: 14px 26px; background: #f1f3f5; color: #0a2540;
}
.trip-edit-row { display: grid; gap: 12px 14px; }
.trip-edit-row + .trip-edit-row { margin-top: 12px; }
.trip-edit-row-people { grid-template-columns: 2fr 1fr 1fr; }
.trip-edit-row-places { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trip-edit-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: #495057; font-size: 0.75rem; font-weight: 700; }
.trip-edit-field input { width: 100%; min-height: 36px; box-sizing: border-box; padding: 7px 10px; border: 1px solid #ced4da; border-radius: 8px; background: #fff; color: #333; font: inherit; font-size: 0.92rem; font-weight: 400; }
.trip-edit-separator { height: 1px; margin: 16px 0 12px; background: #d3dae1; }
@media (max-width: 900px) {
    .trip-edit-row-people, .trip-edit-row-places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trip-edit-box { padding: 12px 18px; }
}
@media (max-width: 480px) {
    .trip-edit-row-people, .trip-edit-row-places { grid-template-columns: minmax(0, 1fr); }
}
body.dark-mode .trip-edit-box { border-color: #333c47; background: #1b2028; color: #e6edf3; }
body.dark-mode .trip-edit-field, body.dark-mode .trip-additional-field, body.dark-mode .trip-additional-info > summary { color: #c3ccd6; }
body.dark-mode .trip-edit-separator { background: #333c47; }

.trip-additional-info > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: #0a2540; font-weight: 700; font-size: 0.92rem; }
.trip-additional-info > summary::-webkit-details-marker { display: none; }
.trip-additional-info > summary::before { content: "▸"; color: #288eaf; transition: transform .15s; }
.trip-additional-info[open] > summary::before { transform: rotate(90deg); }
.trip-additional-info > summary:focus-visible { outline: 2px solid #288eaf; outline-offset: 3px; border-radius: 6px; }
.trip-additional-info-content { padding-top: 14px; }
body.dark-mode .trip-additional-info-content { background: transparent; }
.trip-additional-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.trip-additional-field { display: flex; flex-direction: column; gap: 5px; color: #343a40; font-size: 0.8rem; font-weight: 650; }
.trip-additional-field input,
.trip-additional-field select { width: 100%; min-height: 36px; box-sizing: border-box; padding: 7px 10px; border: 1px solid #ced4da; border-radius: 8px; background: #fff; color: #333; font: inherit; font-weight: 400; }
.trip-additional-particularities { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 16px 0 0; padding: 12px; border: 1px solid #e1e6ea; border-radius: 5px; }
.trip-additional-particularities legend { padding: 0 5px; color: #343a40; font-size: 0.8rem; font-weight: 700; }
.trip-additional-particularities label { display: inline-flex; align-items: center; gap: 7px; color: #495057; font-size: 0.85rem; }
.trip-additional-particularities input { width: 16px; height: 16px; accent-color: #288eaf; }

.edition-layout { display: flex; position: relative; gap: 20px; align-items: flex-start; }

.floating-toolbox {
    position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px;
    align-items: center; z-index: 100;
}

.toolbox-group-white,
.toolbox-group-generation,
.toolbox-group-actions {
    background: #ffffff; padding: 8px; border-radius: 50px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex; flex-direction: column; gap: 8px; align-items: center;
}

.tool-icon-circle {
    width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 0.9rem; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2); user-select: none; transition: transform 0.2s;
}
.tool-icon-circle:hover { transform: scale(1.1); }

.tool-back { background: #6c757d; color: white; }
.tool-back svg { width: 18px; height: 18px; fill: currentColor; }

.tool-mode { background: #17a2b8; color: white; }
.tool-mode svg { width: 18px; height: 18px; fill: currentColor; }

.tool-save {
    background-color: #dc3545; color: white; display: none; text-align: center; font-size: 0.85rem;
}
.tool-save.visible { display: flex; }

.tool-transport { background-color: var(--color-transport); cursor: grab; }
.tool-hebergement { background-color: var(--color-hebergement); cursor: grab; }
.tool-restauration { background-color: var(--color-restauration); cursor: grab; }
.tool-visite { background-color: var(--color-visite); cursor: grab; }
.tool-sport { background-color: var(--color-sport); color: #fff; cursor: grab; }
.tool-bonus { background-color: var(--color-bonus); color: #fff; cursor: grab; }
.tool-autre { background-color: var(--color-autre); color: #fff; cursor: grab; }
.tool-page { background-color: var(--color-page); color: #fff; cursor: grab; }
.tool-page svg path { fill: #fff; }
.tool-transport:active, .tool-hebergement:active, .tool-restauration:active, .tool-visite:active, .tool-sport:active, .tool-bonus:active, .tool-autre:active, .tool-page:active { cursor: grabbing; }

.edition-main-content { flex: 1; min-width: 0; }

/* --- Barre de jour : carré sombre (« JOUR » + numéro), date puis coût à droite --- */
.day-bar { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin: 14px 0 8px; 
    padding: 3px 6px 3px 3px; 
    cursor: pointer; 
    border-radius: 12px; 
    color: #0a2540; 
    font-size: 0.95rem;
    transition: background 0.2s;
}
.day-bar:hover { background: rgba(10, 37, 64, 0.05); }
.day-num { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; background: #25292e; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.day-num small { font-size: 0.52rem; letter-spacing: 0.1em; opacity: 0.8; }
.day-num b { font-size: 1.1rem; }
.day-bar .day-title { flex: 1 1 auto; min-width: 0; font-weight: 400; }
.day-bar .day-cost-display { margin-left: auto; font-size: 1rem; font-style: normal; font-weight: 400; font-variant-numeric: tabular-nums; }
body.dark-mode .day-bar { color: #e6edf3; }
body.dark-mode .day-bar:hover { background: rgba(255, 255, 255, 0.07); }
.day-bar.is-new-day { animation: day-bar-new 2.5s ease-out; }
@keyframes day-bar-new { 0%, 40% { background: rgba(40, 142, 175, 0.28); box-shadow: 0 0 0 2px #288eaf; } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }
body.dark-mode .day-num { background: #0d1014; box-shadow: 0 0 0 1px #3b4552; }
.summary-bar .trip-total-cost {
    font-size: 0.85em;
    font-style: italic;
    font-weight: normal;
}

.functions-container { 
    display: block; 
    padding-left: 0; 
    min-height: 48px; 
    box-sizing: border-box;
    position: relative;
}

.function-item {
    margin: 8px 0;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(10, 37, 64, 0.2);
    transition: margin-left 0.2s ease, opacity 0.2s ease;
    position: relative;
}

.function-item.is-dragging {
    opacity: 0.35 !important;
}

.drag-insert-line {
    width: 100%;
    height: 36px;
    margin: 6px 0;
    background: #e2e8f0;
    border: 2px dashed #94a3b8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-sizing: border-box;
    pointer-events: none;
    user-select: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    animation: insertLinePop 0.12s ease-out;
}

@keyframes insertLinePop {
    from { transform: scaleY(0.4); opacity: 0; }
    to { transform: scaleY(1); opacity: 1; }
}

.offset-transport { margin-left: 0px; }
.offset-hebergement { margin-left: 10px; }
.offset-restauration { margin-left: 20px; }
.offset-visite { margin-left: 30px; }
.offset-sport { margin-left: 30px; }
.offset-bonus { margin-left: 40px; }
.offset-autre { margin-left: 40px; }

.function-bar-minimal {
    position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; cursor: grab; font-size: 0.9rem; user-select: none;
    border-radius: 7px; background: var(--bar-color); color: #fff;
}
.function-bar-minimal:active { cursor: grabbing; }

.item-icon { width: 22px; height: 22px; box-sizing: border-box; vertical-align: middle; margin-right: 8px; display: inline-block; flex: 0 0 auto; }
.item-icon path { fill: currentColor !important; }

.bar-title { display: flex; align-items: center; flex-wrap: wrap; min-width: 0; font-weight: 400; overflow-wrap: anywhere; }
.bar-right-zone { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; }
.function-cost-display { font-size: 0.8rem; font-style: italic; font-weight: normal; }

/* Fiches : bandeau de couleur sur une ligne (icône, titre, coût), enfichées sur un rail pointillé ; couleur de la fiche dans --bar-color. */
.function-item { --bar-color: var(--color-autre); }
.function-item.type-depart { --bar-color: #4f9fc2; }
.function-item.type-transport { --bar-color: var(--color-transport); }
.function-item.type-hebergement { --bar-color: var(--color-hebergement); }
.function-item.type-restauration { --bar-color: var(--color-meal-lunch); }
.function-item.type-restauration.meal-breakfast { --bar-color: var(--color-meal-breakfast); }
.function-item.type-restauration.meal-dinner { --bar-color: var(--color-meal-dinner); }
.function-item.type-restauration.meal-snack { --bar-color: var(--color-meal-snack); }
.function-item.type-visite { --bar-color: var(--color-visite); }
.function-item.type-sport { --bar-color: var(--color-sport); }
.function-item.type-bonus { --bar-color: var(--color-bonus); }
.function-item.type-autre { --bar-color: var(--color-autre); }
/* Barre page : gris clair, icône et texte blancs. */
.function-item.type-page { --bar-color: var(--color-page); }
.function-bar-minimal.is-clickable { cursor: pointer; }
.function-item.is-page-open { box-shadow: 0 0 0 2px #8b949e, 0 4px 10px rgba(10, 37, 64, 0.25); }
.page-bar-inline { padding: 12px 15px; background: #fff; border-radius: 0 0 7px 7px; color: #333; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere; }
.page-bar-inline img { max-width: 100%; height: auto; }
/* En-têtes et pieds de page : pleine largeur, sans rail ni décalage ; la zone vide n'apparaît que pendant le glisser d'une barre page. */
.page-zone { margin: 8px 0; }
.page-zone:empty { height: 0; margin: 0; }
.page-bar-zone { margin-left: 0; margin-right: 0; }
body.is-dragging-page .page-zone { min-height: 44px; outline: 2px dashed #b3bcc5; outline-offset: 2px; border-radius: 8px; }
body.is-dragging-page .page-zone:empty { height: auto; margin: 8px 0; }
body.is-dragging-page .page-zone:empty::before { content: "Déposer ici : " attr(data-zone-label) " (pleine largeur)"; display: flex; align-items: center; justify-content: center; min-height: 44px; color: #6b7580; font-size: 0.82rem; font-weight: 600; }

.function-bar-minimal .plan-b-tag { background: rgba(255, 255, 255, 0.3); color: #fff; }
.function-bar-minimal .plan-b-cost { color: #fff !important; }
.function-bar-minimal .func-menu-btn { width: 24px; height: 24px; }
.function-bar-minimal .link-pill { width: 24px; height: 24px; }
/* Pastille de nuitées : lisible sur le fond de couleur. */
.bar-title span[style*="rgba(111, 66, 193"] { background: rgba(255, 255, 255, 0.28) !important; color: #fff !important; }
.function-bar-minimal:has(+ .function-detail[style*="display: block"]) { border-radius: 7px 7px 0 0; }

/* Plan B et barres absentes : fiche réduite à 50 % d'opacité. */
.function-item.is-compact > .function-bar-minimal { padding: 2px 6px 2px 10px; font-size: 0.8rem; border-radius: 6px; }
.function-item.is-compact .item-icon { width: 16px; height: 16px; margin-right: 6px; }
.function-item.is-compact .func-menu-btn, .function-item.is-compact .link-pill { width: 22px; height: 22px; }
.function-item.is-faded > .function-bar-minimal { opacity: 0.5; }

/* Rail pointillé de la journée et rond de ville : un rond, de la couleur de la barre, à chaque changement de ville (jamais sur les fiches décalées). */
.functions-container:has(> .function-item)::before {
    content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; border-radius: 1px; pointer-events: none;
    background: repeating-linear-gradient(#c4ccd5 0 6px, transparent 6px 10px);
}
.bar-city-dot { position: absolute; left: -25px; top: 10px; z-index: 2; width: 18px; height: 18px; cursor: help; outline: none; }
.bar-city-dot::before { content: ""; position: absolute; left: 4px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bar-color); box-shadow: 0 0 0 3px #fff, 0 0 0 4px #c4ccd5; }
.bar-city-dot::after {
    content: attr(data-city); position: absolute; left: 24px; top: 50%; transform: translateY(-50%); z-index: 6; padding: 3px 9px; border-radius: 6px;
    background: #0a2540; color: #fff; font-size: 0.72rem; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; text-shadow: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.bar-city-dot:hover::after, .bar-city-dot:focus-visible::after { opacity: 1; }

/* Le trait pointillé s'arrête au point d'arrivée : sous le milieu de la barre, un cache de la couleur de la page masque le rail. */
.functions-container:has(> .return-bar) { min-height: 0; }
.return-bar::after {
    content: ""; position: absolute; left: -22px; width: 14px; top: 20px; bottom: 0; background: var(--bg-color); pointer-events: none; z-index: 1;
}
/* Pas de retour au point de départ (édition) : barre grisée. */
.function-item.return-bar.is-disabled { --bar-color: #6c757d; }
.function-item.return-bar.is-disabled > .function-bar-minimal { cursor: default; }

@media print {
    .bar-city-dot::before, .function-bar-minimal, .day-num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Barre sélectionnée : la fiche est cerclée de sa couleur. */
.function-item.is-selected-bar { box-shadow: 0 0 0 2px var(--bar-color), 0 4px 10px rgba(10, 37, 64, 0.25); }
.tool-bonus svg path, .tool-sport svg path, .tool-autre svg path { fill: #fff; }

.function-detail {
    display: none; padding: 10px 15px; background: linear-gradient(color-mix(in srgb, var(--bar-color, #6c757d) 16%, #fff), #fff 140%); border-radius: 0 0 7px 7px; font-size: 0.85rem; color: #555; line-height: 1.4;
}

.detail-content-wrapper { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; flex-wrap: wrap; }

.detail-text-side { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.detail-text-side input, .detail-text-side select, .detail-text-side textarea { padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; width: 100%; box-sizing: border-box; }
/* Barre transport : provenance et destination dans un cadre gris très clair, reliées par un trait fin ; durée et distance sur une seule ligne. */
.transport-route { background: #f4f6f8; border: 1px solid #e3e7eb; border-radius: 12px; padding: 8px 10px; }
.transport-route-row { position: relative; padding-left: 42px; }
.transport-route-row:first-child { padding-bottom: 6px; }
.transport-route-dot { position: absolute; left: 24px; top: 33.5px; width: 10px; height: 10px; border-radius: 50%; background: #288eaf; z-index: 1; }
.transport-route-row:first-child::after { content: ''; position: absolute; left: 28.5px; top: 43.5px; bottom: 0; width: 1px; background: #288eaf; }
.transport-route-row:last-child::before { content: ''; position: absolute; left: 28.5px; top: 0; height: 38.5px; width: 1px; background: #288eaf; }
/* Aimants sans rond : bleus si l'adresse reprise est vérifiée, gris sinon ; les pôles regardent vers le haut (provenance) ou le bas (destination). */
.place-magnet { position: absolute; left: 0; top: 28.5px; width: 20px; height: 20px; padding: 0; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }
.place-magnet.is-on { color: #288eaf; }
.place-magnet.is-off { color: #adb5bd; }
.place-magnet.is-busy { opacity: .5; cursor: progress; }
.place-magnet.is-down svg { transform: rotate(180deg); }
.place-magnet:hover { filter: brightness(0.85); }
/* Bouton copier : deux rectangles arrondis en filet fin, gris, collés au champ de saisie. */
.place-copy-btn { flex: 0 0 auto; box-sizing: border-box; width: 16px; height: 20px; margin-right: -4px; padding: 0; border: 0; background: transparent; color: #8a9096; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.place-copy-btn:hover { color: #495057; }
.place-copy-btn.is-empty { color: #ced4da; cursor: default; }
.place-copy-btn.is-copied { color: #28a745; }
.transport-metrics { display: flex; gap: 10px; }
.transport-metrics > div { flex: 1; min-width: 0; }
body.dark-mode .transport-route { background: #1d232c; border-color: #333c47; }

.detail-images-side { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; max-width: 300px; flex-shrink: 0; }

.detail-row { margin-bottom: 4px; }

.custom-file-upload {
    display: inline-block; background-color: var(--primary-color); color: white; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: bold; text-align: center; transition: background 0.2s;
}
.custom-file-upload:hover { background-color: #0056b3; }
.hidden-file-input { display: none; }

.image-wrapper { position: relative; display: inline-block; }

.delete-img-badge {
    position: absolute; top: -6px; right: -6px; background: #dc3545; color: white; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.3); z-index: 10;
}
.delete-img-badge:hover { background: #bd2130; }

.delete-func-badge {
    background: #dc3545; color: white; border-radius: 50%; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.delete-func-badge:hover { background: #bd2130; }

/* Menu « trois points » d'une barre et état Plan B */
.func-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.func-menu-btn:hover, .func-menu-btn:focus-visible { background: rgba(0, 0, 0, 0.12); outline: none; }
.func-context-menu { position: fixed; z-index: 5000; min-width: 170px; padding: 4px; background: #fff; border: 1px solid #d5dbe1; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; }
.func-context-menu button { padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: #0a2540; font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
.func-context-menu button:hover, .func-context-menu button:focus-visible { background: #e8f4f8; outline: none; }
.func-context-menu button.is-danger { color: #bd2130; }
.func-context-menu button.is-danger:hover { background: #fdecee; }
.func-context-menu-title { padding: 6px 12px 4px; color: #5b6772; font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.func-context-menu button.func-context-menu-choice { position: relative; padding-left: 30px; }
.func-context-menu button.func-context-menu-choice.is-active { font-weight: 700; }
.func-context-menu button.func-context-menu-choice.is-active::before { content: "✓"; position: absolute; left: 11px; color: #288eaf; }
body.dark-mode .func-context-menu-title { color: #aab4bf; }
.plan-b-tag { padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--plan-b-color, #6c757d) 50%, transparent); color: #0a2540; font-size: 0.7rem; font-weight: 700; line-height: 1.3; white-space: nowrap; font-style: normal; }
.plan-b-cost { font-style: italic; color: #8a929a !important; }
body.dark-mode .func-context-menu { background: #1d232c; border-color: #3b4552; }
body.dark-mode .func-context-menu button { color: #e6edf3; }
body.dark-mode .func-context-menu button:hover, body.dark-mode .func-context-menu button:focus-visible { background: #2a3340; }
body.dark-mode .func-context-menu button.is-danger { color: #ff8a93; }

.detail-image {
    width: 75px; height: 75px; object-fit: cover; border-radius: 6px; border: 1px solid #ccc; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: block; cursor: pointer; transition: transform 0.2s;
}
.detail-image:hover { transform: scale(1.05); }

/* --- Bouton "Ajouter un jour" en bleu plus clair --- */
.add-day-btn {
    display: block; 
    width: 100%; 
    padding: 12px; 
    background-color: #17a2b8; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    font-weight: bold; 
    font-size: 0.95rem; 
    cursor: pointer; 
    margin-top: 15px; 
    text-align: center; 
    transition: background 0.2s;
}
.add-day-btn:hover { background-color: #138496; }

.summary-bar { 
    background: #343a40; color: white; padding: 15px; border-radius: 4px; margin-top: 20px; font-weight: bold; display: flex; flex-direction: column; gap: 8px; text-align: center; font-size: 1.1rem;
}

.badge-read-only {
    font-size: 0.75rem; background: #6c757d; color: white; padding: 2px 6px; border-radius: 4px; font-weight: normal; margin-left: 8px;
}

/* --- Barre d'affichage global : niveaux, filtre, carrousel --- */
.prefs-icon-btn.active { background: #288eaf; border-color: #288eaf; color: #fff; }
.prefs-level-number { margin-left: 6px; font-weight: bold; font-size: 0.85rem; }
.prefs-filter { position: relative; }
.prefs-filter > summary { list-style: none; }
.prefs-filter > summary::-webkit-details-marker { display: none; }
.prefs-filter-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 210px;
    background: #fff; color: #333; border: 1px solid #ced4da; border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.prefs-filter-panel label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.85rem; }
.prefs-filter-panel hr { width: 100%; border: 0; border-top: 1px solid #dee2e6; margin: 2px 0; }

.trip-filter-scope.filter-mode-hide.filter-min-transport .function-item.type-transport,
.trip-filter-scope.filter-mode-hide.filter-min-hebergement .function-item.type-hebergement,
.trip-filter-scope.filter-mode-hide.filter-min-restauration .function-item.type-restauration,
.trip-filter-scope.filter-mode-hide.filter-min-visite .function-item.type-visite,
.trip-filter-scope.filter-mode-hide.filter-min-bonus .function-item.type-bonus { display: none; }

.trip-filter-scope.filter-mode-line.filter-min-transport .function-item.type-transport,
.trip-filter-scope.filter-mode-line.filter-min-hebergement .function-item.type-hebergement,
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration,
.trip-filter-scope.filter-mode-line.filter-min-visite .function-item.type-visite,
.trip-filter-scope.filter-mode-line.filter-min-bonus .function-item.type-bonus { margin-top: 2px; margin-bottom: 2px; }
.trip-filter-scope.filter-mode-line.filter-min-transport .function-item.type-transport .function-bar-minimal,
.trip-filter-scope.filter-mode-line.filter-min-hebergement .function-item.type-hebergement .function-bar-minimal,
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration .function-bar-minimal,
.trip-filter-scope.filter-mode-line.filter-min-visite .function-item.type-visite .function-bar-minimal,
.trip-filter-scope.filter-mode-line.filter-min-bonus .function-item.type-bonus .function-bar-minimal {
    height: 6px; padding: 0 !important; overflow: hidden; cursor: default; border-radius: 3px; box-shadow: none !important;
}
.trip-filter-scope.filter-mode-line.filter-min-transport .function-item.type-transport .function-bar-minimal { background: var(--color-transport) !important; }
.trip-filter-scope.filter-mode-line.filter-min-hebergement .function-item.type-hebergement .function-bar-minimal { background: var(--color-hebergement) !important; }
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration .function-bar-minimal { background: var(--color-restauration) !important; }
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration.meal-breakfast .function-bar-minimal { background: var(--color-meal-breakfast) !important; }
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration.meal-lunch .function-bar-minimal { background: var(--color-meal-lunch) !important; }
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration.meal-dinner .function-bar-minimal { background: var(--color-meal-dinner) !important; }
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration.meal-snack .function-bar-minimal { background: var(--color-meal-snack) !important; }
.trip-filter-scope.filter-mode-line.filter-min-visite .function-item.type-visite .function-bar-minimal { background: var(--color-visite) !important; }
.trip-filter-scope.filter-mode-line.filter-min-bonus .function-item.type-bonus .function-bar-minimal { background: var(--color-bonus) !important; }
.trip-filter-scope.filter-mode-line.filter-min-transport .function-item.type-transport .function-bar-minimal > *,
.trip-filter-scope.filter-mode-line.filter-min-hebergement .function-item.type-hebergement .function-bar-minimal > *,
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration .function-bar-minimal > *,
.trip-filter-scope.filter-mode-line.filter-min-visite .function-item.type-visite .function-bar-minimal > *,
.trip-filter-scope.filter-mode-line.filter-min-bonus .function-item.type-bonus .function-bar-minimal > *,
.trip-filter-scope.filter-mode-line.filter-min-transport .function-item.type-transport .function-detail,
.trip-filter-scope.filter-mode-line.filter-min-hebergement .function-item.type-hebergement .function-detail,
.trip-filter-scope.filter-mode-line.filter-min-restauration .function-item.type-restauration .function-detail,
.trip-filter-scope.filter-mode-line.filter-min-visite .function-item.type-visite .function-detail,
.trip-filter-scope.filter-mode-line.filter-min-bonus .function-item.type-bonus .function-detail { display: none !important; }

.trip-filter-scope.filter-mode-hide.filter-min-sport .function-item.type-sport,
.trip-filter-scope.filter-mode-hide.filter-min-planb .function-item.plan-b { display: none; }
/* Plan B décoché en mode « ligne colorée » : la barre devient un trait de sa couleur. */
.trip-filter-scope.filter-mode-line.filter-min-planb .function-item.plan-b { margin-top: 2px; margin-bottom: 2px; }
html body .trip-filter-scope.filter-mode-line.filter-min-planb .function-item.plan-b.plan-b > .function-bar-minimal {
    height: 6px; min-height: 0; padding: 0 !important; overflow: hidden; cursor: default; border-radius: 3px; box-shadow: none !important; opacity: 1;
    background-color: var(--plan-b-color, #6c757d) !important; background-image: none !important;
}
.trip-filter-scope.filter-mode-line.filter-min-planb .function-item.plan-b .function-bar-minimal > *,
.trip-filter-scope.filter-mode-line.filter-min-planb .function-item.plan-b .function-detail { display: none !important; }
.trip-filter-scope.filter-mode-line.filter-min-sport .function-item.type-sport { margin-top: 2px; margin-bottom: 2px; }
.trip-filter-scope.filter-mode-line.filter-min-sport .function-item.type-sport .function-bar-minimal {
    height: 6px; padding: 0 !important; overflow: hidden; cursor: default; border-radius: 3px; box-shadow: none !important; background: var(--color-sport) !important;
}
.trip-filter-scope.filter-mode-line.filter-min-sport .function-item.type-sport .function-bar-minimal > *,
.trip-filter-scope.filter-mode-line.filter-min-sport .function-item.type-sport .function-detail { display: none !important; }

.zoom-nav {
    position: fixed; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,0.2); color: #fff; font-size: 1.3rem; cursor: pointer; align-items: center; justify-content: center; z-index: 2;
}
.zoom-nav:hover { background: rgba(255,255,255,0.4); }
.zoom-prev { left: 24px; }
.zoom-next { right: 24px; }
#zoom-counter { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(0,0,0,0.6); padding: 3px 12px; border-radius: 12px; font-size: 0.85rem; }
.verif-address { margin-top: 4px; color: #8a9096; font-size: 0.85rem; }
.magic-wand-row { display: flex; justify-content: flex-start; }
.magic-theme { display: inline-block; padding: 3px 12px; border-radius: 12px; color: #fff; font-size: 0.8rem; font-weight: 700; margin-bottom: 6px; }
.magic-wand-btn { width: 30px; height: 30px; border-radius: 50%; border: none; background: #6f42c1; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.magic-wand-btn:hover { filter: brightness(0.85); }
.verified-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #28a745; color: #fff; font-size: 0.8rem; font-weight: 700; margin-right: 6px; }
.verified-badge[hidden] { display: none; }
.magic-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 12px; }
.magic-modal { position: relative; background: #fff; color: #222; border-radius: 10px; padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-sizing: border-box; }
.magic-modal h3 { margin: 0 0 10px; }
.magic-modal input[type="text"], .magic-select { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid #ced4da; border-radius: 4px; }
.magic-label { display: block; font-size: 0.75rem; font-weight: 700; margin: 8px 0 2px; }
.magic-close { position: absolute; top: 8px; right: 12px; border: none; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #555; }
.magic-search-btn, .magic-import-btn { margin-top: 10px; padding: 7px 14px; border: none; border-radius: 6px; background: #6f42c1; color: #fff; font-weight: 700; cursor: pointer; }
.magic-import-btn { background: #28a745; }
.magic-import-btn:disabled { opacity: .6; cursor: wait; }
.magic-msg { margin-top: 8px; font-size: 0.8rem; color: #6c757d; }
.magic-msg.is-busy { color: #0a2540; font-weight: 600; }
/* Pastille tournante : recherche en cours (baguette magique, fenêtre de droite). */
.is-busy::before, .side-busy-spinner {
    content: ''; display: inline-block; width: 12px; height: 12px; box-sizing: border-box; margin-right: 8px; vertical-align: -2px;
    border: 2px solid #288eaf; border-right-color: transparent; border-radius: 50%; animation: ySpin .8s linear infinite;
}
@keyframes ySpin { to { transform: rotate(360deg); } }
.magic-search-btn:disabled { opacity: .6; cursor: progress; }
.toolbox-group-generation .tool-bonus svg path, .toolbox-group-generation .tool-autre svg path { fill: #fff; }
.magic-msg.is-error { color: #dc3545; }
.magic-select { margin: 10px 0 4px; }
.magic-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 0.85rem; }
.magic-row input { margin-top: 4px; }
.magic-photo { max-width: 100%; max-height: 140px; border-radius: 6px; margin-top: 4px; }
.magic-actions { text-align: right; }
.link-pill { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: #288eaf; color: #fff; text-decoration: none; border: none; cursor: pointer; vertical-align: middle; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.link-pill:hover { filter: brightness(0.85); color: #fff; }
/* Pictogramme carte d'un champ adresse : gris tant que le champ est vide. */
.link-pill.is-empty { background: #adb5bd; box-shadow: none; }
.field-with-pill { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.field-with-pill > input { flex: 1; min-width: 0; margin-top: 0; }
/* Champ lieu unique : suggestions sous le champ, coche grise (adresse non vérifiée) ou verte (adresse vérifiée). */
.place-field { position: relative; }
.place-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: #adb5bd; color: #fff; font-size: 0.8rem; font-weight: 700; line-height: 1; cursor: pointer; }
.place-badge.is-empty { cursor: default; opacity: .6; }
.place-badge.is-verified { background: #28a745; cursor: default; }
.place-suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin: 2px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #ced4da; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.18); max-height: 280px; overflow-y: auto; }
.place-suggestions[hidden] { display: none; }
.place-suggestion { display: flex; flex-direction: column; padding: 6px 10px; cursor: pointer; color: #0a2540; }
.place-suggestion strong { font-size: 0.85rem; }
.place-suggestion small { font-size: 0.75rem; color: #5b6772; overflow-wrap: anywhere; }
.place-suggestion.is-active, .place-suggestion:hover { background: #e8f4f8; }
.place-suggestion-note { cursor: default; color: #5b6772; font-size: 0.8rem; }
.place-suggestion-note:hover { background: transparent; }
.place-suggestion-free { border-top: 1px solid #e3e8ed; }
body.dark-mode .place-suggestions { background: #1c222b; border-color: #3a4452; }
body.dark-mode .place-suggestion { color: #e6edf3; }
body.dark-mode .place-suggestion small { color: #9fb0c0; }
body.dark-mode .place-suggestion.is-active, body.dark-mode .place-suggestion:hover { background: #2a3442; }
.magic-slider { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; }
.magic-slide-btn { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: none; background: #6f42c1; color: #fff; font-size: 1.1rem; cursor: pointer; }
.magic-slide-btn:disabled { opacity: .35; cursor: default; }
.magic-slide-card { flex: 1; min-width: 0; text-align: center; font-size: 0.8rem; color: #555; }
.magic-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.magic-dot { width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0; background: #ced4da; cursor: pointer; }
.magic-dot.is-active { background: #6f42c1; }
.magic-field-row { display: flex; align-items: flex-start; gap: 10px; }
.magic-field-row > .magic-wand-btn { flex: 0 0 auto; margin-top: 2px; }
.magic-field-body { flex: 1; min-width: 0; }
.magic-field-body > input { width: 100%; box-sizing: border-box; }
.prefs-mode-btn { min-width: 36px; font-weight: bold; font-size: 0.7rem; }
.nav-pill { display: none; }
.prefs-bar-menu { display: none; color: #288eaf; }
.tool-drag-ghost { position: fixed; left: 0; top: 0; width: min(280px, 70vw); margin: 0; opacity: .6; pointer-events: none; z-index: 4000; box-shadow: 0 6px 18px rgba(0,0,0,.3); will-change: transform; }
@media (max-width: 767px) {
    .nav-pill { display: inline-flex; }
    /* Pastilles de guidage 15 % plus grandes. */
    .function-bar-minimal .nav-pill { width: 28px; height: 28px; }
    .function-item.is-compact .nav-pill { width: 25px; height: 25px; }
    .nav-pill svg { width: 16px; height: 16px; }
    /* Menu « trois points » de la barre d'affichage : ce que les barres montrent à droite (géolocalisation, coût € ou coût en devise). */
    .prefs-bar-menu { display: inline-flex; margin-left: auto; }
    .prefs-currency.is-in-bar-menu { display: none; }
    .trip-filter-scope.bar-right-geo .bar-right-zone .function-cost-display { display: none; }
    .trip-filter-scope.bar-right-eur .bar-right-zone .nav-pill, .trip-filter-scope.bar-right-local .bar-right-zone .nav-pill { display: none; }
    /* Marges réduites : menu latéral et accordéon collés au bord, rien ne dépasse ni ne se déplace de gauche à droite. */
    body.side-available { padding-left: 6px; padding-right: 6px; }
    /* Le menu latéral reste sous la barre de menu collée en haut, sans la recouvrir. */
    .trip-split .floating-toolbox { top: calc(var(--trip-nav-h, 74px) + 8px); z-index: 20; }
    .edition-layout { gap: 6px; }
    .edition-main-content { overflow-x: clip; }
    .toolbox-group-white, .toolbox-group-generation, .toolbox-group-actions { padding: 5px; gap: 6px; }
    .floating-toolbox { gap: 8px; }
    .function-bar-minimal { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
    .function-bar-minimal.is-long-press { filter: brightness(0.9); outline: 3px solid #288eaf; outline-offset: -3px; }
}
.function-item.is-just-edited > .function-bar-minimal { animation: barJustEdited 1.6s ease-out; }
@keyframes barJustEdited { 0%, 60% { outline: 3px solid #288eaf; outline-offset: -3px; } 100% { outline: 3px solid transparent; outline-offset: -3px; } }
body.dark-mode .global-prefs-bar { background: #171b22; border-color: #333c47; }
body.dark-mode .prefs-icon-btn { background: transparent; }
body.dark-mode .prefs-icon-btn.active { background: #288eaf; }
.prefs-icon-btn { border-radius: 50%; width: 36px; height: 36px; padding: 0; }
.prefs-filter > summary.prefs-icon-btn { border-radius: 50%; }

.partner-summary-bar { gap: 12px; flex-wrap: wrap; }
.partner-summary-bar.is-link { cursor: pointer; }
.partner-summary-bar.is-link:hover { filter: brightness(1.08); }
.partner-summary-bar small { opacity: 0.85; margin-left: 4px; }
.partner-summary-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 320px; justify-content: flex-end; }
.partner-summary-fields input { padding: 5px 8px; border: 1px solid #ced4da; border-radius: 4px; font-size: 0.85rem; min-width: 110px; flex: 1 1 110px; max-width: 260px; }
.partner-summary-fields input[type="url"] { flex: 2 1 200px; max-width: 360px; }