/* style.css - BASE V1 RESTAURÉE + PATCH BOUTONS */
:root, html[data-theme="maritime"] {
    --bg: #0D3B66; --bg-2: #062B4D; --surface: #FFFFFF; --surface-muted: #F0F4F8; --ink: #102A43; --ink-soft: #627D98; --line: #D9E2EC; --brand: #3B82F6; --brand-soft: #D6EAFE; --ok: #10B981; --warn: #F59E0B; --danger: #EF4444; --shadow: 0 8px 24px rgba(2,12,27,.10), 0 2px 8px rgba(2,12,27,.06); --shadow-soft: 0 4px 12px rgba(100, 116, 139, 0.1);
}

html[data-theme="desert"] {
    --bg: #4d2c12; --bg-2: #3a210e; --surface: #fff8f0; --surface-muted: #f5efe6; --ink: #3a210e; --ink-soft: #8a6f5e; --line: #e0d5c7; --brand: #e88c32; --brand-soft: #faeadd; --ok: #10B981; --warn: #F59E0B; --danger: #EF4444;
}

html[data-theme="oasis"] {
    --bg: #065f46; --bg-2: #054d39; --surface: #f0fdf4; --surface-muted: #e6f7eb; --ink: #064e3b; --ink-soft: #528c7c; --line: #cce8d8; --brand: #34d399; --brand-soft: #d1fae5; --ok: #10B981; --warn: #F59E0B; --danger: #EF4444;
}

html[data-theme="night"] {
    --bg: #111827; --bg-2: #000000; --surface: #1f2937; --surface-muted: #374151; --ink: #d1d5db; --ink-soft: #9ca3af; --line: #4b5563; --brand: #60a5fa; --brand-soft: #374151; --ok: #34d399; --warn: #facc15; --danger: #f87171;
}

html[data-theme="night"] input,
html[data-theme="night"] textarea {
    color: var(--ink);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--surface-muted);
    color: var(--ink);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ======================== STYLES PC ============================ */

