:root {
  --bg: #f4f8fa;
  --card-bg: #ffffff;
  --text: #103b4a;
  --text-muted: #587683;
  --primary: #0a4d68;
  --accent: #17a2b8;
  --border: #d7e4e8;
  --danger-bg: #fdecea;
  --danger-text: #8a2b1f;
  --tile-bg: #eaf6f8;
  --header-grad: linear-gradient(135deg, #0e7d90 0%, #0a4d68 100%);
  --chart-path: #17a2b8;
  --chart-stop: #eda100;
  --chart-surface: #ffffff;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --meter-track: #dcebee;
  --on-primary: #ffffff;
  --time-descent: #3366cc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1d24;
    --card-bg: #122b34;
    --text: #e8f3f5;
    --text-muted: #9db8c0;
    --primary: #4fc3d9;
    --accent: #4fc3d9;
    --border: #1d3d47;
    --danger-bg: #3a1f1c;
    --danger-text: #ffb4a6;
    --tile-bg: #0f333c;
    --header-grad: linear-gradient(135deg, #146f82 0%, #0b2f3a 100%);
    --chart-path: #1a8fa8;
    --chart-stop: #c98500;
    --chart-surface: #122b34;
    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-critical: #d03b3b;
    --meter-track: #1a3a44;
    --on-primary: #04262d;
    --time-descent: #5c8fe0;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

/* ---- Focus clavier : visible partout, jamais sur simple clic souris/tactile
   (:focus-visible). Les cartes/pastilles reposent sur un <input> invisible
   (opacity:0) qui porte le vrai focus : un outline dessus serait lui aussi
   invisible, donc on le reporte explicitement sur l'élément visuel associé. ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.type-card input:focus-visible + .type-card-body,
.seg-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  padding-bottom: 2rem;
}

.app-header {
  position: relative;
  overflow: hidden;
  background: var(--header-grad);
  color: #fff;
  padding: calc(1.25rem + env(safe-area-inset-top)) 1rem 1.5rem;
  text-align: center;
}

.info-btn {
  position: absolute;
  top: calc(.35rem + env(safe-area-inset-top));
  right: .55rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
}
.info-btn:active { background: rgba(255, 255, 255, 0.3); }

.info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 50;
}
.info-card {
  position: relative;
  max-width: 380px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.info-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: .5rem;
}
.info-card h2 { margin: .25rem 0; color: var(--primary); }
.info-version { color: var(--text-muted); font-size: .82rem; margin: 0; }
.info-author { color: var(--accent); font-size: .85rem; font-weight: 600; margin: .15rem 0 .9rem; text-align: center; }
.info-card p { text-align: left; font-size: .9rem; }
.info-copyright { text-align: center; color: var(--text-muted); font-size: .75rem; margin: .75rem 0 0; }
.disclaimer-accept { display: block; width: 100%; margin-top: 1rem; }
.info-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .9rem;
}
.app-header h1 {
  margin: 0;
  font-size: 1.4rem;
  position: relative;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.app-header .subtitle {
  margin: .25rem 0 0;
  font-size: .85rem;
  opacity: .95;
  position: relative;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bubble {
  position: absolute;
  bottom: -20px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  animation: bubble-float linear infinite;
}
@keyframes bubble-float {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translateY(-120px) translateX(var(--drift, 8px)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; display: none; }
  .wizard-step.slide-next, .wizard-step.slide-back { animation: none; }
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem;
}
@media (min-width: 720px) {
  main { max-width: 680px; padding: 1.5rem 1rem; }
  .app-header { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1100px) {
  main { max-width: 760px; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.field-hint {
  margin: .35rem 0 .75rem;
  font-size: .78rem;
  font-style: italic;
  color: var(--text-muted);
}

fieldset.card { border: 1px solid var(--border); }

legend {
  font-weight: 600;
  color: var(--primary);
  padding: 0 .35rem;
}

/* ---- Pavé à molette (wheel picker) ---- */
.wheel-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.wheel-field { flex: 1 1 130px; min-width: 0; }
.wheel-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.wheel-picker {
  position: relative;
  height: 168px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.wheel-picker:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wheel-scroll {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.wheel-scroll::-webkit-scrollbar { display: none; }
.wheel-item {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.wheel-item.is-selected {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.6rem;
}
.wheel-selection-bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 56px;
  transform: translateY(-50%);
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  background: rgba(23, 162, 184, 0.08);
  pointer-events: none;
}

/* ---- Colonnes Plongée / Palier (écran 4) ---- */
.mode-wheels {
  display: flex;
  gap: .75rem;
  margin-top: .75rem;
}
.mode-wheel-col {
  flex: 1;
  min-width: 0;
  opacity: .45;
  filter: grayscale(.7);
  transition: opacity .2s ease, filter .2s ease;
}
.mode-wheel-col.is-active { opacity: 1; filter: none; }
.mode-header {
  display: block;
  width: 100%;
  padding: .55rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: var(--tile-bg);
  color: var(--text-muted);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
}
.mode-wheel-col.is-active .mode-header {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.mode-wheel-col .wheel-picker { border-radius: 0 0 14px 14px; }

/* ---- Cartes illustrées (type de plongée) ---- */
.type-cards {
  display: flex;
  gap: .75rem;
}
.type-card {
  position: relative;
  flex: 1;
  cursor: pointer;
}
.type-card input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.type-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  transition: background .15s ease, border-color .15s ease;
}
.type-icon { width: 64px; height: 36px; color: var(--text-muted); }
.type-label { font-weight: 600; color: var(--text-muted); font-size: .92rem; }
.type-card input:checked + .type-card-body {
  background: var(--primary);
  border-color: var(--primary);
}
.type-card input:checked + .type-card-body .type-icon,
.type-card input:checked + .type-card-body .type-label {
  color: var(--on-primary);
}

.group-title {
  margin: 1rem 0 .25rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.seg-control {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.seg-option {
  flex: 1 1 auto;
  position: relative;
}

.seg-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.seg-option span {
  display: block;
  text-align: center;
  padding: .6rem .5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .9rem;
  white-space: nowrap;
}

.seg-option input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.gf-fields { margin-top: .75rem; }

/* ---- Étiquette de bloc nitrox (résultats) : couleurs fixes, façon ticket
   physique réel — ne suit volontairement pas le thème clair/sombre de l'appli. ---- */
.nitrox-label-svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.nx-ticket-bg { fill: #dba05a; }
.nx-ticket-outline { fill: none; stroke: #a06b2e; stroke-width: 2; }
.nx-divider { stroke: #a06b2e; stroke-width: 1.5; stroke-dasharray: 3 3; }
.nx-label { font-size: 10px; font-weight: 700; fill: #000; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
/* Tout en noir et très gras : lisibilité maximale sur téléphone, priorité sur la
   distinction visuelle donnée/exemple. Police système fiable (pas de cursive,
   absente sur la plupart des téléphones Android et peu lisible en secours). */
.nx-value, .nx-example {
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  fill: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.nx-pmu-label { font-size: 15px; font-weight: 800; fill: #2b1c0d; letter-spacing: .04em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.nx-pmu-sub { font-size: 10px; fill: #5c3d1a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.nx-pmu-value { font-size: 27px; font-weight: 800; fill: #7a1f1f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.seg-control .seg-option span { white-space: normal; }

.pill {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pill:active { opacity: .8; }
.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #04262d;
  font-weight: 600;
}
.pill-custom {
  border-style: dashed;
}
.pill-custom.active {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  border-style: dashed;
}

/* ---- Cartes Gradient Factors (écran 2) : nom parlant + GF en clair en dessous ---- */
.gf-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: .6rem;
}
@media (min-width: 620px) {
  /* Assez de largeur pour 2 cartes côte à côte : la carte recommandée reste en
     pleine largeur pour continuer à se détacher visuellement des autres. */
  .gf-grid { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
  .gf-card2-featured, .gf-card2-custom { grid-column: 1 / -1; }
}
.gf-card2 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: left;
  font-family: inherit;
}
.gf-card2-head { display: flex; align-items: center; gap: .5rem; }
.gf-card2-icon { font-size: 1.15rem; line-height: 1; }
.gf-card2-name { flex: 1; font-weight: 700; font-size: .98rem; color: var(--text); }
.gf-card2-value { font-size: .8rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.gf-card2-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.35; }
.gf-card2-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .1rem; }
.gf-card2-stars { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.gf-card2-bar { display: inline-flex; gap: 3px; flex-shrink: 0; }
.gf-card2-bar i { width: 13px; height: 6px; border-radius: 3px; background: var(--border); display: inline-block; }
.gf-card2-bar i.on { background: var(--accent); }

.gf-card2.active { background: var(--primary); border-color: var(--primary); }
.gf-card2.active .gf-card2-name,
.gf-card2.active .gf-card2-value,
.gf-card2.active .gf-card2-desc,
.gf-card2.active .gf-card2-stars { color: var(--on-primary); }
.gf-card2.active .gf-card2-bar i { background: rgba(255, 255, 255, .3); }
.gf-card2.active .gf-card2-bar i.on { background: var(--on-primary); }

.gf-card2-featured {
  border: 2px solid var(--accent);
  padding: .85rem 1rem 1rem;
}
.gf-card2-badge {
  align-self: flex-start;
  background: var(--accent);
  color: var(--on-primary);
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 999px;
}

.gf-card2-custom { border-style: dashed; }
.gf-card2-custom.active {
  background: transparent;
  border-color: var(--accent);
}
.gf-card2-custom.active .gf-card2-name,
.gf-card2-custom.active .gf-card2-value { color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: .9rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #04262d;
  cursor: pointer;
}
.btn-primary:active { opacity: .85; }

/* ---- Assistant à étapes (wizard) ---- */
.wizard-progress { margin-bottom: 1rem; }

.wizard-icons {
  display: flex;
  justify-content: space-between;
  margin-bottom: .5rem;
  padding: 0 .1rem;
}
.wizard-icon {
  font-size: 1.3rem;
  opacity: .3;
  filter: grayscale(1);
  transform: scale(0.9);
  transition: opacity .25s ease, filter .25s ease, transform .25s ease;
  background: none;
  border: none;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.wizard-icon:active { transform: scale(1.05); }
.wizard-icon.is-active { opacity: 1; filter: none; transform: scale(1.2); }
.wizard-icon.is-done { opacity: .75; filter: none; transform: scale(1); }

.wizard-track {
  height: 6px;
  border-radius: 999px;
  background: var(--meter-track);
  overflow: hidden;
}
.wizard-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--chart-path), var(--accent));
  transition: width .35s ease;
}
.wizard-label {
  text-align: center;
  font-size: .88rem;
  font-weight: 700;
  color: var(--primary);
  margin: .5rem 0 0;
}

.wizard-viewport { overflow: hidden; }

.wizard-step.slide-next { animation: wizard-slide-next .3s ease; }
.wizard-step.slide-back { animation: wizard-slide-back .3s ease; }
@keyframes wizard-slide-next {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes wizard-slide-back {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}

.wizard-nav {
  display: flex;
  gap: .6rem;
  margin-top: .25rem;
}
.wizard-nav .btn-primary,
.wizard-nav .btn-secondary { flex: 1; margin: 0; }

.btn-reset {
  display: block;
  width: 100%;
  margin-top: .75rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-text);
  border-radius: 10px;
  color: var(--danger-text);
  font-weight: 600;
  font-size: .85rem;
  padding: .6rem;
  cursor: pointer;
}
.btn-reset:active { opacity: .7; }

.warnings {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.warnings p { margin: .25rem 0; }

.results h2 { margin-top: 0; color: var(--primary); }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.result-tile {
  background: var(--tile-bg);
  border-radius: 10px;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.result-label {
  font-size: .78rem;
  color: var(--text-muted);
}
.result-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.gps-row {
  margin-top: 1rem;
  font-size: .95rem;
}

.stops-detail { margin-top: 1rem; }
.stops-detail table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stops-detail th, .stops-detail td {
  text-align: left;
  padding: .4rem .3rem;
  border-bottom: 1px solid var(--border);
}

.pressure-detail {
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--text-muted);
  white-space: pre-line;
}

/* ---- Écrans (formulaire / résultats) ---- */
.screen { animation: screen-in .25s ease; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  padding: .55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:active { opacity: .8; }

.btn-adjust-reserve {
  display: block;
  width: 100%;
  margin-top: .75rem;
  white-space: normal;
  line-height: 1.3;
}

.recap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.results-actions {
  display: flex;
  gap: .5rem;
  width: 100%;
  flex-wrap: wrap;
}
.results-actions .btn-secondary,
.results-actions .btn-new { flex: 1 1 120px; }
.btn-new {
  display: block;
  width: auto;
  margin-top: 0;
}
.recap-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  font-size: .82rem;
}
.recap-row span {
  background: var(--tile-bg);
  color: var(--text-muted);
  border-radius: 8px;
  padding: .3rem .6rem;
}
.recap-row span:empty { display: none; }

/* ---- Onglets de l'écran résultats ---- */
.results-tabs {
  display: flex;
  gap: .4rem;
  margin: 1rem 0;
}
.results-tab {
  flex: 1;
  padding: .7rem .5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
}
.results-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.results-tab-panel > .results:first-child { margin-top: 0; }

/* ---- Profil de plongée (SVG) ---- */
.profile-chart { margin-top: 1.25rem; }
.profile-svg { width: 100%; height: auto; display: block; }
.profile-baseline { stroke: var(--border); stroke-width: 1; }
.profile-grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2.5 3; opacity: .7; }
.profile-axis-label {
  font-size: 9.5px;
  fill: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* Profondeur max : mise en évidence sur l'échelle (trait plein + texte gras, couleur
   accent) pour se distinguer des graduations rondes habituelles, recessives. */
.profile-grid-line-max { stroke: var(--accent); stroke-width: 1.2; opacity: .8; }
.profile-axis-label-max {
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* Étiquette "à côté" du temps de décollage, reliée par une courte ligne de rappel
   plutôt que posée dessus ou en bulle. */
.profile-callout-line { stroke-width: 1.2; opacity: .6; }
.profile-callout-line-path { stroke: var(--chart-path); }
.profile-callout-text {
  font-size: 11px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  paint-order: stroke fill;
  stroke: var(--chart-surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.profile-callout-text-path { fill: var(--chart-path); }
.profile-area { fill: url(#profileAreaGrad); stroke: none; }
.profile-grad-start { stop-color: var(--chart-path); stop-opacity: .3; }
.profile-grad-end { stop-color: var(--chart-path); stop-opacity: 0; }
.profile-path-seg { stroke: var(--chart-path); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.profile-stop-seg { stroke: var(--chart-stop); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.profile-dot { fill: var(--chart-path); stroke: var(--chart-surface); stroke-width: 2; }
.profile-stop-dot { fill: var(--chart-stop); stroke: var(--chart-surface); stroke-width: 1.5; }
.profile-label {
  font-size: 12px;
  fill: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* halo derrière le texte : évite que la ligne du profil "coupe" les infos affichées dessus */
  paint-order: stroke fill;
  stroke: var(--chart-surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* ---- Repères interactifs (tap → popup avec le détail) ---- */
.profile-hit { cursor: pointer; }
.profile-hit-target { fill: transparent; stroke: none; }
.profile-hit-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 2.5 2.5;
  opacity: .55;
}
.profile-hit.is-active .profile-hit-ring {
  opacity: 1;
  stroke-dasharray: none;
}
.profile-hint {
  margin: .5rem 0 0;
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
}
.profile-popup {
  position: relative;
  margin-top: .6rem;
  padding: .7rem 2.2rem .7rem .9rem;
  border-radius: 12px;
  background: var(--tile-bg);
  border: 1px solid var(--border);
}
.profile-popup-title { margin: 0; font-weight: 700; color: var(--text); font-size: .92rem; }
.profile-popup-detail { margin: .2rem 0 0; color: var(--text-muted); font-size: .85rem; }
.profile-popup-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
}

/* ---- Répartition des temps (descente / fond / remontée+paliers) ---- */
.profile-time-breakdown { margin-top: 1rem; }
.ptb-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border);
}
.ptb-seg { flex-shrink: 0; flex-basis: 0; height: 100%; }
.ptb-seg-descent { background: var(--time-descent); }
.ptb-seg-bottom { background: var(--chart-path); }
.ptb-seg-ascent { background: var(--chart-stop); }

.ptb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-top: .65rem;
}
.ptb-item {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.ptb-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.ptb-dot-descent { background: var(--time-descent); }
.ptb-dot-bottom { background: var(--chart-path); }
.ptb-dot-ascent { background: var(--chart-stop); }
.ptb-item-label { font-size: .82rem; color: var(--text-muted); }
.ptb-item-value { font-size: .95rem; font-weight: 700; color: var(--text); }

/* ---- Bouteille : budget gaz ---- */
.results h3 { margin: 1.25rem 0 .5rem; font-size: 1rem; color: var(--primary); }

.bottle-widget {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.bottle-graphic { flex: 0 0 auto; width: 90px; }
.bottle-svg { width: 90px; height: auto; display: block; }
.bottle-valve, .bottle-neck { fill: var(--text-muted); opacity: .5; }
.bottle-empty { fill: var(--meter-track); }
.bottle-outline { fill: none; stroke: var(--text-muted); stroke-opacity: .35; stroke-width: 2; }

.bottle-descent { fill: var(--chart-path); }
.bottle-exploration { fill: var(--status-good); }
.bottle-dtr { fill: var(--chart-stop); }
.bottle-reserve { fill: var(--status-critical); }
.bottle-used { fill: var(--meter-track); opacity: .8; }
.bottle-remain-ok { fill: var(--status-good); }
.bottle-remain-low { fill: var(--status-critical); }

.reserve-line { stroke: var(--danger-text); stroke-width: 2; stroke-dasharray: 3 3; }
.reserve-label { font-size: 9px; fill: var(--danger-text); font-weight: 700; }

.bottle-legend { flex: 1 1 auto; min-width: 0; }
.bottle-legend-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--border);
}
.bottle-legend-row:last-of-type { border-bottom: none; }
.bottle-legend-label { flex: 1 1 auto; color: var(--text-muted); }
.bottle-legend-value { color: var(--text); white-space: nowrap; }
.bottle-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.bottle-swatch.bottle-descent { background: var(--chart-path); }
.bottle-swatch.bottle-exploration { background: var(--status-good); }
.bottle-swatch.bottle-dtr { background: var(--chart-stop); }
.bottle-swatch.bottle-reserve { background: var(--status-critical); }
.bottle-swatch.bottle-used { background: var(--meter-track); border: 1px solid var(--border); }
.bottle-swatch.bottle-remain-ok { background: var(--status-good); }
.bottle-swatch.bottle-remain-low { background: var(--status-critical); }

.bottle-legend-total {
  margin-top: .4rem;
  font-size: .75rem;
  color: var(--text-muted);
}

.meter-overflow {
  margin-top: .6rem;
  font-size: .78rem;
  color: var(--danger-text);
  background: var(--danger-bg);
  border-radius: 8px;
  padding: .4rem .6rem;
}

.meter-overflow-like {
  font-size: .9rem;
  font-weight: 600;
  border-radius: 10px;
  padding: .7rem .85rem;
  line-height: 1.4;
}
.status-good-box { background: rgba(12, 163, 12, 0.12); color: var(--status-good); }
.status-critical-box { background: rgba(208, 59, 59, 0.12); color: var(--status-critical); }

.app-footer {
  max-width: 560px;
  margin: 1rem auto 0;
  padding: 0 1rem;
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
}
