/* ==========================================================================
   RideTogether — charte « planifiez. rencontrez. partagez. »
   Bleu électrique, Poppins, cartes arrondies. Mobile d'abord, responsive.
   Aucun style inline (CSP stricte). Polices auto-hébergées (RGPD).
   ========================================================================== */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/poppins-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap; src: url("/static/fonts/poppins-latin-800-normal.woff2") format("woff2"); }

:root {
  --brand: #2b2bea;
  --brand-strong: #1d1dc9;
  --brand-ink: #ffffff;
  --brand-soft: #eeeeff;
  --brand-line: #c9c7f6;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --text: #15152b;
  --muted: #6c6c85;
  --line: #e6e6f0;
  --ok: #138a4b;
  --ok-soft: #e3f6ec;
  --warn: #9a5b00;
  --warn-soft: #fff3d9;
  --danger: #d0263b;
  --danger-soft: #ffe9ec;
  --info-soft: #eeeeff;
  --star: #f5b400;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(21, 21, 70, .05), 0 6px 24px rgba(21, 21, 70, .06);
  --shadow-lg: 0 20px 60px rgba(10, 10, 80, .25);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #6f6fff;
    --brand-strong: #8b8bff;
    --brand-ink: #0b0b24;
    --brand-soft: #1e1e48;
    --brand-line: #3a3a7a;
    --bg: #0d0d1c;
    --surface: #16162b;
    --surface-2: #1e1e36;
    --text: #ececf8;
    --muted: #a0a0bd;
    --line: #2a2a46;
    --ok: #5bd69a;
    --ok-soft: #12301f;
    --warn: #ffc65c;
    --warn-soft: #362a10;
    --danger: #ff7a8a;
    --danger-soft: #3a1820;
    --info-soft: #1e1e48;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font: 15px/1.6 var(--font); background: var(--bg); color: var(--text); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main { flex: 1; padding-top: 24px; padding-bottom: 56px; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3, .h3 { font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.55rem, 4vw, 2.1rem); line-height: 1.2; margin: .1em 0 .5em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 .5em; }
h3, .h3 { font-size: 1rem; margin: 0 0 .6em; display: flex; align-items: center; gap: 8px; }
p { margin: 0 0 .8em; }
img { max-width: 100%; height: auto; }
code { font-size: .88em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
.icon { flex: none; vertical-align: middle; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.lead { font-size: 1.05rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; color: var(--brand); margin: 0 0 .3em; }
.back { text-decoration: none; font-weight: 600; font-size: .9rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- Logo ---------- */
.logo { font-weight: 800; letter-spacing: -.03em; font-size: 1.35rem; color: var(--brand); white-space: nowrap; line-height: 1; }
.logo-r { position: relative; display: inline-block; }
.logo-r::after { content: ""; position: absolute; left: 15%; right: -12%; bottom: .08em; height: .14em; border-radius: 99px; background: currentColor; opacity: .35; transform: rotate(-8deg); }
.logo-sm { font-size: 1.1rem; }
.hero .logo-hero { font-size: clamp(2.5rem, 9vw, 4.6rem); color: #fff; }

/* ---------- En-tête ---------- */
.topbar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); }
.topbar-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { text-decoration: none; display: flex; align-items: center; }
.mainnav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.mainnav a { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.usernav { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.iconbtn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--text); text-decoration: none; }
.iconbtn:hover { background: var(--surface-2); }
.dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.badge { display: inline-block; min-width: 1.5em; padding: 0 .45em; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: .72rem; text-align: center; font-weight: 700; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; background: var(--surface); }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 240px; z-index: 50; display: flex; flex-direction: column; }
.menu-list a, .menu-list .linklike { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); text-align: left; width: 100%; font-size: .92rem; font-weight: 500; }
.menu-list a:hover, .menu-list .linklike:hover { background: var(--surface-2); }
.menu-list form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

/* ---------- Barre d'onglets mobile ---------- */
.tabbar { display: none; }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.center { padding: 36px 24px; }
.empty { text-align: center; color: var(--muted); }
.empty-soft { background: var(--surface-2); border-radius: var(--radius-sm); padding: 22px 18px; text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 12px; border: 1.5px solid transparent; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, transform .05s; min-height: 44px; }
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--brand-line); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-white { background: #fff; color: #2b2bea; }
.btn-white:hover { background: #eef0ff; }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn-outline-white:hover { background: rgba(255, 255, 255, .12); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(.95); }
.btn-small { padding: 7px 14px; font-size: .86rem; min-height: 38px; border-radius: 10px; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }
.linklike.danger, .danger { color: var(--danger); }
.link-strong { font-weight: 600; text-decoration: none; }
.link-strong:hover { text-decoration: underline; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .82rem; font-weight: 500; cursor: pointer; text-decoration: none; min-height: 34px; }
.chip:hover { background: var(--surface-2); }
.chip-on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); font-weight: 700; }
.chip-danger { color: var(--danger); }
.chip-quiet { color: var(--muted); border-color: transparent; background: transparent; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); font-size: .76rem; font-weight: 600; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-muted { color: var(--muted); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: .92rem; }
.alert ul { margin: 0; padding-left: 1.2em; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--info-soft); color: var(--text); }
.banner { padding: 10px 0; font-size: .9rem; }
.banner-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form > .btn { align-self: flex-start; }
.form > .btn-block { align-self: stretch; }
label { display: block; font-weight: 600; font-size: .9rem; }
label > input, label > select, label > textarea, label > .pwd-wrap { display: block; margin-top: 6px; }
label .muted { font-weight: 400; }
label small, .hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin: 5px 0 0; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; width: 100%; font-weight: 400; min-height: 46px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
textarea { resize: vertical; min-height: 90px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
input[type="file"] { padding: 9px; font-size: .85rem; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 6px 12px; margin-right: 10px; background: var(--brand-soft); color: var(--brand); cursor: pointer; }
.check { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 400; font-size: .92rem; cursor: pointer; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; font-size: .92rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; }
.vis-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface-2); padding: 8px 8px 8px 14px; border-radius: var(--radius-sm); }
.vis-row label { font-weight: 500; }
.vis-row select { width: auto; min-width: 170px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.highlight input { border-color: var(--brand); }
.search { display: flex; gap: 8px; }
.search input { min-width: 0; }
.inline-form summary { list-style: none; cursor: pointer; }
.inline-form summary::-webkit-details-marker { display: none; }
.inline-form[open] .form { margin-top: 12px; }
form.inline { display: inline; }
.pwd-wrap { position: relative; }
.pwd-wrap input { margin: 0; padding-right: 48px; }
.pwd-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pwd-toggle:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Mise en page ---------- */
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.col-main { min-width: 0; }
.side { position: sticky; top: 88px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 0; }
.tabs, .seg { display: flex; gap: 4px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs { border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.seg { background: var(--surface-2); padding: 4px; border-radius: 14px; width: fit-content; }
.seg a { padding: 8px 18px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* ---------- Tableau de bord ---------- */
.greeting { margin-bottom: 8px; }
.greeting h1 { margin-bottom: 0; }
.greeting p { color: var(--muted); font-size: 1rem; }
.block { margin-bottom: 26px; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.block-head h2 { margin: 0; font-size: 1.12rem; }
.visit-list { display: flex; flex-direction: column; gap: 10px; }
.visit-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.visit-item:hover { border-color: var(--brand-line); }
.visit-item .icon { color: var(--muted); margin-left: auto; }
.visit-body { display: flex; flex-direction: column; min-width: 0; }
.visit-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-date { flex: none; width: 52px; height: 56px; border-radius: 12px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; text-transform: uppercase; font-weight: 600; letter-spacing: .04em; }
.visit-date b { font-size: 1.3rem; line-height: 1; letter-spacing: 0; }

/* Vignettes de parcs : dégradés de marque. */
.theme-0 { background: linear-gradient(135deg, #2b2bea, #7a3cf0); }
.theme-1 { background: linear-gradient(135deg, #ff7a45, #e8364f); }
.theme-2 { background: linear-gradient(135deg, #00a3a3, #2b6bea); }
.theme-3 { background: linear-gradient(135deg, #c3268e, #6d2bea); }
.theme-4 { background: linear-gradient(135deg, #1e9bf0, #2b2bea); }
.theme-5 { background: linear-gradient(135deg, #f0a500, #ef5b2b); }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.scroller > * { scroll-snap-align: start; }
.park-card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.park-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(21, 21, 70, .12); }
.park-art { position: relative; height: 112px; display: grid; place-items: center; overflow: hidden; }
.park-art::before { content: ""; position: absolute; inset: auto -10% -40% -10%; height: 90%; border-top: 4px solid rgba(255, 255, 255, .35); border-radius: 50% 50% 0 0; transform: rotate(-6deg); }
.park-art::after { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 26px); }
.park-initials { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .95); color: #2b2bea; font-weight: 800; font-size: 1rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); position: absolute; top: 12px; left: 12px; }
.park-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.park-name { font-weight: 600; line-height: 1.3; }
.park-loc { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: 4px; }
.park-meta { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.park-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.park-hero { position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 28px; border-radius: 24px; color: #fff; margin-bottom: 24px; overflow: hidden; }
.park-hero::after { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .1) 0 2px, transparent 2px 34px); pointer-events: none; }
.park-hero > * { position: relative; z-index: 1; }
.park-hero h1 { margin: 0; color: #fff; }
.park-hero p { margin: 4px 0 0; opacity: .9; display: flex; align-items: center; gap: 6px; }
.park-hero .btn { margin-left: auto; }
.park-hero-initials { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: #fff; color: #2b2bea; font-weight: 800; font-size: 1.5rem; }
.attr-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attr-chips li { background: var(--brand-soft); color: var(--brand); padding: 5px 12px; border-radius: 99px; font-size: .82rem; font-weight: 600; }

.promo { background: linear-gradient(150deg, #2b2bea, #4b2bea 60%, #7a3cf0); color: #fff; border: 0; position: relative; overflow: hidden; }
.promo::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 160px; border: 6px solid rgba(255, 255, 255, .18); border-radius: 50%; }
.promo-title { font-weight: 800; font-size: 1.15rem; line-height: 1.3; margin-bottom: 6px; }
.promo .small { opacity: .9; }

/* ---------- Publications ---------- */
.composer > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.composer > summary::-webkit-details-marker { display: none; }
.composer-ph { flex: 1; background: var(--surface-2); padding: 10px 16px; border-radius: 99px; font-size: .92rem; }
.composer > summary .icon { color: var(--brand); }
.composer[open] > summary { margin-bottom: 14px; }
.post { padding: 18px 18px 12px; }
.post-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.post-who { flex: 1; min-width: 0; }
.author { font-weight: 600; color: var(--text); text-decoration: none; }
.author:hover { color: var(--brand); }
.meta { color: var(--muted); font-size: .8rem; }
.meta a { color: inherit; text-decoration: none; }
.vis-badge { font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.vis-badge.vis-public { background: var(--brand-soft); color: var(--brand); }
.place { margin: 0 0 8px; color: var(--brand); font-size: .86rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; }
.photos { display: grid; gap: 4px; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.photos-2, .photos-4 { grid-template-columns: 1fr 1fr; }
.photos-3 { grid-template-columns: 2fr 1fr; }
.photos img { width: 100%; height: 100%; max-height: 480px; object-fit: cover; display: block; }
.photos-1 img { max-height: 600px; }
.post-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; }
.post-actions form { margin: 0; }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; }
.act:hover { background: var(--surface-2); color: var(--text); }
.act-on { color: var(--danger); }
.act-on .icon { fill: currentColor; }
.spacer { flex: 1; }
.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment .body { margin: 4px 0 6px; }
.comment-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar-xs { width: 32px; height: 32px; font-size: .85rem; }
.avatar-sm { width: 42px; height: 42px; }
.avatar-md { width: 56px; height: 56px; }
.avatar-lg { width: 112px; height: 112px; }
.avatar-fallback { display: inline-grid; place-items: center; background: linear-gradient(135deg, #2b2bea, #7a3cf0); color: #fff; font-weight: 700; }
.avatar-lg.avatar-fallback { font-size: 2.6rem; }
.avatar-sm.avatar-fallback { font-size: 1.05rem; }
.avatar-edit { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

.profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: start; }
.profile-head h1 { margin-top: 0; }
.profile-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-row:first-of-type { border-top: 0; }
.list-row.col { flex-direction: column; align-items: flex-start; }
.list-row form { margin: 0; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.link-row { text-decoration: none; color: var(--text); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.link-row:hover { background: var(--surface-2); }
.is-unread { font-weight: 700; }
.is-unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: -4px; }
.is-past { opacity: .55; }
.quote { margin: 4px 0 0; color: var(--muted); font-style: italic; }

.thread { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); align-self: flex-start; }
.msg-me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-radius: 18px 18px 6px 18px; }
.msg-me .msg-meta, .msg-me .msg-meta .linklike, .msg-me .msg-meta a { color: inherit; opacity: .8; }
.msg .body { margin: 0; }
.msg-meta { font-size: .72rem; color: var(--muted); display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.msg-meta form { margin: 0; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 16px; }
.dl dt { font-weight: 600; color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; }
blockquote { margin: 8px 0; padding: 10px 14px; border-left: 4px solid var(--brand-line); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.danger-zone { border-color: var(--danger); }
.codes { columns: 2; font-size: 1.05rem; }
.qr { background: #fff; padding: 8px; border-radius: 14px; }
.secret { word-break: break-all; }
.big-status { font-size: 3.8rem; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }

/* ---------- Connexion / inscription ---------- */
.page-auth main { padding-top: 40px; }
.auth { max-width: 460px; }
.auth-wide { max-width: 620px; }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head h1 { margin: 12px 0 4px; }
.auth-mark { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(135deg, #2b2bea, #7a3cf0); color: #fff; font-weight: 800; font-size: 1.7rem; box-shadow: 0 10px 30px rgba(43, 43, 234, .35); }

/* ---------- Administration ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--muted); }
.stat-n { font-size: 2.2rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.card:has(> .table) { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row-urgent { background: var(--danger-soft); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.attr-list { columns: 2; padding-left: 1.2em; }
.mail-body { white-space: pre-wrap; font: inherit; font-size: .88rem; margin: 0; overflow-wrap: anywhere; }

/* ---------- Accueil public ---------- */
.page-home main { padding-top: 0; }
.hero { position: relative; overflow: hidden; background: #2b2bea; color: #fff; padding: 56px 0 72px; }
.hero-track { position: absolute; inset: auto 0 0 0; width: 100%; height: 75%; color: #5656ff; opacity: .55; pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { margin: 0 0 6px; }
.hero-tag { font-weight: 700; font-size: clamp(1.1rem, 2.6vw, 1.6rem); margin: 0 0 18px; letter-spacing: -.01em; }
.hero-lead { font-size: 1.05rem; max-width: 34em; opacity: .92; font-weight: 300; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 16px; }
.hero-note { font-size: .82rem; opacity: .85; display: flex; align-items: center; gap: 6px; }

.phones { position: relative; height: 560px; }
.phone { position: absolute; width: 270px; height: 552px; border-radius: 46px; background: #0e0e18; padding: 10px; box-shadow: var(--shadow-lg), inset 0 0 0 2px #3a3a48; }
.phone-front { left: 4%; top: 0; z-index: 2; }
.phone-back { left: 46%; top: 36px; transform: rotate(6deg); opacity: .96; }
.phone-screen { height: 100%; border-radius: 37px; background: #fff; color: #15152b; overflow: hidden; font-size: 11px; line-height: 1.45; }
.ph-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px 6px; font-weight: 600; font-size: 12px; position: relative; }
.ph-island { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); width: 84px; height: 24px; border-radius: 20px; background: #0e0e18; }
.ph-pad { padding: 12px 16px; }
.ph-hello { font-size: 17px; font-weight: 700; margin: 6px 0 0; }
.ph-sub { color: #6c6c85; margin: 0 0 14px; }
.ph-row { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 8px; font-size: 12px; }
.ph-btn { display: inline-flex; align-items: center; gap: 3px; border: 1.5px solid #c9c7f6; color: #2b2bea; border-radius: 8px; padding: 3px 8px; font-weight: 600; font-size: 10px; }
.ph-btn-solid { display: inline-flex; align-items: center; gap: 4px; background: #2b2bea; color: #fff; border-radius: 10px; padding: 7px 12px; font-weight: 600; margin: 10px 0; }
.ph-link { color: #2b2bea; font-weight: 600; font-size: 10px; }
.ph-empty { background: #f1f2f7; color: #6c6c85; border-radius: 10px; padding: 12px; text-align: center; font-size: 10px; }
.ph-parks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-parks.small { grid-template-columns: repeat(3, 1fr); }
.ph-parks.small .ph-art { height: 54px; }
.ph-park { border: 1px solid #e6e6f0; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; font-size: 10px; }
.ph-park b, .ph-park small { padding: 0 8px; }
.ph-park b { padding-top: 6px; }
.ph-park small { color: #6c6c85; padding-bottom: 8px; font-size: 9px; }
.ph-art { height: 72px; border-radius: 10px; display: grid; place-items: start; padding: 6px 8px; color: #fff; font-weight: 800; font-size: 11px; }
.ph-park .ph-art { border-radius: 0; }
.ph-tabs { display: flex; gap: 4px; background: #f1f2f7; border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.ph-tabs span { flex: 1; text-align: center; padding: 4px; border-radius: 8px; color: #6c6c85; }
.ph-tabs .on { background: #fff; color: #2b2bea; font-weight: 600; }
.ph-visit { display: flex; gap: 8px; align-items: center; border: 1px solid #e6e6f0; border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.ph-date { width: 38px; height: 40px; border-radius: 9px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 8px; text-transform: uppercase; }
.ph-date b { font-size: 14px; line-height: 1; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 40px 0 24px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature p { color: var(--muted); margin: 0; font-size: .92rem; }
.feature-ico { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.trust { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px; }
.trust h2 { margin-top: 0; }
.trust p { margin: 0; max-width: 46em; }

.prose { max-width: 820px; }
.prose h2 { margin-top: 1.8em; }
.prose .table { font-size: .86rem; }

/* ---------- Pied de page & cookies ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0; font-size: .85rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.footer-tag { margin: 6px 0 0; font-weight: 600; color: var(--muted); }
.footer nav { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--brand); }
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.cookie-inner { pointer-events: auto; max-width: 780px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 16px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cookie-inner p { margin: 0; flex: 1 1 320px; font-size: .85rem; }
.cookie-actions { display: flex; gap: 10px; }

/* ==========================================================================
   Tablette
   ========================================================================== */
@media (max-width: 1020px) {
  .layout-2 { grid-template-columns: 1fr; }
  .side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
  .side .card { margin: 0; }
  .mainnav a span { display: none; }
  .mainnav a { padding: 10px; }
  .hero-inner { grid-template-columns: 1fr; }
  .phones { height: 420px; transform: scale(.78); transform-origin: top center; margin-bottom: -100px; }
  .phone-front { left: calc(50% - 250px); }
  .phone-back { left: calc(50% + 0px); }
}

/* ==========================================================================
   Téléphone : barre d'onglets en bas, navigation du haut allégée
   ========================================================================== */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .mainnav { display: none; }
  .menu-name { display: none; }
  .menu > summary { padding: 3px; border: 0; background: transparent; }
  .topbar-inner { min-height: 58px; gap: 8px; }
  .logo { font-size: 1.2rem; }
  .usernav .btn-ghost { display: none; }
  main { padding-top: 18px; }

  .has-tabbar main { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
  .has-tabbar .footer { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; height: 100%; border-radius: 12px; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tab-plus { justify-self: center; width: 52px; height: 52px !important; border-radius: 18px !important; background: var(--brand); color: #fff !important; box-shadow: 0 8px 22px rgba(43, 43, 234, .4); }
  .has-tabbar .cookie-banner { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }

  .card { padding: 16px; border-radius: 16px; }
  .post { padding: 14px 14px 8px; }
  .grid-2, .row-2, .row-3, .features { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr; }
  .profile-head { grid-template-columns: auto 1fr; }
  .profile-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .avatar-lg { width: 84px; height: 84px; }
  .scroller { grid-auto-columns: 74%; margin-right: -16px; padding-right: 16px; }
  .park-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .park-art { height: 90px; }
  .park-hero { padding: 20px; border-radius: 20px; }
  .park-hero .btn { margin-left: 0; width: 100%; }
  .page-head .search { width: 100%; }
  .vis-row { flex-direction: column; align-items: stretch; padding: 10px 12px; }
  .vis-row select { width: 100%; }
  .codes, .attr-list { columns: 1; }
  .msg { max-width: 90%; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .cookie-inner { padding: 14px 16px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
  .hero { padding: 36px 0 24px; }
  .hero-cta .btn { flex: 1; }
  .phones { display: none; }
  .trust { padding: 20px; }
  .trust .btn { width: 100%; }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 380px) {
  .park-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
