:root {
  --bg: #0b1016;
  --card: #0f141a;
  --muted: #0b1016;
  --text: #e5e9f0;
  --sub: #a9b2bf;
  --grid: #1f2a37;
  --accent: #7dd3fc;
  --green: #22c55e;
  --red: #ef4444;
  --border: #1f2a37;
  --yellow: #eab308;

  /* Coefficients par plage (palette 5 couleurs) */
  --coef-me: #7dd3fc;      /* 20-40 très petites marées : bleu clair */
  --coef-me-moy: #38bdf8;  /* 40-60 petites marées : bleu */
  --coef-pve: #22c55e;     /* 60-80 marées moyennes : vert */
  --coef-ve-moy: #fb923c;  /* 80-100 grandes marées : orange */
  --coef-grande: #ef4444;  /* 100-120 très grandes : rouge */
  --coef-extra: #b91c1c;   /* >120 extraordinaires : rouge foncé */

  /* tailles header */
  --logo-h-mobile: 44px;
  --logo-h-desktop: 52px;
  --logo-scale: 2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

/* Accessibilité focus visible */
:where(a, button, [tabindex], input, select, textarea):focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px;
}

.logo {
  font-weight: 700;
}

.title {
  opacity: .9;
}

.menu {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.menu:hover {
  background: rgba(255, 255, 255, .04);
}

/* === HEADER unifié (logo | tagline | marque) ========================= */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 22, .7);
  backdrop-filter: blur(8px);
  overflow: visible; /* pour laisser le logo dépasser avec scale */
}

/* même largeur que .container (980px) */
.header > .inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* [gauche] | [centre] | [droite] */
  align-items: center;
  gap: 14px;
}

/* ancrages gauche/droite */
.header .logo {
  justify-self: start;
}

.header .brand-right {
  justify-self: end;
}

