/* ==========================================================================
   Myvoisio - Feuille de style principale (mobile-first)
   ========================================================================== */

:root {
    --brand: #1c6b58;
    --brand-600: #175a4a;
    --brand-700: #11453a;
    --brand-100: #e3f2ed;
    --accent: #ef8a3c;
    --accent-100: #fdeedd;
    --ink: #12211d;
    --muted: #6b7c76;
    --line: #e3e9e6;
    --bg: #f4f7f5;
    --surface: #ffffff;
    --danger: #c8402f;
    --danger-100: #fcebea;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(18, 33, 29, .05), 0 8px 24px -12px rgba(18, 33, 29, .14);
    --shadow-sm: 0 1px 2px rgba(18, 33, 29, .07);
    --nav-h: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
}

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

body.has-footer-space { padding-bottom: calc(var(--nav-h) + 32px); }

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px; }
.container--narrow { max-width: 640px; }
.main { min-height: 60vh; }

.section { margin: 24px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section__head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--brand);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.topbar--admin { background: #22272b; }
.topbar__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand__logo {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    display: flex; align-items: center; justify-content: center;
}
.brand__logo svg { width: 20px; height: 20px; display: block; }
.brand__sub { display: block; font-size: 11px; font-weight: 500; opacity: .78; letter-spacing: .02em; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar__link {
    color: #fff; font-size: 13px; font-weight: 600;
    padding: 7px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    white-space: nowrap;
}
.topbar__link:hover { background: rgba(255, 255, 255, .24); text-decoration: none; }
.topbar__user { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 600; }
.topbar__user:hover { text-decoration: none; }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    box-shadow: 0 -4px 16px -12px rgba(18, 33, 29, .35);
}
.bottom-nav__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none;
    position: relative;
}
.bottom-nav__item:hover { text-decoration: none; color: var(--brand); }
.bottom-nav__item svg { width: 22px; height: 22px; }
.bottom-nav__item.is-active { color: var(--brand); }
.bottom-nav__item.is-active::before {
    content: ''; position: absolute; top: 0; width: 28px; height: 3px;
    border-radius: 0 0 3px 3px; background: var(--brand);
}
.bottom-nav__badge {
    position: absolute; top: 6px; left: calc(50% + 6px);
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 9px; background: var(--accent); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font: inherit; font-weight: 600; font-size: 14.5px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--brand-600); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: #d9772d; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: #f6f9f7; color: var(--ink); }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #ac3527; }
.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 11px; border: 1px solid var(--line); background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink); padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: #f4f8f6; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}
.card--pad-lg { padding: 20px; }
.card--flush { padding: 0; overflow: hidden; }

/* ---------- Badges / chips ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
    background: var(--brand-100); color: var(--brand-700);
}
.badge--accent { background: var(--accent-100); color: #a85a15; }
.badge--danger { background: var(--danger-100); color: var(--danger); }
.badge--muted { background: #eef1f0; color: var(--muted); }
.badge svg { width: 13px; height: 13px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    padding: 8px 15px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff;
    font-size: 13.5px; font-weight: 600; color: var(--muted);
    cursor: pointer; white-space: nowrap; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.label { font-size: 13px; font-weight: 600; color: #2e3f39; }
.input, .textarea, .select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit; font-size: 15px; color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(28, 107, 88, .14);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7c76' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.hint { font-size: 12.5px; color: var(--muted); }
.field-row { display: grid; gap: 14px; }

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert--error { background: var(--danger-100); border-color: #f2c9c4; color: #8f2b1e; }
.alert--success { background: #e7f5ee; border-color: #bfe3d2; color: #14603f; }
.alert--info { background: var(--brand-100); border-color: #c6e2d8; color: var(--brand-700); }

/* ---------- Avatar ---------- */
.avatar {
    width: 42px; height: 42px; flex: 0 0 42px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
    overflow: hidden;
    object-fit: cover;
}
img.avatar { background: var(--line); }
.avatar--sm { width: 34px; height: 34px; flex-basis: 34px; font-size: 12.5px; }
.avatar--lg { width: 68px; height: 68px; flex-basis: 68px; font-size: 24px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Hero (accueil public) ---------- */
.hero {
    position: relative;
    color: #fff;
    background: linear-gradient(160deg, var(--brand-700), var(--brand) 55%, #2a8a70);
    overflow: hidden;
}
.hero__img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: .28;
}
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17, 69, 58, .72), rgba(17, 69, 58, .88)); }
.hero__inner { position: relative; padding: 46px 16px 40px; max-width: 1080px; margin: 0 auto; }
.hero h1 { font-size: 30px; max-width: 620px; margin-bottom: 10px; }
.hero p { font-size: 16px; max-width: 560px; opacity: .93; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero .btn--ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .4); }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.hero__stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 28px;
    padding: 0;
}
.hero__stat {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    padding: 14px;
}
.hero__stat strong { display: block; font-size: 24px; line-height: 1.1; }
.hero__stat span { font-size: 12.5px; opacity: .85; }

