/* ══════════════════════════════════════════════════════
   WeightOtter — styles
   Palette : fond noir/violet + bleu clair + étoiles
   ══════════════════════════════════════════════════════ */

:root {
  --bg:       #080612;
  --bg2:      #0d0a1f;
  --card:     rgba(18, 12, 42, 0.88);
  --blue:     #4fc3f7;
  --blue2:    #81d4fa;
  --blue3:    #0288d1;
  --purple:   #ce93d8;
  --text:     #cce8f4;
  --text2:    #6a9ab5;
  --red:      #ef5350;
  --green:    #66bb6a;
  --border:   rgba(79, 195, 247, 0.18);
  --nav-h:    64px;
  --pix:      'Press Start 2P', monospace;
  --mono:     'Share Tech Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: var(--mono);
}

/* ── STARFIELD ── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── APP SHELL ── */
#app {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── SCREENS ── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ══════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════ */
#screen-login {
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  gap: 1.5rem;
  overflow-y: auto;
}

.login-logo { text-align: center; }
.login-logo .t1 {
  font-family: var(--pix);
  font-size: .85rem;
  color: var(--blue);
  text-shadow: 0 0 22px rgba(79, 195, 247, .55);
  letter-spacing: 3px;
  line-height: 2;
}
.login-logo .t2 {
  font-size: .78rem;
  color: var(--text2);
  margin-top: .3rem;
}

/* ── SÉLECTEUR DE LANGUE ── */
.lang-switch {
  display: flex;
  gap: .4rem;
  justify-content: center;
}
.lang-btn {
  padding: .35rem .75rem;
  background: rgba(18, 12, 42, .8);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-family: var(--mono);
  font-size: .78rem;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.lang-btn:hover  { border-color: var(--blue); color: var(--blue); }
.lang-btn.active { background: var(--blue3); border-color: var(--blue3); color: #fff; }

/* ── MASCOTTE ── */
.mascot {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto .5rem;
  filter: drop-shadow(0 0 10px rgba(79,195,247,.35));
}

/* ── COMPTE MÉMORISÉ ── */
.cached-name {
  font-family: var(--pix);
  font-size: .7rem;
  color: var(--blue);
  text-align: center;
  letter-spacing: 2px;
  padding: .6rem 0 .2rem;
}
.cached-hint {
  font-size: .72rem;
  color: var(--text2);
  text-align: center;
  margin-bottom: .3rem;
}

.login-box {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  backdrop-filter: blur(8px);
}

/* ── MODE TOGGLE ── */
.mode-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.mode-toggle button {
  flex: 1;
  padding: .55rem;
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--mono);
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
}
.mode-toggle button.active {
  background: var(--blue3);
  color: #fff;
}

/* ── FORM PRIMITIVES ── */
label {
  font-size: .68rem;
  color: var(--text2);
  display: block;
  margin-bottom: .25rem;
  letter-spacing: 1px;
}

input[type=text],
input[type=number],
input[type=date],
select {
  width: 100%;
  background: rgba(8, 6, 24, .85);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: .95rem;
  padding: .55rem .75rem;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}
input:focus,
select:focus { border-color: var(--blue); }
select option { background: #0d0a1f; }

/* ── PIN ── */
.pin-display {
  display: flex;
  justify-content: center;
  gap: .7rem;
  margin: .3rem 0;
}
.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--blue3);
  background: transparent;
  transition: background .15s;
}
.pin-dot.filled {
  background: var(--blue);
  border-color: var(--blue);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
}
.pin-btn {
  background: rgba(18, 12, 45, .9);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.2rem;
  padding: .85rem;
  cursor: pointer;
  transition: all .1s;
  text-align: center;
  user-select: none;
}
.pin-btn:active {
  background: var(--blue3);
  transform: scale(.94);
}
.pin-btn.del { color: var(--blue2); font-size: .9rem; }
.pin-btn.empty { visibility: hidden; }

