/* ═════════ Riso design tokens (from prototype :root) ═════════ */
:root {
  --v6-paper: #F4ECD8;
  --v6-paper-deep: #ECDFBE;
  --v6-ink: #2A2118;
  --v6-red: #E84A40;
  --v6-green: #7CB976;
  --v6-blue: #79A8D4;
  --v6-shadow-x: 2px;
  --v6-shadow-y: 2px;
}

/* ═════════ Map screen v5 — mint green bg ═════════ */
.map-screen-v5 { background: #E2F3EB; }

/* ═════════ Actions v4 control bar ═════════ */
.v6-actions {
  display: flex;
  gap: 6px;
  padding: 8px 16px 6px;
  align-items: center;
  flex-shrink: 0;
}
.v6-actions-v4 { gap: 4px; }
.v6-actions-v4 .v4-toggle { margin-left: auto; }

/* Compact action buttons (search + critères) */
.v6-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: transparent;
  border: 1.2px dashed var(--v6-ink);
  border-radius: 4px;
  color: var(--v6-ink);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  min-height: 44px;
}
.v6-act[aria-label="Rechercher"] { padding: 6px 8px; }

.v6-badge {
  background: var(--v6-red);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 100px;
  margin-left: 2px;
}

/* Toggle map/list */
.v4-toggle {
  display: inline-flex;
  margin-left: auto;
  border: 1.2px solid var(--v6-ink);
  border-radius: 4px;
  background: transparent;
  overflow: hidden;
}
.v4-toggle-seg {
  width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--v6-ink);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  min-height: 44px;
}
.v4-toggle-seg + .v4-toggle-seg {
  border-left: 1.2px solid var(--v6-ink);
}
.v4-toggle-seg.on {
  background: var(--v6-ink);
  color: var(--v6-paper);
}

/* ─── Catégories v4 — grille 4 colonnes pleine largeur ─── */
.v4-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 10px 14px 14px;
  flex-shrink: 0;
}

/* ─── Variante 2×2 (utilisée sur carte et liste) ─── */
.v4-cats.v4-cats--grid2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 10px;
  padding: 8px 14px 12px;
}
.v4-cats.v4-cats--grid2 .v4-cat {
  height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 16px;
  letter-spacing: 0.005em;
  outline-offset: 2.5px;
}
.v4-cat {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 6px;
  border: 1.4px solid var(--cc, var(--primary));
  border-radius: 7px;
  background: transparent;
  color: var(--cc, var(--primary));
  font: 600 13px/1 'Inter', sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, background 0.1s, color 0.1s;
  overflow: visible;
  min-height: 44px;
}
.v4-cat-label {
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.v4-cat-stamp {
  position: absolute;
  top: -8px;
  right: -6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  transform: rotate(-6deg);
  box-shadow: 1.5px 1.5px 0 var(--primary);
  z-index: 2;
  pointer-events: none;
}
.v4-cat.on {
  background: var(--cc, var(--primary));
  color: #FCFFF5;
  border-color: var(--cc, var(--primary));
  outline-color: var(--cc, var(--primary));
  box-shadow: 2px 2px 0 var(--primary);
}
.v4-cat.on .v4-cat-stamp {
  background: #E2F3EB;
  color: var(--primary);
  box-shadow: 1.5px 1.5px 0 var(--primary);
}
.v4-cat:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--primary);
}

/* Double-outline on map-screen-v5 / list-screen */
.map-screen-v5 .v4-cat {
  border-style: dotted;
  outline: 1.4px solid var(--cc, var(--primary));
  outline-offset: 3px;
}
.map-screen-v5 .v4-cat.on {
  outline-color: var(--cc, var(--primary));
}

/* ═════════ Modale Critères ═════════ */
.crit-section { padding-top: 8px; }
.crit-lede {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  margin: 0 0 18px;
  font-family: "Fraunces", serif;
  font-style: italic;
}
.crit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crit-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  text-align: left;
  color: var(--primary);
  transition: border-color .12s, background .12s;
  cursor: pointer;
  min-height: 44px;
}
.crit-row:hover { background: rgba(255,255,255,0.5); }
.crit-row.on {
  border-color: var(--primary);
  background: #FCFFF5;
  box-shadow: inset 0 0 0 1px var(--primary);
}
.crit-emoji {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(31,58,95,0.06);
  font-size: 18px;
}
.crit-row.on .crit-emoji {
  background: var(--primary);
  color: var(--surface);
}
.crit-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.crit-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.crit-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}
.crit-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(31,58,95,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  background: transparent;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.crit-row.on .crit-check {
  background: var(--primary);
  border-color: var(--primary);
}

/* Critères modal button badge */
.crit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* ═════════ MAP v5 — subcategory bottom sheet ═════════ */
.v5-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -12px 40px -8px rgba(31,58,95,0.18),
              0 -2px 0 rgba(31,58,95,0.1);
  display: flex;
  flex-direction: column;
  max-height: 78%;
  z-index: 30;
  animation: v5-sheet-up 0.22s cubic-bezier(.2,.7,.2,1);
  font-family: 'Inter', sans-serif;
  color: var(--primary);
  touch-action: pan-y;
}
@keyframes v5-sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Grab handle */
.v5-sheet-grab {
  padding: 8px 0 4px;
  display: flex;
  justify-content: center;
  cursor: grab;
}
.v5-sheet-grab span {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(31,58,95,0.2);
}

/* Header */
.v5-sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 18px 12px;
  border-bottom: 1px solid rgba(31,58,95,0.08);
}
.v5-sheet-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.v5-sheet-em {
  font-size: 18px;
  line-height: 1;
}
.v5-sheet-title strong {
  font-weight: 600;
}

/* Scrollable body */
.v5-sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 0 12px;
  overscroll-behavior: contain;
}
.v5-group + .v5-group {
  margin-top: 6px;
}
.v5-group-label {
  margin: 14px 18px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(31,58,95,0.55);
  display: flex;
  align-items: center;
  gap: 6px;
}
.v5-group-em { font-size: 13px; }
.v5-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.v5-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(31,58,95,0.06);
  text-align: left;
  font: 500 14.5px/1.2 'Inter', sans-serif;
  color: var(--primary);
  cursor: pointer;
  min-height: 44px;
}
.v5-row:active { background: rgba(31,58,95,0.04); }
.v5-rows li:first-child .v5-row { border-top: none; }
.v5-row-em {
  font-size: 17px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.v5-row-lbl {
  flex: 1;
}
.v5-check {
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(31,58,95,0.3);
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #fff;
  flex-shrink: 0;
  color: transparent;
}
.v5-check.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}

/* CTA */
.v5-sheet-cta {
  padding: 10px 18px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(31,58,95,0.08);
  background: transparent;
}
.v5-cta-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: var(--surface);
  font: 600 15px/1 'Inter', sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 2px 0 #16294a;
  transition: transform 0.08s, box-shadow 0.08s;
}
.v5-cta-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #16294a;
}
