﻿/* ────────────────────────────────────────────────────────────────
   StatBNB UI — mobile-first (dark par défaut, light en data-theme)
   ──────────────────────────────────────────────────────────────── */

/* ========== Reset & base ========== */
* {
  box-sizing: border-box;
}

html,
body {
  height: auto;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  /* background: var(--bg); */
  background:
    radial-gradient(1200px 600px at 20% -10%, rgb(29 147 149 / 10%), transparent),
    radial-gradient(800px 400px at 90% 10%, rgb(29 147 149 / 6%), transparent),
    var(--bg);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, scroll;
  background-size: 130vmax 70vmax, 100vmax 50vmax, auto;
  background-position: 20% -10%, 90% 10%, 0 0;
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
[role="tab"]:focus-visible,
input[type="range"]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ========== Thème (tokens) ========== */
:root {
  --bg: #0b0f14;
  --card: #121821;
  --border: #1b2330;
  --text: #e7edf5;
  --muted: #95a3b3;
  --field-bg: #0f1620;
  --field-border: #2a3647;
  --teal: #1d9395;
  --teal-strong: #167275;
  --header-h: 56px;
  --dt-row-stripe: 255, 255, 255;
  --dt-column-ordering: 255, 255, 255;

  /* aliases (uniformiser l’existant) */
  --line: var(--border);
  --line-2: rgba(255, 255, 255, .12);
  --panel: var(--card);
  --ring: rgba(29, 147, 149, .45);
  --brand: var(--teal);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .25);
  --radius: 14px;
  --radius-sm: 10px;

  /* Layout */
  --map-h-mobile: 42vh;
  --map-h-desktop: 48vh;
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #0e1a2b;
  --muted: #50627a;
  --field-bg: #f0f4f8;
  --field-border: #d7dee7;
  --teal: #137c7e;
  --teal-strong: #0f6667;
  --dt-row-stripe: 0, 0, 0;
  --dt-column-ordering: 0, 0, 0;

  --line: var(--border);
  --line-2: rgba(0, 0, 0, .08);
  --panel: var(--card);
  --ring: rgba(19, 124, 126, .28);
}

/* ========== Header / nav ========== */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f1620, var(--bg));
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] header {
  background: linear-gradient(135deg, color-mix(in oklab, var(--bg) 86%, transparent), transparent);
  border-radius: 12px 0 0;
}

header h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

/* =============== Header =============== */
.rm-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(140%) blur(8px);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 86%, transparent), transparent);
  border-bottom: 1px solid var(--border);
  transition: padding .18s ease;
}

.rm-shell {
  margin: 0;
  padding: 10px 14px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.rm-left {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}

.rm-nav {
  justify-self: center;
}

.rm-actions {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  display: none;
}

.rm-right {
  display: flex;
  gap: 10px;
  justify-self: end;
}

.rm-sub {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--card);
  font-size: 12px;
  white-space: nowrap;
}

/* --- MODE CONDENSÉ quand on n’est pas en haut --- */
.rm-header.is-condensed {
  padding-top: 0;
  padding-bottom: 0;
}

.rm-header.is-condensed .rm-shell {
  padding-top: 5px;
  padding-bottom: 5px;
}

.rm-header.is-condensed .rm-user-trigger {
  padding: 1px;
}

.rm-header.is-condensed .pro-cta {
  padding: 4px 6px;
}

/* responsive : nav wrap/scroll si besoin */
@media (max-width: 800px) {
  .rm-left {
    justify-self: start;
  }

  .rm-nav {
    justify-self: center;
  }

  .rm-actions {
    justify-self: center;
    display: flex;
    gap: 10px;
  }
}

/* Brand */
.rm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.rm-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.rm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1
}

.rm-brand-name {
  font-weight: 800;
  color: var(--text)
}


.rm-tagline {
  color: var(--muted);
  font-size: 12px
}

.rm-chip {
  margin-left: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--teal);
  border: 1px solid color-mix(in oklab, var(--teal) 85%, black);
  border-radius: 999px;
}

/* Tabs nav */
.rm-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rm-nav::-webkit-scrollbar {
  display: none;
}

.rm-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.rm-tab:hover {
  border-color: color-mix(in oklab, var(--border), var(--teal) 30%);
}

.rm-tab.is-active {
  background: var(--teal);
  color: #fff;
  border-color: color-mix(in oklab, var(--teal) 85%, black);
  box-shadow: 0 3px 3px color-mix(in oklab, var(--teal) 25%, transparent);
}

.rm-user-menu {
  position: relative;
}

.rm-user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  min-width: 180px;
}

.rm-user-trigger:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

@media (max-width: 800px) {
  .rm-user-trigger {
    padding: 6px;
    min-width: 0;
  }
}

.rm-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.rm-user-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  font-size: 12px;
}

.rm-user-label strong {
  font-size: 13px;
  color: var(--text);
}

.rm-user-label small {
  color: var(--muted);
}

.rm-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  z-index: 1000;
}

.rm-user-menu.is-open .rm-user-dropdown {
  display: flex;
}

.rm-user-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  text-decoration: none;
  color: var(--text);
  background: var(--field-bg);
  font-weight: 600;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.rm-user-link:hover {
  background: color-mix(in oklab, var(--field-bg), white 6%);
  border-color: color-mix(in oklab, var(--field-border), var(--teal) 18%);
}

.rm-user-dropdown button.rm-user-link {
  width: 100%;
  appearance: none;
  cursor: pointer;
}

.rm-user-link.logout {
  color: #e54b4b;
  border-color: rgba(229, 75, 75, .4);
  background: rgba(229, 75, 75, .08);
}

.rm-user-dropdown form {
  margin: 0;
}

.rm-user-dropdown button {
  width: 100%;
}

/* Right zone */
.rm-sub {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--card);
  font-size: 12px;
}

@media (max-width: 1200px) {
  .rm-sub {
    display: none;
  }
}

.rm-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: transform .08s ease, background .15s ease;
}

.rm-icon:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--card), white 3%);
}

/* Le bouton hamburger n’apparaît qu’en mobile */
.rm-menu-toggle {
  display: none;
}

@media (max-width: 800px) {
  .rm-menu-toggle {
    display: grid;
    justify-self: center;
  }
}

/* Responsive */
@media (max-width: 800px) {
  .rm-brand {
    grid-column: 1 / -1;
  }

  .rm-brand-text,
  .rm-chip {
    display: none;
  }

  .rm-user-label {
    display: none;
  }
}

