/* ══════════════════════════════════════════════════════════════
   James — design system
   Sombre, dense en données, typographie tabulaire.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Fonds */
  --bg:          #08090B;
  --surface:     #101216;
  --surface-hi:  #171A20;
  --surface-top: #1E222A;
  --line:        rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);

  /* Texte */
  --text:      #F4F6F8;
  --text-2:    #B4BCC8;
  --dim:       #78818F;
  --dim-2:     #565E6B;

  /* Accents */
  --accent:    #00E5A0;
  --accent-dk: #00B37D;

  /* Sémantique physiologique */
  --green:     #12E08A;
  --yellow:    #FFC53D;
  --red:       #FF5A5A;
  --blue:      #3D8BFF;
  --violet:    #A98BFF;

  /* Rythme */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --gap:  14px;

  --pad-x: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font-family: inherit; color: inherit; }
svg { stroke: currentColor; fill: none; }

/* ── Structure ──────────────────────────────────────────────── */

.app {
  height: 100%;
  max-width: 620px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

@media (min-width: 700px) {
  .app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.view[hidden] { display: none; }

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px var(--pad-x) calc(var(--tabbar-h) + var(--safe-bot) + 28px);
}

/* ── En-tête de page ────────────────────────────────────────── */

.page-head {
  padding: calc(var(--safe-top) + 18px) var(--pad-x) 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, var(--bg) 68%, transparent);
  position: relative;
  z-index: 5;
}

.page-head h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -.024em;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
}

.head-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-hi);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.head-badge:empty { display: none; }

/* ── Cartes ─────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: var(--gap);
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) backwards;
}

.card.tight { padding: 15px 16px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.card-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title .note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--dim-2);
  font-size: 11px;
}

.section-label {
  margin: 26px 0 12px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ── Anneau de récupération ─────────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 18px;
}

.ring-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}

.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-track { stroke: rgba(255, 255, 255, .07); }

.ring-value {
  stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .25, 1);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-num {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ring-num sup { font-size: 17px; font-weight: 600; top: -.85em; margin-left: 1px; }

.ring-cap {
  font-size: 8.5px;
  font-weight: 680;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 4px;
}

/* En-tête de métrique : gros chiffre à gauche, chiffres secondaires empilés à droite */
.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.metric-big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.metric-big small { font-size: 14px; color: var(--dim); font-weight: 550; letter-spacing: 0; }

.metric-aside {
  text-align: right;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-aside b { color: var(--text-2); font-weight: 620; }

.hero-side { min-width: 0; flex: 1; }

.hero-verdict {
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -.015em;
  margin: 0 0 6px;
  line-height: 1.3;
}

.hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.45;
}

/* ── Grille de métriques ────────────────────────────────────── */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.metric {
  background: var(--surface);
  padding: 15px 8px 14px;
  text-align: center;
}

.metric-val {
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.metric-val small { font-size: 11px; font-weight: 550; color: var(--dim); margin-left: 2px; letter-spacing: 0; }

.metric-lab {
  font-size: 10px;
  font-weight: 620;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 5px;
}

.card.flush { padding: 0; overflow: hidden; }
.card.flush .hero { padding: 24px 20px 20px; }

/* ── Barre de charge (strain) ───────────────────────────────── */

.strain-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.strain-num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

.strain-num small { font-size: 14px; color: var(--dim); font-weight: 550; letter-spacing: 0; }

.strain-tag {
  font-size: 11px;
  font-weight: 620;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.meter {
  height: 7px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
  position: relative;
}

.meter-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--blue), #7FB4FF);
  width: 0;
  transition: width 1s cubic-bezier(.2, .8, .25, 1);
}

.meter-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 10px;
  color: var(--dim-2);
  font-variant-numeric: tabular-nums;
}

/* ── Tendance 14 jours ──────────────────────────────────────── */

.trend {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 96px;
  margin-bottom: 9px;
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
  cursor: default;
}

.trend-bar {
  border-radius: 4px 4px 2px 2px;
  min-height: 3px;
  transition: opacity .18s;
  animation: grow .6s cubic-bezier(.2, .8, .25, 1) backwards;
}

@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.trend-bar { transform-origin: bottom; }

.trend-col:hover .trend-bar { opacity: .72; }

.trend-labels {
  display: flex;
  gap: 5px;
}