/* slogan pile au milieu */
.header .tagline {
  justify-self: center;
  text-align: center;
  color: var(--sub);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* logo visuellement plus grand sans grossir la barre */
.header .logo img {
  height: var(--logo-h-mobile);
  width: auto;
  display: block;
  transform: scale(var(--logo-scale));
  transform-origin: left center;
  will-change: transform;
}

@media (min-width: 768px) {
  .header .logo img {
    height: var(--logo-h-desktop);
  }
}

/* lien "Radar Marée !" */
.header .brand-right {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.header .brand-right:hover {
  opacity: .9;
}

/* ENTETE */

.place {
  margin: 10px 0 14px;
}

.place.place-centered {
  text-align: center;
}

.place h1 {
  margin: 10px 0 6px 0;
  font-size: 1.7rem;
  line-height: 1.25;
  font-weight: 800;
}

.place-date {
  margin: 0;
  color: var(--sub);
  font-size: .98rem;
}

/* masque le type si nécessaire */
.no-type .place-type {
  display: none !important;
}

/* Recherche (container de la section) */

.search {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

/* input + bouton de base */

.search input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-align: center;
}

.search button {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

/* centrage placeholder puis recentrage au focus */

.search input:focus {
  text-align: left;
}

.search input::placeholder {
  text-align: center;
  opacity: .7;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1 1 260px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.card-title {
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 6px;
}

/* Bloc "Prochaines marées" juste sous la barre de recherche */

.next-tides-card {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.next-tide-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
}

.next-tide-label {
  color: var(--sub);
}

.next-tide-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.current {
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.trend {
  font-size: .95rem;
}

.trend.green {
  color: var(--green);
}

.trend.red {
  color: var(--red);
}

.next {
  color: var(--sub);
  margin-top: 6px;
}

/* Coefficient (badge + lignes) */

.coeff-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Badge générique des coefficients (définition de base) */

.coeff-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 4px 12px;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: #101820;
  -webkit-text-stroke: 0.25px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.coeff-trend {
  color: var(--sub);
}

.coeff-trend .arrow {
  margin-right: 6px;
}

/* centrage des cartes */

#card-current,
#card-coeff {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#card-current .current,
#card-coeff .coeff-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* deux lignes empilées dans l’encart Coefficient */

.coeff-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* états couleur badge simple good/bad -> on NE change plus le fond, on laisse la palette coef faire le job */

.coeff-badge.good {
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.coeff-badge.bad {
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.4);
}

/* Variantes de couleur (par plage de coefficients) */

.coeff--me {
  background: var(--coef-me);
  color: #081018;
}

.coeff--me-moy {
  background: var(--coef-me-moy);
  color: #081018;
}

.coeff--pve {
  background: var(--coef-pve);
  color: #081018;
}

.coeff--ve-moy {
  background: var(--coef-ve-moy);
  color: #081018;
}

.coeff--grande {
  background: var(--coef-grande);
  color: #1a0c06;
}

.coeff--extra {
  background: var(--coef-extra);
  color: #120404;
}

.coeff--me,
.coeff--me-moy,
.coeff--pve,
.coeff--ve-moy,
.coeff--grande,
.coeff--extra {
  -webkit-text-stroke: 0.25px rgba(0, 0, 0, 0.15);
  text-shadow: none;
}

/* Bloc graphique */

.graph-block {
  position: relative;
  overflow: hidden;
}

.graph-head {
  position: relative;
  display: flex;
  justify-content: flex-start; /* Marées reste à gauche */
  align-items: center;
  margin-bottom: 6px;
}

/* Conteneur d'actions à droite dans l'entête du graphique principal */

.graph-head .tide-tiles-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

/* Date du graphique tuiles centrée sur la ligne du titre */

.tide-tiles-block .tiles-day-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--sub);
}

.legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
}

/* Bannières latérales J-1 / J+1 */

.side-banner {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .04);
  border: 1px dashed var(--border);
  padding: 6px 10px;
  border-radius: 12px;
  color: var(--sub);
  user-select: none;
  cursor: pointer;
}

.side-banner:hover {
  background: rgba(255, 255, 255, .06);
}

.side-banner.left {
  left: 6px;
}

.side-banner.right {
  right: 6px;
}

svg {
  width: 100%;
  height: 280px;
  display: block;
}

@media (min-width: 720px) {
  svg {
    height: 320px;
  }
}

/* Grilles et axes */

.grid line {
  stroke: var(--grid);
  stroke-width: 1;
}

.gridline {
  stroke: var(--grid);
  stroke-width: 1;
}

.axis {
  fill: var(--sub);
  font-size: .8rem;
  pointer-events: none;
}

/* Courbe, point actuel, labels */

.path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.cur {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 2;
}

.label {
  fill: var(--text);
  font-size: .8rem;
  text-anchor: middle;
  pointer-events: none;
}

.pm {
  fill: var(--text);
}

.bm {
  fill: var(--text);
}

/* Empêche les éléments d’annotation de bloquer les gestuelles */

svg .bottom-dates text,
svg .hour-dashed-guides line,
svg .day-separator-bars rect {
  pointer-events: none;
}

/* Légende sous-graphique */

.caption {
  display: flex;
  justify-content: center;
  color: var(--sub);
  font-size: .85rem;
  margin-top: 6px;
}

/* Ligne unique des dates J-1 / J / J+1 */

.bottom-dates text.axis {
  dominant-baseline: ideographic;
}

/* Guides horaires pointillés (optionnels) */

.hour-dashed-guides line {
  stroke: var(--grid);
  opacity: .25;
}

/* Table, photo, pied de page */

.table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  color: var(--sub);
  font-weight: 600;
  font-size: .85rem;
}

.table td {
  font-size: .95rem;
}

.table tr:last-child td {
  border-bottom: none;
}

.photo img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.photo p {
  color: var(--sub);
  margin: 8px 2px 0;
}

footer {
  color: var(--sub);
  font-size: .8rem;
  margin: 24px 0;
  text-align: center;
}

.current .percent {
  font-size: 1rem;
  color: var(--sub);
  margin-left: 6px;
}

.caption.warning em {
  font-style: italic;
  opacity: .9;
  text-align: center;
}

/* Photo (fond neutre + fallback) */

.photo img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #0f141a, #0b1016);
}

.photo img.is-fallback {
  filter: saturate(0.9) contrast(1.05);
  opacity: 0.95;
}

/* Carte photo responsive (section .place.card.photo) */