/* Tiroir mobile : on réutilise .rm-nav */
@media (max-width: 800px) {
  .rm-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    /* top: calc(var(--header-height, 64px)); */
    top: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    transform: translateY(-140%);
    transition: transform .18s ease;
    z-index: 940;
  }

  .rm-header.menu-open .rm-nav {
    transform: translateY(0);
  }

  /* Onglets en liste cliquable (touch friendly) */
  .rm-nav .rm-tab {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    background: var(--field-bg);
    border: 1px solid var(--field-border);
  }

  .rm-nav .rm-tab.is-active {
    background: var(--teal);
    border-color: color-mix(in oklab, var(--teal) 85%, black);
    color: #fff;
  }

  /* Backdrop */
  .rm-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 20, .45);
    backdrop-filter: blur(2px);
    z-index: 930;
    padding: 100% 0;
  }

  /* État ouvert */
  body.menu-open .rm-nav {
    transform: translateY(0);
  }

  body.menu-open .rm-menu-backdrop {
    display: block;
  }

  body.menu-open {
    overflow: hidden;
  }

  /* lock scroll sous le menu */
}

/* En desktop on garde ta nav centrée et on masque le bouton */
@media (min-width: 801px) {
  .rm-nav {
    justify-self: center;
  }

  .rm-menu-backdrop {
    display: none !important;
  }
}

/* ========== Footer ========== */
.rm-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg), #05070b 35%);
}

.rm-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.rm-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.rm-footer-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 0;
}

.rm-footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.rm-footer-meta small {
  font-size: 14px;
}

@media (max-width: 768px) {
  .rm-footer-inner {
    padding-inline: 12px;
  }

  .rm-footer-links {
    flex-direction: column;
    align-items: flex-start;
  }
}


.pill {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-weight: 800;
}

.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: conic-gradient(from 220deg at 50% 50%, var(--brand), #0ea5a8 25%, #062f31 60%, var(--brand) 100%);
}

.brand #brandName {
  color: var(--text);
}

/* Onglets */
.nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  background: var(--card);
}

.nav a:hover {
  filter: brightness(1.06);
}

.nav a.active {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

/* Corrections menu mobile */
.rm-menu-backdrop {
  display: none;
}

@media (max-width: 800px) {
  body.menu-open .rm-nav {
    transform: translateY(0) !important;
  }

  body.menu-open .rm-menu-backdrop {
    display: block;
  }
}

/* ========== Layout ========== */
.layout {
  display: grid;
  grid-template-columns: 336px 1fr;
  gap: 16px;
  padding: 12px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

@media (max-width: 768px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  height: fit-content;
}

.card h2 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

@media (min-width:1000px) {
  .layout {
    align-items: start;
  }
}

@media (max-width:900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .layout #filters-open {
    width: 85px;
  }
}

/* ========== Filtres (aside) ========== */
.filters {
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  background: var(--panel);
  border-radius: var(--radius);
}

.filters label {
  font-size: 12px;
  color: var(--muted)
}

.filters input,
.filters select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font-size: 14px;
}

input[type="range"] {
  padding: 0;
}

.range-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.range-inputs .range-sep {
  color: var(--muted);
  font-weight: 600;
}

.range-slider {
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 8px;
}
.range-slider input[type="range"] {
  width: 100%;
  grid-row: 1;
}
.range-slider .range-sep {
  grid-row: 1;
}
.range-slider .range-output {
  font-size: 12px;
  color: var(--muted);
  grid-row: 2;
}
.range-slider .range-output[data-range-display]:first-of-type {
  grid-column: 1;
}
.range-slider .range-output[data-range-display]:last-of-type {
  grid-column: 3;
  text-align: right;
}

.dual-range {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dual-range__values {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.dual-range__slider {
  position: relative;
  height: 32px;
  --range-min: 0%;
  --range-max: 100%;
  --track-out: color-mix(in oklab, var(--field-border), var(--card) 80%);
}
.dual-range__slider::before,
.dual-range__slider::after {
  content: '';
  position: absolute;
  height: 6px;
  border-radius: 999px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none; /* laisse passer le clic vers la piste */
}
.dual-range__slider::before {
  left: 0;
  right: 0;
  background: linear-gradient(to right,
    var(--track-out) 0%,
    var(--track-out) var(--range-min),
    var(--line) var(--range-min),
    var(--line) var(--range-max),
    var(--track-out) var(--range-max),
    var(--track-out) 100%
  );
}
.dual-range__slider::after {
  content: none; /* overlay non nÃ©cessaire, gÃ©rÃ© par le gradient */
}
.dual-range__slider input[type="range"] {
  position: absolute;
  inset: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  margin: 0;
}
.dual-range__slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  pointer-events: all;
}
.dual-range__slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  pointer-events: all;
}
.dual-range__slider input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
}
.dual-range__slider input[type="range"]::-moz-range-track {
  background: transparent;
}
.radius-field {
  grid-column: 1 / -1;
}

.radius-field .radius-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radius-field input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  direction: ltr;
}

.radius-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.radius-field[hidden] {
  display: none !important;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px
}

@media (min-width:560px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

a.btn {
  text-decoration: none;
}

.btnbar {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}

.btn.primary {
  background: var(--teal);
  border-color: var(--teal-strong);
  color: #fff;
}

.btn.pro-cta {
  position: relative;
  background: linear-gradient(135deg, var(--teal), var(--teal-strong));
  background-size: 200% 200%;
  border-color: color-mix(in oklab, var(--teal-strong) 85%, black);
  color: #fff;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--teal) 60%, transparent),
    0 10px 24px rgba(0, 0, 0, .35);
  font-weight: 600;
  letter-spacing: .01em;
  transition: background-position .25s ease, transform .1s ease, box-shadow .1s ease;
  text-decoration: none;
}

.btn.pro-cta:hover {
  background-position: 100% 0;
  transform: translateY(-1px);
  /*box-shadow:0 0 0 1px color-mix(in oklab, var(--teal-strong) 70%, black),
             0 14px 30px rgba(0,0,0,.45); */
}

.btn.pro-cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .4);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed
}