.topbar { position: absolute; top: 0; left: 0; right: 0; height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #fff; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); box-shadow: var(--shadow); z-index: 1001; }
.topbar-left { flex-shrink: 0; }
.topbar-center { flex-grow: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.app-title { font-size: 20px; font-weight: 700; color: #fff; margin: 0; white-space: nowrap; }
.search-container { position: relative; width: 100%; max-width: 450px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9eacba; width: 20px; height: 20px; pointer-events: none; }
#search-input { width: 100%; height: 38px; border-radius: 14px; border: 1px solid rgba(255,255,255,.18); background-color: rgba(255,255,255,.10); padding: 0 16px 0 44px; color: white; font-size: 15px; transition: all .2s ease; }
#search-input::placeholder { color: #9eacba; }
#search-input:focus { outline: none; background-color: rgba(255,255,255,.14); border-color: var(--brand); }
.search-results { position: absolute; top: 100%; left: 0; width: 100%; margin-top: 8px; background-color: var(--surface); border-radius: 8px; box-shadow: var(--shadow); z-index: 1003; max-height: 400px; overflow-y: auto; border: 1px solid var(--line); }
.search-results button { display: block; width: 100%; padding: 12px 15px; background: none; border: none; text-align: left; cursor: pointer; font-size: 15px; color: var(--ink); border-bottom: 1px solid var(--surface-muted); }
.search-results button:last-child { border-bottom: none; }
.search-results button:hover { background-color: var(--surface-muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.10); color: #fff; border: 1px solid rgba(255,255,255,.18); font-weight: 600; cursor: pointer; transition: all .18s ease; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:hover:not(:disabled) { transform: translateY(-1px); background: rgba(255,255,255,.14); }
.btn.active { background: var(--brand); color: #fff; border-color: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; background-color: rgba(255,255,255,.05); }
.separator { height: 24px; width: 1px; background-color: rgba(255,255,255,0.2); margin: 0 4px; }
.zones-container { position: relative; }
.zones-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; background-color: var(--surface); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow); z-index: 2000; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); min-width: 200px; }
.zones-menu button { display: block; width: 100%; padding: 10px 15px; background: none; border: none; text-align: left; cursor: pointer; font-size: 15px; color: var(--ink); }
.zones-menu button:hover { background-color: var(--surface-muted); }

#map { position: absolute; top: 64px; left: 0; right: 0; bottom: 0; }
#app-version { position: absolute; bottom: 30px; left: 10px; z-index: 1003; color: var(--ink-soft); font-size: 12px; background: rgba(255,255,255,0.7); padding: 2px 5px; border-radius: 4px; }
.leaflet-control-attribution { z-index: 1003 !important; }
.hw-icon { display: flex; justify-content: center; align-items: center; width: 32px; height: 32px; background-color: var(--surface); border: 2px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow-soft); }
.hw-icon svg { color: var(--ink); width: 18px; height: 18px; }
.right-sidebar { position: fixed; top: 64px; right: 0; bottom: 0; height: auto; width: clamp(380px, 30vw, 480px); max-width: 100%; background: var(--surface-muted); box-shadow: var(--shadow); z-index: 1002; display: flex; flex-direction: column; }
.sidebar-tabs { display: flex; background-color: var(--surface-muted); padding: 4px; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.tab-button { flex: 1; padding: 10px; border: none; background-color: transparent; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink-soft); border-radius: 8px; transition: all 0.2s ease-in-out; }
.tab-button.active { background-color: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.sidebar-panel { display: none; flex-direction: column; flex-grow: 1; min-height: 0; background: var(--surface-muted); }
.sidebar-panel.active { display: flex; }
.panel-content { padding: 12px; flex-grow: 1; display: flex; flex-direction: column; overflow-y: auto; gap: 12px; }
.detail-section { margin-bottom: 0; display: flex; flex-direction: column; flex-shrink: 0; }
.detail-section h3 { font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 8px 0; display: flex; align-items: center; padding: 0 8px; }
.detail-section .content { background: var(--surface); box-shadow: var(--shadow-soft); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; }
.content.structured-input-row, .content.checkbox-group { display: flex; flex-direction: row; }
.structured-input-row { justify-content: space-around; align-items: center; }
.checkbox-group { justify-content: center; align-items: center; gap: 60px; }
.description-section, .notes-section { display: flex; flex-direction: column; flex-basis: 0; }
.description-section { flex-grow: 6.5; }
.notes-section { flex-grow: 3.5; }
.description-section .content, .notes-section .content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.description-content { flex-grow: 1; overflow-y: auto; font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.source-container { font-size: 12px; margin-top: auto; padding-top: 8px; color: var(--ink-soft); flex-shrink: 0; }
.source-container a { color: var(--brand); }
.input-group { display: flex; flex-direction: row; align-items: center; gap: 12px;}
.input-group label { font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.input-group .fields { display: flex; align-items: center; gap: 4px; }
.input-group input[type="number"] { width: 45px; text-align: center; border-radius: 8px; border: 1px solid var(--line); padding: 6px 4px; height: 28px; box-sizing: content-box; background-color: var(--surface); color: var(--ink); }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.photos-section { min-height: 90px; }
.photos-grid-scroller { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.photo-placeholder { flex-shrink: 0; width: 60px; height: 60px; background: var(--surface-muted); border-radius: 8px; display: grid; place-items: center; color: var(--line); cursor: pointer; }
.photo-placeholder:hover { background-color: var(--line); }
.action-button svg { width: 18px; height: 18px; }
.panel-header { display: grid; grid-template-columns: 1fr auto auto; align-items: center; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 56px; gap: 8px; flex-shrink: 0; }
.editable-field .editable-content { min-width: 0; grid-column: 1; display: flex; flex-direction: column; justify-content: flex-start; }
#panel-title-display, .panel-nom-arabe { margin: 0; padding: 0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-title-display { font-size: 20px; color: var(--ink); font-weight: 700;}
.panel-nom-arabe { color: var(--ink-soft); font-size: 16px; margin-top: 2px; font-style: italic; min-height: 1.3em; }
.editable-field .edit-controls { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.panel-header .edit-controls { margin-left: auto; }
.editable-field .details-nav { grid-column: 3; display: flex; gap: 4px;}
.header-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; }
.action-button { width: 32px; height: 32px; background: transparent; border: none; border-radius: 8px; padding: 0; }
.header-btn, .action-button { display: grid; place-items: center; color: var(--ink-soft); cursor: pointer; flex-shrink: 0; }
.header-btn:hover, .action-button:hover { background: var(--surface-muted); color: var(--ink); }
.header-btn:disabled { opacity: 0.5; cursor: not-allowed; background: var(--surface-muted); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.detail-section h3 .section-controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.editable-field .editable-input { width: 100%; border: 1px solid var(--brand); border-radius: 8px; padding: 8px; font-size: 15px; background-color: var(--surface); box-sizing: border-box; font-family: inherit; }
.panel-header .header-input { font-size: 20px; font-weight: bold; padding: 4px 8px; }
#panel-title-input { grid-column: 1 / span 2; }
.editable-field .editable-text { min-height: 24px; color: var(--ink); font-size: 15px; line-height: 1.6; }
.editable-text.short-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; height: 24px; min-height: 24px; }
.editable-field .editable-text:empty::before { content: 'Cliquez sur le crayon pour ajouter du contenu...'; color: var(--ink-soft); font-style: italic; white-space: normal; }
textarea.editable-input { resize: vertical; flex-grow: 1; }
.detail-section[data-field-id="short_desc"] .content { padding-top: 8px; padding-bottom: 8px; }
.time-editor { display: flex; align-items: center; gap: 8px; }
.time-adjust-btn { display: grid; place-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; padding: 0; }
.time-adjust-btn:hover { background: var(--surface-muted); color: var(--ink); }
.duration-picker-trigger { font-size: 16px; font-weight: 500; color: var(--ink); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; min-width: 70px; text-align: center; height: 28px; line-height: 28px; box-sizing: content-box; }
.duration-picker-trigger:hover { border-color: var(--brand); }
#circuit-panel .circuit-header { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.circuit-title-container { display: flex; align-items: center; width: 100%; }
#circuit-title-text { font-size: 18px; font-weight: 700; color: var(--ink); flex-grow: 1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circuit-description-container { width: 100%; }
#circuit-description { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-family: inherit; font-size: 14px; background-color: var(--surface-muted); box-sizing: border-box; height: 70px; }
#circuit-description:focus { outline: none; border-color: var(--brand); background-color: var(--surface); }
.circuit-title-container .action-button { background: transparent; border: none; cursor: pointer; color: var(--ink-soft); padding: 4px; border-radius: 6px; }
.circuit-title-container .action-button:hover { background: var(--surface-muted); }
.header-name-input { font-size: 18px; color: var(--ink); background-color: var(--surface-muted); border: 1px solid var(--line); width: 100%; padding: 4px 8px; border-radius: 6px; }
.header-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; }
.controls-group { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.header-controls .controls-group:first-child { justify-content: flex-start; } 
.meta-info { justify-content: center; grid-column: 2 / 3; }
.transport-info { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); gap: 16px; }
.transport-group { display: flex; align-items: center; gap: 8px; }
.transport-group:first-of-type { justify-content: flex-start; border-right: 1px solid var(--line); padding-right: 16px; }
.transport-group:last-of-type { justify-content: flex-end; }
.transport-group svg { color: var(--ink-soft); }
.transport-field { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.transport-field input { width: 40px; border: none; border-bottom: 1px solid var(--line); text-align: center; font-size: 14px; padding: 2px; background: transparent; color: var(--ink); }
.transport-field input::placeholder { color: var(--line); }
.transport-field input:focus { outline: none; border-bottom-color: var(--brand); }
.transport-field span { font-size: 13px; }
.steps { padding: 8px; background: var(--surface-muted); flex-grow: 1; overflow-y: auto; }
.empty-list-info { padding: 20px; text-align: center; color: var(--ink-soft); }
.step { border-radius: 10px; background: var(--surface); margin-bottom: 6px; box-shadow: var(--shadow-soft); padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--ink); font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.step-main { font-weight: 500; color: var(--ink); flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.step-actions { display: flex; gap: 6px; }
.stepbtn { color: var(--ink-soft); background: none; border: none; padding: 0; cursor: pointer; border-radius: 6px; display: grid; place-items: center; }
.stepbtn:hover:not(:disabled) { color: var(--ink); }
.stepbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.panel-footer { background: var(--surface-muted); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; padding: 8px; }
.footer-btn.pill { height: 40px; border-radius: 999px; font-weight: 700; font-size: 14px; border: 1px solid transparent; display: flex; align-items: center; justify-content: center; gap: 10px; }
#btn-loop-circuit { background-color: #E0E7FF; color: #3730A3; }
#btn-loop-circuit:hover:not(:disabled) { background-color: #4F46E5; color: #fff; }
#btn-clear-circuit { background-color: #FECACA; color: #991B1B; }
#btn-clear-circuit:hover { background-color: #B91C1C; color: #fff; }
#btn-import-gpx { background-color: #D1FAE5; color: #065F46; }
#btn-import-gpx:hover:not(:disabled) { background-color: var(--ok); color: #fff; }
#btn-export-gpx { background-color: #FEF3C7; color: #B45309; }
#btn-export-gpx:hover:not(:disabled) { background-color: var(--warn); color: #fff; }
.footer-btn.pill:disabled { opacity: 0.6 !important; background-color: var(--surface-muted) !important; color: var(--ink-soft) !important; border-color: var(--line) !important; cursor: not-allowed; }
.circuit-polyline { stroke: var(--brand); stroke-width: 3; stroke-dasharray: 6, 6; opacity: 0.9; }
.real-track-polyline { stroke: var(--danger); stroke-width: 3; opacity: 0.8; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(16, 42, 67, 0.6); z-index: 2000; display: flex; justify-content: center; align-items: center; }
.modal-content { background: var(--surface-muted); border-radius: 16px; width: 90%; max-width: 700px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: 80vh; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-header h2 { margin: 0; font-size: 20px; color: var(--ink); }
.modal-body { padding: 16px 24px; overflow-y: auto; }
.circuit-item { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: 10px; margin-bottom: 10px; background-color: var(--surface); box-shadow: var(--shadow-soft); }
.circuit-item-name { font-weight: 600; color: var(--ink); }
.circuit-item-actions { display: flex; gap: 10px; }
.circuit-item-actions button { display: inline-flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; border: 1px solid var(--line); font-weight: 600; cursor: pointer; background-color: var(--surface); }
.circuit-item-actions button:hover { background-color: var(--surface-muted); }
.circuit-item-actions .btn-delete { color: var(--danger); }
.circuit-item-actions .btn-delete:hover { background-color: var(--danger); color: white; border-color: var(--danger); }
.circuit-item-actions .btn-import { color: var(--ok); }
.circuit-item-actions .btn-import:hover { background-color: var(--ok); color: white; border-color: var(--ok); }
.circuit-item-actions .btn-load { color: var(--brand); }
.circuit-item-actions .btn-load:hover { background-color: var(--brand); color: white; border-color: var(--brand); }
.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(13, 59, 102, 0.7); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.loader-spinner { width: 50px; height: 50px; border: 5px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9998; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 18px; border-radius: 8px; color: #fff; font-weight: 600; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateX(100%); animation: slideIn 0.3s forwards, fadeOut 0.5s 3.5s forwards; }
.toast svg { flex-shrink: 0; }
.toast.toast-success { background-color: var(--ok); }
.toast.toast-error { background-color: var(--danger); }
.toast.toast-warning { background-color: var(--warn); }
.toast.toast-info { background-color: var(--brand); }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateX(100%); } }

/* =================== STYLES MOBILES V1 (C'est ce qui marche !) ================== */

#mobile-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100%; 
    width: 100%;
    background-color: var(--surface-muted);
}

#mobile-main-container {
    flex-grow: 1; 
    overflow-y: auto; 
    position: relative;
    padding: 8px;
    box-sizing: border-box;
}

#mobile-header, .mobile-view-header {
    flex-shrink: 0; 
    background-color: var(--surface);
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    box-sizing: border-box;
    gap: 8px;
}

.header-title-mobile, .mobile-view-header h1 {
    font-size: 22px;
    font-weight: 700;
    white-space: normal;
    text-align: center;
    flex-grow: 1;
    min-width: 0;
    margin: 0;
}

#mobile-back-btn {
    padding: 0;
    flex-shrink: 0;
    background: transparent;
    border: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
}

#mobile-nav {
    flex-shrink: 0; 
    order: 3; 
}
#mobile-nav {
    display: flex;
    justify-content: space-around;
    background-color: var(--surface);
    border-top: 1px solid var(--line);
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 12px;
    flex: 1;
    padding: 8px 4px;
    border-radius: 8px;
}
.mobile-nav-btn span { display: none; } 
.mobile-nav-btn.active { color: var(--brand); }
.mobile-nav-btn.add-poi-btn svg { width: 28px; height: 28px; }

