/* ============================================================
   Application mobile « Soléna » (Hotwire Native)
   Chargée avec les autres feuilles : toutes les règles sont
   limitées à body.mobile pour ne pas toucher au site web.
   ============================================================ */

body.mobile {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface-page);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* Zones sûres : encoche, barre d'état et indicateur d'accueil. */
body.mobile .mobile-main {
  padding:
    calc(16px + env(safe-area-inset-top, 0px))
    calc(16px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(16px + env(safe-area-inset-left, 0px));
}

/* Contenu de l'écran (Turbo Frame « mobile-screen ») : estompé pendant le chargement
   d'un autre jour ou d'une autre période, après un court délai pour éviter le clignotement. */
body.mobile .mobile-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity .15s;
}
body.mobile .mobile-screen[busy] { opacity: .55; transition-delay: .15s; }

/* Dans l'app, la barre de navigation native couvre déjà la zone du haut. */
body.mobile--native .mobile-main { padding-top: 16px; }
/* Titre de page repris par la barre de navigation native : affiché seulement hors de l'app. */
body.mobile--native .m-title-dup { display: none; }

body.mobile .mobile-header h1 { font-size: var(--fs-h3); }

/* Bouton de barre de navigation : remplacé par le bouton natif quand l'app gère « nav-button ». */
[data-bridge-components~="nav-button"] body.mobile [data-controller~="bridge--nav-button"] { display: none; }

/* ---------- Connexion (maquette « 01 Connexion ») et carte biométrie ---------- */

body.mobile-auth {
  display: flex;
  flex-direction: column;
  background: var(--gradient-hero);
}

body.mobile-auth .mobile-auth__hero {
  flex: 0 0 auto;
  min-height: 300px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 24px 0;
}

body.mobile-auth .mobile-auth__hero img { width: 190px; height: auto; display: block; }

body.mobile-auth .mobile-auth__eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--leaf-100);
}

body.mobile-auth .mobile-auth__sheet {
  flex: 1 0 auto;
  background: var(--surface-card);
  border-radius: 28px 28px 0 0;
  padding: 28px calc(24px + env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-base, .2s) var(--ease-out, ease-out);
}

body.mobile-auth .btn { height: 52px; }

body.mobile-auth .mobile-auth__form { flex: 1; display: flex; flex-direction: column; gap: 18px; }
body.mobile-auth .mobile-auth__form h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: var(--ls-tight);
  color: var(--text-strong);
}
body.mobile-auth .field__control input { font-size: 16px; } /* 16 px : pas de zoom automatique sous iOS */

body.mobile-auth .mobile-auth__forgot {
  align-self: flex-start;
  min-height: 44px;
  font-size: 15px;
}

body.mobile-auth .mobile-auth__sent {
  font-size: 14px;
  line-height: 1.45;
  color: var(--forest-700);
  background: var(--leaf-100);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

body.mobile-auth .mobile-auth__submit { margin-top: auto; }

/* Carte « Se connecter plus vite ? » : la feuille monte quand le natif confirme la compatibilité. */
body.mobile-auth .mobile-auth__hero:has(+ .mobile-auth__sheet .biometrics-offer) { flex-grow: 1; }
body.mobile-auth .mobile-auth__sheet:has(> .biometrics-offer) { flex-grow: 0; padding-top: 12px; }
body.mobile-auth .mobile-auth__sheet:has(> .biometrics-offer[hidden]) { transform: translateY(100%); }
body.mobile-auth .mobile-auth__sheet:has(> .biometrics-offer)::before {
  content: "";
  align-self: center;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--neutral-300);
}

body.mobile-auth .biometrics-offer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
body.mobile-auth .biometrics-offer[hidden] { display: flex; visibility: hidden; }

body.mobile-auth .biometrics-offer__icon {
  width: 64px;
  height: 64px;
  margin-top: 24px;
  border-radius: var(--radius-lg);
  background: var(--leaf-100);
  color: var(--forest-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.mobile-auth .biometrics-offer__icon svg[hidden] { display: none; }

body.mobile-auth .biometrics-offer h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--text-strong);
}

body.mobile-auth .biometrics-offer p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

body.mobile-auth .biometrics-offer__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- Production (maquette « 02 Production ») et fiche centrale (« 03 Fiche centrale ») ---------- */

body.mobile .m-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

body.mobile .m-hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
body.mobile .m-hello__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.mobile .m-hello h1,
body.mobile .m-fiche h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: var(--ls-tight);
  color: var(--text-strong);
  line-height: 1.15;
}
body.mobile .m-hello__sub,
body.mobile .m-fiche__sub { font-size: 14px; color: var(--text-muted); }

body.mobile .m-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--forest-700);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