@media (min-width:1000px) {
  .btnbar {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (min-width:901px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width:900px) {
  .mobile-only {
    display: inline-flex;
  }
}

/* Tiroir = OFF par défaut en mobile */
@media (max-width: 900px) {
  .filters-panel {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: 86vw;
    max-width: 420px;
    transform: translateX(-105%);
    transition: transform .25s ease;
    z-index: 940;
    overflow: auto;
    background: var(--card);
    border-right: 1px solid var(--border);
    border-radius: 0;
    /* pas de radius pour coller au bord */
  }

  body.filters-open .filters-panel {
    transform: translateX(0);
  }

  /* bouton fermer dans le tiroir */
  .filters-close {
    position: sticky;
    margin: 8px 8px 0 auto;
    top: 10px;
    width: 27px;
    height: 27px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid var(--field-border);
    background: var(--field-bg);
    color: var(--text);
    display: inline-grid;
    place-items: center;
    font-size: 12px;
    z-index: 1001;
    float: right;
  }

  /* Backdrop du tiroir */
  .filters-backdrop {
    position: fixed;
    inset: 0;
    z-index: 930;
    background: rgba(10, 14, 20, .45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.filters-open .filters-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* cache le panneau latéral desktop si tu en as un doublon */
  .page-map .map-layout {
    grid-template-columns: 1fr;
  }

  .page-map .filters-panel {
    order: 2;
  }

  /* optionnel : sous la carte quand fermé */
}

/* évite le scroll de fond quand le tiroir est ouvert */
.no-scroll {
  overflow: hidden;
}

/* ========== Info bulle (click-only) ========== */
/* Bouton d’aide (ⓘ) */
.hint {
  all: unset;
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  width: 18px;
  height: 18px;
  /* hit-box claire */
  font-size: 12px;
  line-height: 1;
  border-radius: 50%;
  color: var(--muted);
  cursor: help;
  vertical-align: middle;
}

/* Tooltip (caché par défaut) */
.hint[data-tip] {
  position: relative;
}

.hint[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 20px;
  transform: translateX(-50%) translateY(8px);
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}

/* OUVERT uniquement quand .is-open est présent (géré en JS) */
.hint.is-open::after {
  opacity: 1;
  transform: translateX(-50%) translateY(6px);
  pointer-events: none; /* laisse les clics passer (ex: sliders) */
}

.legend-info {
  margin-left: 4px;
}

.legend-info .hint[data-tip]::after {
  left: -96px;
}

.legend-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.legend-btn[aria-pressed="true"] {
  outline: 2px solid var(--ring);
  background: color-mix(in oklab, var(--teal) 12%, transparent);
}

.legend-btn:focus-visible {
  outline: 2px solid var(--ring);
}




/* ========== Carte ========== */
#map {
  height: var(--map-h-mobile);
  border-bottom: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
}

@media (min-width:1000px) {
  #map {
    height: var(--map-h-desktop);
  }
}

/* Grille spécifique à la page map */
.page-map .map-layout {
  display: grid;
  grid-template-columns: 336px 1fr;
  /* largeur colonne filtres */
  gap: 16px;
  padding: 12px;
}

@media (max-width:980px) {
  .page-map .map-layout {
    grid-template-columns: 1fr;
  }

  .page-map .filters-panel {
    order: 2;
  }

  /* filtres sous la map en mobile */
}

/* Barre sous la carte (filtres actifs à gauche, légende à droite) */
.map-legend-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 10px 0 12px;
  flex-wrap: wrap;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.active-filters .chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .85rem;
  background: var(--field-bg);
  color: var(--text);
  border: 1px solid var(--field-border);
  user-select: none;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: .9rem;
}

.map-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green {
  background: #21c36a;
}

.dot-orange {
  background: #ff9f43;
}

.dot-red {
  background: #f95353;
}

.legend-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.legend-btn[aria-pressed="true"] {
  outline: 2px solid var(--ring);
  background: color-mix(in oklab, var(--teal) 12%, transparent);
}

.legend-btn:focus-visible {
  outline: 2px solid var(--ring);
}

@media (max-width:768px) {
  .map-legend {
    flex-basis: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
}

/* ========== Chips génériques ========== */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--card)
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  font-size: 12px;
  color: var(--text);
}

.chip button {
  all: unset;
  cursor: pointer;
  width: 16px;
  height: 16px;
  line-height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-weight: 700;
}

.chip button:hover {
  background: rgba(127, 145, 170, .15);
  color: var(--text)
}

.active-filters .chip button {
  padding: 2px;
}

/* ====== Amenity Tree (Map-like) ====== */
.amen-accordion {
  border: 1px solid var(--field-border);
  border-radius: 8px;
  margin: 6px 0;
  background: var(--bg);
}

.amen-accordion>summary {
  cursor: pointer;
  padding: 6px 10px;
  font-weight: 600;
  font-size: small;
}

.amen-list-v {
  list-style: none;
  margin: 0;
  padding: 6px 10px 8px;
  display: grid;
  grid-template-columns: 1fr;
}

.amen-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 8px;
}

.amen-row .txt {
  margin-left: 6px;
}

.amen-row .cnt {
  opacity: .7;
  font-size: 12px;
}

.amen-row input[type="checkbox"] {
  width: auto;
}

.amen-row.on {
  background: rgba(127, 145, 170, .10);
}

/* Table manquants: ligne sélectionnée */
#tbl-missing tr.is-selected {
  background: color-mix(in oklab, var(--teal) 12%, transparent);
}

/* ========== Légende “pastilles” (dans colonnes/sections) ========== */
.legend {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  align-items: center
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%
}

.dot.green {
  background: #21c36a
}

.dot.orange {
  background: #ff9f43
}

.dot.red {
  background: #f95353
}

/* ========== DataTables / liste ========== */
.table-wrap {
  padding: 12px;
  overflow-x: auto;
}

table.dataTable.nowrap th,
table.dataTable.nowrap td {
  white-space: normal !important;
}

.dtr-details {
  width: 100%;
  color: var(--text);
}

.dtr-details th {
  text-transform: none;
  color: var(--muted);
  font-weight: 600;
}

.dtr-details td,
.dtr-details th {
  padding: 6px 10px;
}

.dtr-details tr {
  border-bottom: 1px solid var(--border);
}

.dtr-details tr:last-child {
  border-bottom: none;
}

table.dataTable {
  border-radius: 12px;
  overflow: hidden;
  width: 100% !important;
}

table.dataTable thead th {
  font-weight: 600;
}

table#grid td:nth-child(1) {
  width: 84px !important;
}

table.dataTable a {
  color: var(--text);
}