.place.card.photo {
  --photo-max-h: 220px;
}

.place.card.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  max-height: var(--photo-max-h);
  border-radius: 12px;
}

@media (min-width: 768px) {
  .place.card.photo {
    --photo-max-h: 260px;
  }
}

@media (min-width: 1200px) {
  .place.card.photo {
    --photo-max-h: 300px;
  }
}

.place.card.photo.sm {
  --photo-max-h: 160px;
}

.place.card.photo.lg {
  --photo-max-h: 320px;
}

.next-tide-card {
  margin-top: 1rem;
}

.next-tide-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.next-tide-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.next-tide-label {
  color: var(--sub);
}

.next-tide-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Centrage du texte sous la photo */

#placeGeo {
  text-align: center;
  margin-top: 0.4em;
  font-weight: 500;
  color: #ddd;
}

/* Petit confort de scroll horizontal sur tableaux si besoin */

.table {
  overflow: auto;
}

/* --- Encarts texte centrés --- */

#tideSummaryCard {
  text-align: center;
}

#tideSummaryCard h3,
#tideSummaryCard p#tideSummary {
  text-align: inherit;
  margin-left: auto;
  margin-right: auto;
}

#placeDescCard {
  text-align: center;
}

#placeDescCard h3,
#placeDescCard #placeDesc,
#placeDescCard #placeDesc p {
  text-align: inherit;
  margin-left: auto;
  margin-right: auto;
}

/* Marées à découvrir à côté */

#nearbyDiscover {
  text-align: center;
}

#nearbyDiscover h3 {
  text-align: inherit;
}

#nearbyDiscover .nearby {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#nearbyDiscover .nearby li {
  text-align: center;
}

#nearbyDiscover .nearby li small {
  color: var(--sub);
}

/* Texte discret (utilisé pour certaines mentions) */

.muted {
  color: var(--sub);
  font-size: 12px;
  margin-top: 8px;
}

/* === Barre de recherche + dropdown ========================== */

section.search {
  width: 100%;
  margin: 12px 0;
}

.searchbar {
  position: relative; /* pour que .suggestions soit sous la barre */
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#searchInput {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0; /* évite que le bouton comprime l'input */
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

#searchBtn {
  flex: 0 0 auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

#searchBtn:hover {
  border-color: var(--accent);
}

/* Liste de suggestions */

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
}

.suggestions[hidden] {
  display: none;
}

.suggestions li[role="option"] {
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.suggestions li[role="option"] .sub {
  color: var(--sub);
  font-size: 12px;
}

.suggestions li[aria-selected="true"],
.suggestions li:hover {
  background: rgba(125, 211, 252, 0.08);
}

/* La liste de suggestions suit la largeur de la barre */

#searchListbox.suggestions {
  width: 100%;
  max-width: 100%;
}

#searchHelp {
  display: none !important;
}

/* === Header : version mobile compact ========================= */

@media (max-width: 640px) {
  .header > .inner {
    /* 2 colonnes : logo | marque, tagline en dessous */
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "logo brand"
      "tagline tagline";
    /* padding vertical réduit pour baisser la hauteur globale */
    padding: 6px 10px 2px;
    row-gap: 2px;
    column-gap: 8px;
  }

  .header .logo {
    grid-area: logo;
  }

  .header .brand-right {
    grid-area: brand;
    justify-self: end;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .header .tagline {
    grid-area: tagline;
    text-align: center;
    white-space: normal; /* retour à la ligne OK */
    overflow: visible;
    text-overflow: clip;
    font-size: 0.78rem;
    margin-top: 0; /* colle la phrase aux éléments du dessus */
    margin-bottom: 2px; /* très léger espace avec le H1 */
  }

  /* logo un peu plus petit pour limiter la hauteur */
  .header .logo img {
    height: 30px;
    transform: scale(1.3);
    transform-origin: left center;
  }
}

.tide-tiles {
  margin-top: 1.5rem;
}

.tide-tiles-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.tide-tiles-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.tide-tiles-date {
  font-size: 0.85rem;
  color: var(--sub);
}

/* Wrapper général de la timeline */

.tide-tiles-inner {
  position: relative;
  height: 150px;
  padding-top: 30px;  /* place pour les heures en haut */
  padding-bottom: 30px; /* place pour J-1 / J / J+1 */
  overflow: visible;     /* surtout ne pas couper les tuiles en bas */
}

/* Rail qui contient les tuiles (position de base du groupe) */

#tideTilesTrack {
  position: absolute;
  top: 34px; /* remonte légèrement tout le groupe */
  left: 0;
  right: 0;
  height: 90px;
}