body.mobile .m-fiche { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
body.mobile .m-fiche__top { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.mobile .m-fiche__top .m-avatar { margin-left: auto; }
body.mobile .m-fiche__badges,
body.mobile .m-plant__badges { display: flex; flex-wrap: wrap; gap: 6px; }
body.mobile .m-back {
  min-height: 44px;
  margin-left: -8px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--forest-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

/* Bannière d'alerte critique */
body.mobile .m-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #f0b6ad;
  border-radius: var(--radius-md);
  background: #fae4e0;
  color: var(--neutral-700);
  text-decoration: none;
}
body.mobile .m-banner__icon { flex: none; color: var(--danger-500); }
body.mobile .m-banner__chevron { flex: none; color: var(--neutral-500); }
body.mobile .m-banner__text { flex: 1; font-size: 14px; line-height: 1.4; }
body.mobile .m-banner__text strong { color: var(--text-strong); }

/* Sélecteurs segmentés (période, métrique) */
body.mobile .m-period { display: flex; flex-direction: column; gap: 10px; }
body.mobile .m-segmented {
  display: flex;
  padding: 2px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}
body.mobile .m-segmented--period { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.mobile .m-segmented--metric { flex: none; background: var(--surface-page); }
body.mobile .m-segmented__item {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}
body.mobile .m-segmented--metric .m-segmented__item { font-size: 13px; }
body.mobile .m-segmented__item.is-active { background: var(--forest-700); color: #fff; }

body.mobile .m-datenav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; }
body.mobile .m-datenav__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest-700);
}
body.mobile .m-datenav__btn.is-disabled { opacity: .35; }
body.mobile .m-datenav__center { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
body.mobile .m-datenav__label { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text-strong); }
body.mobile .m-datenav__trigger {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; max-width: 100%; padding: 4px 10px;
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-strong); cursor: pointer; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
body.mobile .m-datenav__trigger.is-open { background: var(--leaf-100); }
body.mobile .m-datenav__trigger svg { opacity: .6; flex: none; }
body.mobile .date-menu__day { height: 40px; }
body.mobile .date-menu__select { font-size: 16px; }
body.mobile .m-datenav__sub { font-size: 12px; color: var(--text-muted); }

/* KPI empilés */
body.mobile .m-kpis { display: flex; flex-direction: column; }
body.mobile .m-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
body.mobile .m-kpi:last-child { border-bottom: 0; }
body.mobile .m-kpi__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.mobile .m-kpi__label { font-size: 14px; color: var(--text-muted); }
body.mobile .m-kpi__sub { font-size: 12px; color: var(--leaf-600); }
body.mobile .m-kpi__figure { white-space: nowrap; }
body.mobile .m-kpi__value { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--forest-700); letter-spacing: -0.01em; }
body.mobile .m-kpi__unit { font-size: 14px; font-weight: 600; color: var(--neutral-600); }

/* Graphique */
body.mobile .m-chart { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
body.mobile .m-chart__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
body.mobile .m-chart h2,
body.mobile .m-section h2,
body.mobile .m-plants h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: normal;
  color: var(--text-strong);
}
body.mobile .m-chart__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--neutral-600); }
body.mobile .m-chart__legend > span { display: flex; align-items: center; gap: 6px; }
body.mobile .m-chart__swatch { width: 12px; border-radius: 2px; }

body.mobile .m-chart__grid { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 6px; row-gap: 4px; }
body.mobile .m-chart--spot .m-chart__grid { grid-template-columns: 44px minmax(0, 1fr) 36px; }
body.mobile .m-chart__axis { position: relative; height: 180px; }
body.mobile .m-chart__tick {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
body.mobile .m-chart__axis--right .m-chart__tick { right: auto; left: 0; color: var(--forest-900); }

body.mobile .m-chart__plot {
  position: relative;
  height: 180px;
  min-width: 0;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.mobile .m-chart__line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border-subtle); }
body.mobile .m-chart__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
body.mobile .m-chart__bars { position: absolute; inset: 0; display: flex; pointer-events: none; }
body.mobile .m-chart__bar {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 3px;
}
body.mobile .m-chart__bar.is-active { background: var(--surface-sunken); }
body.mobile .m-chart__seg { display: block; flex: none; }
body.mobile .m-chart__seg:last-child { border-radius: 3px 3px 0 0; }
body.mobile .m-chart__bar--missing::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--neutral-300);
}

body.mobile .m-chart__cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--forest-700); opacity: .5; pointer-events: none; }
body.mobile .m-chart__dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid;
  box-sizing: border-box;
  transform: translate(-50%, 50%);
  pointer-events: none;
}
body.mobile .m-chart__tip {
  position: absolute;
  top: 0;
  z-index: 2;
  min-width: 150px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}
body.mobile .m-chart__tip[hidden],
body.mobile .m-chart__cursor[hidden],
body.mobile .m-chart__dot[hidden] { display: none; }
body.mobile .m-chart__tip-title { font-size: 12px; font-weight: 700; color: var(--text-strong); white-space: nowrap; }
body.mobile .m-chart__tip-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-body); white-space: nowrap; }
body.mobile .m-chart__tip-row > span:nth-child(2) { flex: 1; color: var(--text-muted); }
body.mobile .m-chart__tip-row strong { color: var(--text-strong); white-space: nowrap; }
body.mobile .m-chart__tip-swatch { flex: none; width: 8px; height: 8px; border-radius: 50%; }

body.mobile .m-chart__x { display: flex; height: 16px; font-size: 10px; color: var(--text-muted); }
body.mobile .m-chart__x span { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: visible; }
body.mobile .m-chart__x span[style*="center"] { display: flex; justify-content: center; }
body.mobile .m-chart__hint { margin: 0; font-size: 12px; color: var(--text-muted); }

/* Mes centrales */
body.mobile .m-plants { display: flex; flex-direction: column; gap: 12px; }
body.mobile .m-plants h2 { margin-top: 4px; }
body.mobile .m-plant {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
body.mobile .m-plant:active { transform: translateY(1px); }
body.mobile .m-plant__head { display: flex; align-items: flex-start; gap: 12px; }
body.mobile .m-plant__id { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
body.mobile .m-plant__name { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--text-strong); }
body.mobile .m-plant__place { font-size: 13px; color: var(--text-muted); }
body.mobile .m-plant__chevron { flex: none; margin-top: 30px; color: var(--neutral-400); }
body.mobile .m-plant__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.mobile .m-stat { background: var(--surface-page); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
body.mobile .m-stat__label { font-size: 12px; color: var(--text-muted); }
body.mobile .m-stat__value { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--forest-700); white-space: nowrap; }

/* Sections de la fiche : contrats, statut Enedis */
body.mobile .m-section { padding: 16px; display: flex; flex-direction: column; }
body.mobile .m-section h2 { margin-bottom: 8px; }
body.mobile .m-section__empty,
body.mobile .m-section__note { margin: 0; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-muted); }
body.mobile p.m-card.m-section__empty { padding: 16px; border: 1px solid var(--border-subtle); }
body.mobile .m-contract { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
body.mobile .m-contract__head,
body.mobile .m-row__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.mobile .m-contract__ref { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-strong); }
body.mobile .m-contract__label { font-size: 14px; color: var(--text-body); }
body.mobile .m-contract__foot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-muted); }
body.mobile .m-contract__foot strong { color: var(--forest-700); white-space: nowrap; }
body.mobile .m-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
body.mobile .m-row__label { font-size: 13px; color: var(--text-muted); }
body.mobile .m-row__value { font-size: 15px; font-weight: 600; color: var(--text-strong); }

