:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --surface-2: #f0e9de;
  --ink: #2a2420;
  --muted: #6d6259;
  --line: #e4dacb;
  --wood: #b07a45;
  --wood-dark: #8d5d30;
  --pool: #1f7f8f;
  --bot: #f3ede4;
  --me: #2a2420;
  --me-ink: #fff;
  --shadow: 0 10px 30px rgba(60, 40, 20, .10);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171412; --surface: #221e1b; --surface-2: #2b2622; --ink: #f2ebe3; --muted: #b3a79b;
    --line: #3a332d; --wood: #d39b63; --wood-dark: #e3b07c; --pool: #5cc0cf; --bot: #2b2622;
    --me: #f2ebe3; --me-ink: #171412; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #171412; --surface: #221e1b; --surface-2: #2b2622; --ink: #f2ebe3; --muted: #b3a79b;
  --line: #3a332d; --wood: #d39b63; --wood-dark: #e3b07c; --pool: #5cc0cf; --bot: #2b2622;
  --me: #f2ebe3; --me-ink: #171412; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.15rem; text-decoration: none; }
.brand span { color: var(--muted); font-weight: 500; display: none; }
@media (min-width: 480px) { .brand span { display: inline; } }
.topnav { display: none; gap: 22px; margin-left: auto; }
.topnav a { text-decoration: none; color: var(--muted); font-size: .95rem; }
.topnav a:hover { color: var(--ink); }
.topbar .btn { margin-left: auto; }
.topnav + .btn { margin-left: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px;
  padding: 10px 18px; font: 600 .92rem Inter, sans-serif; text-decoration: none; cursor: pointer; border: 0;
  white-space: nowrap;
}
.btn-primary { background: var(--wood); color: #fff; }
.btn-primary:hover { background: var(--wood-dark); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; font-size: .85rem; }
.btn-light { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }

/* Mise en page : mobile d'abord (hero, puis chat, puis contenu) */
.layout {
  display: grid; gap: 28px; padding: 20px 16px 96px; max-width: 1280px; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "hero" "chat" "content";
}
.hero { grid-area: hero; position: relative; min-width: 0; }
.chat { grid-area: chat; min-width: 0; }
.content { grid-area: content; min-width: 0; }

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--wood-dark); font-weight: 600; margin-bottom: .6em; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); margin-bottom: .4em; }
.meta span:not(:last-child)::after { content: "·"; margin-left: 8px; }
.rating { color: var(--muted); font-size: .95rem; }
.rating strong { color: var(--ink); }
.star { color: var(--wood); }
.badge { background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; white-space: nowrap; }

