/* =============================================================================
   THEMETEO — CLIENT WEB MOBILE & RESPONSIVE HAUTE RÉSOLUTION
   Normes & Standards Mobiles Web (PWA, Thumb Zone, iOS & Android Safe Areas)
   ============================================================================= */

:root {
    --bg-main: #0b111e;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 50%, #0b111e 100%);
    --card-bg: rgba(26, 38, 57, 0.72);
    --card-bg-subtle: rgba(15, 23, 42, 0.65);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-border-focus: rgba(56, 189, 248, 0.4);
    --card-hover: rgba(51, 65, 85, 0.85);

    /* Palette Accents */
    --accent-blue: #38bdf8;
    --accent-blue-glow: rgba(56, 189, 248, 0.25);
    --accent-indigo: #818cf8;
    --accent-purple: #c084fc;
    --accent-amber: #fbbf24;
    --accent-amber-glow: rgba(251, 191, 36, 0.2);
    --accent-emerald: #34d399;
    --accent-rose: #fb7185;

    /* Typographie & Couleurs */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Rayons de bordure */
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 9999px;

    /* Ombres & Élévation */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.6);
    --nav-height: 64px;
}

/* -----------------------------------------------------------------------------
   RESET & RÈGLES GLOBALES TACTILES
   ----------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html, body {
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background-color: var(--bg-main);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    justify-content: center;
    padding-top: env(safe-area-inset-top, 12px);
    padding-left: env(safe-area-inset-left, 12px);
    padding-right: env(safe-area-inset-right, 12px);
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 16px) + 16px);
}

/* Boutons tactiles avec retour haptique visuel */
button {
    user-select: none;
    -webkit-user-select: none;
}

button:active {
    transform: scale(0.96);
    transition: transform 0.08s ease-out;
}

/* -----------------------------------------------------------------------------
   CONTENEUR PRINCIPAL DE L'APPLICATION
   ----------------------------------------------------------------------------- */
.app-container {
    width: 100%;
    max-width: 1080px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

/* -----------------------------------------------------------------------------
   1. TOP APP BAR (HEADER STICKY MOBILE)
   ----------------------------------------------------------------------------- */
.top-app-bar {
    position: sticky;
    top: env(safe-area-inset-top, 8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.brand-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.4px;
}

.brand-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pilule de localisation interactive */
.location-pill-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
    min-height: 38px;
}

.location-pill-btn:hover {
    background: rgba(51, 65, 85, 0.85);
    border-color: var(--accent-blue);
}

.loc-pin {
    font-size: 0.9rem;
}

.loc-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.loc-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Actions rapides */
.top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon {
    width: 38px;
    height: 38px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--card-hover);
    border-color: var(--accent-blue);
}

.debug-btn {
    position: relative;
    padding: 0 10px;
    width: auto;
    font-size: 0.85rem;
    gap: 4px;
    display: inline-flex;
}