img.photo {
  width: 72px !important;
  height: 54px !important;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

@media (max-width: 800px) {

  table.dataTable.nowrap th,
  table.dataTable.nowrap td {
    white-space: normal !important;
  }
}

@media (max-width:700px) {

  table.dataTable,
  table.dataTable td,
  table.dataTable th {
    font-size: 12px;
  }

  img.photo {
    width: 60px !important;
    height: 46px !important;
  }
}

/* En-tête normal + flottant */
table.dataTable thead th,
table.dataTable thead td {
  background: var(--card) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
}

div.dtfh-floatingparent-head,
div.dtfh-floatingparent-head table,
div.dtfh-floatingparent-head thead,
div.dtfh-floatingparent-head th,
div.dtfh-floatingparent-head td {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

div.dtfh-floatingparent-head {
  box-shadow: var(--shadow-lg);
  z-index: 1010;
}

.dtfh-floatingparent.dtfh-floatingparent-head {
  top: 40px !important;
}

table#tbl-missing.dataTable>tbody>tr>th,
table#tbl-missing.dataTable>tbody>tr>td {
  padding: 4px 10px;
}

/* ========== Popups Leaflet premium ========== */
.statbnb-popup .leaflet-popup-content {
  margin: 0;
}

.statbnb-popup .leaflet-popup-content-wrapper {
  background: transparent;
  border: none;
  box-shadow: none;
}

.statbnb-popup .leaflet-popup-tip {
  background: var(--card);
  border: 1px solid var(--border);
}

.leaflet-container .statbnb-popup .leaflet-popup-close-button {
  color: #111;
  opacity: 1;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 0 50%;
  width: 22px;
  height: 22px;
  line-height: 17px;
  right: 3px;
  top: 2px;
  font-size: 18px;
  text-shadow: none;
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 0.6);
}

.leaflet-container .statbnb-popup .leaflet-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
}

/* Carte → carte info (popup-card) */
.popup-card {
  width: min(92vw, 360px);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.popup-card .ph {
  height: 130px;
  background: var(--field-bg) center/cover no-repeat;
  border-bottom: 1px solid var(--border);
}

.popup-card .pb {
  padding: 12px;
}

.popup-card .title {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.popup-card .title:hover {
  text-decoration: underline;
}

.popup-card .loc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.popup-card .chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border: none;
  padding: 0 12px;
}

.popup-card .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.popup-card .ico {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(127, 145, 170, .15);
  color: var(--text);
  font-size: 11px;
}

.popup-card .kpis {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px;
}

.popup-card .kpi {
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.popup-card .kpi .lab {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.popup-card .kpi .val {
  font-size: 14px;
  font-weight: 700;
}

.popup-card .amen {
  max-height: 60px;
  overflow: auto;
  padding: 0 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.popup-card .amen::-webkit-scrollbar {
  width: 8px;
  height: 8px
}

.popup-card .amen::-webkit-scrollbar-thumb {
  background: #6f7b8a44;
  border-radius: 8px
}

.popup-card .amen:hover::-webkit-scrollbar-thumb {
  background: #6f7b8a88
}

.leaflet-marker-icon.dot-icon span:hover {
  height: 14px !important;
  width: 14px !important;
  z-index: 155000;
  position: relative;
}

/* ========== Charts / Insights ========== */
.kpi {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px
}

.kpi .box {
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.kpi .box .lab {
  font-size: 12px;
  color: var(--muted)
}

.kpi .box .val {
  font-size: 20px;
  font-weight: 700
}

.kpi .value {
  font-size: 1.6rem;
  font-weight: 700
}

@media (min-width:720px) {
  .kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

.charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px
}

.chart-card h3 {
  margin: 0 0 8px 0;
  font-size: 14px
}

@media (min-width:1100px) {
  .charts {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== Utilitaires ========== */
a {
  color: #72d8e0;
}

a:hover {
  filter: brightness(1.08);
}

@media (max-width:420px) {
  header {
    padding: 12px;
  }

  .layout {
    padding: 10px;
    gap: 10px;
  }

  .filters {
    padding: 10px 12px;
  }

  .table-wrap {
    padding: 10px;
  }
}

/* ========== Tiroir filtres mobile + backdrop ========== */
@media (max-width:900px) {
  aside.card {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 88vw;
    max-width: 420px;
    transform: translateX(-110%);
    transition: transform .25s ease;
    z-index: 1000;
    overflow: auto;
    background: var(--card);
  }

  body.filters-open aside.card {
    transform: translateX(0);
  }
}

.filters-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 900;
}

body.filters-open .filters-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ========== Page Map : accordéon équipements ========== */
#filters .amen-accordion {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  margin: 6px 0;
}

#filters .amenities-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

#filters .amenities>summary {
  display: none;
}

#filters .amen-accordion>summary {
  padding: 3px 10px;
  cursor: pointer;
  list-style: revert;
  font-weight: 300;
  font-size: .85rem;
}

#filters .amen-accordion>summary::-webkit-details-marker {
  display: list-item;
}

#filters .amen-list-v {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 6px 8px 8px;
}

#filters .amen-list-v li {
  list-style: none;
}

#filters .amen-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 8px;
  border-radius: 6px;
}

#filters .amen-row:hover {
  background: rgba(255, 255, 255, .05);
}

#filters .amen-row.on {
  background: rgba(29, 147, 149, .14);
  outline: 1px solid var(--ring);
}

#filters .amen-row input {
  transform: translateY(1px);
}

#filters .amen-row .txt {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#filters .amen-row .cnt {
  opacity: .65;
}

#filters .amenities-wrap input {
  width: auto;
}

#filters .amenities-block span {
  margin: 12px 0px 5px;
  font-size: 14px;
  display: flex;
}

/* ========== Stats bar (au-dessus de la carte) ========== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

@media (max-width:720px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stats-bar .stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.stats-bar .stat .lab {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.stats-bar .stat .val {
  font-weight: 700;
}

/* Filtres : 1 colonne en mobile */
#filters {
  display: grid;
  gap: 10px;
}

/* ≥ 980px : 2 colonnes automatiques */
@media (min-width: 980px) {
  #filters {
    align-items: start;
  }

  /* utilitaire : un élément qui doit occuper les deux colonnes */
  #filters .span-2 {
    grid-column: 1 / -1;
  }
}

/* sécurité : champs à 100% */
#filters input,
#filters select,
#filters .amenities-search {
  width: 100%;
}

/* grille globale: déjà en 2 colonnes desktop dans ton CSS,
  on garde .span-2 pour forcer pleine largeur si besoin */
#filters {
  display: grid;
  gap: 10px;
}

@media (min-width: 980px) {
  #filters .span-2 {
    grid-column: 1 / -1;
  }
}

/* sous-grilles pour organiser des lignes à 2 colonnes */
#filters .row {
  display: grid;
  gap: 10px;
}

#filters .grid-2 {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 420px) {
  #filters .grid-2 {
    grid-template-columns: 1fr;
  }
}

.actions button {
  width: 137px;
}

button.primary:hover {
  filter: brightness(1.08);
}