/* ── BUTTONS ── */
.btn {
  width: 100%;
  background: linear-gradient(135deg, var(--blue3), #01579b);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--pix);
  font-size: .58rem;
  padding: .85rem;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn.btn-sm { padding: .6rem; font-size: .52rem; }
.btn.danger {
  background: rgba(239, 83, 80, .12);
  border: 1px solid rgba(239, 83, 80, .3);
  color: var(--red);
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: 0;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: 0;
}

/* ── ERROR ── */
.err {
  color: var(--red);
  font-size: .72rem;
  text-align: center;
  min-height: 1rem;
}

/* ══════════════════════════════════════════════════════
   BOTTOM NAV
   ══════════════════════════════════════════════════════ */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: rgba(8, 5, 20, .96);
  border-top: 1px solid var(--border);
  display: none;
  z-index: 200;
  backdrop-filter: blur(12px);
}
#bottom-nav.visible { display: flex; }

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--mono);
  font-size: .68rem;
  cursor: pointer;
  transition: color .2s;
  padding: .4rem;
}
.nav-btn.active { color: var(--blue); }
.nav-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   MAIN TRACKER
   ══════════════════════════════════════════════════════ */
.main-header {
  padding: 1rem 1rem .7rem;
  background: rgba(8, 5, 20, .7);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mascot-header {
  width: 52px;
  height: 52px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(79,195,247,.3));
  flex-shrink: 0;
}
.main-header .greeting {
  font-family: var(--pix);
  font-size: .52rem;
  color: var(--blue);
  letter-spacing: 1px;
}
.main-header .date-str {
  font-size: .75rem;
  color: var(--text2);
  margin-top: .25rem;
}

/* ── TABS ── */
.tab-bar {
  display: flex;
  background: rgba(10, 7, 26, .9);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab-btn {
  flex: 1;
  padding: .65rem .15rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-family: var(--mono);
  font-size: .66rem;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: .9rem;
  padding: 1rem 1rem calc(var(--nav-h) + 1rem);
  overflow-y: auto;
  flex: 1;
}
.tab-content.active { display: flex; }

/* ── ADD FORM ── */
.add-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.sec-title {
  font-family: var(--pix);
  font-size: .45rem;
  color: var(--blue3);
  letter-spacing: 2px;
  margin-bottom: .25rem;
}

/* ── ENTRY LIST ── */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.entry-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem .9rem;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: .3rem .7rem;
  align-items: center;
}
.entry-item .day {
  font-family: var(--pix);
  font-size: .42rem;
  color: var(--blue3);
  text-align: center;
  line-height: 1.8;
}
.entry-item .meta {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.entry-item .edate { font-size: .75rem; color: var(--text2); }
.entry-item .esub  { font-size: .68rem; color: var(--text2); }
.entry-item .eweight {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1;
}
.entry-item .evar {
  font-size: .72rem;
  text-align: right;
  line-height: 1;
}
.evar.pos  { color: var(--red); }
.evar.neg  { color: var(--green); }
.evar.zero { color: var(--text2); }

.del-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: .85rem;
  padding: .2rem;
}
.del-btn:hover { color: var(--red); }

/* ── BLOCS DÉPLIABLES (>15 entrées) ── */
.entry-block {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.block-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .85rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text2);
  transition: border-color .15s, color .15s;
}
.block-head.open { border-color: var(--blue); color: var(--blue); }
.block-chev  { font-size: .7rem; }
.block-label { flex: 1; }
.block-count {
  background: rgba(79,195,247,.16);
  border-radius: 10px;
  padding: .08rem .5rem;
  font-size: .7rem;
}
.block-body {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

/* bouton flèche pour replier un groupe ouvert */
.block-fold {
  align-self: center;
  background: rgba(79,195,247,.1);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-size: .72rem;
  padding: .15rem 1.4rem;
  cursor: pointer;
  transition: all .15s;
}
.block-fold:hover { color: var(--blue); border-color: var(--blue); }
.logbook .block-fold {
  background: rgba(0,255,120,.07);
  border-color: rgba(0,255,120,.25);
  color: rgba(95,255,168,.7);
}

/* variante verte dans le carnet de bord */
.logbook .block-head {
  background: rgba(0,255,120,.05);
  border-color: rgba(0,255,120,.22);
  color: rgba(95,255,168,.75);
}
.logbook .block-head.open {
  border-color: rgba(0,255,120,.55);
  color: #5fffa8;
}
.logbook .block-count { background: rgba(0,255,120,.16); }

/* ── GRAPH ── */
.graph-toggle {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.tog-btn {
  flex: 1;
  padding: .5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-family: var(--mono);
  font-size: .78rem;
  cursor: pointer;
  transition: all .2s;
}
.tog-btn.active {
  background: var(--blue3);
  border-color: var(--blue3);
  color: #fff;
}
.chart-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem;
  position: relative;
  height: 280px;
}

/* ── PROJECTION DAYS TOGGLE ── */
.proj-days {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.proj-days-lbl {
  font-size: .62rem;
  color: var(--text2);
  letter-spacing: 1px;
  margin-right: .15rem;
}
.proj-days-btn {
  padding: .3rem .7rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-family: var(--mono);
  font-size: .72rem;
  cursor: pointer;
  transition: all .2s;
  min-width: 38px;
}
.proj-days-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #0a0815;
}

.proj-tip {
  display: none;
  background: rgba(10,7,30,.97);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  padding: .7rem .85rem;
  font-size: .72rem;
  color: var(--text2);
  line-height: 1.55;
}
.proj-tip.visible { display: block; }
.empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text2);
  font-size: .8rem;
}