/* Axe temporel (barres heures + jours), derrière les tuiles */

#tideTilesAxis {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tide-axis-hour {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--grid);
  opacity: 0.3;
}

/* Bande verticale de changement de jour (même esprit que sur le SVG) */

.tide-day-band {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  background: rgba(125, 211, 252, 0.16); /* même bleu translucide que le SVG */
  pointer-events: none;
}

.tide-axis-day {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  opacity: 0.35;
}

.tide-axis-hour-label {
  position: absolute;
  top: 0; /* collé en haut du wrapper */
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--sub);
  white-space: nowrap;
}

.tide-tiles-center {
  position: absolute;
  top: 0;    /* colle en haut du wrapper (même repère que les labels d’heure) */
  bottom: 0; /* va jusqu’en bas de la zone tuiles */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
}

.tide-tiles-center-date {
  font-size: 0.8rem;
  color: var(--sub);
}

.tide-tiles-center-time {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--grid);
  color: var(--sub);
  margin-top: -4px; /* on remonte légèrement, pour coller à la ligne des heures */
}

.tide-tiles-center-bar {
  flex: 1; /* prend tout le reste de la hauteur */
  width: 4px; /* barre plus épaisse */
  background: var(--accent);
  opacity: 1;
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(11, 16, 22, 0.9),   /* léger contour sombre */
    0 0 10px rgba(125, 211, 252, 0.45); /* petit halo bleu */
}

/* Tuiles marée haute / marée basse */

.tide-tile {
  position: absolute; /* largeur gérée par le JS (left/width), pas de min-width ici pour éviter les chevauchements quand les créneaux sont serrés */
  padding: 6px 10px 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(125, 211, 252, 0.7);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ligne haute / ligne basse (quinconce desktop) */

.tide-tile--top {
  top: 18%;
}

.tide-tile--bottom {
  top: 56%;
}

.tide-tile-high {
  border-color: #38bdf8; /* bleu */
  box-shadow: 0 10px 26px rgba(56, 189, 248, 0.35);
}

.tide-tile-low {
  border-color: #eab308; /* jaune */
  box-shadow: 0 10px 26px rgba(234, 179, 8, 0.30);
}

/* Contenu minimal : heure + coef */

.tide-tile-time {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.tide-tile-coef {
  /* pastille coef plus petite dans les tuiles */
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

/* Légende J-1 / J / J+1 en dessous */

.tide-tiles-days {
  margin-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--sub);
}

.tide-tiles-days span:nth-child(2) {
  color: var(--accent);
  font-weight: 500;
}

/* === Timeline marées – ajustements version mobile ================= */

@media (max-width: 640px) {
  /* on garde globalement la même hauteur, juste un peu plus compacte */
  .tide-tiles-inner {
    height: 150px;
    padding-top: 24px;
    padding-bottom: 26px;
  }

  #tideTilesTrack {
    top: 32px;
    height: 90px;
  }

  .tide-tile {
    /* largeur gérée uniquement par le JS, pour qu'elles se touchent sans contrainte CSS qui force un chevauchement */
    padding: 4px 6px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    transform: none;
  }

  .tide-tile-time {
    font-size: 0.70rem;
    margin-bottom: 2px;
  }

  .tide-tile-coef {
    font-size: 0.60rem;
    padding: 1px 6px;
  }

  /* légende J-1 / J / J+1 un peu plus petite */
  .tide-tiles-days {
    font-size: 0.7rem;
    margin-top: 0.15rem;
  }
}

/* Masque la ligne J-1 / J / J+1 sous la timeline tuiles */

.tide-tiles-days {
  display: none !important;
}

/* Masque la ligne J-1 / J / J+1 sous le grand graphique SVG */

svg .bottom-dates {
  display: none !important;
}

/* DEBUT ajout espacement Radar Marée */

/* Espacement sous le premier graphique (timeline tuiles) */

.graph-block.tide-tiles-block {
  margin-bottom: 2.5rem;
}

/* Espacement entre les cartes "Hauteur actuelle / Coefficient" et le 2e graphique */

.row + .graph-block {
  margin-top: 2.5rem;
}

/* Espacement entre le 2e graphique et le tableau des marées */

.graph-block + .table {
  margin-top: 2.5rem;
}

.graph-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.btn-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.16), rgba(15, 23, 42, 0.9));
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition:
    background .15s ease,
    transform .12s ease,
    box-shadow .15s ease,
    border-color .15s ease;
}