.live-dot {
    color: var(--accent-emerald);
    font-size: 0.7rem;
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.refresh-spinner {
    display: inline-block;
    transition: transform 0.4s ease;
}

.refresh-spinner.spinning {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* -----------------------------------------------------------------------------
   2. BANNIÈRE DE STATUT RÉSEAU & MODÈLE
   ----------------------------------------------------------------------------- */
.range-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.coords-tag {
    font-family: ui-monospace, monospace;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.cdn-tag {
    color: var(--accent-emerald);
    font-weight: 600;
}

/* Badges Modèles Météo */
.model-badge {
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-arome {
    background: rgba(251, 191, 36, 0.18);
    color: var(--accent-amber);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.badge-ifs {
    background: rgba(56, 189, 248, 0.18);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-aifs {
    background: rgba(192, 132, 252, 0.18);
    color: var(--accent-purple);
    border: 1px solid rgba(192, 132, 252, 0.35);
}

.badge-confidence-high {
    background: rgba(52, 211, 153, 0.18);
    color: var(--accent-emerald);
    border: 1px solid var(--accent-emerald);
}

/* -----------------------------------------------------------------------------
   3. NAVIGATION PAR ONGLETS DESKTOP
   ----------------------------------------------------------------------------- */
.tabs-nav {
    display: flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.85);
    padding: 5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.tabs-nav.desktop-only {
    display: none; /* Masqué sur mobile, actif sur desktop via media queries */
}

.tab-btn {
    flex: 1;
    padding: 9px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
    min-height: 38px;
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* -----------------------------------------------------------------------------
   4. CONTENU & VUES (AVEC TRANSITIONS FLUIDES)
   ----------------------------------------------------------------------------- */
.views-wrapper {
    width: 100%;
    position: relative;
}

.view-section {
    display: none;
    flex-direction: column;
    gap: 14px;
    animation: fadeInView 0.25s ease-out;
}

.view-section.active {
    display: flex;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -----------------------------------------------------------------------------
   5. WEATHER HERO CARD MOBILE
   ----------------------------------------------------------------------------- */
.weather-hero-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.weather-hero-card::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
    pointer-events: none;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hero-city-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.hero-time-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.hero-model-pill {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-amber);
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.25);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.hero-temp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-temp-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.temp-large {
    font-size: clamp(3.2rem, 11vw, 4.6rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -2px;
}

.temp-unit {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.hero-condition-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 4px;
}

.hero-weather-icon {
    font-size: 2.8rem;
    line-height: 1;
}

.condition-desc {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-blue);
}

/* Alerte Pluie */
.hero-rain-alert {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Grille des statistiques météo clés */
.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.stat-box {
    background: rgba(15, 23, 42, 0.65);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: all 0.2s;
}

.stat-box.selected {
    border-color: var(--accent-amber);
    background: rgba(251, 191, 36, 0.12) !important;
    box-shadow: 0 0 0 2px var(--accent-amber);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

/* -----------------------------------------------------------------------------
   6. TIMELINE HEURE PAR HEURE (HORIZONTAL SCROLL MOBILE)
   ----------------------------------------------------------------------------- */
.timeline-card {
    padding: 16px 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.hint-touch {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.section-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: -6px;
    line-height: 1.4;
}

.hourly-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.hourly-scroll::-webkit-scrollbar {
    display: none;
}

.hour-item {
    min-width: 76px;
    padding: 10px 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: all 0.2s;
}

.hour-item.current {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.hour-item.past {
    opacity: 0.45;
}

.hour-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hour-temp {
    font-size: 1rem;
    font-weight: 700;
}

.hour-pop {
    font-size: 0.72rem;
    color: var(--accent-blue);
    font-weight: 600;
}

/* -----------------------------------------------------------------------------
   7. GRAPHIC CARDS & FILTRES TACTILES
   ----------------------------------------------------------------------------- */
.chart-card {
    padding: 16px 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pills-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}

.pills-scroll::-webkit-scrollbar {
    display: none;
}

.filter-day-btn {
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    min-height: 32px;
    flex-shrink: 0;
}

.filter-day-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-main);
}

.filter-day-btn.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 700;
}

/* HUD Tactile & En direct au-dessus des graphiques */
.chart-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
}

.chart-hud::-webkit-scrollbar {
    display: none;
}

.hud-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.hud-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.hud-val {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.85rem;
}

.chart-wrapper {
    position: relative;
    height: 240px;
    width: 100%;
    touch-action: pan-y; /* Permet le défilement vertical fluide de la page sur mobile */
}

.chart-wrapper canvas {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

/* -----------------------------------------------------------------------------
   8. VUE MOYEN TERME & LONG TERME AIFS
   ----------------------------------------------------------------------------- */
.medium-daily-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.medium-steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 4px;
}

.day-selector-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.day-selector-scroll::-webkit-scrollbar {
    display: none;
}

.day-btn {
    padding: 7px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.2s;
    min-height: 34px;
    flex-shrink: 0;
}

.day-btn.active {
    background: var(--accent-purple);
    color: #0f172a;
    border-color: var(--accent-purple);
    font-weight: 800;
}

.scenarios-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scenarios-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.scenario-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.scenario-card:hover {
    border-color: var(--accent-purple);
}

.scenario-card.selected {
    border-color: var(--accent-purple);
    background: rgba(192, 132, 252, 0.12);
    box-shadow: 0 0 0 2px var(--accent-purple);
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scenario-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.scenario-prob {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-purple);
}

.prob-bar-container {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.prob-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent-indigo), var(--accent-purple));
}

.scenario-steps-row {
    display: flex;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.4);
    padding: 6px 8px;
    border-radius: var(--radius-md);
}

.scenario-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.scenario-step-hour {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.scenario-step-temp {
    font-size: 0.85rem;
    font-weight: 700;
}

/* -----------------------------------------------------------------------------
   9. VUE DIAGNOSTIC & DEBUGGER
   ----------------------------------------------------------------------------- */
.debugger-card {
    background: #090d16;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    color: #38bdf8;
    display: flex;
    flex-direction: column;
    gap: 10px;
    word-break: break-all;
}

.debugger-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-weight: 700;
}

.debug-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-sm {
    padding: 4px 8px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

#debug-output {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.74rem;
    line-height: 1.45;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.debug-meta-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-wrap: wrap;
    gap: 4px;
}

/* -----------------------------------------------------------------------------
   10. SEARCH MODAL / BOTTOM SHEET TACTILE MOBILE
   ----------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-sheet {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    background: #0f172a;
    border-top: 1px solid var(--card-border);
    border-left: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 12px 18px calc(env(safe-area-inset-bottom, 16px) + 16px);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 4px auto;
}

.sheet-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 12px 36px 12px 38px;
    border-radius: var(--radius-md);
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 16px; /* 16px strict : bloque le zoom automatique iOS Safari */
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.btn-clear {
    position: absolute;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-text {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 6px 8px;
}

/* Raccourci GPS dans la feuille de recherche */
.sheet-geoloc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.sheet-geoloc-item:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent-blue);
}

.geo-icon {
    font-size: 1.3rem;
}

.geo-info {
    display: flex;
    flex-direction: column;
}

.geo-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.geo-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Favoris & Villes Récentes */
.favorites-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.72rem;
    cursor: pointer;
}

.favorites-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fav-chip {
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.fav-chip:hover {
    background: var(--accent-blue-glow);
    border-color: var(--accent-blue);
}

/* Suggestions Dropdown */
.suggestions-container {
    display: flex;
    flex-direction: column;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-item {
    padding: 12px 14px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 48px; /* Standard ergonomique tactile >= 48px */
    display: flex;
    align-items: center;
    transition: all 0.15s;
}

.suggestion-item:hover, .suggestion-item:active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* -----------------------------------------------------------------------------
   11. BOTTOM NAVIGATION BAR (FIXE MOBILE DANS LA THUMB ZONE)
   ----------------------------------------------------------------------------- */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(11, 17, 30, 0.88);
    border-top: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-item {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.nav-indicator {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 2px);
    width: 24px;
    height: 3px;
    background: transparent;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--text-main);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

.nav-item.active .nav-label {
    color: var(--accent-blue);
    font-weight: 800;
}

.nav-item.active .nav-indicator {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-indigo));
    box-shadow: 0 0 8px var(--accent-blue);
}

/* -----------------------------------------------------------------------------
   12. TOAST NOTIFICATION MOBILE
   ----------------------------------------------------------------------------- */
.toast-notification {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 16px) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--accent-blue);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* -----------------------------------------------------------------------------
   13. ADAPTATION TABLETTES & DESKTOP (HYBRIDE)
   ----------------------------------------------------------------------------- */
@media (min-width: 769px) {
    body {
        padding: 24px;
        padding-bottom: 32px;
    }

    .top-app-bar {
        padding: 14px 20px;
    }

    .brand-title {
        font-size: 1.4rem;
    }

    .tabs-nav.desktop-only {
        display: flex;
    }

    .bottom-nav-bar {
        display: none; /* Masqué sur grand écran car on utilise les onglets desktop */
    }

    .weather-hero-card {
        padding: 24px 28px;
    }

    .hero-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .medium-daily-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .medium-steps-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .scenarios-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .chart-wrapper {
        height: 300px;
    }
}