/* ---------- Prix spot (maquette « 04 Prix spot ») ---------- */

body.mobile .m-spot__head { display: flex; flex-direction: column; gap: 8px; }
body.mobile .m-spot__badge { display: flex; justify-content: center; }

body.mobile .m-spot-pending {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  box-shadow: none;
}
body.mobile .m-spot-pending__icon,
body.mobile .m-alerts-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--leaf-100);
  color: var(--forest-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.mobile .m-spot-pending__title { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--text-strong); text-wrap: balance; }
body.mobile .m-spot-pending a { min-height: 44px; display: flex; align-items: center; font-size: 15px; font-weight: 600; }

body.mobile .m-spot-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fae4e0;
  border: 1px solid #f0b6ad;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.45;
  color: var(--neutral-700);
  text-wrap: pretty;
}
body.mobile .m-spot-alert__icon { flex: none; margin-top: 1px; color: var(--danger-500); }
body.mobile .m-spot-alert strong { color: var(--text-strong); }

body.mobile .m-spot-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.mobile .m-spot-kpi { padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
body.mobile .m-spot-kpi__figure { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 4px; }
body.mobile .m-spot-kpi__value { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; color: var(--forest-700); white-space: nowrap; }
body.mobile .m-spot-kpi__unit { font-size: 12px; font-weight: 700; color: var(--forest-700); }
body.mobile .m-spot-kpi__label { font-size: 13px; font-weight: 600; color: var(--text-strong); }
body.mobile .m-spot-kpi__trend { font-size: 12px; min-height: 16px; color: var(--leaf-600); }
body.mobile .m-spot-kpi--leaf .m-spot-kpi__unit { color: var(--leaf-500); }
body.mobile .m-spot-kpi--sun .m-spot-kpi__unit { color: var(--sun-500); }
body.mobile .m-spot-kpi--danger .m-spot-kpi__unit { color: var(--danger-500); }
body.mobile .m-spot-kpi--danger .m-spot-kpi__trend { color: #a5271a; }
body.mobile .m-spot-kpi--empty .m-spot-kpi__value { color: var(--neutral-400); }
body.mobile .m-spot-kpi--empty .m-spot-kpi__trend { color: var(--text-muted); }

body.mobile .m-spot-chart__head { display: flex; flex-direction: column; gap: 2px; }
body.mobile .m-chart__sub { font-size: 12px; color: var(--text-muted); }
body.mobile .m-spot-chart__grid { grid-template-columns: 30px minmax(0, 1fr); }
body.mobile .m-spot-chart .m-chart__axis,
body.mobile .m-spot-chart .m-chart__plot { height: 200px; }
body.mobile .m-spot-chart__zero { position: absolute; left: 0; right: 0; border-top: 1px solid var(--neutral-400); }
body.mobile .m-spot-chart__bars { position: absolute; inset: 0; display: flex; gap: 1px; pointer-events: none; }
body.mobile .m-spot-chart__bar { flex: 1 1 0; min-width: 0; position: relative; }
body.mobile .m-spot-chart__bar.is-active { background: var(--surface-sunken); }
body.mobile .m-spot-chart__bar > span { position: absolute; left: 0; right: 0; min-height: 1px; background: var(--forest-700); border-radius: 1px 1px 0 0; }
body.mobile .m-spot-chart__bar.is-negative > span { background: var(--danger-500); border-radius: 0 0 1px 1px; }
body.mobile .m-spot-chart__x { position: relative; display: block; }
body.mobile .m-spot-chart__x span { position: absolute; top: 0; }
body.mobile .m-chart__tip-value { font-family: var(--font-display); font-size: 16px; color: var(--text-strong); white-space: nowrap; }
body.mobile .m-chart__tip-value.is-negative { color: #a5271a; }
body.mobile .m-spot-chart .m-chart__tip { min-width: 0; }
body.mobile .m-spot-chart .m-chart__tip-title { font-weight: 400; color: var(--text-muted); }

body.mobile .m-spot-table { padding: 4px 16px; }
body.mobile .m-spot-table summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  cursor: pointer;
  list-style: none;
}
body.mobile .m-spot-table summary::-webkit-details-marker { display: none; }
body.mobile .m-spot-table__heading { display: flex; flex-direction: column; gap: 2px; }
body.mobile .m-spot-table__title { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text-strong); }
body.mobile .m-spot-table__sub { font-size: 12px; color: var(--text-muted); }
body.mobile .m-spot-table__chevron { flex: none; color: var(--forest-700); transition: transform var(--dur-base, .2s) var(--ease-out, ease-out); }
body.mobile .m-spot-table[open] .m-spot-table__chevron { transform: rotate(180deg); }
body.mobile .m-spot-table__grid { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; }
body.mobile .m-spot-table__head,
body.mobile .m-spot-table__row { display: grid; grid-template-columns: 40px repeat(4, minmax(0, 1fr)); gap: 2px; align-items: center; }
body.mobile .m-spot-table__head {
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
body.mobile .m-spot-table__head span { text-align: right; padding: 0 6px; }
body.mobile .m-spot-table__row { font-size: 13px; }
body.mobile .m-spot-table__hour { font-size: 11px; font-weight: 700; color: var(--text-muted); }
body.mobile .m-spot-table__cell { text-align: right; padding: 5px 6px; border-radius: var(--radius-sm); color: var(--text-body); white-space: nowrap; }
body.mobile .m-spot-table__cell.is-negative { background: #f8ded9; color: #a5271a; font-weight: 700; }

body.mobile .m-spot-plants { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
body.mobile .m-spot-plants h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: normal; color: var(--text-strong); }
body.mobile .m-spot-plant { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
body.mobile .m-spot-plant__id { display: flex; align-items: center; gap: 10px; }
body.mobile .m-spot-plant__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
body.mobile .m-spot-plant__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.mobile .m-spot-plant__name { font-family: var(--font-display); font-weight: 600; color: var(--text-strong); }
body.mobile .m-spot-plant__meta { font-size: 12px; color: var(--text-muted); }
body.mobile .m-spot-plant__figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.mobile .m-spot-plant__figure { background: var(--surface-page); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
body.mobile .m-spot-plant__label { font-size: 12px; color: var(--text-muted); }
body.mobile .m-spot-plant__value { font-family: var(--font-display); font-size: 18px; color: var(--forest-700); }
body.mobile .m-spot-plant__unit { font-size: 12px; color: var(--neutral-600); }
body.mobile .m-spot-plants__empty { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ---------- Alertes (maquette « 06 Alertes ») ---------- */

body.mobile .m-alerts__section {
  margin: 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}
body.mobile .m-alerts__section--current { color: var(--leaf-600); }
body.mobile .m-alerts__section:not(.m-alerts__section--current) { margin-top: 8px; }

body.mobile .m-alert { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
body.mobile .m-alert__head { display: flex; align-items: center; gap: 10px; }
body.mobile .m-alert__tile {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.mobile .m-alert__tile--critique { background: #fae4e0; color: var(--danger-500); }
body.mobile .m-alert__tile--surveiller { background: #fdf0d3; color: #8a6410; }
body.mobile .m-alert__tile--information { background: #e8f1f9; color: var(--info-500); }
body.mobile .m-alert__since { margin-left: auto; font-size: 12px; color: var(--text-muted); text-align: right; }
body.mobile .m-alert__context { font-size: 13px; color: var(--text-muted); }
body.mobile .m-alert__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: normal; color: var(--text-strong); }
body.mobile .m-alert__detail { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-body); text-wrap: pretty; }
body.mobile .m-alert__back { padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-muted); }
body.mobile .m-alert__action {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 18px;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-default);
  background: var(--surface-card);
  color: var(--forest-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

body.mobile .m-alerts-empty { padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; box-shadow: none; }
body.mobile .m-alerts-empty__icon { width: 52px; height: 52px; }
body.mobile .m-alerts-empty__title { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--text-strong); }
body.mobile .m-alerts-empty p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); text-wrap: pretty; }

body.mobile .m-resolved { display: flex; flex-direction: column; overflow: hidden; box-shadow: none; }
body.mobile .m-resolved__row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: start;
}
body.mobile .m-resolved__row:last-child { border-bottom: 0; }
body.mobile .m-resolved__icon { color: var(--leaf-500); }
body.mobile .m-resolved__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
body.mobile .m-resolved__what { font-size: 14px; color: var(--text-strong); }
body.mobile .m-resolved__sub { font-size: 12px; line-height: 1.4; color: var(--text-muted); }
body.mobile .m-resolved__when { font-size: 12px; font-weight: 600; color: var(--leaf-600); white-space: nowrap; }
body.mobile .m-resolved__empty { margin: 0; padding: 14px 16px; font-size: 14px; color: var(--text-muted); }

/* ---------- Factures (maquette « 05 Factures » et « 05b Détail facture ») ---------- */

body.mobile .m-chips { margin: 0 -16px; overflow-x: auto; scrollbar-width: none; }
body.mobile .m-chips__row { display: flex; align-items: center; gap: 6px; padding: 0 16px; width: max-content; }
body.mobile .m-chips__sep { flex: none; width: 1px; height: 24px; background: var(--border-default); margin: 0 4px; }
body.mobile .m-chip {
  flex: none;
  height: 36px;
  padding: 0 14px;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-default);
  background: var(--surface-card);
  color: var(--forest-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
}
body.mobile .m-chip.is-active { border-color: var(--forest-700); background: var(--forest-700); color: #fff; }

body.mobile .m-bill-count { font-size: 13px; color: var(--text-muted); }

body.mobile .m-bill-list { display: flex; flex-direction: column; overflow: hidden; }
body.mobile .m-bill-row {
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
body.mobile .m-bill-row:last-child { border-bottom: 0; }
body.mobile .m-bill-row:active { background: var(--surface-page); }
body.mobile .m-bill-row--upcoming { color: inherit; }
body.mobile .m-bill-row__top,
body.mobile .m-bill-row__mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.mobile .m-bill-row__num { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-strong); }
body.mobile .m-bill-row__site { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--text-body); }
body.mobile .m-bill-row__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
body.mobile .m-bill-row__amount { font-size: 15px; color: var(--text-strong); white-space: nowrap; text-align: right; }
body.mobile .m-bill-row__estimated { font-size: 11px; font-weight: 400; color: var(--text-muted); }
body.mobile .m-bill-row__due { font-size: 12px; color: var(--text-muted); }
body.mobile .m-bill-row__due--late { color: #a5271a; }
body.mobile .m-bill-list__empty { padding: 32px 16px; text-align: center; font-size: 14px; color: var(--text-muted); }

body.mobile .m-bill-note { margin: 0; font-size: 12px; color: var(--text-muted); text-align: center; }

/* Détail facture (05b), présentée par le natif comme une modale plein écran. */
body.mobile .m-sheet { display: flex; flex-direction: column; gap: 16px; }
body.mobile .m-sheet__id { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
body.mobile .m-sheet__num { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--text-strong); }
body.mobile .m-sheet__site { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
body.mobile .m-sheet__amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-page);
  border-radius: var(--radius-md);
}
body.mobile .m-sheet__amount-block { display: flex; flex-direction: column; gap: 2px; }
body.mobile .m-sheet__amount-label { font-size: 12px; color: var(--text-muted); }
body.mobile .m-sheet__amount-value { font-family: var(--font-display); font-size: 24px; color: var(--forest-700); }
body.mobile .m-sheet__section-title {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--leaf-600);
}

body.mobile .m-timeline { display: flex; flex-direction: column; }
body.mobile .m-timeline__step { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 12px; }
body.mobile .m-timeline__marker { display: flex; flex-direction: column; align-items: center; }
body.mobile .m-timeline__dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--neutral-300); }
body.mobile .m-timeline__dot--forest { background: var(--forest-600); }
body.mobile .m-timeline__dot--leaf { background: var(--leaf-500); }
body.mobile .m-timeline__dot--sun { background: var(--sun-500); }
body.mobile .m-timeline__dot--danger { background: var(--danger-500); }
body.mobile .m-timeline__line { flex: 1; width: 2px; min-height: 14px; background: var(--border-subtle); }
body.mobile .m-timeline__text { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; }
body.mobile .m-timeline__title { font-size: 14px; font-weight: 600; color: var(--text-strong); }
body.mobile .m-timeline__title--danger { color: #a5271a; }
body.mobile .m-timeline__detail,
body.mobile .m-timeline__link { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }

body.mobile .m-detail-list { display: flex; flex-direction: column; }
body.mobile .m-detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
body.mobile .m-detail-row:last-child { border-bottom: 0; }
body.mobile .m-detail-row span:first-child { color: var(--text-muted); }
body.mobile .m-detail-row span:last-child { color: var(--text-strong); font-weight: 600; text-align: right; }

body.mobile .m-sheet__pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  border-radius: var(--radius-pill);
  background: var(--forest-700);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

/* ---------- Profil (écran 08) ---------- */
body.mobile .m-profile { display: flex; flex-direction: column; gap: 16px; }

body.mobile .m-avatar--lg { width: 56px; height: 56px; font-size: 19px; }

body.mobile .m-profile__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}
body.mobile .m-profile__identity-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.mobile .m-profile__name { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--text-strong); }
body.mobile .m-profile__email { font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }

body.mobile .m-profile__section-title {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--leaf-600);
}