.trend-labels span {
  flex: 1;
  text-align: center;
  font-size: 9.5px;
  color: var(--dim-2);
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
}

.legend i {
  width: 8px; height: 8px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -1px;
}

/* ── Sommeil : stades ───────────────────────────────────────── */

.stages { display: flex; height: 9px; border-radius: 100px; overflow: hidden; gap: 2px; }
.stages > div { transition: flex-grow .8s cubic-bezier(.2,.8,.25,1); }

.stage-key {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 12px;
}

.stage-key > div { display: flex; align-items: center; justify-content: space-between; }
.stage-key b { font-variant-numeric: tabular-nums; font-weight: 620; }
.stage-key span { color: var(--dim); display: flex; align-items: center; gap: 7px; }
.stage-key i { width: 8px; height: 8px; border-radius: 2px; }

/* ── Listes (séances, programme) ────────────────────────────── */

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row:first-of-type { padding-top: 0; }

.row-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--surface-hi);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--dim);
}

.row-icon svg { width: 17px; height: 17px; }
.row-main { flex: 1; min-width: 0; }

.row-title {
  font-size: 14.5px;
  font-weight: 580;
  letter-spacing: -.01em;
  text-transform: capitalize;
}

.row-sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.row-end {
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.row-end b { display: block; font-size: 15px; font-weight: 640; letter-spacing: -.02em; }
.row-end span { font-size: 10.5px; color: var(--dim-2); text-transform: uppercase; letter-spacing: .06em; }

/* ── Biomarqueurs ───────────────────────────────────────────── */

.bio {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.bio:last-child { border-bottom: 0; padding-bottom: 2px; }
.bio:first-child { padding-top: 2px; }

.bio-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.bio-name { font-size: 14.5px; font-weight: 580; letter-spacing: -.01em; }

.bio-val {
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  font-size: 16px;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.bio-val small { font-size: 11px; font-weight: 500; color: var(--dim); margin-left: 3px; letter-spacing: 0; }

.bio-scale {
  height: 5px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .06);
  position: relative;
  margin-bottom: 7px;
}

.bio-zone {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(18, 224, 138, .28);
  border-radius: 100px;
}

.bio-dot {
  position: absolute;
  top: 50%;
  width: 11px; height: 11px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2.5px solid var(--surface);
  transition: left .9s cubic-bezier(.2, .8, .25, 1);
}

.bio-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--dim-2);
  font-variant-numeric: tabular-nums;
}

.bio-note {
  margin: 9px 0 0;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.5;
}

.bio-action {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  border-left: 2px solid currentColor;
}

/* ── Puces d'état ───────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.st-critique  { color: var(--red);    background: rgba(255, 90, 90, .13); }
.st-alerte    { color: #FF9A4D;       background: rgba(255, 154, 77, .13); }
.st-surveiller{ color: var(--yellow); background: rgba(255, 197, 61, .13); }
.st-bon       { color: var(--green);  background: rgba(18, 224, 138, .13); }
.st-excellent { color: var(--accent); background: rgba(0, 229, 160, .13); }

/* ── Priorités ──────────────────────────────────────────────── */