.btn-today::before {
  content: "⏱";
  font-size: 1rem;
}

.btn-today:hover {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(15, 23, 42, 1));
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.btn-today:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Boutons "Revenir à maintenant" sous les graphiques */

.graph-actions {
  margin-top: 0.5rem;  /* plus proche du graphique */
  margin-bottom: 0.5rem; /* évite un gros vide en bas de la carte */
  display: flex;
  justify-content: center;
}

.btn-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.16), rgba(15, 23, 42, 0.9));
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition:
    background .15s ease,
    transform .12s ease,
    box-shadow .15s ease,
    border-color .15s ease;
}

.btn-today::before {
  content: "⏱";
  font-size: 1rem;
}

.btn-today:hover {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(15, 23, 42, 1));
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.btn-today:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Bouton "Revenir à maintenant" sous les graphiques */

.graph-today-wrapper {
  /* on remonte le bloc vers le haut */
  margin-top: -1.5rem; /* tu peux ajuster entre -1rem et -2rem si besoin */
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}

.graph-today-wrapper .btn-today {
  margin: 0; /* pas de marge supplémentaire */
}

/* Rapprocher les boutons "Revenir à maintenant" des graphiques */

.tide-tiles-actions,
.graph-actions {
  margin-top: 12px; /* juste sous le graphique */
}

/* On évite qu'un margin-top du bouton lui-même le repousse vers le bas */

.tide-tiles-actions .btn-today,
.graph-actions .btn-today {
  margin-top: 0;
}

.graph-actions {
  margin-top: 12px;
  margin-bottom: 8px;
  text-align: center;
}

.graph-actions .btn-today {
  margin-top: 0;
}

/* Ajuste la taille des coefficients dans les tuiles sur mobile */

@media (max-width: 600px) {
  .tide-tiles-block .tide-tile-coef.coeff-badge {
    font-size: 0.65rem;
    padding: 0 0.45rem;
    min-width: 2.1rem;
    height: 1.4rem;
    line-height: 1.4rem;
    border-radius: 999px;
  }

  .tide-tiles-block .tide-tile {
    padding-bottom: 0.35rem;
  }
}


/* === Encadré "Prochaines marées" sous la recherche =================== */

.next-tides-card {
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  text-align: left;
}

.next-tides-card .next-tide-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
}

.next-tides-card .next-tide-label {
  color: var(--sub);
}

.next-tides-card .next-tide-time {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Version mobile : un poil plus compacte */

@media (max-width: 640px) {
  .next-tides-card {
    margin-top: 6px;
    margin-bottom: 12px;
  }

  .next-tides-card .next-tide-row {
    font-size: 0.9rem;
  }
}

/* === Encadré "Prochaines marées" sous la recherche =================== */

.next-tides-card {
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  text-align: left;
}

.next-tides-card .next-tide-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
}

.next-tides-card .next-tide-label {
  color: var(--sub);
}

