/* Garmin Dashboard — mise en page de l'application (les composants sont dans gd.css). */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
a { color: var(--accent-ink); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Coquille : barre latérale (ordinateur) / barre du bas (téléphone) ---------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidenav-width) minmax(0, 1fr); min-height: 100vh; }
.shell .gd-sidenav { position: sticky; top: 0; height: 100vh; }
.shell .gd-sidenav__foot button { all: unset; cursor: pointer; font-weight: 700; color: var(--ink-2); }
.shell .gd-sidenav__foot a { color: var(--ink-2); font-weight: 700; text-decoration: none; }
.view { padding: var(--space-8); min-width: 0; max-width: var(--content-max); width: 100%; display: flex; flex-direction: column; gap: var(--space-6); }
.mobile-nav { display: none; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mobile-only { display: none; }
@media (max-width: 899px) {
  .shell { display: block; }
  .shell .gd-sidenav { display: none; }
  .view { padding: var(--space-5) var(--space-4) calc(var(--nav-height) + var(--space-6)); gap: var(--space-4); }
  .mobile-nav { display: grid; grid-template-columns: repeat(6, 1fr); }
  .mobile-nav a { font-size: 10px; }
  .mobile-nav .gd-nav-ind { width: 44px; }
  .gd-pagehead__title { font-size: 32px; line-height: 36px; }
  .mobile-only { display: inline-grid; }
  .gd-pagehead { position: relative; padding-right: 52px; }
  .gd-pagehead > .page-actions { width: calc(100% + 52px); margin-right: -52px; }
  .page-actions .gd-btn { flex: 1 1 auto; padding: 0 12px; font-size: 14px; }
  .page-actions > .gd-iconbtn.mobile-only { position: absolute; top: 0; right: 0; }
}

/* ---- Grille de contenu ---------------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
.col { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
@media (max-width: 1199px) { .s3, .s4, .s5 { grid-column: span 6; } .s7, .s8 { grid-column: span 12; } }
@media (max-width: 899px) { .grid { gap: var(--space-4); } .grid > * { grid-column: span 12 !important; } .col { gap: var(--space-4); } }
.dials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
@media (max-width: 599px) { .two { grid-template-columns: 1fr; } }
.ring-row { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.ring-row > .grow { flex: 1 1 200px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.macro-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.macro-line b { color: var(--ink); }
.macro-line span:last-child { color: var(--ink-2); }
.facts3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; width: 100%; }
.center { align-items: center; text-align: center; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; }

/* ---- Barres simples (aperçus de séries) ------------------------------------------------------------------- */
.bars { position: relative; display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--chart-axis); }
.bars__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.bars__seg { width: 100%; max-width: 28px; margin: 0 auto; }
.bars__seg:first-child { border-radius: 6px 6px 0 0; }
.bars__target { position: absolute; left: 0; right: 0; border-top: 1px solid var(--chart-target); }
.bars__target span { position: absolute; right: 0; bottom: 4px; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.bars__labels { display: flex; gap: 10px; font-size: 11px; font-weight: 600; color: var(--ink-muted); }
.bars__labels span { flex: 1; text-align: center; }

/* ---- Feuille du bas / fenêtre (ajout d'aliment, exercices) --------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim); }
.overlay .gd-sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; }
@media (min-width: 900px) { .overlay { align-items: center; } .overlay .gd-sheet { border-radius: var(--radius-xl); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.sheet-head h2 { font-family: var(--font-display); font-size: 22px; line-height: 26px; font-weight: 800; }
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; width: 100%; }
.list__item:hover { background: var(--surface-sunken); }
.list__main { display: flex; flex-direction: column; min-width: 0; }
.list__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__sub { font-size: 13px; color: var(--ink-muted); }
.list__val { font-weight: 800; white-space: nowrap; }
.section-label { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-top: var(--space-2); }

/* ---- Scanner ---------------------------------------------------------------------------------------------- */
.scanner { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #000; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner__frame { position: absolute; left: 50%; top: 40%; width: 260px; height: 150px; transform: translate(-50%, -50%); border: 3px solid #ffffff; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); }
.scanner__bar { position: absolute; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
.scanner__msg { padding: 10px 14px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.6); color: #ffffff; text-align: center; font-weight: 600; }
.scanner .gd-iconbtn { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); left: 16px; }

/* ---- Hypnogramme ------------------------------------------------------------------------------------------- */
.hypno { position: relative; height: 104px; }
.hypno__label { position: absolute; left: 0; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.hypno__seg { position: absolute; height: 18px; border-radius: 5px; }

/* ---- Divers ------------------------------------------------------------------------------------------------- */
.route { width: 100%; height: 280px; display: block; border-radius: 20px; background: var(--run-soft); }
.route .casing { fill: none; stroke: #ffffff; stroke-width: 10; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.route .line { fill: none; stroke: var(--zone-3); stroke-width: 4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.route .start { fill: var(--forme); stroke: #ffffff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.wip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--warning-soft); font-size: 13px; font-weight: 800; letter-spacing: 0.04em; }
.gd-composer input:disabled, .gd-composer button:disabled { cursor: not-allowed; opacity: 0.55; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.loading { opacity: 0.6; transition: opacity 0.2s; }
.empty-line { padding: 10px 0 4px; color: var(--ink-2); }
.timer { font-variant-numeric: tabular-nums; }
.gd-sets input { min-width: 0; }
@media (max-width: 599px) { .gd-sets { grid-template-columns: 22px minmax(0, 0.9fr) 64px 52px 44px; gap: 6px; } }

/* ---- Connexion ------------------------------------------------------------------------------------------------ */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6) var(--space-4); }
.login__card { width: 100%; max-width: 400px; }
.login__brand { padding: 0; }
.login .gd-notice { display: block; }

/* ---- Texte ---------------------------------------------------------------------------------------------------- */
.screen-title { font-family: var(--font-display); font-size: 32px; line-height: 36px; font-weight: 800; letter-spacing: -0.02em; margin: var(--space-4) 0 var(--space-5); }
.card-title { font-family: var(--font-display); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.caption { font-size: 13px; line-height: 18px; }
.code { font-family: var(--font-mono); font-size: 12px; }
.preview-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-md); background: var(--surface-sunken); }
.ring-mini { flex: none; display: inline-flex; }
.ring-mini text { display: none; }
@media (min-width: 900px) { #gd-toasts { left: auto !important; right: 24px !important; bottom: 24px !important; width: 400px; } }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.check-row input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--strength); }
.rest-slot:empty { display: none; }