.prio {
  display: flex;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.prio:last-child { border-bottom: 0; padding-bottom: 0; }
.prio:first-child { padding-top: 0; }

.prio-rank {
  width: 25px; height: 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  background: var(--surface-hi);
  color: var(--dim);
}

.prio:nth-child(1) .prio-rank { background: rgba(255, 90, 90, .16); color: var(--red); }
.prio:nth-child(2) .prio-rank { background: rgba(255, 90, 90, .16); color: var(--red); }
.prio:nth-child(3) .prio-rank { background: rgba(255, 154, 77, .16); color: #FF9A4D; }

.prio-title { font-size: 14.5px; font-weight: 580; letter-spacing: -.01em; margin-bottom: 3px; }
.prio-detail { font-size: 12.5px; color: var(--dim); line-height: 1.5; }

/* ── Alertes ────────────────────────────────────────────────── */

.alert-card {
  background: linear-gradient(180deg, rgba(255, 90, 90, .07), rgba(255, 90, 90, .02));
  border-color: rgba(255, 90, 90, .22);
}

.alert-card .card-title { color: var(--red); }

.alert-item {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  padding: 9px 0 9px 18px;
  position: relative;
  border-bottom: 1px solid rgba(255, 90, 90, .1);
}

.alert-item:last-child { border-bottom: 0; padding-bottom: 0; }
.alert-item:first-child { padding-top: 0; }

.alert-item::before {
  content: "";
  position: absolute;
  left: 2px; top: 15px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.alert-item:first-child::before { top: 6px; }

/* ── HYROX ──────────────────────────────────────────────────── */

.hyrox-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.hyrox-goal {
  font-size: 30px;
  font-weight: 720;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.hyrox-from { font-size: 13px; color: var(--dim); }

.station {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.station:last-child { border-bottom: 0; padding-bottom: 0; }
.station:first-of-type { padding-top: 2px; }

.station-name { flex: 1; font-size: 13.5px; font-weight: 540; min-width: 0; }

.station-times {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.station-times b { font-weight: 640; }
.station-times s { color: var(--dim-2); font-size: 11.5px; margin-right: 6px; }
.station-times .gain { color: var(--green); font-size: 11px; margin-left: 6px; font-weight: 600; }

.dot-verdict { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.v-fort   { background: var(--green); }
.v-moyen  { background: var(--yellow); }
.v-faible { background: var(--red); }
.v-progres{ background: var(--accent); }

/* ── Charges ────────────────────────────────────────────────── */

.lift {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.lift:last-child { border-bottom: 0; padding-bottom: 0; }
.lift:first-of-type { padding-top: 0; }

.lift-main { flex: 1; min-width: 0; }
.lift-name { font-size: 14px; font-weight: 570; letter-spacing: -.01em; }
.lift-goal { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

.lift-load {
  font-variant-numeric: tabular-nums;
  text-align: right;
  flex-shrink: 0;
}

.lift-load b { font-size: 17px; font-weight: 680; letter-spacing: -.03em; }
.lift-load b small { font-size: 11px; font-weight: 500; color: var(--dim); }
.lift-load span { display: block; font-size: 11px; color: var(--dim-2); font-weight: 550; }

/* ── Semaine ────────────────────────────────────────────────── */

.week-day {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.week-day:last-child { border-bottom: 0; padding-bottom: 0; }
.week-day:first-of-type { padding-top: 0; }

.week-day.today .day-abbr { background: var(--accent); color: #06120D; }
.week-day.today .week-name { color: var(--text); font-weight: 640; }

.day-abbr {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--surface-hi);
  color: var(--dim);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.week-main { flex: 1; min-width: 0; }
.week-name { font-size: 14px; font-weight: 540; color: var(--text-2); }
.week-place { font-size: 11.5px; color: var(--dim-2); margin-top: 1px; }

/* ── Chat ───────────────────────────────────────────────────── */

.chat-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.chat-identity { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dk));
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 229, 160, .22);
}

.avatar svg { width: 20px; height: 20px; fill: #06120D; stroke: none; }
.chat-head h1 { font-size: 19px; }

.ghost-btn {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--surface-hi);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--dim);
  transition: color .15s, background .15s;
}

.ghost-btn:hover { color: var(--text); background: var(--surface-top); }
.ghost-btn svg { width: 17px; height: 17px; }

.chat-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.msg {
  max-width: 86%;
  animation: rise .32s cubic-bezier(.2, .7, .3, 1) backwards;
}

.msg.me { align-self: flex-end; }
.msg.james { align-self: flex-start; }

.bubble {
  padding: 11px 15px;
  border-radius: 19px;
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.msg.me .bubble {
  background: linear-gradient(160deg, var(--accent), var(--accent-dk));
  color: #05130E;
  border-bottom-right-radius: 6px;
  font-weight: 500;
}

.msg.james .bubble {
  background: var(--surface-hi);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.msg.error .bubble {
  background: rgba(255, 90, 90, .1);
  border: 1px solid rgba(255, 90, 90, .3);
  color: #FF8B8B;
  font-size: 13.5px;
}

.bubble p { margin: 0 0 9px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble h3 { margin: 14px 0 7px; font-size: 14px; font-weight: 660; letter-spacing: -.01em; }
.bubble h3:first-child { margin-top: 0; }
.bubble ul { margin: 7px 0 9px; padding-left: 17px; }
.bubble li { margin-bottom: 5px; }
.bubble li:last-child { margin-bottom: 0; }
.bubble strong { font-weight: 660; }
.bubble code {
  background: rgba(255, 255, 255, .08);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.msg.me .bubble code { background: rgba(0, 0, 0, .13); }

.bubble .flag {
  display: block;
  margin-top: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 229, 160, .09);
  border-left: 2px solid var(--accent);
  font-size: 13px;
  color: var(--text-2);
}

.msg-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; justify-content: flex-end; }
.msg-photos img { width: 104px; height: 104px; object-fit: cover; border-radius: 13px; border: 1px solid var(--line); }

/* Curseur de frappe */
.typing-dots { display: inline-flex; gap: 4px; padding: 3px 0; }
.typing-dots i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dim);
  animation: pulse 1.3s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }

@keyframes pulse {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30%           { opacity: 1;  transform: translateY(-3px); }
}

.caret {
  display: inline-block;
  width: 2px; height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* Écran vide */
.chat-empty {
  margin: auto 0;
  text-align: center;
  padding: 20px 10px 40px;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) backwards;
}

.chat-empty h2 {
  font-size: 19px;
  font-weight: 640;
  letter-spacing: -.02em;
  margin: 0 0 7px;
}

.chat-empty p { color: var(--dim); font-size: 13.5px; margin: 0 auto 22px; max-width: 300px; line-height: 1.55; }

.suggestions { display: flex; flex-direction: column; gap: 8px; }

.sugg {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 15px;
  text-align: left;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
  line-height: 1.4;
}

.sugg:hover { border-color: var(--line-strong); background: var(--surface-hi); }
.sugg:active { transform: scale(.985); }

/* ── Zone de saisie ─────────────────────────────────────────── */

.composer-wrap {
  padding: 10px var(--pad-x) calc(var(--tabbar-h) + var(--safe-bot) + 10px);
  background: linear-gradient(180deg, transparent, var(--bg) 22%);
  position: relative;
  z-index: 4;
}

.attachments { display: flex; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }

.thumb { position: relative; width: 62px; height: 62px; animation: rise .25s backwards; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

.thumb button {
  position: absolute;
  top: -6px; right: -6px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--surface-top);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 25px;
  padding: 6px 6px 6px 8px;
  transition: border-color .18s;
}

.composer:focus-within { border-color: rgba(0, 229, 160, .38); }

.attach-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--dim);
  flex-shrink: 0;
  transition: color .15s;
}

.attach-btn:hover { color: var(--accent); }
.attach-btn svg { width: 19px; height: 19px; }

.composer textarea {
  flex: 1;
  border: 0;
  background: none;
  resize: none;
  outline: none;
  font-size: 15px;
  line-height: 1.45;
  padding: 9px 2px;
  max-height: 132px;
}

.composer textarea::placeholder { color: var(--dim-2); }

#send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #06120D;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .18s, transform .12s;
}

#send-btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
#send-btn:active { transform: scale(.92); }
#send-btn:disabled { opacity: .32; cursor: default; }

.cost-hint {
  margin: 7px 2px 0;
  font-size: 10.5px;
  color: var(--dim-2);
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-height: 13px;
}

/* ── Barre d'onglets ────────────────────────────────────────── */

.tabbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  display: flex;
  background: rgba(8, 9, 11, .82);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
  z-index: 20;
}

.tab {
  flex: 1;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--dim-2);
  transition: color .18s;
  padding: 0 2px;
}

.tab svg { width: 21px; height: 21px; }
.tab span { font-size: 9.5px; font-weight: 600; letter-spacing: .01em; }
.tab.is-active { color: var(--accent); }
.tab:active { opacity: .6; }

/* ── Squelettes de chargement ───────────────────────────────── */

.skeleton-wrap { padding-top: 10px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hi) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-lg);
  margin-bottom: var(--gap);
}

.skeleton.ring  { height: 178px; }
.skeleton.bar   { height: 120px; }
.skeleton.short { height: 78px; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── État vide ──────────────────────────────────────────────── */

.empty-note {
  text-align: center;
  padding: 46px 24px;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.6;
}

.empty-note code {
  display: inline-block;
  margin-top: 9px;
  background: var(--surface-hi);
  padding: 5px 10px;
  border-radius: 7px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-2);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Mention discrete des photos d'un echange passe : l'image elle-meme n'est
   pas conservee au journal, seul le fait qu'il y en avait une. */
.photo-note {
  align-self: flex-end;
  margin: 0 4px -4px;
  font-size: 11px;
  color: var(--dim-2);
  font-style: italic;
}
