
  :root {
    --bg: #F4F7FB; --surface: #FFFFFF; --ink: #0E1B2E; --muted: #5E6B7D; --line: #E2E8F0;
    --blue: #1E6FF2; --blue-soft: #E8F0FE; --navy: #081530; --navy-2: #12305C;
    --red: #C5221F; --green: #188038; --amber: #B26A00;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0B1220; --surface: #131D30; --ink: #E7ECF4; --muted: #9AA7BA; --line: #24324A;
      --blue: #5B9BFF; --blue-soft: #1A2B4A; --red: #F28B82; --green: #81C995; --amber: #F6C35C;
    }
  }
  :root[data-theme="dark"] {
    --bg: #0B1220; --surface: #131D30; --ink: #E7ECF4; --muted: #9AA7BA; --line: #24324A;
    --blue: #5B9BFF; --blue-soft: #1A2B4A; --red: #F28B82; --green: #81C995; --amber: #F6C35C;
  }
  html { scroll-padding-top: env(safe-area-inset-top, 0px); scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
  *, *::before, *::after { box-sizing: inherit; }
  body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; }
  img { max-width: 100%; }
  input, button, select { font: inherit; }
  a { color: inherit; }
  .container { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
  button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8AB4FF; outline-offset: 2px; }

  /* ---------- Hero ---------- */
  .hero {
    position: relative; color: #fff; overflow: hidden;
    padding-top: env(safe-area-inset-top, 0px);
    background:
      radial-gradient(900px 500px at 85% 20%, rgba(70,130,255,.35), transparent 60%),
      radial-gradient(700px 400px at 10% 90%, rgba(30,111,242,.25), transparent 60%),
      linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  }
  .hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
    background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(90deg, transparent 30%, #000 80%);
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 80%);
  }
  .nav { position: relative; display: flex; align-items: center; gap: 2rem; padding: 1.25rem 0; }
  .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.6rem; text-decoration: none; letter-spacing: -.02em; }
  .brand svg { width: 34px; height: 34px; }
  .brand .b2 { color: #6FA8FF; }
  .links { display: flex; gap: 1.75rem; margin-left: 1rem; }
  .links a { text-decoration: none; font-weight: 500; opacity: .9; padding: .35rem 0; border-bottom: 2px solid transparent; }
  .links a:hover, .links a.on { opacity: 1; color: #8AB4FF; border-color: #8AB4FF; }
  .nav-right { margin-left: auto; display: flex; gap: .75rem; align-items: center; }
  .icon-btn { width: 46px; height: 46px; border-radius: 12px; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
  .icon-btn:hover { background: rgba(255,255,255,.2); }
  .icon-btn svg { width: 22px; height: 22px; }
  .cta { background: var(--blue); color: #fff; border: 0; border-radius: 12px; padding: .8rem 1.3rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
  .cta:hover { filter: brightness(1.08); }
  .cta.ghost { background: rgba(255,255,255,.12); }
  @media (max-width: 960px) { .links { display: none; } }
  @media (max-width: 520px) { .cta.add { display: none; } .brand { font-size: 1.35rem; } }

  .hero-body { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; padding: 2.5rem 0 7rem; }
  @media (max-width: 960px) { .hero-body { grid-template-columns: 1fr; padding-bottom: 6rem; } }
  .hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 1.25rem; font-weight: 800; }
  .hero h1 .l2 { display: block; color: #4D94FF; }
  .hero p.intro { font-size: 1.12rem; opacity: .88; max-width: 34em; margin: 0 0 2rem; }
  .searchbox { display: flex; align-items: center; background: #fff; border-radius: 14px; padding: .35rem .35rem .35rem 1rem; max-width: 640px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
  .searchbox svg { width: 22px; height: 22px; color: #5E6B7D; flex: none; }
  .searchbox input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: #0E1B2E; padding: .8rem .75rem; font-size: 1rem; }
  .searchbox button { border: 0; background: var(--blue); color: #fff; border-radius: 10px; padding: .85rem 1.4rem; font-weight: 600; cursor: pointer; display: flex; gap: .5rem; align-items: center; }
  @media (max-width: 520px) { .searchbox button span { display: none; } }
  .popular { margin-top: 1.1rem; font-size: .95rem; opacity: .9; display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
  .popular button { background: none; border: 0; color: #fff; padding: 0; cursor: pointer; opacity: .85; }
  .popular button:hover { color: #8AB4FF; opacity: 1; text-decoration: underline; }

  .collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; padding: 1rem; }
  @media (max-width: 960px) { .collage { max-width: 560px; } }
  .float {
    position: relative; aspect-ratio: 1.45; background: #fff; border-radius: 16px; display: grid; place-items: center; padding: 1rem;
    box-shadow: 0 18px 40px rgba(0,0,0,.35); text-decoration: none; color: #0E1B2E;
    transform: rotate(var(--r, 0deg)) translateY(var(--y, 0)); transition: transform .2s;
  }
  .float:hover { transform: rotate(0deg) translateY(-6px) scale(1.04); z-index: 2; }
  .float img { max-width: 88%; max-height: 80%; object-fit: contain; }
  .float .mono { width: 54%; font-size: 1.3rem; }
  .float .tip { position: absolute; bottom: -2.4rem; left: 50%; transform: translateX(-50%); background: #0E1B2E; color: #fff; font-size: .8rem; padding: .4rem .8rem; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
  .float:hover .tip, .float:focus-visible .tip { opacity: 1; }
  .collage-empty { grid-column: 1 / -1; color: rgba(255,255,255,.7); text-align: center; padding: 3rem 1rem; border: 2px dashed rgba(255,255,255,.25); border-radius: 18px; }

  /* ---------- Stats ---------- */
  .stats { position: relative; margin-top: -3.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 30px rgba(8,21,48,.08); display: grid; grid-template-columns: repeat(4, 1fr); }
  .stat { display: flex; gap: 1rem; align-items: center; padding: 1.4rem 1.5rem; }
  .stat + .stat { border-left: 1px solid var(--line); }
  .stat svg { width: 36px; height: 36px; color: var(--blue); flex: none; }
  .stat strong { display: block; font-size: 1.35rem; line-height: 1.2; }
  .stat span { color: var(--muted); font-size: .92rem; }
  @media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }
  @media (max-width: 460px) { .stat { padding: 1rem; gap: .65rem; } .stat svg { width: 28px; height: 28px; } .stat strong { font-size: 1.1rem; } .stat span { font-size: .8rem; } }

  /* ---------- Sections ---------- */
  section.block { padding: 3rem 0 0; }
  .sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
  .sec-head h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 1.85rem); letter-spacing: -.02em; }
  .sec-head .meta { color: var(--muted); font-size: .95rem; }
  .linkbtn { background: none; border: 0; color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; }

  .cats { display: flex; gap: .75rem; overflow-x: auto; padding: .25rem .1rem 1rem; scrollbar-width: thin; }
  .cat { flex: 0 0 auto; width: 118px; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: .8rem .5rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: .82rem; font-weight: 500; text-align: center; line-height: 1.25; }
  .cat svg { width: 26px; height: 26px; color: var(--navy-2); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cat svg { color: #9CC0FF; } }
  :root[data-theme="dark"] .cat svg { color: #9CC0FF; }
  .cat:hover { border-color: var(--blue); }
  .cat[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
  .cat[aria-pressed="true"] svg { color: #fff; }

  .grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.1rem; }
  @media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
  @media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; } }
  .card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
  .card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(8,21,48,.12); }
  .card-top { aspect-ratio: 1.9; display: grid; place-items: center; padding: 1rem; }
  .card-top img { max-width: 78%; max-height: 82%; object-fit: contain; }
  .card-top .mono { width: 34%; font-size: 1.2rem; }
  .card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
  .card-body strong { font-size: 1rem; line-height: 1.3; }
  .card-body small { color: var(--muted); font-size: .85rem; }
  .visit { margin-top: auto; padding-top: .8rem; }
  .visit span { display: flex; justify-content: center; align-items: center; gap: .4rem; background: var(--blue-soft); color: var(--blue); border-radius: 10px; padding: .55rem; font-weight: 600; font-size: .88rem; }
  .card:hover .visit span { background: var(--blue); color: #fff; }
  .visit svg { width: 16px; height: 16px; }
  .mono { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
  .empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; }

  nav.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 2rem; }
  .btn { font-weight: 600; min-width: 2.6rem; height: 2.6rem; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
  .btn:hover:not(:disabled) { border-color: var(--blue); }
  .btn.primary, .pager .btn[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: #fff; }
  .btn.danger { color: var(--red); }
  .btn.small { height: 2.1rem; min-width: 0; padding: 0 .75rem; font-size: .85rem; }
  .btn:disabled { opacity: .4; cursor: default; }

  /* ---------- About / contact ---------- */
  .about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; margin: 3.5rem 0 0; }
  @media (max-width: 760px) { .about { grid-template-columns: 1fr; } }
  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem; }
  .panel h2 { margin: 0 0 .75rem; font-size: 1.4rem; }
  .panel p { margin: 0; color: var(--muted); max-width: 60ch; white-space: pre-line; }
  .panel.dark { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; border: 0; }
  .panel.dark p { color: rgba(255,255,255,.8); margin-bottom: 1.25rem; }
  footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2.5rem 0 3rem; }

  /* ---------- Admin ---------- */
  .admin { background: var(--surface); border: 2px solid var(--blue); border-radius: 20px; padding: 1.5rem; margin-top: 3rem; }
  .admin h2 { margin: 0 0 .25rem; font-size: 1.5rem; }
  .admin h3 { margin: 1.75rem 0 .75rem; font-size: 1.1rem; }
  .admin .hint { color: var(--muted); margin: 0 0 1rem; font-size: .92rem; }
  .form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  @media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
  .field { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--muted); }
  .field.full { grid-column: 1 / -1; }
  .field input:not([type="file"]):not([type="color"]), .field select, .field textarea { font: inherit; font-size: 1rem; padding: .6rem .85rem; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
  .field textarea { min-height: 90px; resize: vertical; }
  .field input[type="color"] { width: 64px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 3px; }
  .logo-pick { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--ink); }
  .preview { width: 110px; height: 64px; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: .75rem; text-align: center; }
  .preview img { max-width: 90%; max-height: 85%; object-fit: contain; }
  .actions { display: flex; gap: .6rem; flex-wrap: wrap; grid-column: 1 / -1; }
  .msg { font-size: .9rem; color: var(--muted); min-height: 1.4em; margin: .5rem 0 0; }
  .msg.err { color: var(--red); }
  .list-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
  th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
  th { color: var(--muted); font-weight: 600; }
  td.thumb div { width: 64px; height: 40px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
  td.thumb img { max-width: 86%; max-height: 80%; object-fit: contain; }
  td.thumb .mono { width: 30px; font-size: .7rem; }
  .badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1.5px solid currentColor; white-space: nowrap; }
  .badge.active { color: var(--green); } .badge.upcoming { color: var(--amber); } .badge.expired { color: var(--red); }
  .row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
  .savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.5rem -1.5rem -1.5rem; padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; }

  /* Login + admin page */
  .admin-page { min-height: 100vh; }
  .admin-top { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
  .admin-top .nav { padding: 1rem 0; }
  .login { max-width: 420px; margin: 4rem auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 2rem; display: flex; flex-direction: column; gap: 1rem; }
  .login h1 { margin: 0; font-size: 1.5rem; }
  .login p { margin: 0; color: var(--muted); }
  .notice { max-width: 640px; margin: 4rem auto; background: var(--surface); border: 2px solid var(--red); border-radius: 18px; padding: 1.5rem; }
  .meter { font-size: .85rem; color: var(--muted); }
  .meter.warn { color: var(--red); font-weight: 600; }
  .loading { text-align: center; color: var(--muted); padding: 4rem 1rem; }

  /* Onglets admin */
  .tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1.25rem 0 0; border-bottom: 1px solid var(--line); }
  .tab { border: 0; background: none; color: var(--muted); font-weight: 600; padding: .75rem 1rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
  .tab:hover { color: var(--ink); }
  .tab[aria-selected="true"] { color: var(--blue); border-color: var(--blue); }
  .tabpanel[hidden] { display: none; }
  .icon-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
  .icon-opt { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
  .icon-opt svg { width: 24px; height: 24px; }
  .icon-opt[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
  td.ic svg { width: 24px; height: 24px; color: var(--blue); }

  /* Visites */
  .quick { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1.25rem; }
  .kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
  @media (max-width: 640px) { .kpis { grid-template-columns: 1fr; } }
  .kpi { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.25rem; }
  .kpi span { display: block; color: var(--muted); font-size: .88rem; }
  .kpi strong { font-size: 1.9rem; line-height: 1.2; }
  .kpi small { color: var(--muted); }
  .chart { display: flex; align-items: flex-end; gap: 3px; height: 200px; padding: .5rem 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .bar { flex: 1 0 8px; min-width: 8px; background: var(--blue); border-radius: 4px 4px 0 0; position: relative; }
  .bar.zero { background: var(--line); }
  .chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin: .35rem 0 1.5rem; }
  .visits-table { min-width: 0; max-width: 420px; }
  .savebar[hidden] { display: none; }
  .kpi small { display: block; }

  /* Contact + formulaire de demande */
  .contact-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
  .cta.wa { background: #1FAF55; }
  .contact-lines { list-style: none; padding: 0; margin: 1rem 0 0; color: rgba(255,255,255,.85); font-size: .95rem; }
  .contact-lines a { color: #fff; }
  .brand-img { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; display: block; }
  .cat-img { width: 28px; height: 28px; object-fit: contain; }
  td.ic .cat-img { width: 26px; height: 26px; }
  .modal { width: min(640px, calc(100% - 2rem)); max-height: calc(100% - 2rem); border: 0; border-radius: 20px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
  .modal::backdrop { background: rgba(8,21,48,.6); }
  .modal form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
  .modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
  .modal-head h2 { margin: 0; font-size: 1.4rem; }
  .icon-close { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
  .seg { display: flex; gap: .5rem; flex-wrap: wrap; }
  .seg label { cursor: pointer; }
  .seg input { position: absolute; opacity: 0; pointer-events: none; }
  .seg span { display: inline-block; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: .92rem; }
  .seg input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
  .seg input:focus-visible + span { outline: 3px solid #8AB4FF; outline-offset: 2px; }
  .field[hidden] { display: none; }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .modal .cta { align-self: flex-start; }

  /* Demandes (admin) */
  .req { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.25rem; margin-bottom: .85rem; background: var(--bg); }
  .req.new { border-left: 4px solid var(--blue); }
  .req-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
  .req-top strong { font-size: 1.05rem; }
  .req-date { color: var(--muted); font-size: .85rem; }
  .req-lines { margin: .5rem 0; font-size: .93rem; display: grid; gap: .2rem; }
  .req-lines a { color: var(--blue); }
  .req-msg { white-space: pre-wrap; margin: .5rem 0 .75rem; color: var(--ink); }
  .tab .count { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; margin-left: .35rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .75rem; }
  .icon-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; color: var(--ink); }

  /* VIP */
  .card-top { position: relative; }
  .card.vip { border-color: #E3A72F; box-shadow: 0 0 0 1px #E3A72F; }
  .vip-badge { position: absolute; top: .55rem; left: .55rem; background: #E3A72F; color: #1B1300; font-size: .72rem; font-weight: 800; padding: .2rem .55rem; border-radius: 999px; letter-spacing: .02em; }
  .btn.star { color: #B7791F; font-size: 1rem; }
  .btn.star[aria-pressed="true"] { background: #E3A72F; border-color: #E3A72F; color: #1B1300; }
  .check { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-size: .95rem; cursor: pointer; }
  .check input { width: 20px; height: 20px; accent-color: #E3A72F; }