body.mobile .m-profile__list {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}
body.mobile .m-profile__row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.mobile .m-profile__row:last-child { border-bottom: 0; }
body.mobile .m-profile__row-label { font-size: 15px; font-weight: 600; color: var(--text-strong); }
body.mobile .m-profile__row-hint { font-size: 12px; line-height: 1.4; color: var(--text-muted); }
body.mobile .m-profile__channels { display: flex; gap: 18px; }
body.mobile .m-profile__channel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
body.mobile .m-profile__channel .switch { margin-left: 4px; }

body.mobile .m-profile__security {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
/* La règle display: flex ci-dessus prime sur la feuille par défaut du navigateur pour [hidden] :
   la ligne reste masquée tant que le composant bridge n'a pas confirmé la compatibilité. */
body.mobile .m-profile__security[hidden] { display: none; }
/* Section « Sécurité » (titre + ligne) : masquée ensemble tant que le bridge n'a pas répondu. */
body.mobile .m-profile__security-section { display: flex; flex-direction: column; gap: 16px; }
body.mobile .m-profile__security-section[hidden] { display: none; }
body.mobile .m-profile__security-icon { flex: none; color: var(--forest-700); }
/* Idem pour les icônes SVG : la feuille par défaut ne masque pas [hidden] sur un <svg> inline. */
body.mobile .m-profile__security-icon svg[hidden] { display: none; }
body.mobile .m-profile__security-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

body.mobile .m-profile__logout { margin-top: 4px; }

body.mobile .m-profile__version { font-size: 12px; color: var(--text-muted); text-align: center; }
body.mobile .m-profile__version a { color: inherit; }

/* ---------- Onduleurs : section de la fiche (maquette « 03b ») et détail (« 03c ») ---------- */

body.mobile .m-inverters { display: flex; flex-direction: column; gap: 10px; }
body.mobile .m-inverters__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; }
body.mobile .m-inverters__head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text-strong); }
body.mobile .m-inverters__status { font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: right; }
body.mobile .m-inverters__status--stale { color: #a5271a; }

body.mobile .m-inverter {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
body.mobile .m-inverter:active { transform: translateY(1px); }
body.mobile .m-inverter__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.mobile .m-inverter__name { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text-strong); }
body.mobile .m-inverter__badge { display: flex; align-items: center; gap: 6px; }
body.mobile .m-inverter__chevron { flex: none; color: var(--neutral-400); }
body.mobile .m-inverter__power { display: flex; flex-direction: column; gap: 6px; }
body.mobile .m-inverter__power-row,
body.mobile .m-inverter-power__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
body.mobile .m-inverter__value { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--forest-700); }
body.mobile .m-inverter__unit { margin-left: 4px; font-size: 14px; font-weight: 600; color: var(--neutral-600); }
body.mobile .m-inverter__rated { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
body.mobile .m-inverter__gauge { display: block; height: 6px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
body.mobile .m-inverter__gauge > span { display: block; height: 100%; border-radius: var(--radius-pill); }
body.mobile .m-inverter__gauge--large { height: 8px; }
body.mobile .m-inverter__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
body.mobile .m-inverter__stat {
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-page);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.mobile .m-inverter__stat-label { font-size: 11px; line-height: 1.3; color: var(--text-muted); }
body.mobile .m-inverter__stat-value { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--forest-700); white-space: nowrap; }
body.mobile .m-inverter__stat--alert .m-inverter__stat-value { color: #a5271a; }

/* Détail d'un onduleur */
body.mobile .m-inverter-detail__sn { font-size: 13px; color: var(--text-muted); letter-spacing: .02em; }

body.mobile .m-inverter-stale {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #f0b6ad;
  border-radius: var(--radius-md);
  background: #fae4e0;
  color: var(--neutral-700);
  font-size: 14px;
  line-height: 1.45;
}
body.mobile .m-inverter-stale__icon { flex: none; margin-top: 1px; color: var(--danger-500); }
body.mobile .m-inverter-stale strong { color: var(--text-strong); }

body.mobile .m-inverter-power { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
body.mobile .m-inverter-power .m-inverter__stat { padding: 10px; }
body.mobile .m-inverter-power .m-inverter__stat-value { font-size: 15px; }
body.mobile .m-inverter-power__figure { display: flex; flex-direction: column; gap: 6px; }
body.mobile .m-inverter-power__value { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: var(--ls-tight); color: var(--forest-700); }
body.mobile .m-inverter-power__unit { margin-left: 5px; font-size: 15px; font-weight: 600; color: var(--leaf-600); }
body.mobile .m-inverter-power__rated { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
body.mobile .m-inverter-power__note { font-size: 12px; color: var(--text-muted); }

body.mobile .m-inverter-alarms { gap: 10px; }
body.mobile .m-inverter-alarms h2,
body.mobile .m-inverter-iso h2 { margin: 0; }
body.mobile .m-inverter-alarms__none { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
body.mobile .m-inverter-alarms__ok { color: var(--leaf-500); }
body.mobile .m-inverter-alarm {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #f0b6ad;
  border-radius: var(--radius-md);
  background: #fae4e0;
}
body.mobile .m-inverter-alarm__text { font-size: 15px; color: var(--text-strong); }
body.mobile .m-inverter-alarm__since { font-size: 12px; font-weight: 600; color: #a5271a; }

body.mobile .m-inverter-iso { gap: 8px; }
body.mobile .m-inverter-iso__value { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--forest-700); }
body.mobile .m-inverter-iso__unit { margin-left: 5px; font-size: 14px; color: var(--neutral-600); }
body.mobile .m-inverter-iso__note { font-size: 13px; color: var(--text-muted); }
body.mobile .m-inverter-iso svg { width: 100%; height: 56px; margin-top: 4px; overflow: visible; }
body.mobile .m-inverter-iso__area { fill: rgba(93,173,77,.14); stroke: none; }
body.mobile .m-inverter-iso__line { fill: none; stroke: var(--leaf-500); stroke-width: 2; stroke-linejoin: round; }
body.mobile .m-inverter-iso--low .m-inverter-iso__value,
body.mobile .m-inverter-iso--low .m-inverter-iso__note { color: #8a6410; }
body.mobile .m-inverter-iso--low .m-inverter-iso__area { fill: rgba(244,183,64,.2); }
body.mobile .m-inverter-iso--low .m-inverter-iso__line { stroke: #d99a1e; }
body.mobile .m-inverter-iso__axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }

body.mobile .m-strings { padding-bottom: 8px; }
body.mobile .m-strings__head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; }
body.mobile .m-strings__head h2 { margin: 0; }
body.mobile .m-strings__summary { font-size: 13px; font-weight: 600; color: var(--text-muted); }
body.mobile .m-strings__summary--low { color: #8a6410; }
body.mobile .m-strings__summary--cut { color: #a5271a; }
body.mobile .m-string {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 64px 52px;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  border-top: 1px solid var(--border-subtle);
  font-size: 14px;
}
body.mobile .m-string__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--leaf-500); }
body.mobile .m-string--low .m-string__dot { background: var(--sun-500); }
body.mobile .m-string--cut .m-string__dot { background: var(--danger-500); }
body.mobile .m-string--idle .m-string__dot { background: var(--neutral-300); }
body.mobile .m-string__id { display: flex; flex-direction: column; min-width: 0; }
body.mobile .m-string__input { font-weight: 600; color: var(--text-strong); }
body.mobile .m-string__mppt { font-size: 11px; color: var(--text-muted); }
body.mobile .m-string__current { text-align: right; color: var(--text-strong); white-space: nowrap; }
body.mobile .m-string__voltage { text-align: right; color: var(--text-muted); white-space: nowrap; }
body.mobile .m-string--low .m-string__mppt,
body.mobile .m-string--low .m-string__current { color: #8a6410; }
body.mobile .m-string--cut .m-string__mppt,
body.mobile .m-string--cut .m-string__current { color: #a5271a; }
body.mobile .m-strings__not-wired { padding: 10px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-muted); }

body.mobile .m-journal__head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; }
body.mobile .m-journal__head h2 { margin: 0; }
body.mobile .m-journal__count { font-size: 12px; color: var(--text-muted); }
body.mobile .m-journal__empty { margin: 0; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-muted); }
body.mobile .m-journal-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
body.mobile .m-journal-row__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.mobile .m-journal-row__date { font-size: 12px; font-weight: 600; color: var(--text-muted); }
body.mobile .m-journal-row__inv { font-size: 12px; font-weight: 600; color: var(--text-strong); }
body.mobile .m-journal-row__text { font-size: 14px; color: var(--text-body); line-height: 1.4; }

/* ---------- Performance (écrans « 03d Performance », « 03e Carte Performance », « 03f Demain ») ---------- */

/* Carte « Performance » de la fiche centrale (03e) : vers l'écran de détail. */
body.mobile .m-perf-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; }
body.mobile .m-perf-card:active { transform: translateY(1px); }
body.mobile .m-perf-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.mobile .m-perf-card__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.mobile .m-perf-card__title { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text-strong); }
body.mobile .m-perf-card__label { font-size: 12px; color: var(--text-muted); }
body.mobile .m-perf-card__chevron { flex: none; color: var(--neutral-400); }
body.mobile .m-perf-card__grid { display: grid; gap: 8px; }
body.mobile .m-perf-card__value { display: block; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
body.mobile .m-perf-card__warn { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #a5271a; }
body.mobile .m-perf-card__warn-icon { flex: none; }
body.mobile .m-perf-card__cta { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--forest-700); }

/* Carte « Demain » de la fiche centrale (03f) : prévision Solar::TomorrowCard. */
body.mobile .m-tomorrow { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
body.mobile .m-tomorrow__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--leaf-600); }
body.mobile .m-tomorrow h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text-strong); }
body.mobile .m-tomorrow__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.mobile .m-tomorrow__value { display: block; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--forest-700); }
body.mobile .m-tomorrow__price { font-size: 11px; font-weight: 700; color: var(--text-muted); }
body.mobile .m-tomorrow__negative { padding: 10px 12px; border-radius: var(--radius-md); background: #fdf0d3; display: flex; flex-direction: column; gap: 2px; }
body.mobile .m-tomorrow__negative-label { font-size: 12px; font-weight: 700; color: #8a6410; }
body.mobile .m-tomorrow__negative-text { font-size: 14px; line-height: 1.4; color: var(--text-strong); }
body.mobile .m-tomorrow__chart { position: relative; height: 100px; }
body.mobile .m-tomorrow__chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
body.mobile .m-tomorrow__cut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(209,72,58,.12) 0 6px, rgba(209,72,58,.04) 6px 12px); }
body.mobile .m-tomorrow__cap-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--neutral-500); }
body.mobile .m-tomorrow__cap { position: absolute; left: 0; padding-bottom: 2px; font-size: 10px; font-weight: 700; color: var(--neutral-600); }
body.mobile .m-tomorrow__issued { font-size: 12px; color: var(--text-muted); }

