/* Carte plein écran, commandes flottantes en verre dépoli, feuilles iOS qui montent du bas. */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --fg: #111114;
  --muted: #6e6e76;
  --line: rgba(60, 60, 67, .16);
  --fill: rgba(118, 118, 128, .12);
  --glass: rgba(255, 255, 255, .78);
  --accent: #e8590c;
  --accent-fg: #ffffff;
  --ok: #248a3d;
  --danger: #d70015;
  --shadow: 0 6px 24px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --display: -apple-system-headline, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --fg: #f5f5f7; --muted: #98989f;
    --line: rgba(84, 84, 88, .55); --fill: rgba(118, 118, 128, .24); --glass: rgba(30, 30, 32, .78);
    --accent: #ff7a2f; --accent-fg: #1a0a00; --ok: #30d158; --danger: #ff453a;
    --shadow: 0 6px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--fg); font: 16px/1.35 var(--font); -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Google Maps impose position:relative sur ce conteneur : la taille doit venir de width/height. */
#map { position: fixed; inset: 0; width: 100%; height: 100%; background: var(--bg); }
.map-error { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px var(--gut-r) 24px var(--gut-l); color: var(--muted); }
.map-error div { max-width: 34ch; }
.map-error strong { display: block; color: var(--fg); font-size: 18px; margin-bottom: 6px; }

.glass { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow); }

/* Haut */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--gut-r) 0 var(--gut-l); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.top > * { pointer-events: auto; }
.search { display: flex; align-items: center; gap: 8px; border-radius: 14px; padding: 4px 4px 4px 12px; }
.search svg { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 0; font-size: 17px; outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: 15px; display: grid; place-items: center; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gut-r)) 0 calc(-1 * var(--gut-l)); padding: 2px var(--gut-r) 6px var(--gut-l); }
.filters::-webkit-scrollbar { display: none; }
.filters:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 0; border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 500; background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.banner { border-radius: 12px; padding: 9px 12px; font-size: 13px; color: var(--fg); }
.banner button { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 0; }

/* Bas */
.bottom { position: fixed; z-index: 10; left: var(--gut-l); right: var(--gut-r); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 16px; font-weight: 600; font-size: 15px; margin-right: auto; font-variant-numeric: tabular-nums; }
.round { width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; }
.primary-round { background: var(--accent); color: var(--accent-fg); box-shadow: 0 6px 18px rgba(232, 89, 12, .45); width: 58px; height: 58px; }
.primary-round svg { width: 26px; height: 26px; stroke-width: 2.5; }
#btn-locate svg { color: #0a84ff; fill: #0a84ff; stroke: none; width: 18px; height: 18px; }
.pick-hint { position: fixed; z-index: 20; top: calc(env(safe-area-inset-top, 0px) + 12px); left: var(--gut-l); right: var(--gut-r); border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 500; }
.pick-hint button { border: 0; background: var(--fill); border-radius: 999px; padding: 6px 12px; font-weight: 600; }

/* Repères */
.pin { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font: 700 14px/1 var(--font); border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); transform-origin: 50% 100%; transition: transform .15s; }
.pin::after { content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.pin .ok { position: absolute; right: -6px; top: -6px; width: 17px; height: 17px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; display: grid; place-items: center; }
.pin .ok svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3.5; }
.pin.draft { background: #111 !important; animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .pin.draft { animation: none; } }

/* Feuilles */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .28); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { position: relative; width: 100%; max-width: 600px; max-height: 70%; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 14px 14px 0 0; padding: 6px var(--gut-r) calc(env(safe-area-inset-bottom, 0px) + 24px) var(--gut-l); animation: up .28s cubic-bezier(.2, .9, .3, 1); }
.sheet-card.tall { max-height: calc(100% - env(safe-area-inset-top, 0px) - 12px); }
@keyframes up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .sheet-card { animation: none; } }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 8px; }
.grabber.light { background: rgba(255,255,255,.7); position: absolute; top: 6px; left: 50%; transform: translateX(-50%); margin: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0 12px; position: sticky; top: -6px; background: var(--bg); z-index: 2; }
.sheet-head h2 { margin: 0; font: 700 22px/1.2 var(--display); letter-spacing: -.01em; }
.sheet-head .center-title { font-size: 17px; font-weight: 600; }
.x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill); color: var(--muted); font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none; }
.x.over { position: absolute; top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); background: rgba(0,0,0,.45); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.text-btn { border: 0; background: none; color: var(--accent); font-size: 17px; padding: 6px 0; }
.text-btn.strong { font-weight: 600; }
.text-btn:disabled { opacity: .4; }

