:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --ink: #000000;
  --ink-2: #3d3d38;
  --ink-3: #6f6f68;
  --line: #ebebe7;
  --line-strong: #d4d4ce;
  --track: #f2f2ef;
  --hover: #f7f7f5;
  --ease: cubic-bezier(.32, .72, 0, 1);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--ink-3); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Page */
.page { max-width: 1160px; margin: 0 auto; padding: 72px 32px 56px; }

/* Titre : le nombre et la phrase qui relit la recherche. */
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
h1 { margin: 0; font-size: 44px; font-weight: 400; letter-spacing: -.032em; line-height: 1.08; }
.count-num { display: inline-block; min-width: 1ch; font-variant-numeric: tabular-nums; }
.summary { min-height: 1.45em; margin: 10px 0 0; color: var(--ink-3); font-size: 17px; letter-spacing: -.01em; }

/* Contrôles */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px; }
.segmented { position: relative; display: inline-flex; padding: 3px; background: var(--track); border-radius: 999px; }
.segmented button { position: relative; z-index: 1; height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); transition: color .2s; }
.segmented button[aria-pressed="true"], .segmented button:hover { color: var(--ink); }
.thumb { position: absolute; top: 3px; left: 0; height: 32px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px rgb(0 0 0 / .05), 0 1px 3px rgb(0 0 0 / .08); transition: transform .4s var(--ease), width .4s var(--ease); }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-3); transition: border-color .2s, box-shadow .2s; }
.search:hover { border-color: var(--line-strong); }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--track); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; font: 12px/1 inherit; color: var(--ink-3); }
.search:focus-within kbd { visibility: hidden; }
.search input:focus-visible { outline: none; }
.pill { appearance: none; field-sizing: content; height: 36px; max-width: 260px; padding: 0 32px 0 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6f68' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 11px center / 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); cursor: pointer; transition: border-color .2s, color .2s, box-shadow .2s; }
.pill:hover { border-color: var(--line-strong); color: var(--ink); }
/* Un filtre actif se voit d'un coup d'œil : trait et texte pleins. */
.pill.is-set { border-color: var(--ink); color: var(--ink); font-weight: 500; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E"); }
.pill.small { height: 32px; padding-left: 12px; font-size: 13px; }
.reset { margin-left: 4px; }
.export { display: inline-flex; flex: none; align-items: center; gap: 7px; height: 36px; margin-bottom: 2px; padding: 0 16px 0 13px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; transition: background-color .2s, transform .2s var(--ease); }
.export:hover { background: #262624; }
.export:active { transform: scale(.97); }
.export svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.export:hover svg { transform: translateY(1.5px); }

/* Tableau */
.table-wrap { margin-top: 28px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th.col-wine { width: 24%; }
th.col-place { width: 22%; }
th.col-contact { width: 92px; }
th.col-count { width: 104px; }
th { padding: 0 12px 10px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: 13px; font-weight: 400; text-align: left; white-space: nowrap; }
th.num { text-align: right; }
th button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; transition: color .15s; }
th button:hover, th[aria-sort="ascending"] button, th[aria-sort="descending"] button { color: var(--ink); }
th[aria-sort="descending"] button::after { content: "↓"; font-size: 12px; }
th[aria-sort="ascending"] button::after { content: "↑"; font-size: 12px; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.row { cursor: pointer; transition: background-color .15s; }
.row:hover { background: var(--hover); }
.row[aria-current="true"] { background: var(--track); }
.row:focus-visible { outline-offset: -2px; }
.name, .city, .wine-main { display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.name { font-weight: 500; }
.sub { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-3); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sub-siren { font-variant-numeric: tabular-nums; }
.sub-city { display: none; }
.col-count { white-space: nowrap; }
.contact-icons { display: inline-flex; gap: 8px; color: var(--ink-3); }
.contact-icon { display: inline-grid; }
.contact-icon svg { width: 15px; height: 15px; }
.row:hover .contact-icons { color: var(--ink-2); }
.table-wrap tbody { transition: opacity .2s .12s; }
.table-wrap[aria-busy="true"] tbody { opacity: .45; }
.placeholder td { height: 64px; }
.bar { display: block; width: 60%; height: 10px; border-radius: 5px; background: var(--track); }
.placeholder td:first-child .bar { width: 70%; }
.num .bar { margin-left: auto; width: 32px; }
.message-row td { padding: 80px 12px; text-align: center; }
.message-row p { margin: 0 0 6px; }
.message-title { color: var(--ink); font-size: 16px; }
.message-row .text-button { margin-top: 10px; }
.text-button { padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-decoration-color: #cfcfc9; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
.text-button:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Pagination */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pager-controls { display: flex; align-items: center; gap: 8px; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); transition: border-color .15s, background-color .15s, transform .2s var(--ease); }
.icon-button:hover:not(:disabled) { border-color: var(--line-strong); }
.icon-button:active:not(:disabled) { transform: scale(.94); }
.icon-button:disabled { color: #cdcdc7; cursor: default; }
.page-input { display: inline-flex; align-items: center; gap: 6px; }
.page-input input { width: 52px; height: 32px; padding: 0 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; text-align: center; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.page-input input::-webkit-inner-spin-button, .page-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Fiche */
.overlay { position: fixed; inset: 0; z-index: 10; background: rgb(20 20 18 / .14); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.sheet { position: fixed; top: 8px; right: 8px; bottom: 8px; z-index: 11; width: min(600px, calc(100vw - 16px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 24px 64px rgb(0 0 0 / .12); transform: translateX(calc(100% + 16px)); visibility: hidden; transition: transform .5s var(--ease), visibility 0s .5s; }
.sheet-open .overlay { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
.close { position: absolute; top: 20px; right: 20px; z-index: 1; border-color: transparent; }
.close:hover { background: var(--track); }
.sheet:focus { outline: none; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 44px 44px 36px; }

/* Apparition en cascade des blocs à l'ouverture : le seul mouvement non déclenché de la fiche. */
.reveal { opacity: 0; animation: rise .6s var(--ease) forwards; animation-delay: calc(80ms + var(--i) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sheet h2 { margin: 0 48px 0 0; font-size: 32px; font-weight: 500; letter-spacing: -.03em; line-height: 1.12; overflow-wrap: anywhere; }
.sheet-meta { margin: 10px 0 0; color: var(--ink-3); font-size: 15px; }
.lead { max-width: 64ch; margin: 30px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.lead-official { padding-left: 14px; border-left: 2px solid var(--line); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.action { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 100%; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
.action span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action:hover { border-color: var(--line-strong); background: var(--hover); }
.action:active, .social:active, .chip:active { transform: scale(.97); }
.action svg { color: var(--ink-3); }
.action.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.action.primary:hover { background: #262624; }
.action.primary svg { width: 13px; height: 13px; color: #fff; transition: transform .3s var(--ease); }
.action.primary:hover svg, .inline-link:hover svg { transform: translate(2px, -2px); }
.socials { display: inline-flex; gap: 2px; margin-left: 2px; }
.social { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; color: var(--ink-3); transition: color .2s, background-color .2s, transform .2s var(--ease); }
.social:hover { color: var(--ink); background: var(--track); }
.social svg { width: 18px; height: 18px; }

.facts { margin-top: 30px; padding: 4px 20px; border: 1px solid var(--line); border-radius: 16px; }
.fact { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact-label { color: var(--ink-3); font-size: 13px; line-height: 1.7; }
.fact-value { font-size: 15px; line-height: 1.45; }
.inline-link { display: inline-flex; white-space: nowrap; align-items: center; gap: 4px; color: var(--ink); text-decoration: underline; text-decoration-color: #cfcfc9; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.inline-link:hover { text-decoration-color: currentColor; }
.inline-link svg { width: 12px; height: 12px; transition: transform .3s var(--ease); }

.block { margin-top: 40px; }
.block h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 500; }
.count-badge { padding: 1px 8px; background: var(--track); border-radius: 999px; color: var(--ink-3); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.presence-title { margin: 0 0 10px; color: var(--ink-3); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 13px; transition: border-color .2s, background-color .2s, color .2s, transform .2s var(--ease); }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip-count { color: var(--ink-3); font-variant-numeric: tabular-nums; transition: color .2s; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .chip-count { color: rgb(255 255 255 / .6); }
.chip-more { padding: 0 4px; color: var(--ink-3); font-size: 13px; }
.places { margin: 0; padding: 0; list-style: none; }
.place { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.place:last-child { border-bottom: 0; }
.place.appear { animation: rise .45s var(--ease) both; }
.place-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.place-tag { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-3); font-size: 12px; font-weight: 400; }
.place-address { display: flex; align-items: flex-start; gap: 6px; color: var(--ink-2); text-decoration: none; transition: color .15s; }
.place-address svg { width: 14px; height: 14px; margin-top: 2px; color: var(--ink-3); opacity: .55; transition: opacity .2s, color .2s; }
.place-address:hover { color: var(--ink); }
.place-address:hover svg { opacity: 1; color: var(--ink); }
.more { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-decoration-color: #cfcfc9; text-underline-offset: 3px; font-variant-numeric: tabular-nums; }
.more:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Repli animé des informations légales (Chrome récent ; ailleurs, ouverture sans animation). */
.legal { margin-top: 40px; border-top: 1px solid var(--line); interpolate-size: allow-keywords; }
.legal summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; cursor: pointer; font-size: 15px; font-weight: 500; list-style: none; }
.legal summary::-webkit-details-marker { display: none; }
.legal summary svg { color: var(--ink-3); transition: transform .35s var(--ease); }
.legal[open] summary svg { transform: rotate(180deg); }
.legal::details-content { block-size: 0; overflow: hidden; transition: block-size .4s var(--ease), content-visibility .4s allow-discrete; }
.legal[open]::details-content { block-size: auto; }
.legal dl { margin: 0 0 8px; }
.legal-row { display: grid; grid-template-columns: 136px 1fr; gap: 16px; padding: 8px 0; font-size: 14px; }
.legal-row dt { color: var(--ink-3); }
.legal-row dd { margin: 0; overflow-wrap: anywhere; }
.purpose { color: var(--ink-2); line-height: 1.55; }
.people { display: flex; flex-direction: column; gap: 2px; }
.with-copy { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.copy { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-3); transition: background-color .15s, color .15s; }
.copy:hover { background: var(--track); color: var(--ink); }
.copy-icons { display: grid; }
.copy-icons svg { grid-area: 1 / 1; width: 14px; height: 14px; transition: opacity .2s, transform .3s var(--ease); }
.copy-icons svg:last-child { opacity: 0; transform: scale(.6); }
.copied .copy-icons svg:first-child { opacity: 0; transform: scale(.6); }
.copied .copy-icons svg:last-child { opacity: 1; transform: none; color: var(--ink); }

.source { margin: 28px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }

.sheet-placeholder { display: flex; flex-direction: column; gap: 14px; }
.shimmer { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--track) 0%, #fafaf8 50%, var(--track) 100%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
.shimmer:first-child { height: 30px; margin-bottom: 4px; }
.shimmer:nth-child(3) { height: 80px; margin-top: 18px; border-radius: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 960px) {
  th.col-contact, td.col-contact { display: none; }
}

@media (max-width: 720px) {
  .page { padding: 40px 16px 40px; }
  h1 { font-size: 32px; }
  .summary { font-size: 15px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .search { flex-basis: 100%; }
  .filters .pill { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; }
  .heading { flex-direction: column; align-items: flex-start; gap: 16px; }
  th.col-place, td.col-place { display: none; }
  th.col-count { width: 84px; }
  .name { display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  th.col-wine { width: 36%; }
  .sub-siren { display: none; }
  .sub-city { display: inline; }
  .pager { flex-direction: column-reverse; align-items: stretch; }
  .pager-controls { justify-content: space-between; }
  .sheet { top: 0; right: 0; bottom: 0; width: 100vw; border: 0; border-radius: 0; }
  .sheet-body { padding: 28px 20px; }
  .sheet h2 { font-size: 26px; }
  .fact { grid-template-columns: 1fr; gap: 4px; }
  .place { grid-template-columns: 1fr; gap: 2px; }
  .legal-row { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; animation-delay: 0s !important; }
}
.client-footer { display: flex; gap: 1.5rem; align-items: center; justify-content: center; padding: 2rem 0 1rem; }
.client-footer[hidden], #limit-note[hidden] { display: none; }
.auth-page { max-width: 42rem; margin-inline: auto; }
.auth-page form { display: grid; gap: 1rem; max-width: 24rem; }
.auth-page input { display: block; width: 100%; margin-top: .4rem; padding: .65rem; }