/* Axe des heures positionné en pourcentage (courbes « Réel et attendu » et « Demain »). */
body.mobile .m-hour-axis { position: relative; height: 16px; font-size: 10px; color: var(--text-muted); }
body.mobile .m-hour-axis span { position: absolute; top: 0; white-space: nowrap; }

/* Écran « Performance » (03d) : indicateurs. */
body.mobile .m-perf-summary { padding: 16px; display: flex; flex-direction: column; }
body.mobile .m-perf-summary__park { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 10px; }
body.mobile .m-perf-summary__label { font-size: 14px; color: var(--text-muted); }
body.mobile .m-perf-summary__value { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -0.02em; }
body.mobile .m-perf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
body.mobile .m-perf-row__id { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.mobile .m-perf-row__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
body.mobile .m-perf-row__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
body.mobile .m-perf-row__name { font-size: 15px; font-weight: 600; color: var(--text-strong); }
body.mobile .m-perf-row__status { font-size: 12px; font-weight: 600; }
body.mobile .m-perf-row__value { font-family: var(--font-display); font-size: 22px; white-space: nowrap; }
body.mobile .m-perf-summary__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
body.mobile .m-perf-summary__note { font-size: 11px; color: var(--text-muted); }

/* Graphique « Réel et attendu » : axe droit (ensoleillement), légende, plafond, écrêtage. */
body.mobile .m-chart--dual .m-chart__grid { grid-template-columns: 44px minmax(0, 1fr) 36px; }
body.mobile .m-chart__swatch--dashed { width: 14px; height: 0; border-top: 2px dashed; background: none !important; }
body.mobile .m-chart__swatch--band { background: rgba(244,183,64,.32); }
body.mobile .m-chart__swatch--hatch { background: repeating-linear-gradient(135deg, rgba(80,90,75,.16) 0 5px, rgba(80,90,75,.05) 5px 10px); }
body.mobile .m-chart__cut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(80,90,75,.16) 0 5px, rgba(80,90,75,.05) 5px 10px); pointer-events: none; }
body.mobile .m-chart__cap-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--danger-500); pointer-events: none; }
body.mobile .m-chart__cap { position: absolute; right: 0; padding-bottom: 2px; font-size: 10px; font-weight: 700; color: #a5271a; pointer-events: none; }

/* Tendance (semaine, mois) : barres côte à côte par onduleur, jour renvoyant à la vue jour. */
body.mobile .m-perf-trend__bars { position: absolute; inset: 0; display: flex; gap: 6px; }
body.mobile .m-perf-trend__day { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 4px 4px 0 0; color: inherit; text-decoration: none; }
body.mobile a.m-perf-trend__day:active { background: var(--surface-sunken); }
body.mobile .m-perf-trend__bar { flex: 1 1 0; max-width: 10px; border-radius: 2px 2px 0 0; }
body.mobile .m-perf-trend__threshold { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--danger-500); pointer-events: none; z-index: 1; }
body.mobile .m-perf-trend__x { display: flex; gap: 6px; font-size: 10px; color: var(--text-muted); }
body.mobile .m-perf-trend__x span { flex: 1; min-width: 0; text-align: center; white-space: nowrap; }