/* Formulaire façon Réglages iOS */
form { display: flex; flex-direction: column; gap: 18px; }
.group { background: var(--card); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
form .group { margin-bottom: 0; }
.group-label { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
.group-label.sub { margin-top: 6px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], textarea {
  width: 100%; min-width: 0; border: 0; background: var(--fill); border-radius: 10px; padding: 10px 12px; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row.wrap { flex-wrap: wrap; }
.field-row input { flex: 1; }
.mini { border: 0; background: var(--fill); color: var(--accent); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.danger-bg { background: var(--danger); color: #fff; }
.big { width: 100%; border: 0; background: var(--accent); color: var(--accent-fg); border-radius: 12px; padding: 13px; font-weight: 600; font-size: 17px; }
.link { border: 0; background: none; color: var(--accent); padding: 4px 0; text-align: left; font-size: 15px; align-self: flex-start; }
.link.danger { color: var(--danger); }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.hint:empty { display: none; }
.hint.err { color: var(--danger); }
.hint button { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 0; font-size: inherit; }

.suggestions { display: flex; flex-direction: column; }
.suggestions:empty { display: none; }
.sugg { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.sugg:last-child { border-bottom: 0; }
.sugg svg { color: var(--muted); }
.sugg .m { font-weight: 600; display: block; }
.sugg .s { color: var(--muted); font-size: 14px; display: block; }
.powered { font-size: 11px; color: var(--muted); text-align: right; padding-top: 4px; }

.picked { display: flex; gap: 12px; align-items: center; }
.picked .ph { width: 64px; height: 64px; border-radius: 10px; background: var(--fill) center/cover; flex: none; }
.picked .t { font-weight: 600; }
.picked .s { color: var(--muted); font-size: 14px; }
.picked .body { flex: 1; min-width: 0; }
.stars { color: #ff9f0a; font-size: 13px; font-weight: 600; }
.stars span { color: var(--muted); font-weight: 400; }

.caption-box summary { color: var(--accent); font-size: 15px; cursor: pointer; padding: 4px 0; }
.caption-box textarea { margin-top: 6px; }

.coll-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.coll-picker .chip { box-shadow: none; background: var(--fill); -webkit-backdrop-filter: none; backdrop-filter: none; }
.coll-picker .chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.switch-row { display: flex; align-items: center; justify-content: space-between; font-size: 17px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 51px; height: 31px; border-radius: 999px; background: var(--fill); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--ok); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Liste */
.list { display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden; }
.row { display: flex; gap: 12px; align-items: center; text-align: left; border: 0; background: none; padding: 11px 14px; border-bottom: 1px solid var(--line); width: 100%; }
.row:last-child { border-bottom: 0; }
.row .dot { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; }
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .warn { color: var(--danger); font-size: 13px; }
.row .chev { color: var(--muted); width: 16px; height: 16px; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }

/* Fiche */
.sheet-card.detail { padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 24px); }
.hero { position: relative; height: 210px; background: var(--fill) center/cover no-repeat; border-radius: 14px 14px 0 0; }
.hero.none { height: 54px; background: none; }
.hero.none .x.over { background: var(--fill); color: var(--muted); }
.hero.none .grabber.light { background: var(--line); }
.detail-body { padding: 14px var(--gut-r) 0 var(--gut-l); display: flex; flex-direction: column; gap: 10px; }
.detail-body h2 { margin: 0; font: 700 26px/1.15 var(--display); letter-spacing: -.015em; text-wrap: balance; }
.d-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--fill); }
.tag.ok { color: var(--ok); }
.d-sub { margin: -4px 0 0; color: var(--muted); font-size: 15px; }
.d-sub:empty { display: none; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: var(--card); color: var(--accent); border-radius: 12px; padding: 10px 4px; font-size: 13px; font-weight: 600; text-decoration: none; }
.action.primary { background: var(--accent); color: var(--accent-fg); }
.info { background: var(--card); border-radius: 12px; }
.info-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { font-size: 13px; color: var(--muted); }
.info-row .v { overflow-wrap: anywhere; }
.info-row a.v { color: var(--accent); text-decoration: none; }
.pre { white-space: pre-wrap; }
.open { color: var(--ok); font-weight: 600; }
.closed { color: var(--danger); font-weight: 600; }
.embed:empty { display: none; }
.embed .instagram-media { min-width: 0 !important; width: 100% !important; margin: 0 !important; }
.danger-zone { padding-top: 6px; }
.confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }

.howto { margin: 0; padding-left: 20px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }

.toast { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 90px); background: rgba(30,30,32,.92); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 15px; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