/* groupe visuel (léger séparateur) */
#filters .group {
  border-top: 1px solid var(--field-border);
  padding-top: 8px;
  margin-top: 6px;
}

/* sécurité largeur champs */
#filters input,
#filters select {
  width: 100%;
}

/* ========== KPIs (Équipements) — Option A modern ==========
   Cartes comparatives + deltas visuels */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 12px
}

.kcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px
}

.kpi-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted)
}

.kpi-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--dt-row-stripe), .08);
  color: var(--text)
}

.kpi-list li button {
  background: none;
  border: 0;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 0
}

.kpi-list li button:hover {
  color: #ff4d6d
}

.kpi-list li.muted {
  background: none;
  color: var(--muted);
  font-style: italic
}

.kcard header {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 6px
}

.k-main .k-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .2px
}

.k-main .k-sub {
  color: var(--muted);
  margin-top: 2px
}

.k-lines {
  display: grid;
  gap: 8px
}

.k-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px
}

.k-label {
  color: var(--muted)
}

.k-val {
  justify-self: end;
  font-weight: 700
}

.k-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  font-weight: 700
}

.k-pill.up {
  color: #17c964;
  border-color: #0b6b41;
  background: color-mix(in oklab, #17c964 15%, transparent)
}

.k-pill.down {
  color: #ff4d6d;
  border-color: #8a1d45;
  background: color-mix(in oklab, #ff4d6d 12%, transparent)
}

.k-pill .arrow {
  font-weight: 900
}

.k-bar {
  height: 8px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 999px;
  overflow: hidden
}

.k-bar-fill {
  height: 100%;
  background: #21c36a;
  transition: width .25s ease
}

@media (max-width:980px) {
  .kpi-grid {
    grid-template-columns: 1fr
  }
}

/* ========== Auth / Modales ========== */
body.modal-open {
  overflow: hidden;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.w-full {
  width: 100%;
}

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
}

.alert-error {
  border-color: rgba(229, 75, 75, .5);
  color: #ff6b6b;
  background: rgba(229, 75, 75, .12);
}

.alert-success {
  border-color: rgba(32, 201, 151, .5);
  color: #1aa374;
  background: rgba(32, 201, 151, .12);
}

.alert-warning {
  border-color: rgba(255, 190, 60, .6);
  color: #c77800;
  background: rgba(255, 190, 60, .18);
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, .72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 24px;
}

.auth-modal.is-open {
  display: flex;
}

.auth-dialog {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text);
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--teal);
  border-color: var(--teal-strong);
  color: #fff;
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.auth-form .auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.auth-form .auth-check label {
  display: block;
}

.auth-form .auth-check input[type="checkbox"] {
  margin-top: 4px;
}

.auth-form .btn {
  margin-top: 4px;
}

.auth-sso {
  margin-top: 18px;
  text-align: center;
}

.sso-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
}

.sso-btn {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  padding: 10px;
  cursor: pointer;
  background: var(--field-bg);
  color: var(--text);
  font-weight: 600;
}

.sso-btn.sso-google {
  border-color: #ea4335;
}

.sso-btn.sso-microsoft {
  border-color: #2f6fed;
}

.amen-control-panel {
  display: grid;
  gap: 12px;
}

.amen-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.amen-control-head h4 {
  margin: 2px 0 0;
}

.amen-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.amen-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel) 92%, transparent);
}

.amen-control-label {
  font-size: 13px;
  color: var(--muted);
}

.auth-page,
.account-page {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.auth-card,
.account-card {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.client-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: flex-start;
  margin-top: 8px;
}

.client-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.client-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  top: calc(var(--header-h) + 12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.client-nav-title {
  margin: 4px 4px 0;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.client-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.client-nav-link:hover {
  border-color: var(--border);
  background: color-mix(in oklab, var(--panel) 70%, transparent);
}

.client-nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.client-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-nav-label {
  font-weight: 700;
  font-size: .95rem;
}

.client-nav-link small {
  color: var(--muted);
}

.client-nav-link.is-active {
  background: color-mix(in oklab, var(--teal) 14%, var(--panel));
  border-color: color-mix(in oklab, var(--teal) 45%, var(--border));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
  color: var(--teal);
}

.client-nav-link.is-active .client-nav-dot {
  background: var(--teal);
  border-color: var(--teal-strong);
  transform: scale(1.05);
}

.client-nav-link.is-active small {
  color: color-mix(in oklab, var(--teal) 70%, var(--muted));
}

.client-shell .account-page {
  padding: 0;
  justify-content: flex-start;
  flex-direction: column;
  gap: 16px;
}

.client-shell .account-card {
  max-width: none;
}

@media (max-width: 1024px) {
  .client-shell {
    grid-template-columns: 1fr;
  }

  .client-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .client-nav-title {
    width: 100%;
    margin: 0 0 4px;
  }

  .client-nav-link {
    flex: 1 1 240px;
  }
}

.legal-page {
  max-width: 720px;
  margin: 0 auto;
}

.legal-page .contact-form {
  margin-top: 18px;
}

.legal-page .contact-form .form-row,
.legal-page .contact-form .form-group {
  width: 100%;
}

.legal-page .contact-form textarea {
  min-height: 160px;
}

.account-fields {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  margin: 8px 0 16px;
}

.account-fields dt {
  font-weight: 600;
  color: var(--muted);
}

.account-fields dd {
  margin: 0;
}

.account-subscription {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-subscription-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.account-subscription-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.logout-form {
  margin-top: 16px;
}

/* ========== ROI Page ========== */
.page-roi .layout {
  display: grid;
  grid-template-columns: 336px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width:1100px) {
  .page-roi .layout {
    grid-template-columns: 1fr;
  }
}

.roi-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.roi-actions-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--panel-bg);
}

.roi-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.roi-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.roi-actions-split {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
}

.badge.muted {
  color: var(--muted);
}

.hidden-md {
  display: block;
}

@media (max-width:720px) {
  .hidden-md {
    display: none;
  }
}

.roi-share-alert {
  border: 1px solid var(--teal);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  background: color-mix(in oklab, var(--teal) 12%, transparent);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.roi-presets .btn {
  min-width: 110px;
}

.roi-presets .btn.is-active {
  border-color: var(--teal);
  color: var(--teal);
  background: transparent;
}

.roi-presets .btn.is-active[data-roi-preset="pessimiste"] {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

.roi-presets .btn.is-active[data-roi-preset="optimiste"] {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}

.roi-presets .btn.is-active[data-roi-preset="base"] {
  background: var(--panel-bg);
  color: var(--text);
  border-color: var(--teal);
}

.roi-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.roi-kpi {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roi-kpi header {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.roi-kpi strong {
  font-size: 1.6rem;
  font-weight: 700;
}

.roi-kpi .muted {
  font-size: 12px;
  color: var(--muted);
}

.roi-kpi .triple {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.roi-kpi .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  font-size: 13px;
}

.roi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.roi-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.roi-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roi-card header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roi-card header.between {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.roi-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.roi-field-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.roi-field-grid input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
}

.roi-toggle {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.roi-toggle label {
  display: flex;
  gap: 6px;
  align-items: center;
}

.roi-toggle input {
  accent-color: var(--teal);
}

.stacked {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.stacked input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.roi-loan-card,
.roi-charge-row {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
}

.roi-loan-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.roi-loan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.roi-loan-card input,
.roi-loan-card select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
}

.roi-charge-row .row-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.roi-charge-row input,
.roi-charge-row select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
}

.roi-stress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roi-stress input[type=\"range\"] {
  flex: 1;
  accent-color: var(--teal);
}

.roi-stress-value {
  font-weight: 600;
}

.roi-stress-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  font-size: 13px;
}

.roi-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roi-tabs button {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}

.roi-tabs button.active {
  background: var(--teal);
  color: #fff;
  border-color: color-mix(in oklab, var(--teal) 85%, black);
}

.roi-table-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roi-table-scroll {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}

.roi-table-scroll table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  min-width: 375px;
  font-variant-numeric: tabular-nums;
}

.roi-table-scroll th,
.roi-table-scroll td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: inherit;
  text-align: left;
}

.roi-table-scroll th.numeric,
.roi-table-scroll td.numeric {
  text-align: right;
}

.roi-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--field-bg);
  box-shadow: 0 1px 0 var(--border);
}

.roi-table-scroll tbody tr:nth-of-type(even) {
  background: var(--surface-2);
}

.roi-table-scroll tbody tr:hover {
  background: var(--surface-3);
}

.roi-table-scroll td:first-child,
.roi-table-scroll th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--field-bg);
}