.next-tides-card .next-tide-time {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Version mobile : un poil plus compacte */

@media (max-width: 640px) {
  .next-tides-card {
    margin-top: 6px;
    margin-bottom: 12px;
  }

  .next-tides-card .next-tide-row {
    font-size: 0.9rem;
  }
}

/* Bloc "Prochaines marées" sous la barre de recherche */

.next-tides-card {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Ligne de date en haut du bloc */

.next-tides-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.next-tides-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.next-tides-date {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.next-tides-date {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Lignes haute / basse */

.next-tide-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
}

.next-tide-label {
  color: var(--sub);
}

.next-tide-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------- Carte "Prochaine marée haute / basse" ---------- */

.next-tides-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.next-tides-card #nextTidesDate {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sub);
}

/* Ligne haute / basse */

.next-tides-card .tide-next-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Libellé + icône */

.next-tides-card .tide-next-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.next-tides-card .tide-next-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: rgba(125, 211, 252, 0.10); /* halo léger */
}

/* --- Mise en avant de la marée la plus proche dans le bloc "Prochaines marées" --- */

.next-tides-card .tide-next-row.is-active {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.45),
              0 6px 20px rgba(0, 0, 0, 0.55);
  transform: scale(1.03);
}

.next-tides-card .tide-next-row.is-active .tide-next-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.next-tides-card .tide-next-row.is-active .tide-next-time {
  font-size: 1.15rem;     /* heure plus visible */
  font-weight: 800;
}

.next-tides-card .tide-next-row.is-active .tide-next-icon {
  transform: scale(1.2);
  background: rgba(125, 211, 252, 0.20);  /* halo plus marqué */
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.6);
}


.next-tides-card .tide-next-icon--up {
  color: var(--green);
}

.next-tides-card .tide-next-icon--down {
  color: var(--red);
  transform: translateY(1px);
}

/* Zone valeurs (heure + coef) */

.next-tides-card .tide-next-values {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.next-tides-card .tide-next-time {
  font-size: 1.05rem;
  font-weight: 700;
}

/* Pastille de coefficient, on réutilise coeff-badge + good/bad */

.next-tides-card .tide-next-coef {
  min-width: 2.0rem;
  padding: 0.06rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}


.next-tides-header {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  color: var(--text);
}

.next-tides-time {
  font-weight: 500;
  color: var(--sub);
}

/* Si tu n’as pas déjà ces classes, tu peux les renforcer ici */

.next-tides-card .next-tide-icon--up {
  color: var(--green); /* marée haute en vert */
}

.next-tides-card .next-tide-icon--down {
  color: var(--yellow); /* marée basse en jaune */
  transform: translateY(1px);
}

/* === Espacement vertical global des blocs du main === */

/* 1) Aucune marge par défaut sur les sections du main */

main.container > section {
  margin-block: 0;
}

/* 2) Même espace entre chaque bloc successif du main */

main.container > section + section {
  margin-top: 1.5rem; /* ajuste à 1.25rem ou 2rem si tu veux plus/moins */
}

/* 3) On neutralise les marges verticales des wrappers internes pour que ce soit bien la <section> qui contrôle l'espacement */

main.container .card,
main.container .row,
main.container .graph-block,
main.container .table {
  margin-block: 0;
}

/* 4) Cas particuliers qui pouvaient ajouter des "trous" visuels */

.tide-tiles-block,
.next-tides-card,
#card-current,
#card-coeff,
#tideSummaryCard,
.place.photo,
#nearbyDiscover {
  margin-block: 0;
}

/* Ligne "Analyse à jour mois HH:mm" sous le titre Hauteur actuelle */

#card-current .current-analysis {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--sub);
}

.current-analysis-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}

/* === Override "Prochaines marées" : 2 lignes centrées ===================== */

.next-tides-card {
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center; /* centre le contenu */
  gap: 0.5rem;
  text-align: center;  /* texte centré */
}

/* Une ligne = marée haute, une ligne = marée basse */

.next-tides-card .tide-next-row {
  display: flex;
  align-items: center;
  justify-content: center; /* centre tout sur la largeur */
  gap: 0.75rem;
  white-space: nowrap; /* évite que ça se casse en 2 lignes */
}

/* Libellé + icône, toujours sur la même ligne */

.next-tides-card .tide-next-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Heure + coef sur la même ligne, collés au libellé */

