/* Ordinateur de bord (computer-ui.mjs, étape 16, tâche 9 a ; brief 16-tchat-brief.md § 5, maquettes B1 et avis de B3) : bouton de la
   barre du bas (emplacement 3), panneau non modal à rubriques en onglets (Évolutions, Journal), marqueur sur la console du camion.
   Au grand écran, sous le tchat sans le recouvrir (maquette du 08/10) ; à côté de lui sur un écran bas. Le bouton et le panneau suivent
   le pied de la barre (--hud-bar-bottom, hud.css), descendue sur un écran bas en paysage (tâche 10). */
.halo-preview {
  --computer-bottom: calc(var(--hud-bar-bottom) + var(--hud-trigger-height) + 14px);
  --computer-top: calc(var(--chat-top) + 56px);
  --computer-cyan: #8fe3f5;
  --computer-gold: #e0c98f;
}
.halo-preview:has(#chat-ui.chat:not(.is-collapsed)) { --computer-top: calc(var(--chat-top) + min(var(--chat-height), var(--chat-max-height)) + 12px); }
.halo-preview:has(#chat-ui.chat.is-tall:not(.is-collapsed)) { --computer-top: calc(var(--chat-top) + min(var(--chat-tall-height), var(--chat-max-height)) + 12px); }

.computer-launch {
  position: fixed; z-index: 24; bottom: var(--hud-bar-bottom); left: calc(var(--edge, 22px) + 165px);
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--ui-glass-line); border-radius: 4px;
  color: #b7ccc1; background: var(--ui-glass-soft); box-shadow: inset 0 1px var(--ui-glass-highlight);
  backdrop-filter: var(--ui-glass-blur); -webkit-backdrop-filter: var(--ui-glass-blur); cursor: pointer; pointer-events: auto;
}
/* Couleur des autres boutons de la barre (remarque de l'utilisateur du 14/10 : l'icône était teintée de cyan). */
/* Sans le bouton de l'entraînement (le pantin au camp, étape 2, tâche 11), l'ordinateur prend sa place dans la barre. */
@media (min-width: 721px) and (pointer: fine) {
  .halo-preview.without-combat-launcher .computer-launch { left: calc(var(--edge, 22px) + 110px); }
}
.computer-launch:hover, .computer-launch[data-open="true"] { color: #e6eee0; background: rgb(43 63 60 / 92%); border-color: rgb(170 205 195 / 40%); }
/* La pastille du Journal : le chiffre gravé ambre de toutes les pastilles (choix de l'utilisateur du 14/10, chat.css), au coin bas du
   bouton et en ligne après le nom de la rubrique. */
.computer-unread, .computer-tab-badge {
  display: inline-flex; align-items: center; color: #f0d4a2; background: none; font: 700 10px/1 var(--font-ui, system-ui, sans-serif);
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgb(0 0 0 / 60%);
}
.computer-tab-badge { font-size: 11px; font-weight: 650; }
.computer-unread { position: absolute; bottom: 4px; right: 5px; }
.computer-launch:focus-visible, .computer-console-marker:focus-visible, .computer-panel button:focus-visible { outline: 2px solid #add3be; outline-offset: 3px; }
.computer-launch[hidden], .computer-panel[hidden], .computer-console-marker[hidden], .computer-panel [hidden] { display: none !important; }

/* Au plan des marqueurs de scène (evolutions.css) : sous tout panneau ouvert. */
.computer-console-marker {
  position: fixed; z-index: 7; left: 0; top: 0; display: flex; align-items: center; gap: 6px; min-height: 44px; box-sizing: border-box; padding: 5px 12px 5px 9px;
  border: 1px solid rgb(150 214 228 / 45%); border-radius: 999px; color: #d8f4fa; background: rgb(15 34 38 / 72%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font: 600 11px/1 var(--font-ui, system-ui, sans-serif); letter-spacing: .4px;
  cursor: pointer; pointer-events: auto; white-space: nowrap;
}
.computer-console-marker svg { width: 17px; height: 17px; color: var(--computer-cyan); }

.computer-panel {
  position: fixed; z-index: 26; left: var(--edge, 22px); bottom: var(--computer-bottom);
  display: flex; flex-direction: column; width: min(var(--chat-width, 340px), calc(100vw - 32px)); min-width: min(320px, calc(100vw - 32px));
  max-height: max(260px, calc(100dvh - var(--computer-top) - var(--computer-bottom))); box-sizing: border-box; overflow: hidden;
  border: 1px solid rgb(150 214 228 / 30%); border-radius: 7px; color: var(--ui-text, #e9ede0); background: rgb(17 33 33 / 72%);
  backdrop-filter: blur(9px) saturate(1.12); -webkit-backdrop-filter: blur(9px) saturate(1.12); box-shadow: 0 12px 35px rgb(12 25 20 / 22%), inset 0 1px rgb(231 237 205 / 10%);
  text-shadow: 0 1px 3px rgb(8 17 16 / 65%); font: 12px/1.5 var(--font-ui, system-ui, sans-serif); pointer-events: auto;
}
.computer-header { display: flex; align-items: flex-start; gap: 6px; padding: 10px 6px 4px 16px; }
.computer-heading { flex: 1; min-width: 0; }
.computer-eyebrow {
  margin: 0 0 6px; padding: 4px 0 6px; border-bottom: 1px solid rgb(224 201 143 / 55%); color: var(--computer-gold);
  font-size: 10px; letter-spacing: 2.4px; text-transform: uppercase;
}
.computer-title-row { display: flex; align-items: center; gap: 4px; }
.computer-title { margin: 0; font: 400 18px/1.3 Georgia, serif; color: #f1e9d8; }
.computer-back { display: grid; place-items: center; width: 44px; height: 44px; flex: none; margin-left: -12px; border: 0; border-radius: 6px; background: transparent; color: #d6e2d8; cursor: pointer; }
.computer-close { width: 44px; height: 44px; flex: none; border: 0; border-radius: 6px; background: transparent; color: #d6e2d8; font-size: 22px; cursor: pointer; }
.computer-back:hover, .computer-close:hover { background: rgb(196 222 207 / 10%); }
.computer-intro { margin: 1px 0 0; color: #a9b9ad; font-size: 11px; }
/* Les rubriques : soulignement cyan de l'onglet montré ; la rangée défile quand d'autres s'y ajoutent (Mission, Mémoires, Équipage, Votes). */
.computer-tabs {
  display: flex; flex: none; gap: 2px; margin: 6px 0 0; padding: 0 12px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid rgb(180 205 183 / 16%);
}
.computer-tabs::-webkit-scrollbar { display: none; }
.computer-tab {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1 0 auto; min-width: 96px; min-height: 44px;
  margin: 0; padding: 0 14px; border: 0; border-radius: 0; color: #9daea4; background: transparent; font: inherit; font-size: 12px; white-space: nowrap;
  box-shadow: inset 0 -2px transparent; cursor: pointer;
}
.computer-tab:hover { color: #e0e9dc; background: rgb(188 217 194 / 5%); }
.computer-tab[aria-selected="true"] { color: #eef3e8; box-shadow: inset 0 -2px var(--computer-cyan); }
/* Trois onglets ou plus (étape 5, 8 e2 : Votes et Réserve ; brief 05-votes § 3) : resserrés partout — au téléphone (quatre tiennent à 390 px,
   356 px pour 356, mesuré à 8 e0b) comme au bureau sous 1800 px, où le panneau fait 340 px (« Réserve » y était à demi coupé, recette de
   8 e7) ; à 440 px, ils s'étirent à parts égales. Deux gardent leurs 96 px à parts égales : `SURVIE` coupé, rien ne bouge (critère 16). */
.computer-tabs:has(> .computer-tab:nth-child(3)) > .computer-tab { min-width: 0; padding: 0 10px; }
.computer-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.computer-section { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 0 12px; }

/* Évolutions dans l'ordinateur (evolutions.css garde les tuiles et la fiche du bouclier). */
.evolutions-empty { margin: 18px 16px 6px; color: #b7c3b8; }

/* Journal de CENDRE (journal-ui.mjs) : avis du plus récent, séparateurs de jour, cartes « CENDRE » de la maquette B3. */
.journal-offline { margin: 10px 14px 0; padding: 7px 10px; border: 1px solid rgb(226 188 126 / 35%); border-radius: 5px; color: #f0d4a2; background: rgb(60 44 22 / 30%); font-size: 11px; }
/* « Reste à faire aujourd'hui » (étape 5, piste survie, sous-tâche 7 e4 ; brief 05-jour § 4, R1) : une rangée discrète au-dessus des avis, à la
   marge de la liste, un filet fin en pied ; jamais la carte d'un avis (ni « CENDRE », ni genre, ni heure). */
.journal-reste {
  margin: 10px 14px 0; padding: 0 0 8px; border-bottom: 1px solid var(--ui-glass-line, rgb(196 222 207 / 30%));
  color: var(--ui-text-muted, #c4d2c6); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere;
}
.journal-state { display: grid; justify-items: center; gap: 6px; margin: 22px 16px 8px; text-align: center; }
.journal-state-text { margin: 0; color: #dfe7da; font-size: 13px; }
.journal-state-note { margin: 0; color: #a9b9ad; font-size: 11px; font-style: italic; }
.journal-list { display: grid; gap: 10px; padding: 4px 14px 0; }
.journal-day { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; color: var(--computer-gold); font-size: 11px; letter-spacing: .4px; }
.journal-day::after { content: ""; flex: 1; height: 1px; background: rgb(224 201 143 / 45%); }
.journal-notice {
  display: grid; gap: 5px; padding: 11px 14px 12px 17px; border: 1px solid rgb(150 214 228 / 22%); border-radius: 6px;
  background: rgb(14 32 35 / 46%); box-shadow: inset 2px 0 rgb(143 227 245 / 38%);
}
.journal-notice[data-unread="true"] { border-color: rgb(143 227 245 / 42%); box-shadow: inset 4px 0 var(--computer-cyan); }
.journal-notice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.journal-notice-source {
  padding-bottom: 3px; border-bottom: 1px solid rgb(224 201 143 / 55%); color: var(--computer-gold);
  font-size: 10px; letter-spacing: 3.2px; text-transform: uppercase;
}
.journal-notice-new {
  padding: 2px 9px; border: 1px solid rgb(143 227 245 / 55%); border-radius: 999px; color: var(--computer-cyan); background: rgb(143 227 245 / 10%);
  font-size: 11px; font-weight: 600; text-shadow: none;
}
.journal-notice-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; }
.journal-notice-kind { color: #cfd9cf; font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; }
.journal-notice-time { flex: none; color: #a9b9ad; font-size: 11px; font-variant-numeric: tabular-nums; }
.journal-notice-text { margin: 0; color: #e9ede0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.journal-older, .journal-retry, .journal-lien {
  min-height: 44px; padding: 0 16px; border: 1px solid rgb(150 214 228 / 38%); border-radius: 6px; color: #dff6fb; background: rgb(32 72 80 / 34%);
  font: 600 12px var(--font-ui, system-ui, sans-serif); cursor: pointer;
}
.journal-older { display: block; width: calc(100% - 28px); margin: 12px 14px 0; }
/* « Voir les votes » under a vote's notice (step 5, 8 e5; brief 05-votes § 10): the pattern of « Avis plus anciens », one line, at the start. */
.journal-lien { justify-self: start; margin-top: 3px; }
.journal-older:hover, .journal-retry:hover, .journal-lien:hover { background: rgb(50 104 116 / 46%); }
.journal-older:disabled, .journal-retry:disabled { opacity: .5; cursor: default; }
.journal-start { margin: 12px 14px 0; color: #93a397; font-size: 11px; text-align: center; }

.halo-preview:is(.clean-view, .combat-open, .entry-open, .auth-open, .intro-open) :is(.computer-launch, .computer-console-marker, .computer-panel) { visibility: hidden; pointer-events: none; }

/* Grand écran bas : à côté du tchat déplié plutôt que dessous (la place sous lui ne suffit pas). */
@media (min-width: 721px) and (pointer: fine) and (max-height: 900px) {
  .halo-preview:has(#chat-ui.chat:not(.is-collapsed)) .computer-panel { left: calc(var(--edge, 22px) + var(--chat-width) + 12px); max-height: calc(100dvh - var(--chat-top) - var(--computer-bottom)); }
}
@media (min-width: 721px) and (pointer: fine) and (max-height: 1100px) {
  .halo-preview:has(#chat-ui.chat.is-tall:not(.is-collapsed)) .computer-panel { left: calc(var(--edge, 22px) + var(--chat-width) + 12px); max-height: calc(100dvh - var(--chat-top) - var(--computer-bottom)); }
}
/* Grand écran (étape 6, tâche 8 d ; Q25) : une rubrique qui le demande (« Évolutions », computer-ui.mjs, `heading.wide`) élargit le panneau à
   ≈ 1000 px, d'une hauteur fixe pour que choisir une fiche ne le fasse pas sauter ; le plafond de hauteur ci-dessus reste. À côté du tchat
   des écrans bas : 474 + 1000 < 1800. */
@media (min-width: 1800px) and (pointer: fine) {
  .computer-panel[data-wide="true"] { width: min(1000px, calc(100vw - var(--edge, 22px) - 24px)); height: 820px; }
}
@media (max-width: 720px), (pointer: coarse) {
  .halo-preview:not(.combat-open) .computer-launch {
    --mobile-slot: 3; bottom: var(--mobile-dock-bottom); width: var(--mobile-button-size); height: var(--mobile-button-size);
    left: calc(var(--mobile-dock-left) + var(--mobile-slot) * (var(--mobile-button-size) + var(--mobile-dock-gap)));
  }
  /* Sans le bouton de l'entraînement (le pantin au camp, mobile-hud.css), à sa place. */
  .halo-preview.without-combat-launcher:not(.combat-open) .computer-launch { --mobile-slot: 2; }
  .computer-panel { left: 16px; right: 16px; width: auto; min-width: 0; bottom: var(--mobile-panel-bottom); max-height: var(--mobile-panel-height); }
  /* The caravan is ≈ 300 px wide on a phone: the console's and the trunk's points become round icons like « Entrer », their names kept by
     aria-label (recette de l'étape 16, réponse de l'utilisateur du 15/10 : the two labels touched and covered the trunk). */
  .computer-console-marker { width: 44px; height: 44px; padding: 0; gap: 0; justify-content: center; }
  .computer-console-marker span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Sous 360 px de large (Q129 du 08/11) : les quatre onglets tiennent à 320 px ; à l'étape 10, la rangée défile et l'onglet choisi revient. */
@media (max-width: 359px) {
  .computer-tabs:has(> .computer-tab:nth-child(3)) { gap: 0; padding: 0 8px; }
  .computer-tabs:has(> .computer-tab:nth-child(3)) > .computer-tab { gap: 5px; padding: 0 7px; }
}
@media (prefers-reduced-motion: reduce) { .computer-panel, .journal-notice { transition: none; animation: none; } }