.roi-table-scroll tbody tr:nth-of-type(even) td:first-child {
  background: var(--field-bg);
}

.roi-table-scroll tbody tr:last-child td {
  border-bottom: none;
}

.roi-table-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-3);
  min-height: 32px;
}

.roi-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roi-pagination-controls .btn {
  padding: 4px 8px;
  line-height: 1;
  min-height: 28px;
}

.roi-pagination-info {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.roi-charges-table,
.roi-loans-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roi-charges-table table,
.roi-loans-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.roi-charges-table thead th,
.roi-loans-table thead th {
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.roi-charges-table tbody td,
.roi-loans-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.roi-charges-table tbody tr:last-child td,
.roi-loans-table tbody tr:last-child td {
  border-bottom: none;
}

.roi-charges-table input,
.roi-charges-table select,
.roi-loans-table input,
.roi-loans-table select {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface-1);
  font-size: 13px;
  transition: border .2s, box-shadow .2s;
}

.roi-charges-table select,
.roi-loans-table select {
  min-width: 120px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.roi-charges-table input:focus,
.roi-charges-table select:focus,
.roi-loans-table input:focus,
.roi-loans-table select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 30%, transparent);
  outline: 0;
}

.charge-value-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.charge-value-input span {
  font-size: 12px;
  color: var(--muted);
}

.loan-insurance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loan-insurance select {
  flex: 0 0 140px;
}

.loan-insurance input {
  flex: 1;
}

.loan-insurance span {
  font-size: 12px;
  color: var(--muted);
}

.charge-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.charge-chip {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.roi-charge-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-3);
}

.roi-charge-totals strong {
  font-size: 14px;
  color: var(--ink-1);
}

.btn.full {
  width: 100%;
  justify-content: center;
}

.roi-annual-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  font-size: 13px;
}

.roi-notes {
  list-style: disc;
  padding-left: 20px;
  line-height: 1.4;
}

.roi-card small,
.roi-card p.muted {
  color: var(--muted);
  font-size: 12px;
}

.roi-revenue-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roi-revenue-groups [hidden] {
  display: none !important;
}

.roi-chart-shell {
  height: 360px;
  width: 100%;
}

.roi-chart-shell canvas {
  height: 100% !important;
  width: 100% !important;
}

.kpi-pos {
  color: #15803d !important;
}

.kpi-neg {
  color: #b91c1c !important;
}

.paywall-banner {
  background: linear-gradient(90deg, rgba(22, 114, 117, .25), transparent);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.paywall-content {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.paywall-content .icon {
  font-size: 1.3rem;
}

.subscription-layout {
  display: flex;
  gap: 24px;
}

.subscription-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.subscription-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
}

.sub-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(56, 189, 248, .08));
}

.sub-hero-muted {
  background: var(--panel-bg, #fff);
  border-style: dashed;
}

.sub-hero-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.sub-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.sub-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 700;
  background: var(--panel-bg, #fff);
  color: var(--card);
}

.sub-status-active {
  background: rgba(34, 197, 94, .12);
  border-color: rgba(34, 197, 94, .3);
  color: #166534;
}

.sub-status-trialing {
  background: rgba(56, 189, 248, .12);
  border-color: rgba(56, 189, 248, .3);
  color: #0f4c81;
}

.sub-status-past_due {
  background: rgba(234, 179, 8, .16);
  border-color: rgba(234, 179, 8, .3);
  color: #92400e;
}

.sub-status-canceled {
  background: rgba(248, 113, 113, .14);
  border-color: rgba(248, 113, 113, .32);
  color: #991b1b;
}

.sub-plan-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .12);
  border: 1px solid rgba(99, 102, 241, .28);
  font-weight: 700;
  color: var(--card);
}

.sub-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.sub-tile {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-bg, #fff);
}

.sub-tile-label {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.sub-tile-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.sub-note {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: rgba(148, 163, 184, .1);
  color: var(--card);
}

.sub-note.warning {
  background: rgba(234, 179, 8, .12);
  border-color: rgba(234, 179, 8, .35);
  color: #92400e;
}

.sub-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--panel-bg, #fff);
  flex-wrap: wrap;
}

@media print {
  body.page-roi .rm-header,
  body.page-roi .rm-footer,
  body.page-roi .filters-panel,
  body.page-roi #filters-open,
  body.page-roi .roi-actions-card,
  body.page-roi .stats-topbar,
  body.page-roi .stats-mode,
  body.page-roi .active-filters,
  body.page-roi .roi-actions-left,
  body.page-roi .roi-actions-right,
  body.page-roi .roi-actions-split,
  body.page-roi .roi-presets,
  body.page-roi #roi-share-alert,
  body.page-roi .btn[data-keep-filters] {
    display: none !important;
  }
  body.page-roi .layout {
    display: block;
  }
  body.page-roi .roi-main {
    padding: 0;
  }
}