/* ── SUMMARY ── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .85rem .7rem;
  text-align: center;
}
.stat-card.full { grid-column: 1 / -1; }
.stat-lbl {
  font-size: .6rem;
  color: var(--text2);
  letter-spacing: .5px;
  margin-bottom: .45rem;
  line-height: 1.4;
}
.stat-val {
  font-family: var(--pix);
  font-size: .7rem;
  color: var(--blue);
  line-height: 1.4;
}
.stat-val.green  { color: var(--green); }
.stat-val.red    { color: var(--red); }
.stat-val.purple { color: var(--purple); }
.stat-sub {
  font-size: .65rem;
  color: var(--text2);
  margin-top: .3rem;
}

/* ══════════════════════════════════════════════════════
   TRACK — écrans CRT rétro-futuristes vert
   ══════════════════════════════════════════════════════ */
.track-today {
  text-align: center;
  font-family: var(--mono);
  font-size: .78rem;
  color: #5fffa8;
  letter-spacing: .5px;
  text-shadow: 0 0 8px rgba(0,255,120,.5);
  text-transform: capitalize;
}

.crt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
}

.crt-screen {
  position: relative;
  background: radial-gradient(ellipse at 50% 38%, rgba(0,58,26,.92), rgba(2,11,6,.98));
  border: 2px solid rgba(0,255,120,.34);
  border-radius: 12px;
  padding: 1rem .8rem;
  overflow: hidden;
  box-shadow: inset 0 0 28px rgba(0,255,120,.16), 0 0 14px rgba(0,255,120,.1);
}

/* scanlines CRT */
.crt-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0)   0px, rgba(0,0,0,0)   2px,
    rgba(0,0,0,.22) 3px, rgba(0,0,0,.22) 4px);
  pointer-events: none;
}

.crt-label {
  position: relative;
  font-style: italic;
  font-size: .85rem;
  color: #5fffa8;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 0 9px rgba(0,255,120,.7);
  margin-bottom: .45rem;
}

.crt-value {
  position: relative;
  font-family: var(--mono);
  font-size: 2.55rem;
  font-weight: 700;
  color: #4dff9b;
  text-align: center;
  line-height: 1;
  text-shadow: 0 0 10px rgba(0,255,120,.9), 0 0 24px rgba(0,255,120,.5);
  cursor: pointer;
  transition: transform .1s;
}
.crt-value:active { transform: scale(.95); }

.crt-unit {
  position: relative;
  font-family: var(--mono);
  font-size: .7rem;
  color: rgba(95,255,168,.6);
  text-align: center;
  margin-top: .2rem;
}

.crt-btns {
  position: relative;
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}

.crt-btn {
  flex: 1;
  background: rgba(0,255,120,.08);
  border: 1px solid rgba(0,255,120,.4);
  border-radius: 8px;
  color: #5fffa8;
  font-family: var(--mono);
  font-size: 1.35rem;
  line-height: 1;
  padding: .45rem;
  cursor: pointer;
  transition: all .12s;
  text-shadow: 0 0 6px rgba(0,255,120,.6);
}
.crt-btn:active {
  background: rgba(0,255,120,.28);
  transform: scale(.93);
}

/* carnet de bord — écran plus grand */
.crt-screen.logbook { margin-top: .1rem; }

.logbook-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-height: 280px;
  overflow-y: auto;
}

.logbook-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  border: 1px solid rgba(0,255,120,.22);
  border-radius: 8px;
  padding: .5rem .7rem;
  font-family: var(--mono);
  font-size: .82rem;
}

.lb-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-self: start;
}

