/* Maquette Simu3D (simu3d.js) : page « Ma simulation » du site et Helyo Home Admin.
   Tout est préfixé .s3, pour cohabiter avec site.css comme avec la feuille de l'admin. */
.s3 { --s3-surface: #1a1a19; --s3-line: #ffffff14; --s3-ink: #fff; --s3-ink-2: #c3c2b7; --s3-muted: #898781; --s3-sun: #f2b533;
  display: grid; grid-template-rows: minmax(320px, 1fr) auto; color: var(--s3-ink); font-family: 'Space Grotesk', system-ui, sans-serif; }
.s3 button { font: 500 13px/1 'Space Grotesk', system-ui, sans-serif; color: var(--s3-ink-2); background: #ffffff0a; border: 1px solid #ffffff1a; border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.s3 button:hover { color: var(--s3-ink); }
.s3-stage { position: relative; overflow: hidden; border: 1px solid var(--s3-line); border-radius: 20px 20px 0 0; background: #0d0d0d; }
.s3-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.s3-tags { position: absolute; inset: 0; pointer-events: none; }
.s3-tag { position: absolute; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; text-shadow: 0 1px 3px #000c, 0 0 12px #0009; }
.s3-tag[hidden] { display: none; }
.s3-tag .n { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--s3-ink-2); }
.s3-tag .v { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.s3-tag .s { font-size: 11px; color: var(--s3-sun); }
.s3-tag::after { content: ""; display: block; width: 1px; height: calc(18px + var(--lift, 0px)); margin: 4px auto 0; background: linear-gradient(#ffffff59, #ffffff1f); }
.s3-hud { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; pointer-events: none; }
.s3-hud > * { pointer-events: auto; }
.s3-clock { font-size: 40px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.s3-date { font-size: 14px; color: var(--s3-ink-2); margin-top: 6px; }
.s3-sky { font-size: 12px; color: var(--s3-muted); margin-top: 3px; }
.s3-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }
.s3-chips button { border-radius: 999px; backdrop-filter: blur(12px); }
.s3-chips button[aria-pressed="true"] { color: var(--s3-ink); background: #f2b53321; border-color: #f2b53361; }
.s3-zoom { position: absolute; right: 14px; bottom: 14px; display: grid; gap: 6px; }
.s3 .s3-zoom button { width: 36px; height: 36px; padding: 0; font-size: 18px; }
.s3-hint { position: absolute; left: 16px; bottom: 14px; margin: 0; font-size: 12px; color: var(--s3-muted); pointer-events: none; }
/* Thème sombre : la scène de jour reste claire (applyTime), l’aide garde un fond pour rester lisible. */
:root:not([data-mode="jour"]) .s3-hint { background: #141414d9; border-radius: 10px; padding: 4px 8px; }
.s3-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--s3-muted); text-align: center; padding: 24px; }
.s3-empty[hidden] { display: none; }
.s3-dock { background: var(--s3-surface); border: 1px solid var(--s3-line); border-top: 0; border-radius: 0 0 20px 20px; padding: 12px 16px 10px; }
.s3-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.s3-edit { display: contents; }
.s3-ro .s3-edit, .s3-detail .s3-edit { display: none; }
.s3-champ { display: inline-flex !important; align-items: center; gap: 6px; margin-right: 14px; white-space: nowrap; }
.s3 .s3-champ input { width: 56px; font: inherit; color: var(--s3-ink); background: #0d0d0d; border: 1px solid #ffffff22; border-radius: 8px; padding: 4px 6px; }
.s3-max { color: var(--s3-sun); font-size: 12px; }
.s3-live { display: inline-block; min-width: 10em; color: var(--s3-ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.s3-live:not(:empty)::before { content: "→ "; color: var(--s3-muted); }
.s3-k { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px; background: #ffffff1f; border: 1px solid #ffffff40; color: var(--s3-ink); font-size: 11px; font-weight: 600; letter-spacing: 0; text-shadow: none; font-variant-numeric: tabular-nums; }
.s3-tag-k .n { margin-bottom: 2px; }
.s3-row label { font-size: 13px; color: var(--s3-ink-2); display: flex; gap: 8px; align-items: center; }
.s3 select { font: inherit; font-size: 13px; color: var(--s3-ink); background: #0d0d0d; border: 1px solid #ffffff22; border-radius: 8px; padding: 6px 8px; }
.s3 input[type=range] { accent-color: var(--s3-sun); width: 140px; }
.s3-setup { flex: 1 1 220px; font-size: 13px; color: var(--s3-ink-2); }
.s3-sum { margin: 10px 0 0; font-size: 13px; color: var(--s3-ink-2); }
.s3-sum b { color: var(--s3-ink); font-weight: 500; }
.s3-sum .loss { color: var(--s3-sun); }
.s3-vals { display: flex; justify-content: flex-end; font-size: 11px; font-weight: 500; min-height: 15px; margin-top: 6px; font-variant-numeric: tabular-nums; color: #ffce5c; }
.s3-frise { position: relative; height: 92px; cursor: ew-resize; touch-action: none; }
.s3-frise canvas { display: block; width: 100%; height: 100%; }
.s3-note { margin: 6px 0 0; font-size: 11px; color: var(--s3-muted); }
.s3 .s3-play { width: 36px; height: 30px; padding: 0; display: grid; place-items: center; }
.s3-play svg { width: 14px; height: 14px; }
.s3-play .i-pause, .s3-play.on .i-play { display: none; }
.s3-play.on .i-pause { display: block; }
/* Sur une année (sous la maquette, hors de sa hauteur fixe) */
.s3y { --s3-ink: #fff; --s3-ink-2: #c3c2b7; --s3-muted: #898781; --s3-sun: #f2b533;
  margin-top: 14px; padding: 16px 18px 12px; border: 1px solid #ffffff14; border-radius: 20px; background: #1a1a19;
  color: var(--s3-ink); font-family: 'Space Grotesk', system-ui, sans-serif; }
.s3y[hidden], .sim[hidden] + .s3y { display: none; }
.s3y-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.s3y p { margin: 0; }
.s3y-k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--s3-sun); font-weight: 500; }
.s3y-tot { font-size: 15px; color: var(--s3-ink-2); margin-top: 6px !important; }
.s3y-tot b { font-size: 30px; font-weight: 500; color: var(--s3-ink); font-variant-numeric: tabular-nums; }
.s3y-sub { font-size: 13px; color: var(--s3-ink-2); margin-top: 2px !important; }
.s3y-sub .loss { color: var(--s3-sun); }
.s3y-champs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--s3-ink-2); }
.s3y-champs li { display: flex; justify-content: space-between; gap: 18px; }
.s3y-champs b { color: var(--s3-ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.s3y-vals { display: flex; justify-content: flex-end; font-size: 11px; font-weight: 500; min-height: 15px; margin-top: 10px; font-variant-numeric: tabular-nums; color: #ffce5c; }
.s3y-chart { position: relative; height: 150px; touch-action: pan-y; cursor: default; }
.s3y-chart:focus-visible { outline: 1px solid #f2b53399; outline-offset: 4px; border-radius: 6px; }
.s3y-chart canvas { display: block; width: 100%; height: 100%; }
.s3y-tip { position: absolute; z-index: 1; pointer-events: none; white-space: nowrap; padding: 8px 10px; border-radius: 10px;
  background: #0d0d0deb; border: 1px solid #ffffff1f; font-size: 12px; color: var(--s3-ink-2); display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.s3y-tip[hidden] { display: none; }
.s3y-tip b { color: var(--s3-ink); font-weight: 500; font-size: 13px; }
.s3y-tip i { font-style: normal; }
.s3y-note { margin-top: 6px !important; font-size: 11px; color: var(--s3-muted); }

@media (max-width: 600px) {
  /* Une colonne qui ne s'élargit jamais : les champs de panneaux, sur une ligne, poussaient
     la page bien au-delà de l'écran du téléphone. */
  .s3 { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .s3-stage { height: 62svh; min-height: 360px; max-height: 560px; border-radius: 18px 18px 0 0; }
  /* L'heure et les jours sur un fondu sombre : sans lui, le texte se perdait dans les toits. */
  .s3-stage::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 150px; pointer-events: none;
    background: linear-gradient(#0d0d0df2 40%, #0d0d0d00); }
  .s3-hud { top: 12px; left: 12px; right: 12px; flex-direction: column; flex-wrap: nowrap; gap: 10px; }
  .s3-clock { font-size: 28px; }
  .s3-date { font-size: 13px; margin-top: 4px; }
  .s3-chips { flex-wrap: nowrap; justify-content: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .s3-chips::-webkit-scrollbar { display: none; }
  .s3 .s3-chips button { flex: none; padding: 7px 10px; font-size: 12px; }
  .s3-hint { display: none; }
  .s3-dock { padding: 12px 14px 10px; border-radius: 0 0 18px 18px; }
  .s3-setup { flex: 1 1 100%; min-width: 0; display: grid; gap: 10px; }
  /* Un champ sur deux lignes : son nom, puis le nombre de panneaux et ce qu'il produit à l'heure affichée. */
  .s3-champ { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 8px; white-space: normal; margin-right: 0; }
  .s3-champ > span:not(.s3-max):not(.s3-live) { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .s3-live { min-width: 0; flex: 1 1 auto; }
  .s3y-champs b { white-space: nowrap; }
  .s3 input[type=range] { width: 120px; }
  .s3y { padding: 14px 14px 10px; }
  .s3y-tot b { font-size: 26px; }
  .s3y-champs { width: 100%; }
}
/* Au doigt, on pince pour zoomer : les boutons + / − masquaient la scène. */
@media (hover: none) and (pointer: coarse) {
  .s3-stage .s3-zoom { display: none; }
}