.subs-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
  justify-content: center;
}

.hero-text {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-text h1 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.2;
}

.subs-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.reassurance {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

.hero-pricing {
  flex: 0 0 360px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.billing-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.billing-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
}

.billing-toggle button.is-active {
  background: var(--teal);
  color: #fff;
}

.billing-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
}

.pricing-card .price {
  font-size: 2.2rem;
  margin: 4px 0;
}

.pricing-card .cta-secondary {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.pricing-card.highlight {
  border-color: var(--teal);
  box-shadow: 0 10px 32px rgba(22, 114, 117, .35);
}

.pricing-card.best-offer {
  border-width: 2px;
  position: relative;
}

.pricing-card.best-offer::before {
  content: 'Meilleure offre';
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 2px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  border: 1px solid color-mix(in oklab, var(--teal) 85%, black);
}

.value-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.value-pillars article {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
}

.features-block .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.features-block article {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
}

.compare-free-pro .columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.compare-free-pro article {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: var(--card);
}

.compare-free-pro article.highlight {
  border-color: var(--teal);
  box-shadow: 0 6px 24px rgba(22, 114, 117, .2);
}

.compare-free-pro ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.competitor-block .scrollable {
  overflow: auto;
}

.competitor-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.competitor-block th,
.competitor-block td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.audience-grid article {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
}

.audience-grid ul {
  padding-left: 16px;
  margin: 8px 0 0;
}

.roi-block .roi-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.roi-block article {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: var(--card);
}

.subs-faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 12px;
  background: var(--card);
}

.subs-faq summary {
  cursor: pointer;
  font-weight: 600;
}

.subs-faq summary::marker {
  color: var(--teal);
}

.subs-faq p {
  margin: 8px 0 0;
}

.final-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.final-cta .subs-cta {
  margin-top: 0;
}

@media(max-width:900px) {
  .hero-pricing {
    flex: 1 1 100%;
  }
}

.results-cap-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(140deg, color-mix(in oklab, var(--teal) 16%, var(--panel)) 0%, color-mix(in oklab, var(--teal) 5%, var(--panel)) 100%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
  position: relative;
  margin-top: 12px;
}

.results-cap-banner.is-guest {
  background: linear-gradient(140deg, color-mix(in oklab, var(--teal) 24%, var(--panel)) 0%, color-mix(in oklab, var(--teal) 8%, var(--panel)) 100%);
}

.results-cap-copy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

@media (max-width: 420px) {
  .results-cap-copy {
    display: block;
  }
}

@media (max-width: 420px) {
  .cap-pill {
    margin-bottom: 10px;
  }
}

.cap-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--teal) 40%, var(--border));
  background: color-mix(in oklab, var(--teal) 12%, transparent);
  color: var(--teal);
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
}

.cap-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 1.05rem;
}

.cap-body {
  margin: 0;
  color: var(--muted);
}

.cap-points {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: .9rem;
}

.cap-points li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cap-points li::before {
  content: '✅';
  color: var(--teal);
  font-weight: 700;
}

.results-cap-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cap-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--ring);
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
  border: 1px solid var(--border);
}

.cap-close:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--teal) 16%, var(--panel));
  border-color: var(--border);
}

.results-cap-banner.is-hidden {
  display: none;
}

@media (max-width: 768px) {
  .results-cap-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cap-pill {
    white-space: normal;
  }
}

.stats-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.stats-topbar-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}

.stats-topbar-left .stats-mode {
  margin: 0;
}

.stats-topbar-left .active-filters {
  margin: 0;
}

.results-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
  margin-left: auto;
}

.results-indicator>span {
  font-size: .8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.results-indicator strong {
  font-size: 1.3rem;
  color: var(--text);
}

.results-indicator small {
  font-size: .7rem;
  color: var(--muted);
}

.reliability {
  font-size: .75rem;
  color: var(--muted);
  display: block;
}

.thinking {
  position: relative;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: color-mix(in oklab, var(--panel) 88%, transparent);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.thinking[hidden] {
  display: none !important;
}

.thinking::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--teal) 40%, var(--text));
  border-left-color: transparent;
  animation: spin 0.8s linear infinite;
}

@media (max-width: 420px) {
  .thinking {
    display: flex;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.stats-topbar.results-only {
  justify-content: flex-end;
}

.results-indicator.dual {
  align-items: flex-end;
}

.results-indicator.dual .results-dual-values {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  color: var(--text);
}

.results-indicator.dual .results-dual-values strong {
  font-size: 1.3rem;
}

.results-indicator.dual .results-dual-values span {
  color: var(--muted);
}

.results-indicator.dual .results-dual-labels {
  display: flex;
  gap: 12px;
  font-size: .7rem;
  color: var(--muted);
}

/* Stats mode toggle (Médiane / Moyenne) */
.page-map .stats-mode,
.page-aggregates .stats-mode,
.page-insights .stats-mode,
.page-roi .stats-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.page-map .stats-mode label,
.page-aggregates .stats-mode label,
.page-insights .stats-mode label,
.page-roi .stats-mode label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .8rem;
  color: var(--muted);
  min-width: 80px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.page-map .stats-mode input[type="radio"],
.page-aggregates .stats-mode input[type="radio"],
.page-insights .stats-mode input[type="radio"],
.page-roi .stats-mode input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.page-map .stats-mode label:has(input[type="radio"]:checked),
.page-aggregates .stats-mode label:has(input[type="radio"]:checked),
.page-insights .stats-mode label:has(input[type="radio"]:checked),
.page-roi .stats-mode label:has(input[type="radio"]:checked) {
  background: var(--muted);
  color: #fff;
}

.page-insights .stats-mode,
.page-roi .stats-mode {
  width: 172px;
}

/* Layout Pricing spécifique */
.layout-pricing {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 60px;
  font-family: Inter, system-ui, sans-serif;
}

/* 1. Hero Section */
.pricing-hero {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.pricing-hero h1 {
  font-size: 2.5rem;
  margin: 16px 0;
  background: linear-gradient(to right, #fff, var(--muted));
  -webkit-background-clip: text;
  /* color: transparent;  Optionnel si tu veux un effet dégradé sur le texte */
  color: var(--text);
  line-height: 1.1;
}

.pricing-hero .subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 32px;
}

.badge-pill {
  background: rgba(29, 147, 149, 0.15);
  color: var(--teal);
  border: 1px solid var(--teal);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Toggle Switch Custom */
.billing-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--field-bg);
  border: 1px solid var(--border);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: var(--muted);
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--teal);
  border-color: var(--teal);
}

input:checked+.slider:before {
  transform: translateX(20px);
  background-color: #fff;
}

.toggle-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
}