.lb-del {
  background: none;
  border: none;
  color: rgba(95,255,168,.5);
  font-size: .9rem;
  line-height: 1;
  padding: .15rem .25rem;
  cursor: pointer;
  transition: color .15s;
}
.lb-del:hover, .lb-del:active { color: #ff6b6b; }

.lb-date { color: rgba(95,255,168,.7); }

.lb-cal, .lb-prot {
  cursor: pointer;
  border-bottom: 1px dotted rgba(0,255,120,.4);
  transition: text-shadow .15s;
}
.lb-cal {
  justify-self: center;
  color: #4dff9b;
  font-size: 1.05rem;
  text-shadow: 0 0 8px rgba(0,255,120,.7);
}
.lb-prot {
  justify-self: end;
  color: #5fffa8;
}
.lb-cal:active, .lb-prot:active { text-shadow: 0 0 12px rgba(0,255,120,.95); }

.logbook-empty {
  text-align: center;
  color: rgba(95,255,168,.55);
  font-size: .78rem;
  padding: 1.5rem .5rem;
}

/* ── DIGICODE — saisie directe (écran vert) ── */
.digicode-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
}

.digicode-panel {
  width: 100%;
  max-width: 300px;
  background: radial-gradient(ellipse at 50% 28%, rgba(0,58,26,.96), rgba(2,11,6,.99));
  border: 2px solid rgba(0,255,120,.42);
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  box-shadow: inset 0 0 30px rgba(0,255,120,.18), 0 0 26px rgba(0,255,120,.22);
}

.digicode-title {
  font-style: italic;
  text-align: center;
  font-size: .9rem;
  color: #5fffa8;
  letter-spacing: 1px;
  text-shadow: 0 0 9px rgba(0,255,120,.7);
}

.digicode-screen {
  font-family: var(--mono);
  font-size: 2.3rem;
  text-align: center;
  color: #4dff9b;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(0,255,120,.3);
  border-radius: 8px;
  padding: .5rem;
  line-height: 1;
  text-shadow: 0 0 10px rgba(0,255,120,.9);
}

.digicode-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.digi-key {
  background: rgba(0,255,120,.08);
  border: 1px solid rgba(0,255,120,.35);
  border-radius: 8px;
  color: #5fffa8;
  font-family: var(--mono);
  font-size: 1.3rem;
  padding: .7rem;
  cursor: pointer;
  transition: all .1s;
  text-shadow: 0 0 6px rgba(0,255,120,.5);
}
.digi-key:active {
  background: rgba(0,255,120,.3);
  transform: scale(.92);
}
.digi-key.ok {
  background: rgba(0,255,120,.5);
  color: #051209;
  font-weight: 700;
  text-shadow: none;
}

/* ══════════════════════════════════════════════════════
   PROFILE
   ══════════════════════════════════════════════════════ */
#screen-profile {
  overflow-y: auto;
  padding: 1rem 1rem calc(var(--nav-h) + 1rem);
  gap: .9rem;
}

.prof-title {
  font-family: var(--pix);
  font-size: .58rem;
  color: var(--blue);
  letter-spacing: 2px;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.prof-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.calc-row {
  background: rgba(2, 136, 209, .08);
  border: 1px solid rgba(2, 136, 209, .2);
  border-radius: 6px;
  padding: .7rem .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.calc-lbl { font-size: .75rem; color: var(--text2); }
.calc-val {
  font-family: var(--pix);
  font-size: .6rem;
  color: var(--blue);
}

.hint {
  font-size: .68rem;
  color: var(--text2);
  line-height: 1.6;
}

/* ── LABEL HINT INLINE ── */
.label-hint {
  font-size: .6rem;
  color: var(--blue3);
  font-style: italic;
  letter-spacing: 0;
  font-family: var(--mono);
}

/* ── LABEL + ? ROW ── */
.label-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .25rem;
}
.label-row label { margin-bottom: 0; }

.help-btn {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--blue3);
  background: rgba(2,136,209,.12);
  color: var(--blue);
  font-size: .62rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.help-btn:hover { background: rgba(2,136,209,.3); }

/* ── ACTIVITY TOOLTIP ── */
.activity-tip {
  display: none;
  flex-direction: column;
  gap: .35rem;
  background: rgba(10,7,30,.97);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .7rem .8rem;
  margin-bottom: .4rem;
}
.activity-tip.visible { display: flex; }

.tip-row {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  font-size: .72rem;
  line-height: 1.5;
}
.tip-lvl {
  color: var(--blue);
  min-width: 80px;
  flex-shrink: 0;
  font-size: .68rem;
}
.tip-desc { color: var(--text2); }

/* ══════════════════════════════════════════════════════
   PROJECTIONS
   ══════════════════════════════════════════════════════ */
.proj-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.proj-nodata {
  text-align: center;
  color: var(--text2);
  font-size: .75rem;
  padding: .4rem 0;
}

.proj-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .3rem;
  border-bottom: 1px solid rgba(79,195,247,.07);
}
.proj-row:last-child { border-bottom: none; }