/* ---------- Page head ---------- */
.page-head { padding: 20px 0 4px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .muted { margin: 4px 0 0; }

/* ---------- Annonces ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid--cards { grid-template-columns: 1fr; }
.voisins-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.voisins-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid--stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }

.annonce-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
}
.annonce-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.annonce-card__img { width: 100%; height: 178px; object-fit: cover; background: var(--line); }
.annonce-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.annonce-card__title { font-size: 17px; font-weight: 700; margin: 0; }
.annonce-card__title a { color: var(--ink); }
.annonce-card__title a:hover { color: var(--brand); text-decoration: none; }
.annonce-card__excerpt { color: var(--muted); font-size: 14px; margin: 0; }
.annonce-card__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.annonce-card__foot .author { font-size: 13px; font-weight: 600; }
.annonce-card__foot .date { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }

.annonce-detail__img { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.annonce-detail__body { white-space: pre-line; font-size: 15.5px; }

/* ---------- Comments ---------- */
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment__body { min-width: 0; }
.comment__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment__name { font-weight: 700; font-size: 14px; }
.comment__text { white-space: pre-line; font-size: 14.5px; }

/* ---------- Chat ---------- */
.chat-thread {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    height: 58vh;
    min-height: 320px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    -webkit-overflow-scrolling: touch;
}
.msg { display: flex; gap: 8px; max-width: 88%; }
.msg--me { margin-left: auto; flex-direction: row-reverse; }
.msg__bubble {
    background: #f0f4f2;
    border-radius: 16px 16px 16px 4px;
    padding: 9px 13px;
    font-size: 14.5px;
    word-break: break-word;
}
.msg--me .msg__bubble { background: var(--brand); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg__meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg--me .msg__meta { text-align: right; }
.msg__author { font-size: 12px; font-weight: 700; color: var(--brand-700); margin-bottom: 2px; }

.chat-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.chat-form .textarea { min-height: 48px; max-height: 120px; flex: 1 1 auto; min-width: 0; }

.thread-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.thread-item:hover { background: #f7faf8; text-decoration: none; }
.thread-item:last-child { border-bottom: 0; }
.thread-item__name { font-weight: 700; font-size: 14.5px; }
.thread-item__last { color: var(--muted); font-size: 13px; }
.thread-item__side { margin-left: auto; text-align: right; display: grid; gap: 5px; justify-items: end; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* ---------- Voisins ---------- */
.voisin-card { display: flex; gap: 12px; align-items: center; }
.voisin-card__body { min-width: 0; flex: 1 1 auto; }
.voisin-card__name { font-weight: 700; font-size: 15px; margin: 0; }
.voisin-card__meta { font-size: 12.5px; color: var(--muted); }

/* ---------- Stats cards (admin) ---------- */
.stat-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.stat-card__label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-card__label svg { width: 15px; height: 15px; color: var(--brand); }
.stat-card__value { font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.stat-card__delta { font-size: 12.5px; color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 0 0 auto; padding: 10px 14px; font-size: 14px; font-weight: 600;
    color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer;
    background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit;
    text-decoration: none;
}
.tab:hover { color: var(--brand); text-decoration: none; }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; min-width: 620px; font-size: 14px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: #f7faf8; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcfb; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Empty / loader ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; margin-bottom: 10px; color: #b9c7c2; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2.5px solid var(--brand-100); border-top-color: var(--brand);
    animation: spin .7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); z-index: 90; display: grid; gap: 8px; width: calc(100% - 32px); max-width: 420px; }
.toast {
    background: #1d2a26; color: #fff; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; box-shadow: var(--shadow); animation: toast-in .2s ease;
}
.toast--error { background: var(--danger); }
.toast--success { background: #157a54; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modales ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(12, 24, 20, .55); }
.modal__box {
    position: relative; background: #fff; border-radius: var(--radius);
    padding: 20px; width: 100%; max-width: 460px;
    max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal__box h2 { font-size: 19px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
body.modal-open { overflow: hidden; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand__logo {
    width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px;
    background: var(--brand-100); color: var(--brand-700);
    display: flex; align-items: center; justify-content: center;
}
.auth-brand__logo svg { width: 32px; height: 32px; }

/* ---------- Install PWA ---------- */
.install-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--brand-100); border: 1px solid #c6e2d8; border-radius: var(--radius);
    padding: 14px; color: var(--brand-700);
}
.install-row svg { width: 22px; height: 22px; flex: 0 0 22px; }
.install-row .grow { min-width: 140px; }
.install-row strong { display: block; font-size: 14.5px; }
.install-row .small { font-size: 12.5px; opacity: .85; }
.store-badges { display: flex; align-items: center; gap: 10px; }
.store-badges svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.footer { background: #fff; border-top: 1px solid var(--line); margin-top: 32px; padding: 24px 0 28px; }
.footer__grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.footer h4 { font-size: 14px; margin-bottom: 8px; }
.footer__links { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.footer__bottom { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 280px; }

/* ==========================================================================
   Responsive >= 640px
   ========================================================================== */
@media (min-width: 640px) {
    body { font-size: 15.5px; }
    .container { padding: 20px; }
    .grid--cards { grid-template-columns: repeat(2, 1fr); }
    .grid--stats { grid-template-columns: repeat(2, 1fr); }
    .hero__inner { padding: 60px 20px 48px; }
    .hero h1 { font-size: 36px; }
    .hero__stats { grid-template-columns: repeat(4, 1fr); }
    .field-row { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .grid--cards { grid-template-columns: repeat(3, 1fr); }
    .footer__grid { grid-template-columns: 2fr 1fr 1fr; }
    .voisins-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .layout-2col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
}

/* ==========================================================================
   Correctifs mobiles < 768px (grilles et rangees)
   ========================================================================== */
@media (max-width: 768px) {
    .grid, .grid--cards, .grid--stats { grid-template-columns: 1fr; }
    .hero__stats { grid-template-columns: repeat(2, 1fr); }
    .field-row { grid-template-columns: 1fr; }
    .layout-2col { display: block; }
    .install-row { align-items: flex-start; }
    .install-row .btn { width: 100%; }
    .modal__actions { flex-direction: column-reverse; }
    .modal__actions .btn { width: 100%; }
    .page-head { align-items: stretch; }
    .page-head .btn { width: 100%; }
    .chat-thread { height: 52vh; }
    .msg { max-width: 94%; }
    .stat-card__value { font-size: 22px; }
}

@media (max-width: 380px) {
    .hero h1 { font-size: 25px; }
    .hero__stats { grid-template-columns: 1fr; }
    .bottom-nav__item { font-size: 10px; }
}

@media print {
    .bottom-nav, .topbar, .footer, .btn { display: none !important; }
    body { padding-bottom: 0; }
}
