/* ============================================================
   Voisin — feuille de style principale
   Mobile-first. Toute grille multi-colonnes est déclarée
   à partir de 768px : sous cette largeur, tout est en 1 colonne.
   ============================================================ */

:root {
  --brand: #2F6FED;
  --brand-dark: #1B4BB8;
  --brand-soft: #EAF1FE;
  --accent: #F5A524;
  --accent-soft: #FEF3E2;
  --green: #12B76A;
  --green-soft: #E7F8F0;
  --red: #E5484D;
  --red-soft: #FDECEC;
  --violet: #7A5AF8;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --text: #101828;
  --text-2: #475467;
  --muted: #7C8698;
  --line: #E6E9F0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(16, 24, 40, .07);
  --shadow-lg: 0 18px 44px rgba(16, 24, 40, .13);
  --tabbar-h: 62px;
  --bar-h: 60px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
ul { margin: 0; padding-left: 1.1rem; }

.ico { flex: 0 0 auto; display: block; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-sm { gap: 6px; }

/* ---------------- Structure ---------------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--bar-h);
  padding: 8px 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-bar__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-bar__right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.app-bar__titles { min-width: 0; }
.app-bar__title { display: block; font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar__sub { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; flex: 0 0 auto;
}

.app-main {
  flex: 1 1 auto;
  padding: 14px 14px calc(var(--tabbar-h) + 26px);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  padding: 6px 2px;
  transition: color .16s ease;
}
.tabbar__item.is-active { color: var(--brand); }
.tabbar__ico { position: relative; display: grid; place-items: center; }
.tabbar__badge {
  position: absolute; top: -5px; right: -9px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: .62rem; font-weight: 700; display: grid; place-items: center;
}
.tabbar__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease;
  text-align: center;
  line-height: 1.2;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47, 111, 237, .26); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--dark { background: var(--text); color: #fff; }
.btn--accent { background: var(--accent); color: #3B2600; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn--white { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.btn--danger { background: var(--red-soft); color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }
.btn--success { background: var(--green-soft); color: #067647; }
.btn--sm { padding: 8px 12px; font-size: .82rem; border-radius: 10px; }
.btn--xs { padding: 5px 9px; font-size: .74rem; border-radius: 9px; }
.btn--block { width: 100%; }
.btn--icon { padding: 9px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  color: var(--text-2); background: transparent; border: 1px solid transparent;
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg); }

.btn-install { flex: 0 0 auto; }
.btn-install__label { display: none; }

/* ---------------- Formulaires ---------------- */
.field { margin-bottom: 14px; }
.field > label, .label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
  font-size: .95rem;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(47, 111, 237, .12); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237C8698' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.field-error { color: var(--red); font-size: .78rem; margin-top: 5px; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.search-box { position: relative; }
.search-box .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 40px; }

/* ---------------- Cartes ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card + .card { margin-top: 14px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__title { font-weight: 700; font-size: 1rem; margin: 0; }

.section { margin: 20px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section__head h2 { margin: 0; }
.section__head a { font-size: .84rem; font-weight: 600; }

/* ---------------- Avatars ---------------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  background: var(--brand-soft); color: var(--brand-dark);
}
.avatar--text { display: grid; place-items: center; font-weight: 700; font-size: .86rem; }
.avatar--xs { width: 30px; height: 30px; font-size: .7rem; }
.avatar--sm { width: 38px; height: 38px; font-size: .78rem; }
.avatar--lg { width: 76px; height: 76px; font-size: 1.4rem; }

/* ---------------- Badges et puces ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; white-space: nowrap;
}
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-dark);
}
.badge--don { background: var(--green-soft); color: #067647; }
.badge--vente { background: var(--accent-soft); color: #8A5A00; }
.badge--pret { background: #EEF0FF; color: #3538CD; }
.badge--service { background: var(--brand-soft); color: var(--brand-dark); }
.badge--info { background: #F1F3F7; color: var(--text-2); }
.badge--danger { background: var(--red-soft); color: var(--red); }
.badge--success { background: var(--green-soft); color: #067647; }
.badge--warn { background: var(--accent-soft); color: #8A5A00; }

/* ---------------- Hero (accueil) ---------------- */
.hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  min-height: 232px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16, 24, 40, .32) 0%, rgba(16, 24, 40, .34) 45%, rgba(11, 26, 54, .9) 100%);
}
.hero__body { position: relative; padding: 20px 18px; width: 100%; }
.hero__kicker {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 5px 11px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  margin-bottom: 10px;
}
.hero h1 { font-size: 1.5rem; margin-bottom: 6px; }
.hero p { color: rgba(255, 255, 255, .88); font-size: .92rem; margin-bottom: 14px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 9px; }