.proj-row-left {
  display: flex;
  flex-direction: column;
  gap: .12rem;
}
.proj-label      { font-size: .8rem; color: var(--text); }
.proj-date-hint  { font-size: .64rem; color: var(--text2); }

.proj-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .12rem;
}
.proj-weight {
  font-family: var(--pix);
  font-size: .58rem;
  color: var(--blue);
}
.proj-diff { font-size: .7rem; }

.proj-result {
  font-size: .8rem;
  color: var(--text2);
  padding: .35rem 0;
  line-height: 1.5;
}
.proj-result.ok   { color: var(--green); }
.proj-result.warn { color: var(--red); }

/* ══════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(2, 136, 209, .92);
  color: #fff;
  padding: .55rem 1.3rem;
  border-radius: 20px;
  font-size: .78rem;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ══════════════════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════════════════ */
.empty {
  text-align: center;
  color: var(--text2);
  font-size: .78rem;
  padding: 2rem;
  line-height: 1.8;
}

/* ══════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--blue3); border-radius: 2px; }

/* ══════════════════════════════════════════════════════
   PUBLICITÉS — interstitiel + bandeau de consentement
   ══════════════════════════════════════════════════════ */
.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 3, 12, .88);
  backdrop-filter: blur(3px);
  animation: adIn .18s ease-out;
}
@keyframes adIn { from { opacity: 0 } to { opacity: 1 } }

.ad-panel {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.ad-tag {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .18em;
  color: var(--text2);
  text-align: center;
}

.ad-slot {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 20, .6);
  border-radius: 10px;
  overflow: hidden;
}

.ad-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.ad-support {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text2);
  flex: 1;
  line-height: 1.4;
}

.ad-close {
  flex-shrink: 0;
  padding: .55rem .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--blue3);
  color: #fff;
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: opacity .2s;
}
.ad-close:disabled {
  background: transparent;
  color: var(--text2);
  cursor: default;
}

/* ── Encart maison (repli / démo) ── */
.ad-house {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  padding: 1.2rem;
  text-align: center;
}
.ad-house img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  image-rendering: pixelated;
}
.ad-house-txt { display: flex; flex-direction: column; gap: .35rem; }
.ad-house-txt strong {
  font-family: var(--pix);
  font-size: .8rem;
  color: var(--blue);
}
.ad-house-txt span {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text2);
}

/* ── Bandeau de consentement ── */
.ad-consent {
  position: fixed;
  left: .6rem;
  right: .6rem;
  bottom: .6rem;
  z-index: 320;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  backdrop-filter: blur(6px);
}
.ad-consent-txt {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--text);
  line-height: 1.5;
}
.ad-consent-btns { display: flex; gap: .5rem; }
.ad-consent-btn {
  flex: 1;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--blue3);
  color: #fff;
  font-family: var(--mono);
  font-size: .68rem;
  cursor: pointer;
}
.ad-consent-btn.ghost { background: transparent; color: var(--text2); }

/* ══════════════════════════════════════════════════════
   PROJECTIONS — valeurs bornées au plancher physiologique
   ══════════════════════════════════════════════════════ */
.proj-weight.capped { color: var(--text2); }
.proj-capped-note {
  margin-top: .6rem;
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text2);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: .55rem;
}

/* ══════════════════════════════════════════════════════
   LIEN POLITIQUE DE CONFIDENTIALITÉ
   ══════════════════════════════════════════════════════ */
.privacy-link {
  display: block;
  margin: 1.2rem auto 0;
  text-align: center;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.privacy-link:hover { color: var(--blue); }

.ad-consent-link {
  display: inline-block;
  margin-top: .35rem;
  color: var(--blue);
  font-size: .64rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
