/* =========================================================
   Kooltraitance — design « chaleureux & arrondi »
   Couleurs : mandarine (action), sarcelle (confiance), soleil (statuts)
   ========================================================= */
:root {
  --bg: #F7F5F2;
  --bg-tint: #FFF1EA;
  --surface: #FFFFFF;
  --line: #ECE6E0;
  --line-strong: #DCD3CB;
  --ink: #23212E;
  --ink-2: #4A4757;
  --muted: #7A7586;

  --coral: #FF6A3D;
  --coral-dark: #E2522A;
  --coral-soft: #FFE6DC;
  --teal: #0E8C7F;
  --teal-soft: #DDF3EF;
  --sun: #F5A524;
  --sun-soft: #FFF0D1;
  --violet: #7C5CE0;
  --violet-soft: #ECE6FF;
  --sky: #2F80ED;
  --sky-soft: #E1EEFF;
  --leaf: #3FA34D;
  --leaf-soft: #E3F5E5;
  --danger: #D64545;
  --danger-soft: #FDE4E4;

  --f-display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --f-body: "Nunito Sans", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 10px;
  --r: 18px;
  --r-lg: 28px;
  --shadow: 0 1px 2px rgba(35, 33, 46, .04), 0 6px 20px rgba(35, 33, 46, .06);
  --shadow-lg: 0 10px 40px rgba(35, 33, 46, .12);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--coral-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: clamp(30px, 4.6vw, 52px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.container { max-width: 1180px; margin: 0 auto; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 28px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.nums { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-dark); }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: 22px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.wordmark { letter-spacing: -.01em; }
.wordmark b { font-weight: 600; color: var(--coral); }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { color: var(--ink-2); font-weight: 700; padding: 9px 14px; border-radius: 999px; font-size: 15px; }
.mainnav a:hover { background: var(--bg); text-decoration: none; }
.mainnav a.on { background: var(--coral-soft); color: var(--coral-dark); }
.usernav { display: flex; gap: 6px; align-items: center; }
.iconbtn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.iconbtn:hover { background: var(--bg); text-decoration: none; }
.badge { position: absolute; top: 3px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px; min-width: 230px; display: grid; z-index: 50; }
.menu-panel a, .menu-panel button { display: block; text-align: left; padding: 10px 12px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: 15px; background: none; border: 0; font-family: inherit; cursor: pointer; width: 100%; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg); text-decoration: none; }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.navtoggle { display: none; }
@media (max-width: 900px) {
  .mainnav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--surface); flex-direction: column; padding: 10px var(--gutter) 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .mainnav.open { display: flex; }
  .navtoggle { display: grid; }
  .topbar .container { gap: 8px; }
  .brand span { display: none; }
  .hide-sm { display: none !important; }
}

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--f-body); font-weight: 800; font-size: 15px; padding: 11px 20px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; text-decoration: none !important; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-dark); }
.btn-primary:hover { background: var(--coral-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-soft { background: var(--coral-soft); color: var(--coral-dark); }
.btn-link { background: none; border: 0; padding: 4px 0; color: var(--coral-dark); font-weight: 800; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-lg { padding: 15px 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Pastilles & étiquettes ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.chip-ok { background: var(--leaf-soft); color: #2C7A37; }
.chip-sun { background: var(--sun-soft); color: #A86A06; }
.chip-sky { background: var(--sky-soft); color: #1F63C4; }
.chip-muted { background: #EFEDEA; color: var(--muted); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-coral { background: var(--coral-soft); color: var(--coral-dark); }
.chip-teal { background: var(--teal-soft); color: var(--teal); }
.chip-urgent { background: var(--danger); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.tone-coral { background: var(--coral-soft); color: var(--coral-dark); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-sun { background: var(--sun-soft); color: #B7730A; }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-sky { background: var(--sky-soft); color: var(--sky); }
.tone-leaf { background: var(--leaf-soft); color: #2C7A37; }

.avatar { display: inline-grid; place-items: center; border-radius: 30%; font-family: var(--f-display); font-weight: 600; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.verified { display: inline-flex; align-items: center; gap: 4px; color: var(--teal); font-weight: 800; font-size: 13px; }

.stars { display: inline-flex; align-items: center; gap: 1px; color: var(--sun); line-height: 1; }
.stars .off { color: #E3DDD6; }
.stars-md { font-size: 17px; }
.stars-lg { font-size: 24px; }
.stars-note { margin-left: 6px; color: var(--ink-2); font-weight: 700; font-size: 14px; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-link { display: block; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.card-link:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.mcard { display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.mcard-cover { aspect-ratio: 16 / 8; background: var(--bg-tint); position: relative; overflow: hidden; max-width: 100%; }
.mcard-cover img { width: 100%; height: 100%; object-fit: cover; }
.mcard-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; }
.mcard-cover .ph svg { width: 56px; height: 56px; opacity: .85; }
.mcard-cover .chips { position: absolute; top: 12px; left: 12px; }
.mcard-body { padding: 16px 18px 18px; display: grid; gap: 8px; align-content: start; }
.mcard-title { font-family: var(--f-display); font-weight: 600; font-size: 18px; line-height: 1.25; color: var(--ink); }
.mcard-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; }
.mcard-meta span { display: inline-flex; align-items: center; gap: 5px; }
.mcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line); }
.price { font-family: var(--f-display); font-weight: 600; font-size: 18px; color: var(--ink); white-space: nowrap; }

.ccard { padding: 20px; display: grid; gap: 12px; align-content: start; }
.ccard-head { display: flex; gap: 14px; align-items: center; }
.ccard-head > div { min-width: 0; }
.ccard-name { font-family: var(--f-display); font-weight: 600; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.trust { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.trust .on { color: var(--teal); }

/* ---------- Héros ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 100%); padding-block: 56px 64px; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); z-index: 0; }
.hero::before { width: 420px; height: 420px; right: -120px; top: -140px; background: radial-gradient(circle, rgba(255,106,61,.20), rgba(255,106,61,0) 70%); }
.hero::after { width: 360px; height: 360px; left: -140px; bottom: -180px; background: radial-gradient(circle, rgba(14,140,127,.16), rgba(14,140,127,0) 70%); }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
.hero h1 em { font-style: normal; color: var(--coral); }
.hero .lead { font-size: 19px; color: var(--ink-2); margin-top: 16px; max-width: 54ch; }
@media (max-width: 920px) { .hero .container { grid-template-columns: 1fr; } .hero-visual { display: none; } }

.searchbar { margin-top: 28px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 6px; border: 1px solid var(--line); }
.searchbar label { display: grid; padding: 4px 18px; border-radius: 999px; }
.searchbar label + label { border-left: 1px solid var(--line); }
.searchbar span { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.searchbar input, .searchbar select { border: 0; outline: 0; font: inherit; font-size: 16px; padding: 2px 0; background: transparent; color: var(--ink); min-width: 0; }
.searchbar .btn { border-radius: 999px; }
.searchtabs { display: inline-flex; gap: 4px; background: rgba(255,255,255,.7); border-radius: 999px; padding: 4px; margin-top: 26px; border: 1px solid var(--line); }
.searchtabs button { border: 0; background: none; font: inherit; font-weight: 800; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.searchtabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
@media (max-width: 640px) {
  .searchbar { border-radius: var(--r); grid-template-columns: 1fr; }
  .searchbar label + label { border-left: 0; border-top: 1px solid var(--line); }
  .searchbar .btn { border-radius: 14px; }
}
.hero-stats { display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats b { display: block; font-family: var(--f-display); font-size: 28px; font-weight: 600; }
.hero-stats span { font-size: 14px; color: var(--muted); font-weight: 700; }

.hero-visual { position: relative; height: 420px; }
.float-card { position: absolute; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 16px 18px; border: 1px solid var(--line); }
.float-card.a { top: 10px; left: 0; right: 40px; transform: rotate(-2deg); }
.float-card.b { top: 190px; left: 60px; right: 0; transform: rotate(2.5deg); }
.float-card.c { bottom: 6px; left: 10px; width: 230px; transform: rotate(-1deg); }
@media (prefers-reduced-motion: no-preference) {
  .float-card.a { animation: bob 6s ease-in-out infinite; }
  .float-card.b { animation: bob 7s ease-in-out -2s infinite; }
  @keyframes bob { 50% { translate: 0 -8px; } }
}

/* ---------- Sections ---------- */
.section { padding-block: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head p { color: var(--muted); margin-top: 6px; }
.tradegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.trade { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 15px; transition: transform .15s, box-shadow .15s; }
.trade:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.trade .ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.trade small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: s; }
.step { padding: 24px; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); position: relative; }
.step::before { counter-increment: s; content: counter(s); width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 20px; background: var(--coral); color: #fff; margin-bottom: 14px; }
.step p { color: var(--ink-2); margin-top: 6px; font-size: 15px; }

.band { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.band p { color: rgba(255,255,255,.75); margin-top: 8px; }
@media (max-width: 700px) { .band { grid-template-columns: 1fr; padding: 28px; } }

/* ---------- Pages de liste ---------- */
.pagehead { padding-block: 32px 8px; }
.pagehead p { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.layout-filters { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; padding-block: 18px 56px; }
@media (max-width: 960px) { .layout-filters { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 86px; padding: 20px; display: grid; gap: 14px; }
@media (max-width: 960px) { .filters { position: static; } }
.filters h3 { font-size: 17px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a, .seg button { padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--ink-2); border: 0; background: none; cursor: pointer; font-family: inherit; }
.seg .on { background: var(--ink); color: #fff; text-decoration: none; }
.map { height: 440px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); z-index: 0; max-width: 100%; }
.map-sm { height: 260px; }
.empty { text-align: center; padding: 48px 24px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); display: grid; gap: 10px; justify-items: center; color: var(--muted); }
.empty h3 { color: var(--ink); }
.empty svg { color: var(--coral); }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; color: var(--ink); }
.pager .on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field .label { font-weight: 800; font-size: 14px; color: var(--ink); }
.field .req { color: var(--coral); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=tel],
.field input[type=url], .field input[type=date], .field input[type=search], .field select, .field textarea,
.input { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 11px 14px; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 0; border-color: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }
.field input[type=file] { font: inherit; font-size: 14px; padding: 10px; border: 2px dashed var(--line-strong); border-radius: 14px; width: 100%; background: var(--bg); }
.help { font-size: 13px; color: var(--muted); }
.errors { color: var(--danger); font-size: 13.5px; font-weight: 700; margin: 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices > div { display: contents; }
.choices label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--surface); user-select: none; }
.choices input { accent-color: var(--coral); margin: 0; }
.choices label:has(input:checked) { border-color: var(--coral); background: var(--coral-soft); color: var(--coral-dark); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--coral); margin-top: 2px; flex: none; }
.starpick .choices { flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.starpick .choices label { border: 0; padding: 0 2px; background: none; font-size: 0; }
.starpick .choices input { position: absolute; opacity: 0; pointer-events: none; }
.starpick .choices label::before { content: "★"; font-size: 34px; color: #E3DDD6; transition: color .1s; }
.starpick .choices label:has(input:checked)::before,
.starpick .choices label:has(input:checked) ~ label::before,
.starpick .choices label:hover::before,
.starpick .choices label:hover ~ label::before { color: var(--sun); }
.starpick .choices label:has(input:checked) { background: none; }
.starpick .choices label:focus-within::before { text-shadow: 0 0 0 var(--coral); outline: 2px solid var(--coral); border-radius: 6px; }
.fieldset { padding: 22px; display: grid; gap: 16px; }
.fieldset > h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.fieldset > h3 .n { width: 30px; height: 30px; border-radius: 10px; background: var(--coral-soft); color: var(--coral-dark); display: grid; place-items: center; font-size: 16px; }
.photos-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photos-edit label { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 1; display: block; cursor: pointer; border: 2px solid transparent; max-width: 100%; }
.photos-edit img { width: 100%; height: 100%; object-fit: cover; }
.photos-edit span { position: absolute; left: 6px; bottom: 6px; background: rgba(255,255,255,.92); padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.photos-edit label:has(input:checked) { border-color: var(--danger); opacity: .6; }
.photos-edit input { position: absolute; top: 8px; right: 8px; accent-color: var(--danger); }
.preview { display: flex; gap: 8px; flex-wrap: wrap; }
.preview img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }

/* ---------- Auth ---------- */
.auth { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(160deg, var(--coral) 0%, #FF8F5E 100%); color: #fff; padding: 56px; display: grid; align-content: center; gap: 18px; position: relative; overflow: hidden; }
.auth-side p { color: rgba(255,255,255,.88); font-size: 18px; max-width: 42ch; }
.auth-side ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; font-weight: 700; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li::before { content: "✓"; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 14px; flex: none; }
.auth-main { display: grid; place-items: center; padding: 40px var(--gutter); }
.auth-box { width: min(520px, 100%); display: grid; gap: 20px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- Détail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; padding-block: 18px 64px; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.aside { display: grid; gap: 18px; position: sticky; top: 86px; }
@media (max-width: 960px) { .aside { position: static; } }
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; border-radius: var(--r); overflow: hidden; }
.gallery a { display: block; overflow: hidden; aspect-ratio: 4/3; max-width: 100%; }
.gallery a:first-child { grid-row: span 2; aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.03); }
.gallery.one { grid-template-columns: 1fr; }
.gallery.one a:first-child { aspect-ratio: 16/8; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fact { background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.fact .k { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fact .v { font-weight: 800; margin-top: 2px; overflow-wrap: anywhere; }
.prose { white-space: pre-line; overflow-wrap: anywhere; color: var(--ink-2); }
.ref { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.offer { border: 2px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.offer.win { border-color: var(--leaf); background: var(--leaf-soft); }
.offer.best { border-color: var(--sun); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.bar-rating { display: grid; grid-template-columns: 1fr 120px 34px; gap: 10px; align-items: center; font-size: 14px; font-weight: 700; }
.bar-rating .track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-rating .fill { height: 100%; background: var(--sun); border-radius: 999px; }
.review { padding-block: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.review:first-child { border-top: 0; padding-top: 0; }
.reply { background: var(--bg); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.cover-band { height: 140px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(120deg, var(--coral-soft), var(--teal-soft)); }
.profile-head { padding: 0 24px 24px; margin-top: -48px; display: grid; gap: 14px; }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; display: grid; gap: 4px; }
.kpi b { font-family: var(--f-display); font-size: 32px; font-weight: 600; line-height: 1; }
.kpi span { color: var(--muted); font-weight: 700; font-size: 14px; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 960px) { .dash { grid-template-columns: 1fr; } }
.list { display: grid; }
.list > * { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; color: inherit; }
.list > *:first-child { border-top: 0; }
.list > a:hover { background: var(--bg); text-decoration: none; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 800; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head h3 { font-size: 18px; }
.progress { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--coral), var(--sun)); border-radius: 999px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 15px; font-weight: 700; }
.checklist li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.checklist li.ok { color: var(--ink); }
.checklist li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.checklist li.ok::before { background: var(--leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10l3 3 7-7' stroke='white' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--leaf); }

/* ---------- Messagerie ---------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 160px); min-height: 520px; overflow: hidden; margin-block: 18px 40px; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; }
.thread { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: inherit; }
.thread:hover { background: var(--bg); text-decoration: none; }
.thread.on { background: var(--coral-soft); }
.thread > div { min-width: 0; flex: 1; }
.thread .last { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.unread .last { color: var(--ink); font-weight: 800; }
.thread .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); flex: none; align-self: center; }
.conv { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.conv-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.conv-head > div { min-width: 0; }
.conv-back { display: none !important; }
@media (max-width: 800px) { .conv-back { display: grid !important; } }
.stream { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.bubble { max-width: min(560px, 80%); padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 1px solid var(--line); white-space: pre-line; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--coral); color: #fff; border-color: var(--coral); border-radius: 18px 18px 6px 18px; }
.bubble.me a { color: #fff; text-decoration: underline; }
.bubble.sys { align-self: center; background: var(--sun-soft); border-color: transparent; font-size: 14px; border-radius: 999px; padding: 6px 14px; color: #8A5A05; font-weight: 700; text-align: center; }
.bubble time { display: block; font-size: 11.5px; opacity: .7; margin-top: 3px; }
.composer { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; background: var(--surface); }
.composer textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 16px; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; min-height: 48px; max-height: 160px; }
.composer textarea:focus { outline: 0; border-color: var(--coral); }
.attach { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); cursor: pointer; flex: none; color: var(--ink-2); }
.attach input { display: none; }
@media (max-width: 800px) {
  .inbox { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .inbox.has-current .inbox-list { display: none; }
  .inbox:not(.has-current) .conv { display: none; }
  .stream { max-height: 60vh; }
}

/* ---------- Divers ---------- */
.flash { display: grid; gap: 8px; margin-top: 16px; }
.alert { padding: 12px 16px; border-radius: 14px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.alert-success { background: var(--leaf-soft); color: #23662D; }
.alert-info { background: var(--sky-soft); color: #1F5AB0; }
.alert-warning { background: var(--sun-soft); color: #8A5A05; }
.alert-error { background: var(--danger-soft); color: #A92F2F; }
.notif { display: flex; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); color: inherit; }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--bg); text-decoration: none; }
.notif.unread { background: #FFF8F4; }
.notif .ic { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 18px; }
.legal { max-width: 760px; padding-block: 40px 64px; }
.legal h1 { margin-bottom: 8px; }
.legal h2 { font-size: 22px; margin: 28px 0 10px; }
.legal p, .legal li { color: var(--ink-2); margin-bottom: 10px; }
.table-wrap { overflow-x: auto; }
table.simple { width: 100%; border-collapse: collapse; font-size: 15px; }
table.simple th, table.simple td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); }
table.simple th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 0; }

.footer { background: var(--ink); color: rgba(255,255,255,.75); padding-block: 48px 32px; margin-top: 40px; }
.footer .cols { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 28px; }
.footer h4 { color: #fff; margin-bottom: 12px; font-size: 16px; }
.footer a { color: rgba(255,255,255,.75); display: block; padding: 3px 0; font-size: 15px; }
.footer a:hover { color: #fff; }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 20px; font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr 1fr; } }

.cookie { position: fixed; left: var(--gutter); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 560px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 18px 20px; display: grid; gap: 12px; z-index: 60; }
.leaflet-popup-content-wrapper { border-radius: 14px !important; font-family: var(--f-body); }
.leaflet-popup-content a { font-weight: 800; }
.map-pin { background: var(--coral); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.map-pin.me { background: var(--teal); }
.footer a.brand { display: flex; color: #fff; font-size: 22px; padding: 0; }

[hidden]{display:none!important}
.cookie[hidden]{display:none!important}

/* Connexion avec Google */
.btn-google { background: #fff; color: #1F1F1F; border: 1px solid #DADCE0; gap: 12px; box-shadow: none; }
.btn-google:hover { background: #F8F9FA; color: #1F1F1F; }
.or-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Recherche d'entreprise (INSEE) à l'inscription */
.cfind { display: grid; gap: 6px; padding: 16px; border-radius: var(--r); background: var(--coral-soft, #FFE6DC); border: 1px solid var(--line); }
.cfind .label { font-weight: 800; }
.cfind-box { position: relative; }
.cfind-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 340px; overflow: auto; }
.cfind-list li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: grid; gap: 2px; }
.cfind-list li[aria-selected="true"], .cfind-list li:hover { background: var(--bg); }
.cfind-list li b { font-size: 15px; }
.cfind-list li span { font-size: 13px; color: var(--muted); }
.cfind-list li.off { cursor: default; opacity: .65; }
.cfind-list li.msg { cursor: default; color: var(--muted); font-size: 14px; }
.cfind-tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--ink); margin-left: 6px; vertical-align: 1px; }
.cfind-picked { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.cfind-picked b { display: block; font-size: 15px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--coral); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.is-auto .field-auto-hide { display: none; }

/* Suggestions ville / code postal */
.sugg-holder { position: relative; }
.sugg { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; min-width: 220px; text-align: left; }
.sugg li { padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); font-size: 15px; }
.sugg li span { color: var(--muted); font-size: 13px; margin-left: 4px; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--bg); }