/* Galerie : défilement horizontal sur mobile, mosaïque sur ordinateur */
.gallery {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 18px -16px 0;
  padding: 0 16px; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery button {
  flex: 0 0 86%; aspect-ratio: 4/3; border: 0; padding: 0; border-radius: 14px; overflow: hidden;
  scroll-snap-align: center; cursor: zoom-in; background: var(--surface-2);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery button:hover img { transform: scale(1.03); }
.all-photos { margin-top: 12px; }

/* Chat */
.chat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; height: min(72vh, 620px); overflow: hidden;
  outline: 3px solid color-mix(in srgb, var(--wood) 35%, transparent); outline-offset: 0;
}
.chat-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px; background: var(--wood); color: #fff; }
.chat-head h2 { font-size: 1.2rem; margin: 0; color: #fff; }
.chat-head p { margin: 0; font-size: .8rem; opacity: .9; }
.avatar {
  flex: 0 0 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.2); font: 600 1.3rem Fraunces, serif;
}
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; white-space: pre-line; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.msg.bot { background: var(--bot); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--me); color: var(--me-ink); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.escalate { border-left: 3px solid var(--wood); }
.msg .en { display: block; margin-top: 6px; color: var(--muted); font-size: .85rem; }
.msg .chips-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px;
  padding: 7px 12px; font: 500 .85rem Inter, sans-serif; cursor: pointer; text-align: left;
}
.chip:hover { border-color: var(--wood); }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; max-height: 120px;
  font: 16px/1.4 Inter, sans-serif; background: var(--bg); color: var(--ink);
}
.chat-input textarea:focus { outline: 2px solid var(--wood); border-color: transparent; }
.send { flex: 0 0 44px; height: 44px; border-radius: 50%; border: 0; background: var(--wood); color: #fff; cursor: pointer; display: grid; place-items: center; }
.send:disabled { opacity: .5; cursor: default; }
.chat-foot { margin: 0; padding: 0 16px 12px; font-size: .75rem; color: var(--muted); }

/* Contenu */
.highlights { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 8px; }
.hl { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.hl-ico { font-size: 1.5rem; line-height: 1; }
.hl p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.block { padding: 28px 0; border-bottom: 1px solid var(--line); }
.note { color: var(--wood-dark); font-weight: 600; font-size: .92rem; }
.small { font-size: .88rem; color: var(--muted); }
.amenities { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.amenities li { padding-left: 22px; position: relative; font-size: .93rem; }
.amenities li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--wood); opacity: .75; }
.block-pool { display: grid; gap: 18px; }
.block-pool img { border-radius: 14px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.two-col { display: grid; gap: 24px; }
.guides { display: grid; gap: 12px; }
.guides article { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.guides p { margin: 0; color: var(--muted); font-size: .93rem; }
.hosts { display: flex; gap: 16px; align-items: center; }
.host-avatars { display: flex; }
.host-avatars span {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2);
  border: 3px solid var(--bg); font: 600 1.2rem Fraunces, serif; color: var(--wood-dark);
}
.host-avatars span + span { margin-left: -14px; }
.hosts p { margin: 0; color: var(--muted); }
.foot { padding: 32px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.foot .btn { margin-bottom: 14px; }

/* Réservation directe */
.btn-sm { padding: 8px 16px; font-size: .88rem; }
.btn-block { width: 100%; padding: 14px 18px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: default; }
.booking { border-bottom: 0; }
.booking-head h2 { margin-bottom: .3em; }
.beta-tag { display: inline-block; background: color-mix(in srgb, var(--wood) 18%, transparent); color: var(--wood-dark);
  border-radius: 8px; padding: 4px 10px; font-size: .82rem; font-weight: 600; margin-bottom: .6em; }
.cal-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-hint { font-weight: 600; font-size: .92rem; text-align: center; }
.cal-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1.3rem; cursor: pointer; flex: 0 0 auto; }
.cal-btn:disabled { opacity: .3; cursor: default; }
.cal-months { display: grid; grid-template-columns: 1fr; gap: 18px; }
.cal-title { text-align: center; font-weight: 600; text-transform: capitalize; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: .72rem; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal-day { aspect-ratio: 1; border: 0; background: none; color: var(--ink); border-radius: 50%; font: 500 .9rem Inter, sans-serif; cursor: pointer; }
.cal-day:hover:not(:disabled) { outline: 1.5px solid var(--ink); }
.cal-day:disabled { color: var(--muted); opacity: .45; cursor: default; }
.cal-day.busy { text-decoration: line-through; }
.cal-day.in { background: color-mix(in srgb, var(--wood) 22%, transparent); border-radius: 0; }
.cal-day.sel { background: var(--wood); color: #fff; opacity: 1; }
.cal-legend { margin: 10px 0 0; font-size: .78rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.lg-busy { background: var(--line); }
.lg-sel { background: var(--wood); }
.book-form label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 12px; }
.book-form input, .book-form select, .book-form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: 16px Inter, sans-serif;
}
.book-form textarea { resize: vertical; }
.book-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.book-form label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.book-form label.check input { width: auto; margin: 0; }
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.q-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .95rem; }
.q-line s { color: var(--muted); margin-right: 6px; }
.q-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.05rem; }
.q-save { margin: 8px 0 0; color: var(--pool); font-size: .88rem; font-weight: 600; }
.terms { margin: 4px 0 12px; font-size: .88rem; }
.terms summary { cursor: pointer; font-weight: 600; }
.terms ul { color: var(--muted); padding-left: 20px; }
.form-error { color: #c0392b; font-size: .9rem; min-height: 1.2em; margin: 6px 0; }
@media (min-width: 640px) { .cal-months { grid-template-columns: 1fr 1fr; } }

/* Page de suivi */
.status-page { max-width: 640px; margin: 0 auto; padding: 32px 16px 64px; }
.status-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.status-badge { display: inline-block; border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: .85rem; background: var(--surface-2); margin-bottom: 10px; }
.status-badge.ok { background: color-mix(in srgb, var(--pool) 20%, transparent); color: var(--pool); }
.status-badge.wait { background: color-mix(in srgb, var(--wood) 20%, transparent); color: var(--wood-dark); }

/* Bouton flottant (mobile) */
.fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  border: 0; border-radius: 999px; padding: 14px 20px; background: var(--wood); color: #fff;
  font: 600 1rem Inter, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.fab.hide { opacity: 0; transform: translateY(20px); pointer-events: none; }

/* Visionneuse */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.lightbox::backdrop { background: rgba(0,0,0,.6); }
.lb-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg); z-index: 2; border-bottom: 1px solid var(--line); }
.lb-close { border: 0; background: var(--surface-2); color: var(--ink); width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
.lb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
.lb-grid button { border: 0; padding: 0; aspect-ratio: 4/3; overflow: hidden; border-radius: 8px; cursor: zoom-in; background: var(--surface-2); }
.lb-grid img { width: 100%; height: 100%; object-fit: cover; }
.lb-viewer { position: fixed; inset: 0; background: #0d0b0a; display: grid; place-items: center; z-index: 3; }
.lb-viewer[hidden] { display: none; }
.lb-viewer img { max-width: 100vw; max-height: 82dvh; object-fit: contain; }
.lb-viewer p { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #e9e1d8; margin: 0; padding: 0 16px; font-size: .9rem; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.8rem; cursor: pointer; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }

/* Tablette */
@media (min-width: 640px) {
  .highlights { grid-template-columns: 1fr 1fr; }
  .lb-grid { grid-template-columns: repeat(3, 1fr); }
  .guides { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .amenities { grid-template-columns: repeat(3, 1fr); }
}

/* Ordinateur : contenu à gauche, chat collant à droite */
@media (min-width: 1024px) {
  .topbar { padding: 14px 32px; }
  .topnav { display: flex; }
  .layout {
    padding: 28px 32px 64px; column-gap: 40px; row-gap: 12px;
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-areas: "hero chat" "content chat";
    align-items: start;
  }
  .chat { position: sticky; top: 84px; grid-row: 1 / span 2; }
  .chat-card { height: calc(100vh - 110px); max-height: 820px; }
  .gallery {
    display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px;
    height: 440px; margin: 22px 0 0; padding: 0; overflow: hidden; border-radius: var(--radius);
  }
  .gallery button { border-radius: 0; aspect-ratio: auto; }
  .gallery button:first-child { grid-row: 1 / span 2; }
  .gallery button:nth-child(n+6) { display: none; }
  .all-photos { position: absolute; right: 16px; bottom: 16px; box-shadow: var(--shadow); }
  .block-pool { grid-template-columns: 1fr 1fr; align-items: center; }
  .fab { display: none; }
  .lb-grid { grid-template-columns: repeat(4, 1fr); max-width: 1280px; margin: 0 auto; }
}

/* Mode « ouverture prochaine » */
.soon-bar { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); text-align: center; font-size: .9rem; padding: 8px 16px; line-height: 1.4; }
.soon-bar strong { font-weight: 600; }
.soon-badge { display: inline-block; margin: 0 0 .8em; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--wood-dark); font-weight: 600; font-size: .85rem; }
.block.soon { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