/* ---------------- Statistiques ---------------- */
.stats { display: grid; grid-template-columns: 1fr; gap: 12px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.stat__ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); flex: 0 0 auto; }
.stat__ico--accent { background: var(--accent-soft); color: #8A5A00; }
.stat__ico--green { background: var(--green-soft); color: #067647; }
.stat__ico--violet { background: #EEF0FF; color: #3538CD; }
.stat__ico--red { background: var(--red-soft); color: var(--red); }
.stat__value { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.stat__label { font-size: .78rem; color: var(--muted); }

/* ---------------- Annonces ---------------- */
.listings { display: grid; grid-template-columns: 1fr; gap: 14px; }
.listing {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.listing:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.listing__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.listing__media img { width: 100%; height: 100%; object-fit: cover; }
.listing__cat { position: absolute; top: 10px; left: 10px; backdrop-filter: blur(6px); background: rgba(255, 255, 255, .93); }
.listing__price {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(16, 24, 40, .82); color: #fff;
  padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: .84rem;
}
.listing__body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.listing__title { font-weight: 700; font-size: 1rem; margin: 0; }
.listing__desc { color: var(--text-2); font-size: .86rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing__meta { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.listing__meta-text { min-width: 0; }
.listing__author { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing__sub { font-size: .73rem; color: var(--muted); }

/* Détail annonce */
.detail-media { border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 10; background: var(--bg); }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 1.4rem; margin: 14px 0 6px; }
.detail-price { font-size: 1.3rem; font-weight: 800; color: var(--brand-dark); }
.prose { color: var(--text-2); font-size: .95rem; white-space: pre-line; }
.author-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------- Messagerie ---------------- */
.conv-list { display: flex; flex-direction: column; }
.conv {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: inherit;
}
.conv:last-child { border-bottom: 0; }
.conv__body { min-width: 0; flex: 1 1 auto; }
.conv__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv__name { font-weight: 700; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__time { font-size: .72rem; color: var(--muted); flex: 0 0 auto; }
.conv__preview { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }

.thread {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 2px 4px;
  min-height: 44vh;
  max-height: 58vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bubble { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: .92rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.bubble__time { display: block; font-size: .68rem; opacity: .7; margin-top: 4px; }
.bubble--in { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble--out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
.composer .input { flex: 1 1 auto; border-radius: 20px; }
.composer .btn { flex: 0 0 auto; border-radius: 20px; padding: 11px 15px; }

/* ---------------- Voisins ---------------- */
.people { display: grid; grid-template-columns: 1fr; gap: 12px; }
.person {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px; box-shadow: var(--shadow);
}
.person__body { min-width: 0; flex: 1 1 auto; }
.person__name { font-weight: 700; font-size: .95rem; }
.person__sub { font-size: .78rem; color: var(--muted); }

/* ---------------- Tableaux (admin) ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 560px; }
table.data th, table.data td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #FAFBFD; }
table.data tbody tr:hover { background: #FAFBFD; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- Divers ---------------- */
.quote { border-left: 3px solid var(--brand); padding: 8px 0 8px 12px; color: var(--text-2); font-size: .9rem; }
.reply { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.reply:last-child { border-bottom: 0; }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .86rem; background: var(--brand-soft); color: var(--brand-dark); }
.notice--warn { background: var(--accent-soft); color: #8A5A00; }
.notice--danger { background: var(--red-soft); color: var(--red); }
.notice--success { background: var(--green-soft); color: #067647; }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); font-size: .9rem; }
.chart-box { position: relative; height: 250px; width: 100%; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.pill-nav { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px 14px; padding: 0 14px 4px; scrollbar-width: none; }
.pill-nav::-webkit-scrollbar { display: none; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(16, 24, 40, .55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  backdrop-filter: blur(3px);
}
.modal__box {
  background: #fff; width: 100%; max-width: 520px;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
  max-height: 90vh; overflow-y: auto;
}
.modal__box h3 { margin-bottom: 6px; }
.modal__actions { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.install-steps { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 12px 0 4px; }
.install-step { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; }
.install-step__os { display: flex; align-items: center; gap: 8px; color: var(--brand-dark); font-size: .86rem; margin-bottom: 4px; }
.install-step p { margin: 0; font-size: .84rem; color: var(--text-2); }

/* Toasts */
.toast-wrap { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 14px); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: #101828; color: #fff; border-radius: 13px;
  padding: 12px 14px; font-size: .86rem; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px;
  animation: toastIn .22s ease;
}
.toast--err { background: var(--red); }
.toast--ok { background: #067647; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- Pages d'authentification ---------------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.auth-hero {
  position: relative; color: #fff; padding: 34px 20px 30px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  overflow: hidden;
}
.auth-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.auth-hero__veil { position: absolute; inset: 0; background: linear-gradient(150deg, rgba(27, 75, 184, .92), rgba(16, 24, 40, .86)); }
.auth-hero__body { position: relative; }
.auth-hero h1 { font-size: 1.42rem; }
.auth-hero p { color: rgba(255, 255, 255, .87); font-size: .9rem; margin: 0; }
.auth-card {
  background: #fff; border-radius: 22px 22px 0 0;
  margin-top: -18px; position: relative; z-index: 2;
  padding: 22px 18px calc(var(--tabbar-h) + 30px);
  flex: 1 1 auto;
}
.auth-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.auth-switch { text-align: center; font-size: .86rem; color: var(--muted); margin-top: 18px; }
.trust-row { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
.trust { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border-radius: var(--radius-sm); padding: 11px 12px; font-size: .84rem; color: var(--text-2); }
.trust .ico { color: var(--brand); margin-top: 1px; }

/* Bandeau installation */
.install-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(120deg, #101828, #1B2A4A);
  color: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
}
.install-banner p { margin: 0; font-size: .84rem; color: rgba(255, 255, 255, .84); }
.install-banner strong { color: #fff; }

/* ---------------- Barre d'outils, FAB, détails ---------------- */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }

.toolbar { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }

.fab {
  position: fixed;
  right: 14px;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .92rem;
  box-shadow: 0 12px 26px rgba(47, 111, 237, .38);
}
body.has-fab .app-main { padding-bottom: calc(var(--tabbar-h) + 96px); }

.kv { display: grid; grid-template-columns: 1fr; gap: 8px; }
.kv__row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.kv__row:last-child { border-bottom: 0; }
.kv__key { color: var(--muted); flex: 0 0 auto; min-width: 96px; }
.kv__val { font-weight: 600; }

.thread-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-mini { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 14px; text-align: center; color: var(--muted); font-size: .84rem; background: #FAFBFD; }
.preview-img { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16/9; background: var(--bg); }
.preview-img img { width: 100%; height: 100%; object-fit: cover; }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px 16px; padding: 0 14px 4px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: .84rem; font-weight: 600; cursor: pointer;
}
.admin-tab.is-active { background: var(--text); border-color: var(--text); color: #fff; }
.admin-panel[hidden] { display: none !important; }
.gate {
  min-height: 70vh; display: flex; align-items: center; justify-content: center;
}
.gate__box { max-width: 460px; width: 100%; }

/* ---------------- Desktop (>= 768px) ---------------- */
@media (min-width: 768px) {
  body { font-size: 16px; }
  .app-main { padding: 22px 22px calc(var(--tabbar-h) + 34px); }
  .btn-install__label { display: inline; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .listings { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: repeat(2, 1fr); }
  .auth-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr auto; align-items: start; }
  .table-columns { display: grid; grid-template-columns: 2fr 3fr; gap: 14px; }
  .install-steps { grid-template-columns: repeat(2, 1fr); }
  .modal { align-items: center; padding: 20px; }
  .modal__box { border-radius: 22px; }
  .chip-row { margin: 0; padding-left: 0; padding-right: 0; }
  .pill-nav { margin: 0 0 14px; padding: 0; }
  .hero { min-height: 300px; }
  .hero h1 { font-size: 2rem; }
  .thread { max-height: 62vh; }
  .listing__desc { -webkit-line-clamp: 3; }
  .auth-wrap { max-width: 560px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .admin-tabs { margin: 0 0 16px; padding: 0; }
  .fab { right: 22px; }
}

@media (min-width: 1024px) {
  .app-main { padding-top: 26px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .listings { grid-template-columns: repeat(3, 1fr); }
  .people { grid-template-columns: repeat(3, 1fr); }
  .admin-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
}

@media (max-width: 420px) {
  .btn-install__label { display: none; }
  .app-bar { padding: 8px 10px; }
  .hero h1 { font-size: 1.32rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
