.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  background: #ffcc00;
  color: #000;
  text-align: center;
  font-weight: 600;
  padding: 0.75rem;

  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.offline-banner.hidden {
  display: none;
}

.burger-nav {
  position: relative;
}

#burger-toggle {
  font-size: 1.5rem;
}

#burger-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  list-style: none;
  padding: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.hidden {
  display: none;
}

/* Container principal */
.calendar {
  padding: 1rem;
}

/* Boutons "Voir avant / Voir après" */
.calendar-nav {
  display: block;
  width: 100%;
  padding: 0.6rem;
  margin: 0.5rem 0;
  border: 1px solid #0d6efd;
  border-radius: 6px;
  background: #fff;
  color: #0d6efd;
  font-weight: 600;
  cursor: pointer;
}

.calendar-nav:hover {
  background: #0d6efd;
  color: #fff;
}

/* Une journée */
.calendar-day {
  margin-bottom: 1.5rem;
}

/* Date */
.calendar-date {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
  border-left: 4px solid #0d6efd;
}

/* Liste d'événements */
.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Un événement */
.event {
  display: grid;
  grid-template-columns: 3.5rem 2.5rem 1fr;
  /*align-items: center; */
  align-items: stretch; /* IMPORTANT pour que les colonnes prennent toute la hauteur */

  background: #fff;
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;

  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-left: 4px solid #e9ecef;
  cursor: pointer;
}
/* Heure */
.event-time {
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;

  background-color: #9fedff; /* fond bleu clair */
  display: flex;             /* pour centrer le texte verticalement */
  align-items: center;
  justify-content: center;   /* centre horizontalement si tu veux */
  border-radius: 6px 0 0 6px; /* optionnel : arrondi côté gauche */
  height: 100%;              /* prend toute la hauteur de la ligne */
}