.toggle-label.active {
  color: var(--text);
}

.discount-tag {
  background: #F95353;
  /* Couleur rouge existante dans ton CSS pour .dot-red  */
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
  vertical-align: middle;
}

/* 2. Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
  /* Alignement vertical */
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.price-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s;
}

/* Style Highlight (Annuel) */
.price-card.highlight {
  border: 2px solid var(--teal);
  background: linear-gradient(180deg, rgba(29, 147, 149, 0.05) 0%, var(--card) 100%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  /* Plus d'ombre */
  transform: scale(1.02);
  z-index: 1;
}

.best-value-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal);
  color: white;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(29, 147, 149, 0.4);
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 10px 0;
}

.price-block .currency {
  font-size: 1.5rem;
  font-weight: 500;
}

.price-block {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}

.price-block .freq {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}

.muted-small {
  font-size: 0.9rem;
  color: var(--muted);
  /* text-decoration: line-through; */
  margin-top: -10px;
}

.features-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0 20px;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text);
}

.highlight-text {
  color: var(--teal);
  font-weight: 700;
}

.guarantee {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

/* 3. Value Pillars */
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.value-item {
  background: var(--panel);
  /* Utilise ton alias --panel  */
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.icon-bg {
  width: 48px;
  height: 48px;
  background: var(--field-bg);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.value-item h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.value-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* 4. Final CTA Box */
.final-cta-box {
  background: linear-gradient(135deg, var(--card), var(--bg));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.final-cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), transparent);
}

.final-cta-box h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.final-cta-box p {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 1.1rem;
}

/* FAQ Stylisée */
.faq-grid details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  transition: background 0.2s;
}

.faq-grid details[open] {
  background: var(--field-bg);
}

.faq-grid summary {
  font-weight: 600;
  color: var(--text);
}

.pricing-grid header {
  display: block;
}

.pricing-grid header h3,
.pricing-grid header .price-block {
  text-align: center;
  display: block;
}

/* ========== Dropdowns (Menu V2) ========== */
.rm-dropdown-group {
  position: relative;
  display: inline-block;
}

.rm-dropdown-trigger {
  cursor: pointer;
  padding-right: 8px;
  /* espace pour le caret */
}

.rm-caret {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.rm-dropdown-group:hover .rm-caret,
.rm-dropdown-group:focus-within .rm-caret {
  transform: rotate(180deg);
}

.rm-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 260px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  display: none;
  /* caché par défaut */
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Affichage au survol (Desktop) */
@media (min-width: 801px) {

  .rm-dropdown-group:hover .rm-dropdown-menu,
  .rm-dropdown-group:focus-within .rm-dropdown-menu {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.rm-dropdown-item {
  display: flex;
  align-items: flex-start;
  /* aligner icône en haut si multiline */
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
  transition: background 0.1s ease;
}

.rm-dropdown-item:hover {
  background: var(--ring);
}

.rm-dropdown-item.is-active {
  background: color-mix(in oklab, var(--teal) 15%, transparent);
  border: 1px solid color-mix(in oklab, var(--teal) 30%, transparent);
}

.rm-dd-icon {
  font-size: 18px;
  line-height: 1;
  padding-top: 2px;
}

.rm-dd-content {
  display: flex;
  flex-direction: column;
}

.rm-dd-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.rm-dd-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* ========== Mobile Menu Adjustments ========== */
@media (max-width: 800px) {
  .rm-nav {
    /* On garde les styles existants mais on ajuste pour les groupes */
    align-items: stretch;
    /* prendre toute la largeur */
    flex-direction: column;
    /* empiler verticalement */
    gap: 12px;
    padding: 16px;
  }

  .rm-dropdown-group {
    width: 100%;
    display: block;
  }

  .rm-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 12px 4px;
    font-size: 15px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .rm-dropdown-trigger:hover {
    border-color: var(--border);
    /* reset hover border */
  }

  .rm-dropdown-trigger .rm-caret {
    display: none;
    /* pas de caret en mobile, c'est toujours ouvert ou accordéon */
  }

  /* En mobile, on affiche toujours les items (version simple "ouverte") */
  .rm-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    display: flex;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 8px;
    min-width: 0;
  }

  .rm-dropdown-item {
    background: var(--card);
    border: 1px solid var(--border);
    margin-bottom: 6px;
  }

  /* Lien direct (Rentabilité) en mobile */
  .rm-nav>.rm-tab {
    width: 100%;
    justify-content: flex-start;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 12px 14px;
    font-size: 15px;
  }

  /* FAQ & Pricing Mobile Adjustments */
  .faq-grid details[open] {
    background: var(--field-bg);
  }

  .faq-grid summary {
    font-weight: 600;
    color: var(--text);
  }

  .pricing-grid header {
    display: block;
  }

  .pricing-grid header h3,
  .pricing-grid header .price-block {
    text-align: center;
    display: block;
  }
}

/* Fix hover gap */
.rm-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}
/* =========================================
   My Subscription Page Redesign
   ========================================= */
.subscription-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.subscription-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0;
    /* Reset padding for internal layout */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.sub-hero {
    padding: 40px;
    background: linear-gradient(to bottom, var(--bg), var(--card));
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.sub-hero-muted {
    background: var(--bg);
    opacity: 0.8;
}

.sub-hero-text h1 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
}

.sub-tags {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.sub-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sub-status-trialing {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sub-status-past_due {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sub-status-canceled {
    background: var(--border);
    color: var(--muted);
    border: 1px solid var(--border);
}

.sub-plan-chip {
    background: var(--ring);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.sub-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 200px;
}

.sub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
    /* Creates the grid lines */
    padding: 1px;
    /* Outer border */
}

.sub-tile {
    background: var(--card);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-tile-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
}

.sub-tile-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.sub-note {
    padding: 24px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-note.warning {
    background: rgba(239, 68, 68, 0.05);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.sub-empty {
    text-align: center;
    padding: 60px 20px;
}

.sub-empty p {
    margin-bottom: 24px;
    font-size: 1.1rem;
    color: var(--muted);
}

@media (max-width: 768px) {
    .sub-hero {
        flex-direction: column;
        padding: 24px;
    }

    .sub-actions {
        width: 100%;
        flex-direction: row;
    }

    .sub-actions .btn {
        flex: 1;
    }
}