/* Pertes. */
body.mobile .m-losses { padding: 16px; gap: 0; }
body.mobile .m-loss { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
body.mobile .m-loss__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
body.mobile .m-loss__figures { white-space: nowrap; }
body.mobile .m-loss__gain { color: var(--leaf-600); font-weight: 600; }
body.mobile .m-loss__bar { height: 5px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
body.mobile .m-loss__bar div { height: 100%; border-radius: var(--radius-pill); }
body.mobile .m-loss--total { flex-direction: row; justify-content: space-between; align-items: baseline; border-top: 1.5px solid var(--border-default); font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-strong); }
body.mobile .m-perf-credit { margin: 0; font-size: 12px; color: var(--text-muted); }

/* ---------- Hydraulique (La Louge, « 03g/03h/03i ») ---------- */

/* Tuiles de l'onglet Performance (« 03g »). */
body.mobile .m-perf-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.mobile .m-perf-tile { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
body.mobile .m-perf-tile__label { font-size: 12px; color: var(--text-muted); }
body.mobile .m-perf-tile__value { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--forest-700); white-space: nowrap; }
body.mobile .m-perf-tile__unit { font-size: 13px; }

/* Graphique du jour : lignes de seuil (réservé, démarrage, crue) et unités des axes. */
body.mobile .m-hydro-chart__line { position: absolute; left: 0; right: 0; pointer-events: none; }
body.mobile .m-hydro-chart__line--reserved { border-top: 1.5px dashed #2f77b8; }
body.mobile .m-hydro-chart__line--start { border-top: 1.5px dashed var(--neutral-600); }
body.mobile .m-hydro-chart__line--flood { border-top: 1.5px dashed var(--danger-500); }
body.mobile .m-hydro-chart__unit { font-size: 10px; color: #1f5d93; }
body.mobile .m-hydro-chart__unit--kw { text-align: right; color: var(--text-muted); }

/* Mentions de la page Performance (deux lignes, contrairement à .m-perf-credit). */
body.mobile .m-hydro-credit { display: flex; flex-direction: column; gap: 3px; font-size: 11px; line-height: 1.4; color: var(--text-muted); }

/* Tendance (semaine, mois) : une barre par jour, icône d'étiage ou de crue.
   .m-perf-trend__day (générique, partagée avec la tendance solaire) n'est pas positionnée :
   sans ce repère, .m-hydro-trend__icon se positionnerait par rapport à .m-perf-trend__bars
   (toute la rangée) et tous les jours afficheraient leur icône au même endroit, au milieu du
   graphique (comme .hydro-trend .perf-trend__day côté web). */
body.mobile .m-hydro-trend .m-perf-trend__day { position: relative; }
body.mobile .m-hydro-trend__bar { flex: 0 1 72%; max-width: 20px; }
body.mobile .m-hydro-trend__icon { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); color: var(--neutral-500); display: flex; }

/* Productible (année) : bande sec/humide, réel, médiane, un mois par colonne. */
body.mobile .m-hydro-productible__facts { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; color: var(--text-strong); }
body.mobile .m-hydro-productible__facts p { margin: 0; }
body.mobile .m-hydro-productible { position: relative; height: 150px; display: flex; gap: 3px; }
body.mobile .m-hydro-productible__month { flex: 1; min-width: 0; position: relative; height: 100%; }
body.mobile .m-hydro-productible__band { position: absolute; left: 4%; right: 4%; background: var(--leaf-100); border: 1px solid var(--leaf-200); box-sizing: border-box; border-radius: 3px; }
body.mobile .m-hydro-productible__real { position: absolute; left: 26%; right: 26%; bottom: 0; background: var(--forest-700); border-radius: 2px 2px 0 0; }
body.mobile .m-hydro-productible__median { position: absolute; left: 0; right: 0; border-top: 2px solid var(--sun-500); }
body.mobile .m-hydro-productible__x { display: flex; gap: 3px; font-size: 10px; color: var(--text-muted); }
body.mobile .m-hydro-productible__x span { flex: 1; text-align: center; }

/* Écart au potentiel constructeur (DIVE), information hors pertes. */
body.mobile .m-hydro-dive { padding: 10px 12px; margin-top: 4px; border-radius: var(--radius-md); background: var(--surface-page); font-size: 13px; line-height: 1.4; color: var(--text-body); }

/* Carte « Aujourd'hui » (« 03i »). */
body.mobile .m-hydro-today { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
body.mobile .m-hydro-today__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.mobile .m-hydro-today__trend { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; font-weight: 700; color: #1f5d93; }
body.mobile .m-hydro-today__spark { position: relative; height: 64px; }
body.mobile .m-hydro-today__spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
body.mobile .m-hydro-today__start-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--neutral-500); }
body.mobile .m-hydro-today__start { position: absolute; left: 0; transform: translateY(100%); padding: 2px 4px 0 0; font-size: 10px; font-weight: 700; color: var(--neutral-600); background: var(--surface-card); }
body.mobile .m-hydro-today__axis { display: flex; justify-content: space-between; margin-top: -6px; font-size: 10px; color: var(--text-muted); }
body.mobile .m-hydro-today__state { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--neutral-700); font-size: 14px; font-weight: 600; line-height: 1.35; }
body.mobile .m-hydro-today__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--neutral-400); }
body.mobile .m-hydro-today__state--production { background: var(--leaf-100); color: var(--forest-700); }
body.mobile .m-hydro-today__state--production .m-hydro-today__dot { background: var(--leaf-500); }
body.mobile .m-hydro-today__state--crue, body.mobile .m-hydro-today__state--stale { background: #fdf0d3; color: #8a6410; }
body.mobile .m-hydro-today__state--crue .m-hydro-today__dot, body.mobile .m-hydro-today__state--stale .m-hydro-today__dot { background: var(--sun-500); }