.event-icon.bike ~ .event-details { border-left-color: #198754; }

.event.past {
  opacity: 0.6;
}



/* Icône */
.event-icon {
  font-size: 1.6rem;
  text-align: center;
}

/* Variantes par sport */
.event-icon.bike { color: #198754; }
.event-icon.run  { color: #dc3545; }
.event-icon.swim { color: #0dcaf0; }

/* Détails */
.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Titre */
.event-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #222;
  display: flex;
  align-items: center; /* centre verticalement tous les éléments */
  gap: 8px; /* espace entre les éléments */
}

.event-title img {
  height: 24px;   /* hauteur identique pour les 2 logos */
  width: auto;    /* conserve les proportions */
}

/* Durée */
.event-duration {
  font-size: 0.8rem;
  color: #777;
}

.discipline-1 {
  background-color: #9fedff;
}
.discipline-2 {
  background-color: #ff787c;
}
.discipline-3 {
  background-color: #ffdd00;
}
.discipline-4 {
  background-color: #dddddd;
}
.discipline-5 {
  background-color: #27ca11;
}
.discipline-7 {
  background-color: #ffdd00;
}
.discipline-8 {
  background-color: #27ca11;
}
.discipline-1-light {
  background-color: #cff6ff;
}
.discipline-2-light {
  background-color: #ffbcbe;
}
.discipline-3-light {
  background-color: #ffee80;
}
.discipline-4-light {
  background-color: #eeeeee;
}
.discipline-5-light {
  background-color: #27ca11;
}
.discipline-7-light {
  background-color: #ffee80;
}
.discipline-8-light {
  background-color: #27ca11;
}

.effort-badge {
  color: black;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  display: inline-block;
}
.effort-1 {
  background-color: #99afd6;
}
.effort-2 {
  background-color: #92d650;
}
.effort-3 {
  background-color: #92d650;
}
.effort-4 {
  background-color: #faff35;
}
.effort-5 {
  background-color: #faff35;
}
.effort-6 {
  background-color: #f7c31d;
}
.effort-7 {
  background-color: #f7c31d;
}
.effort-8 {
  background-color: #f40024;
  color: white;
}
.effort-9 {
  background-color: #f40024;
  color: white;
}
.effort-10 {
  background-color: #c3001e;
  color: white;
}


.context-menu {
  position: fixed;
  z-index: 2000;

  background: #fff;
  border-radius: 12px;
  padding: 0.5rem 0;

  width: 220px;

  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.context-menu.hidden {
  display: none;
}

.context-menu button {
  width: 100%;
  padding: 0.75rem 1rem;

  background: none;
  border: none;
  text-align: left;

  font-size: 0.95rem;
}

.context-menu button:active {
  background: #f1f3f5;
}

:root {
  --bg: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --planned: #2563eb;
  --actual: #16a34a;
}

body {
  font-family: system-ui, sans-serif;
  background: #f9fafb;
  margin: 0;
  padding: 1rem;
  color: var(--text);
}


/* see training v1 */
/*
.card {
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  max-width: 600px;
  margin: auto;
}

.title {
  margin-bottom: 1rem;
}

.common {
  margin-bottom: 1rem;
}

.common .label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.common .value {
  font-weight: 500;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.header:nth-child(2) {
  color: var(--planned);
}

.header:nth-child(3) {
  color: var(--actual);
}

.label {
  font-weight: 500;
}

.comparison div {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 480px) {
  .comparison {
    grid-template-columns: 1fr;
  }

  .comparison .header {
    display: none;
  }

  .comparison .label {
    margin-top: 0.75rem;
    font-size: 0.9rem;
  }

  .comparison div:nth-child(3n+2)::before {
    content: "Prévu: ";
    color: var(--planned);
    font-weight: 500;
  }

  .comparison div:nth-child(3n+3)::before {
    content: "Réalisé: ";
    color: var(--actual);
    font-weight: 500;
  }
}
*/
/* see training v2, iOS like */
/*
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #111;
  --muted: #8e8e93;

  --planned: #0a84ff;
  --actual: #30d158;

  --positive: #34c759;
  --negative: #ff453a;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

.screen {
  padding: 16px;
  max-width: 500px;
  margin: auto;
}

.header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.subtitle {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.row {
  padding: 12px 8px;
}

.row + .row {
  border-top: 1px solid #eee;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 500;
}

.values {
  display: flex;
  gap: 8px;
}

.values.text {
  flex-direction: column;
  gap: 4px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.planned {
  background: rgba(10,132,255,0.1);
  color: var(--planned);
}

.actual {
  background: rgba(48,209,88,0.1);
  color: var(--actual);
}

.delta {
  font-size: 0.8rem;
  font-weight: 600;
}

.delta.positive {
  color: var(--positive);
}

.delta.negative {
  color: var(--negative);
}
*/


/* see training v3, 2 colonnes */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #111;
  --muted: #8e8e93;

  --planned: #0a84ff;
  --actual: #ea632d;
  /*--actual: #30d158;*/

  --positive: #34c759;
  --negative: #ff453a;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

.screen {
  padding: 16px;
  max-width: 500px;
  margin: auto;
}

.header h1 {
  margin: 0;
  font-size: 1.4rem;
}


h2 {
  margin: 0;
  font-size: 1.2rem;
}

.subtitle {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 8px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ITEM */

.item {
  padding: 12px 16px;
}

.item + .item {
  border-top: 1px solid #eee;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.label {
  font-weight: 600;
}

/* BLOCKS */

.block {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

.block .tag {
  font-size: 0.75rem;
  margin-bottom: 2px;
  font-weight: 600;
}

.block .value {
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.value textarea {
  width: 100%;
  box-sizing: border-box;
}

.value.duration {
  display: flex;
  align-items: center;
  gap: 6px;
}

.value.duration input {
  width: 60px;
  text-align: center;
  font-size: 0.8rem;
}

.value.distance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.distance-input {
  width: 120px;
}

.provider-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  vertical-align: super;
}

/* Bouton flottant "Nouvel entraînement" */
.fab-add {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--planned);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-add:hover {
  background: #1d4ed8;
}

.fab-add:active {
  transform: translateY(1px);
}

.fab-add:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

/* Sélecteur de discipline (ouvert au clic sur le FAB) */
.discipline-picker {
  position: fixed;
  right: 20px;
  bottom: calc(88px + env(safe-area-inset-bottom)); /* au-dessus du FAB */
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.discipline-picker.hidden {
  display: none;
}

.discipline-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.discipline-option:hover {
  background: #f1f3f5;
}

.discipline-option img {
  height: 28px;
}

.provider-id {
  font-size: 0.7rem;
  color: #666;
  margin-left: 2px;
  vertical-align: middle;
}

.title-input {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  padding: 0.2em 0.4em;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.copy-planned-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--planned);
  border-radius: 8px;
  background: #fff;
  color: var(--planned);
  font-size: 0.85rem;
  cursor: pointer;
}

.copy-planned-btn:hover {
  background: var(--planned);
  color: #fff;
}

.date-fr {
  width: 120px;
}

.time-fr {
  width: 80px;
}

/* Choix des sensations (smileys radio) */
.feeling-choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feeling-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.feeling-option img {
  height: 40px;
  cursor: pointer;
  opacity: 0.4;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 2px;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.feeling-option:hover img {
  opacity: 0.8;
}

.feeling-option input:checked + img {
  opacity: 1;
  border-color: var(--actual);
}

.feeling-option input:focus-visible + img {
  outline: 3px solid rgba(234, 99, 45, 0.4);
  outline-offset: 2px;
}

.save-bar {
  position: sticky;
  bottom: 0;

  padding: 12px;
  background: var(--bg-color);

  border-top: 1px solid #ddd;
}

.save-bar {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.save-button {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--planned);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
  transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.save-button:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.save-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.4);
}

.save-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.save-button:disabled {
  background: #9ab7f0;
  box-shadow: none;
  cursor: not-allowed;
}

.realize-button {
  width: 100%;
  margin-bottom: 8px;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--actual);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(234, 99, 45, 0.35);
  transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.realize-button:hover {
  background: #d2541f;
  box-shadow: 0 4px 12px rgba(234, 99, 45, 0.45);
}

.realize-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(234, 99, 45, 0.4);
}

.realize-button:focus-visible {
  outline: 3px solid rgba(234, 99, 45, 0.4);
  outline-offset: 2px;
}

/* COLORS */

.planned {
  background: rgba(10,132,255,0.08);
}

.planned .tag {
  color: var(--planned);
}

.actual {
  /*background: rgba(48,209,88,0.08);*/
  background: rgba(234,99,45,0.08);
}

.actual .tag {
  color: var(--actual);
}

/* DELTA */

.delta {
  font-size: 0.8rem;
  font-weight: 600;
}

.delta.positive {
  color: var(--positive);
}

.delta.negative {
  color: var(--negative);
}