/* =======================================================================
   Lui - feuille de style principale
   Approche mobile-first. Le multi-colonnes vit dans @media (min-width:768px)
   ======================================================================= */

:root {
    --primary: #14634f;
    --primary-dark: #0d4a3a;
    --primary-soft: #e4f0eb;
    --accent: #dc7a3d;
    --accent-soft: #fbeade;
    --bg: #f5f4f0;
    --card: #ffffff;
    --text: #1b211f;
    --muted: #6d7873;
    --border: #e5e3dc;
    --border-strong: #d3d0c6;
    --danger: #c0392b;
    --danger-soft: #fbe9e7;
    --success: #1f8a5f;
    --warning: #b7791f;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(20, 30, 25, .06), 0 1px 3px rgba(20, 30, 25, .04);
    --shadow: 0 4px 16px rgba(20, 30, 25, .07);
    --shadow-lg: 0 14px 40px rgba(20, 30, 25, .13);

    --nav-h: 64px;
    --header-h: 60px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---------------------- Typo ---------------------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.strong { font-weight: 600; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------------------- Structure ---------------------- */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 720px; }
.section { padding: 28px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.section-head .link { color: var(--primary); font-weight: 600; font-size: .86rem; }

/* ---------------------- En-tête ---------------------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0px);
}
.app-header .inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 11px;
    background: linear-gradient(140deg, var(--primary), #1c8a6c);
    display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.brand-logo svg { width: 19px; height: 19px; }
.brand-name { font-family: var(--font-display); font-size: 1.15rem; }
.brand-sub { font-size: .7rem; color: var(--muted); font-weight: 500; display: block; margin-top: -3px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; color: var(--text);
    background: transparent; transition: background .18s;
    position: relative;
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn .dot {
    position: absolute; top: 6px; right: 6px;
    min-width: 17px; height: 17px; border-radius: 999px;
    background: var(--accent); color: #fff; font-size: .62rem;
    font-weight: 700; display: grid; place-items: center; padding: 0 4px;
    border: 2px solid #fff;
}

/* ---------------------- Barre de navigation basse ---------------------- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
}
.bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: .66rem; font-weight: 600;
    position: relative; transition: color .18s;
    padding-top: 6px;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary);
}
.bottom-nav .nav-dot {
    position: absolute; top: 6px; left: calc(50% + 8px);
    min-width: 16px; height: 16px; border-radius: 999px; background: var(--accent);
    color: #fff; font-size: .6rem; font-weight: 700; display: grid; place-items: center;
    padding: 0 4px; border: 2px solid #fff;
}

/* ---------------------- Boutons ---------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: .9rem;
    transition: transform .12s, background .18s, box-shadow .18s;
    border: 1px solid transparent; white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.94); }
.btn-ghost { background: var(--card); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: #fafaf8; }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-soft:hover { background: #d6e9e1; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f6d9d5; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: 10px; }
.btn-lg { padding: 15px 26px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------------------- Cartes ---------------------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-pad { padding: 16px; }
.card-hover { transition: box-shadow .2s, transform .2s; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------------------- Badges / puces ---------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 600;
    background: var(--primary-soft); color: var(--primary-dark);
}
.badge-accent { background: var(--accent-soft); color: #a8541f; }
.badge-muted { background: #eff0ec; color: var(--muted); }
.badge-prix { background: #e8f4ee; color: var(--success); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600;
    background: var(--card); border: 1px solid var(--border); color: var(--muted);
    white-space: nowrap; transition: all .18s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-row {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.chip-row::-webkit-scrollbar { display: none; }

/* ---------------------- Avatars ---------------------- */
.avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    background: var(--primary-soft); color: var(--primary-dark);
    overflow: hidden; border: 1px solid rgba(20, 99, 79, .12);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 34px; height: 34px; font-size: .74rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.35rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.8rem; }
.avatar-accent { background: var(--accent-soft); color: #a8541f; }

/* ---------------------- Formulaires ---------------------- */
.field { margin-bottom: 15px; }
.field label {
    display: block; font-size: .82rem; font-weight: 600;
    margin-bottom: 6px; color: #3d453f;
}
.input, .textarea, .select {
    width: 100%; padding: 12px 14px; border-radius: 12px;
    border: 1px solid var(--border-strong); background: var(--card);
    transition: border-color .18s, box-shadow .18s; font-size: .92rem;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 99, 79, .12);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
.form-hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }
.error-text { color: var(--danger); font-size: .82rem; margin-top: 8px; }
.auth-aside { display: none; }
.auth-box {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px 20px; box-shadow: var(--shadow-sm);
}

/* ---------------------- Alertes ---------------------- */
.alert {
    padding: 12px 14px; border-radius: 12px; font-size: .86rem;
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--danger-soft); color: #8e2b20; }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); }
.alert-warn { background: #fdf3e0; color: #8a5c10; }

/* ---------------------- États vides / chargement ---------------------- */
.empty {
    text-align: center; padding: 44px 20px; color: var(--muted);
}
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--border-strong); }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 1rem; }
.empty p { font-size: .86rem; max-width: 320px; margin: 0 auto 16px; }