.welcome-container { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; padding: 24px; text-align: center; }
.welcome-container h1 { font-size: 24px; color: var(--ink); }
.welcome-container p { font-size: 16px; color: var(--ink-soft); max-width: 400px; margin-bottom: 24px; }
.welcome-container .btn-primary { padding: 12px 24px; font-size: 16px; font-weight: 600; background-color: var(--brand); color: white; border: none; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }

.mobile-list { padding: 0; }
.mobile-list-item { display: flex; align-items: center; width: 100%; padding: 16px; background-color: var(--surface); border: none; border-radius: 16px; margin-bottom: 8px; box-shadow: var(--shadow-soft); text-align: left; cursor: pointer; font-size: 16px; font-weight: 500; box-sizing: border-box; }
.mobile-list-item .poi-list-icon,
.mobile-list-item [data-lucide="route"],
.actions-list .mobile-list-item [data-lucide] {
    margin-right: 16px;
    color: var(--ink-soft);
    flex-shrink: 0;
}
.mobile-list-item [data-lucide="route"],
.actions-list .mobile-list-item [data-lucide] {
    color: var(--brand);
}
.mobile-list-item span { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-list-item [data-lucide="chevron-right"] { color: var(--line); margin-left: auto; }

.circuit-info-bar { display: flex; justify-content: center; gap: 24px; padding: 12px 16px; background: var(--surface-muted); font-size: 14px; color: var(--ink-soft); border-bottom: 1px solid var(--line); text-align: center; }
.circuit-info-bar span { display: inline-flex; align-items: center; gap: 8px; }
.taxi-info-bar { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 10px 16px; background: var(--brand-soft); color: var(--ink); font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--line); }
.taxi-info-bar span { display: inline-flex; align-items: center; gap: 6px; }
.taxi-info-bar i, .taxi-info-bar svg { color: var(--brand); }