.next-tides-card .tide-next-values {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
/* === OVERRIDE : rendre les coeff + textes plus petits en haut de page === */

/* 1) Coeff + heure dans les TUILLES du 1er graphique */
.tide-tiles-block .tide-tile-time {
  font-size: 0.8rem;        /* au lieu de ~0.9rem */
}

.tide-tiles-block .tide-tile-coef {
  font-size: 0.6rem;        /* pastille beaucoup plus fine */
  padding: 1px 0.45rem;
  min-width: 1.7rem;
}

/* 2) Bloc "Prochaines marées" (juste sous la recherche) */
.next-tides-card .tide-next-label {
  font-size: 0.85rem;       /* texte un peu réduit */
}

.next-tides-card .tide-next-time {
  font-size: 0.98rem;       /* heure un tout petit peu plus petite */
}

.next-tides-card .tide-next-coef {
  font-size: 0.7rem;        /* pastille plus fine */
  min-width: 1.7rem;
  padding: 0 0.45rem;
}

/* Version mobile : encore plus compact */
@media (max-width: 640px) {
  .tide-tiles-block .tide-tile-time {
    font-size: 0.72rem;
  }

  .tide-tiles-block .tide-tile-coef {
    font-size: 0.55rem;
    padding: 0 0.35rem;
    min-width: 1.5rem;
  }

  .next-tides-card .tide-next-label {
    font-size: 0.8rem;
  }

  .next-tides-card .tide-next-time {
    font-size: 0.9rem;
  }

  .next-tides-card .tide-next-coef {
    font-size: 0.65rem;
    min-width: 1.5rem;
    padding: 0 0.35rem;
  }
}

/* === Prochaines marées : même gabarit que les tuiles ================= */

/* Heure : légèrement plus petite mais bien lisible */
.next-tides-card .tide-next-time {
  font-size: 0.85rem;      /* plus petit, comme les tuiles */
  font-weight: 600;
}

/* Pastille de coefficient dans le bloc "Prochaine marée" */
.next-tides-card .next-tide-coef {
  min-width: 1.9rem;        /* plus petite pastille */
  height: 1.4rem;
  line-height: 1.4rem;      /* centre le texte verticalement */
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.70rem;       /* texte plus petit */
  font-weight: 700;
  text-align: center;
  /* Surtout : on NE met ni background ni color ici,
     ce sont coeff-badge + coeff--xxx qui pilotent la couleur */
}

/* Icône ronde (↑ / ↓) un peu plus discrète */
.next-tides-card .tide-next-icon {
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.8rem;
}
/* Mini pastilles pour le bloc "Prochaine marée haute / basse" sous la recherche */
.next-tides-card .tide-next-coef {
  font-size: 0.70rem !important;   /* texte plus petit */
  min-width: 1.9rem !important;    /* pilule plus courte */
  padding: 0 0.45rem !important;   /* moins de marges internes */
  height: 1.3rem !important;       /* pastille plus basse */
  line-height: 1.3rem !important;  /* centre verticalement le texte */
  border-radius: 999px !important; /* garde la forme pilule */
}
/* Mise en avant de la marée la plus proche (bloc "Prochaines marées") */
.next-tides-card .next-tide-row--main {
  font-weight: 700;              /* toute la ligne un peu plus grasse */
}

.next-tides-card .next-tide-row--main .next-tide-label {
  font-weight: 800;              /* "Prochaine marée ..." encore plus gras si la classe existe */
}

.next-tides-card .next-tide-time--main {
  font-size: 1.1rem;
  font-weight: 800;
}

.next-tides-card .next-tide-arrow--main {
  font-size: 1.3rem;             /* flèche plus grosse */
  font-weight: 900;
  color: var(--accent);          /* couleur bien visible */
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}

.next-tides-card .next-tide-coef--main {
  transform: scale(1.05);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.7),
    0 0 16px rgba(0, 0, 0, 0.75);
}
.intent-block {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.9rem;
  color: var(--sub);
}

@media (max-width: 640px) {
  .intent-block {
    font-size: 0.85rem;
  }
}

.local-facts {
  margin-top: 0.75rem;
}

.local-facts ul {
  padding-left: 1.1rem;
  margin: 0.25rem 0 0;
}

.local-facts li {
  font-size: 0.9rem;
  color: var(--sub);
  margin-bottom: 0.15rem;
}
.faq-card {
  margin-top: 0.75rem;
}

.faq-card h3 {
  margin-bottom: 0.5rem;
}

.faq-item + .faq-item {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.faq-item h4 {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.faq-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sub);
}