.skeleton {
    background: linear-gradient(90deg, #eeece7 25%, #f6f5f1 50%, #eeece7 75%);
    background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
    width: 20px; height: 20px; border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------- Hero ---------------------- */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(150deg, var(--primary-dark), var(--primary) 55%, #1f8a6b);
    color: #fff; padding: 34px 0 30px;
}
.hero::after {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 82% 12%, rgba(255,255,255,.16), transparent 42%),
                      radial-gradient(circle at 12% 88%, rgba(220,122,61,.28), transparent 46%);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 1.85rem; margin-bottom: 10px; }
.hero p.lead { font-size: .96rem; opacity: .88; max-width: 520px; margin-bottom: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.2); }
.hero .btn-accent { background: #fff; color: var(--primary-dark); }

/* ---------------------- Statistiques ---------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm);
}
.stat .val { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--primary); line-height: 1.1; }
.stat .lab { font-size: .76rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; }
.hero-stat {
    background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22);
    border-radius: 14px; padding: 12px;
}
.hero-stat .val { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.hero-stat .lab { font-size: .72rem; opacity: .82; }

/* ---------------------- Listes ---------------------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    display: flex; gap: 12px; padding: 14px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s, border-color .2s;
    cursor: pointer; text-align: left; width: 100%;
}
.list-item:hover { box-shadow: var(--shadow); border-color: #d8d5cc; }
.list-item .body { flex: 1; min-width: 0; }
.list-item h3 { font-size: .95rem; margin-bottom: 4px; }
.list-item h3 a:hover { color: var(--primary); }
.list-item .extrait {
    font-size: .84rem; color: var(--muted); margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); }
.list-meta .mi { display: inline-flex; align-items: center; gap: 4px; }
.list-meta svg { width: 14px; height: 14px; }
.item-pin {
    display: inline-flex; align-items: center; gap: 4px; font-size: .68rem;
    font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em;
}
.item-pin svg { width: 13px; height: 13px; }

/* ---------------------- Grille annonces ---------------------- */
.annonces-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.an-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.an-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.an-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #ecebe6; }
.an-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.an-body h3 { font-size: .98rem; }
.an-body p { font-size: .84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.an-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.an-author { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); }
.an-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------------------- Détail sujet ---------------------- */
.topic-head { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.topic-head h1 { font-size: 1.35rem; margin-bottom: 10px; }
.topic-body { white-space: pre-wrap; font-size: .94rem; margin-top: 14px; line-height: 1.65; }
.post {
    display: flex; gap: 12px; padding: 16px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.post .post-body { flex: 1; min-width: 0; }
.post .post-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.post .post-text { white-space: pre-wrap; font-size: .9rem; line-height: 1.6; }

/* ---------------------- Chat ---------------------- */
.chat-shell { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - var(--nav-h) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.5; position: relative; }
.msg .t { font-size: .66rem; margin-top: 4px; opacity: .7; }
.msg-in { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg-out { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--card); }
.chat-form .input { border-radius: 999px; }
.chat-send { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.chat-send svg { width: 20px; height: 20px; }
.conv-item { display: flex; gap: 12px; padding: 13px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); align-items: center; box-shadow: var(--shadow-sm); }
.conv-item .cm { flex: 1; min-width: 0; }
.conv-item .cm h3 { font-size: .92rem; }
.conv-item .cm p { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-unread { min-width: 22px; height: 22px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }

/* ---------------------- Profil ---------------------- */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head .ph-info { flex: 1; min-width: 180px; }
.tabs { display: flex; gap: 6px; background: #ecebe6; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tabs button { flex: 1; padding: 9px 12px; border-radius: 9px; font-size: .85rem; font-weight: 600; color: var(--muted); transition: all .18s; }
.tabs button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------------------- Modale ---------------------- */
.modal-back {
    position: fixed; inset: 0; z-index: 100; background: rgba(15, 25, 20, .5);
    backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .22s;
}
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--card); width: 100%; max-width: 560px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px; max-height: 92vh; overflow-y: auto;
    transform: translateY(20px); transition: transform .25s;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.modal-back.open .modal { transform: translateY(0); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 0 auto 14px; }

/* ---------------------- Toasts ---------------------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px); z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast {
    background: #23302b; color: #fff; padding: 11px 18px; border-radius: 999px;
    font-size: .85rem; font-weight: 600; box-shadow: var(--shadow-lg);
    animation: toastIn .25s ease; max-width: 420px; text-align: center;
}
.toast.ok { background: var(--success); }
.toast.ko { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------- Divers ---------------------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row > * { min-width: 0; }
.row .grow { flex: 1; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fab {
    position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 65; width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: #fff; display: grid; place-items: center;
    box-shadow: var(--shadow-lg);
}
.fab svg { width: 24px; height: 24px; }

.page-title { padding: 22px 0 4px; }
.page-title h1 { font-size: 1.5rem; }
.page-title p { color: var(--muted); font-size: .88rem; margin-top: 4px; }

.install-banner {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm);
}
.install-banner .ib-txt { flex: 1; min-width: 0; }
.install-banner h3 { font-size: .92rem; }
.install-banner p { font-size: .78rem; color: var(--muted); }
.install-banner svg { width: 28px; height: 28px; color: var(--primary); flex-shrink: 0; }

.footer {
    border-top: 1px solid var(--border); margin-top: 30px; padding: 24px 0 20px;
    color: var(--muted); font-size: .8rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.footer-links a:hover { color: var(--primary); }

.store-badges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.store-badge {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--border-strong); border-radius: 12px;
    padding: 8px 14px; font-size: .78rem; font-weight: 600; color: var(--text);
    background: var(--card);
}
.store-badge svg { width: 20px; height: 20px; }

/* =======================================================================
   Tablette / Desktop — le multi-colonnes vit ICI
   ======================================================================= */
@media (min-width: 640px) {
    .annonces-grid { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 0 22px; }
    .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

@media (min-width: 768px) {
    body { font-size: 15.5px; }
    .hero { padding: 52px 0 46px; }
    .hero h1 { font-size: 2.5rem; }
    .hero .intro-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
    .hero-stats { margin-top: 0; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .annonces-grid { grid-template-columns: repeat(3, 1fr); }
    .auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; max-width: 940px; margin: 0 auto; }
    .auth-aside { display: block; }
    .modal-back { align-items: center; padding: 20px; }
    .modal { border-radius: var(--radius-lg); padding-bottom: 20px; transform: translateY(10px) scale(.98); }
    .modal-back.open .modal { transform: translateY(0) scale(1); }
    .modal-grab { display: none; }
    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .layout-split { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
    .sticky-side { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 16px); }
    .bottom-nav { max-width: 560px; margin: 0 auto; border-radius: 20px 20px 0 0; left: 50%; transform: translateX(-50%); right: auto; width: 100%; border: 1px solid var(--border); border-bottom: none; }
    .chat-shell { height: calc(100vh - var(--header-h) - 40px); }
}

@media (min-width: 1024px) {
    .annonces-grid { grid-template-columns: repeat(4, 1fr); }
}

/* L'application installée occupe tout l'écran : on remonte les marges basses */
@media (display-mode: standalone) {
    .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