#mobile-main-container .panel-content { padding: 0; gap: 0; }
.details-header-nav { display: flex; gap: 4px; }
.details-header-nav button { padding: 8px; background: transparent; border: none; border-radius: 8px; color: var(--ink-soft); display: grid; place-items: center; cursor: pointer; }
.details-header-nav button:hover:not(:disabled) { background: var(--surface-muted); }
.details-header-nav button:disabled { opacity: 0.5; cursor: not-allowed; }
.detail-section { margin-bottom: 10px; }
.detail-section h3 { font-size: 12px; font-weight: 600; padding: 0 4px 6px; margin-bottom: 0; display: flex; align-items: center; color: var(--ink-soft); text-transform: uppercase; }
.detail-section .content { padding: 16px; border-radius: 16px; box-shadow: var(--shadow-soft); background: var(--surface); }
.title-section-line { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.title-names { text-align: left; min-width: 0; }
.title-names h2 { font-size: 22px; margin: 0; white-space: normal; }
.title-names p { font-size: 16px; margin: 2px 0 0 0; color: var(--ink-soft); font-style: italic; }
.title-actions { display: flex; align-items: center; gap: 4px; }
.title-actions .action-button, .details-header-nav button { width: 32px; height: 32px; padding: 6px; background: transparent; border: none; border-radius: 8px; color: var(--ink-soft); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.title-actions .action-button:hover, .details-header-nav button:hover:not(:disabled) { background: var(--surface-muted); }

.description-section .description-content,
.notes-section .description-content {
    min-height: 4.8em; 
}
.description-section.editable-field .content {
    display: flex;
    flex-direction: column;
}

.mobile-search { width: 100%; }
.mobile-search #mobile-search-input { width: 100%; height: 44px; border-radius: 12px; padding-left: 48px; background-color: var(--surface-muted); border: 1px solid var(--line); color: var(--ink); }
.mobile-search #mobile-search-input::placeholder { color: var(--ink-soft); }
.mobile-search .search-icon { position: absolute; left: 16px; color: var(--ink-soft); }
#mobile-search-results { padding-top: 0; }

#fullscreen-editor { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--surface); z-index: 3000; display: none; flex-direction: column; }
.editor-header { display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-soft); padding: 12px 16px; }
.editor-header h2 { font-size: 18px; color: var(--ink); margin: 0; }
#editor-cancel-btn, #editor-save-btn { display: flex; align-items: center; gap: 8px; border: none; background: transparent; font-size: 16px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
#editor-cancel-btn { color: var(--ink-soft); }
#editor-save-btn { color: var(--brand); }
#editor-textarea { flex-grow: 1; border: none; padding: 16px; font-family: inherit; font-size: 16px; line-height: 1.6; resize: none; background: var(--surface-muted); color: var(--ink); }
#editor-textarea:focus { outline: none; }

@media (max-width: 768px) {
    .topbar, #map, .right-sidebar, #app-version { display: none !important; }
    #mobile-container { display: flex !important; }
    .input-group { gap: 8px; } 
}
@media (min-width: 769px) {
    #mobile-container { display: none !important; }
}

/* ========================================================= */
/* === AJOUTS FINS (DESIGN & PATCH 5 BOUTONS) === */
/* ========================================================= */

/* --- GALERIE & PHOTOS (Restauré) --- */
.photo-item { position: relative; flex-shrink: 0; width: 60px; height: 60px; border-radius: 8px; overflow: hidden; }
.photo-item .img-preview { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.photo-delete-btn { position: absolute; top: 2px; right: 2px; background: rgba(255, 255, 255, 0.9); border: none; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; cursor: pointer; color: var(--danger); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.photo-delete-btn svg { width: 12px; height: 12px; }
.checkbox-group { justify-content: center !important; gap: 15px; flex-wrap: wrap; }
/* Le conteneur (Fond noir) */
.photo-viewer {
    display: none; /* Géré par le JS */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    
    /* CENTRAGE FLEXBOX */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* L'image (La Double Limite) */
.viewer-content {
    /* 1. Réinitialisation */
    display: block;
    width: auto;
    height: auto;
    margin: auto;

    /* 2. La Logique PC : Max 800px de large OU 80% de haut */
    max-width: 95vw;
    max-height: 95vh;

    /* 3. Esthétique */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    animation: zoom 0.3s;
}

/* 4. La Règle Mobile (SORTIE des accolades ci-dessus) */
@media (max-width: 800px) {
    .viewer-content {
        max-width: 95vw; /* Sur petit écran, on prend presque toute la largeur */
    }
}
.close-viewer { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; z-index: 10001; }
.close-viewer:hover { color: #bbb; text-decoration: none; cursor: pointer; }
.viewer-nav { cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -50px; color: white; font-weight: bold; font-size: 30px; transition: 0.6s ease; border-radius: 0 3px 3px 0; user-select: none; background-color: rgba(0,0,0,0.3); z-index: 10001; }
.nav-next { right: 0; border-radius: 3px 0 0 3px; }
.nav-prev { left: 0; border-radius: 0 3px 3px 0; }
.viewer-nav:hover { background-color: rgba(0,0,0,0.8); }
@keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} }
@media only screen and (max-width: 700px){ .viewer-content { width: 100%; } .viewer-nav { padding: 10px; font-size: 20px; } }

/* --- PATCH POUR LE GÉNÉRATEUR (Design aéré) --- */
.generator-container { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.generator-card { background: var(--surface); padding: 20px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid var(--line); }
.generator-label { font-weight: 600; color: var(--ink); margin-bottom: 12px; font-size: 15px; }
.action-btn-large { width: 100%; padding: 16px; border-radius: 12px; border: none; font-weight: 700; background: var(--brand); color: white; display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 16px; box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2); }
input[type=range] { width: 100%; height: 6px; background: var(--line); border-radius: 5px; margin-top: 15px; }

/* --- PATCH POUR LA LISTE (Marges aérées pour scroll confortable) --- */
@media (max-width: 768px) {
    .mobile-list { padding: 12px 12px 80px 12px !important; } /* 80px en bas pour ne pas cacher le dernier élément */
    .mobile-list-item { margin-bottom: 10px !important; }
}