/* public/dashboard/styles/apps.css — LES APPLIS (spec Atlas § 4 et § 5 ; Conclure, spec 2026-10-29 § 4 ; la scène, spec
   2026-11-06 « Peau » § 4 et § 5.2) : la scène de l'écran principal (la carte en fond, la capsule et le rond du compte en
   haut, la feuille ou le panneau), la page de lecture des autres écrans, le menu du compte, et l'habillage des écrans des
   applis. Chaque règle vise une classe `app-*` ou `scene*`, ou vit sous la peau `:root[data-skin="atlas"]` ; seule
   public/dashboard.html charge cette feuille : la console ne la reçoit jamais. Couleurs, traits et coins viennent des
   jetons de la peau (tokens.css). */

/* L'espace n'a ni barre latérale ni barre haute : la zone principale prend toute la largeur. */
:root[data-skin="atlas"] #tenant-shell-root { grid-template-columns: minmax(0, 1fr); }

/* ---------- La page de lecture : le retour vers la carte, le titre, les onglets, le rond du compte ---------- */
/* Fiches, Réglages, Résultats, Messages, Aide, Mon compte : une colonne de 1 040 px au plus, centrée (spec § 4). */
.app-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
  box-sizing: border-box; width: 100%; max-width: 1040px; margin: 0 auto; padding: var(--space-4) var(--space-5) 0;
}
:root[data-skin="atlas"] #tenant-shell-root:not([data-layout="scene"]) #shell-page-outlet { box-sizing: border-box; width: 100%; max-width: 1040px; margin: 0 auto; }
.app-back {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min, 44px);
  padding: 0 var(--space-4) 0 var(--space-3); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-weight: 700; text-decoration: none;
}
.app-back::before { content: '←' / ''; }
.app-back:hover { background: var(--panel-2); }
.app-back[hidden] { display: none; }
.app-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: var(--font-5, var(--font-4)); line-height: 1.15; overflow-wrap: anywhere; }
.app-account-slot { flex: none; margin-left: auto; }
/* Les onglets : un sélecteur segmenté, des pastilles ; l'onglet ouvert est plein. */
.app-tabs[hidden] { display: none; }
.app-tabs ul { list-style: none; margin: 0; padding: 4px; display: flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; }
.app-tabs li { flex: 1 1 0; min-width: 0; }
.app-tab {
  display: flex; align-items: center; justify-content: center; min-height: var(--target-min, 44px); padding: 0 var(--space-4);
  border-radius: 999px; color: var(--muted); font-weight: 700; text-decoration: none; text-align: center; white-space: nowrap;
}
/* Quatre onglets ou plus : chacun prend la place de son mot (Appeler du salarié). */
.app-tabs ul:has(> li:nth-child(4)) > li { flex: 1 1 auto; }
.app-tabs ul:has(> li:nth-child(4)) .app-tab { padding: 0 var(--space-2); font-size: var(--font-2); }
.app-tab:hover { color: var(--text); }
.app-tab[aria-current="page"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 0 var(--border), 0 0 0 1px var(--border); }
.app-tab:focus-visible, .app-back:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (max-width: 720px) {
  .app-bar { padding: var(--space-3) var(--space-3) 0; }
  /* Le retour et le rond sur la première ligne, le titre dessous, puis les onglets sur toute la largeur. */
  .app-title { order: 2; flex-basis: 100%; }
  .app-bar .app-tabs { order: 3; flex-basis: 100%; }
  .app-tab { padding: 0 var(--space-2); font-size: var(--font-2); }
}

/* ---------- La scène : la carte en fond, ce qui flotte en haut, la feuille ou le panneau ---------- */
/* La page ne défile jamais sur un écran principal : la scène couvre la fenêtre, seuls la feuille ou le panneau défilent. La
   barre de lecture reste là pour son h1 (lu par les lecteurs d'écran), hors de la vue. */
:root[data-skin="atlas"]:has(#tenant-shell-root[data-layout="scene"]) body { overflow: hidden; }
:root[data-skin="atlas"] #tenant-shell-root[data-layout="scene"] .app-bar {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
:root[data-skin="atlas"] #tenant-shell-root[data-layout="scene"] #shell-page-outlet { padding: 0; }
.scene { position: fixed; inset: 0; overflow: hidden; background: var(--bg); color: var(--text); }
.scene-map { position: absolute; inset: 0; }
/* Les cartes des applis remplissent la scène ; leur liste se lit dans la feuille (styles/map.css). */
.scene-map :is(.app-zones-map, .app-live-map, .app-map) { position: absolute; inset: 0; display: block; padding: 0; border: 0; border-radius: 0; background: transparent; }
.scene-map :is(.app-zones-map-canvas, .app-live-map-canvas, .app-tour-map) { position: absolute; inset: 0; height: auto; border-radius: 0; }
.scene-map > .app-live { position: absolute; z-index: 1; left: 16px; top: 84px; margin: 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); }
.scene-top {
  position: absolute; z-index: 3; top: max(16px, env(safe-area-inset-top)); left: 16px; right: 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none;
}
.scene-top > * { pointer-events: auto; }
.scene-capsule { min-width: 0; max-width: min(560px, calc(100% - 56px)); }
.scene-capsule:empty { display: none; }
/* La capsule : ce qu'y pose chaque appli (le chiffre du jour, les trois chiffres) flotte sur une pastille ; celle d'Appeler a
   la sienne (game.css). */
.scene-capsule > :not(.app-prize-capsule-slot) {
  box-sizing: border-box; margin: 0; padding: 10px 16px; min-height: var(--target-min, 44px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.scene-account { flex: none; margin-left: auto; }
/* Le chiffre de Ma tournée tient sur une ligne dans la capsule. */
.scene-capsule .ui-cartouche-value { font-size: var(--font-5); }
@media (max-width: 720px) {
  /* Trois chiffres dans 300 px : des libellés en minuscules, qui passent à la ligne sans déborder sur le voisin. */
  .scene-capsule .app-top-stat-label { text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
  .scene-map > .app-live { top: 112px; right: 16px; }
}

/* La feuille (téléphone, tablette) : arrondie en haut, trois hauteurs ; le panneau (ordinateur) : à droite, flottant. */
.scene-sheet {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: var(--scene-callbar-h, 0px); box-sizing: border-box;
  display: flex; flex-direction: column; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-bottom: 0; border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 32px rgb(0 0 0 / .28); padding-bottom: env(safe-area-inset-bottom);
  transition: height .32s cubic-bezier(.2, .8, .2, 1);
}
.scene-sheet[data-dragging="true"] { transition: none; user-select: none; }
.scene-handle {
  flex: none; display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--target-min, 44px);
  margin: 0; padding: 0; border: 0; background: transparent; cursor: grab; touch-action: none;
}
.scene-handle::before { content: ''; width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
.scene-handle:focus-visible { outline: 2px solid var(--text); outline-offset: -4px; border-radius: 26px 26px 0 0; }
.scene-tabs { flex: none; padding: 0 20px var(--space-3); }
.scene-tabs:empty, .scene-tabs:has(> .app-tabs[hidden]) { display: none; }
.scene-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px var(--space-3); display: flex; flex-direction: column; gap: var(--space-4); }
.scene-action { flex: none; padding: var(--space-3) 20px 20px; border-top: 1px solid var(--border); }
.scene-action:empty { display: none; }
/* « Maintenant » et le bilan sont leur propre bloc : pas de trait au-dessus. */
.scene-action:has(> .app-now, > .app-bilan) { border-top: 0; }
.scene-action .app-gesture { width: 100%; min-height: 56px; }
@media (max-width: 1024px) {
  .scene-sheet { max-width: 560px; margin-inline: auto; }
  .scene-sheet[data-state="half"] { height: 50%; }
  .scene-sheet[data-state="full"] { height: calc(100% - 76px - var(--scene-callbar-h, 0px)); }
  .scene-sheet[data-state="collapsed"] .scene-body { display: none; }
  /* Les contrôles et l'attribution de la carte restent au-dessus de la feuille, et sous ce qui flotte en haut. */
  .scene-map :is(.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left) { bottom: calc(var(--scene-sheet-h, 50%) + var(--scene-callbar-h, 0px)); }
  .scene-map .maplibregl-ctrl-top-right { top: 76px; }
}
@media (max-width: 720px) {
  .scene-sheet { max-width: none; }
}
/* Sur ordinateur, le panneau flottant à droite : 400 px, toute la hauteur moins les marges et ce qui flotte en haut. */
@media (min-width: 1025px) {
  .scene-sheet { left: auto; right: 16px; top: 76px; bottom: 16px; width: 400px; height: auto !important; border-bottom: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow); }
  .scene-handle { display: none; }
  .scene-tabs { padding-top: var(--space-4); }
  .scene-map :is(.maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right) { right: 432px; }
  .scene-map .maplibregl-ctrl-top-left { top: 76px; }
}
/* La barre d'appel passe au-dessus de la scène : en bas sur téléphone (la feuille remonte d'autant), à gauche du panneau sur
   ordinateur. Les avis d'un espace résilié ou d'une nouvelle version flottent sous la capsule. */
:root[data-skin="atlas"] #tenant-shell-root[data-layout="scene"] #shell-callbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; }
:root[data-skin="atlas"] #tenant-shell-root[data-layout="scene"] :is(.shell-terminated-banner, .shell-version-notice) { position: fixed; z-index: 4; top: 76px; left: 16px; right: 16px; max-width: 560px; }
@media (min-width: 1025px) {
  :root[data-skin="atlas"] #tenant-shell-root[data-layout="scene"] #shell-callbar { left: 16px; right: 432px; bottom: 16px; border: 1px solid var(--border); border-radius: 18px; }
}

/* ---------- Le menu du compte : le rond, puis une feuille (téléphone, tablette) ou un menu qui tombe (ordinateur) ---------- */
:root[data-skin="atlas"] .shell-account-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: var(--target-min, 44px); height: var(--target-min, 44px); padding: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); cursor: pointer;
}
:root[data-skin="atlas"] .shell-account-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.app-account-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-skin="atlas"] .shell-account-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--pot); color: var(--on-pot, var(--bg)); font-size: 11px; font-weight: 800; line-height: 1;
}
:root[data-skin="atlas"] .shell-account-count[hidden], :root[data-skin="atlas"] .shell-bell-count[hidden] { display: none; }
:root[data-skin="atlas"] .shell-account-menu {
  position: absolute; z-index: 90; right: 0; top: calc(100% + 8px); width: 320px; max-height: calc(100vh - 96px); overflow-y: auto;
  box-sizing: border-box; padding: var(--space-2); gap: 2px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
:root[data-skin="atlas"] .shell-account-menu[hidden], :root[data-skin="atlas"] .shell-account-scrim[hidden] { display: none; }
:root[data-skin="atlas"] .shell-account-item { display: flex; align-items: center; gap: var(--space-2); width: 100%; font-size: var(--font-3, var(--font-2)); font-weight: 600; }
:root[data-skin="atlas"] .shell-account-item[hidden] { display: none; }
:root[data-skin="atlas"] .shell-account-group { display: flex; flex-direction: column; gap: 2px; padding: var(--space-1) 0; border-block: 1px solid var(--border); }
:root[data-skin="atlas"] .shell-account-group[hidden] { display: none; }
:root[data-skin="atlas"] .shell-account-menu .shell-presence { padding: var(--space-2); flex-wrap: wrap; }
:root[data-skin="atlas"] .shell-account-menu .shell-presence[hidden] { display: none; }
:root[data-skin="atlas"] .shell-account-menu .shell-bell { justify-content: space-between; }
:root[data-skin="atlas"] .shell-account-menu .shell-bell-count { position: static; }
:root[data-skin="atlas"] .shell-account-menu .shell-bell-panel { position: static; width: auto; max-height: none; box-shadow: none; border: 0; padding: 0 var(--space-2) var(--space-2); }
:root[data-skin="atlas"] .shell-logout-btn { color: var(--muted); }
@media (max-width: 1024px) {
  :root[data-skin="atlas"] .shell-account-scrim { position: fixed; inset: 0; z-index: 89; background: rgb(0 0 0 / .5); }
  :root[data-skin="atlas"] .shell-account-menu {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: 560px; margin-inline: auto; max-height: 85vh;
    padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom)); border-bottom: 0; border-radius: 26px 26px 0 0;
  }
}

/* ---------- Cibles : 44 px au moins sous la peau (spec § 5) ---------- */
/* Le menu du compte, les boutons, les boutons icônes (fermer une fenêtre, retirer une étiquette), les
   champs et les touches de la barre d'appel n'ont que leur remplissage pour hauteur (25 à 40 px) ; la console, qui ne
   reçoit pas cette feuille, garde les siens. Le plancher est le jeton de cible ; le bouton unique de l'accueil a son
   minimum, plus haut (`.app-gesture`). Un lien en bouton est un flex : sa hauteur tient et son texte reste centré. Le
   clavier d'appel a six touches, chacune de 44 px de large au moins ; un bouton icône est carré. */
:root[data-skin="atlas"] .shell-account-btn,
:root[data-skin="atlas"] .shell-bell,
:root[data-skin="atlas"] .shell-presence-actions button,
:root[data-skin="atlas"] .shell-account-item,
:root[data-skin="atlas"] .ui-icon-btn,
:root[data-skin="atlas"] .callbar-dialpad input,
:root[data-skin="atlas"] .callbar-wrapup select,
:root[data-skin="atlas"] .callbar-wrapup textarea,
:root[data-skin="atlas"] .callbar-dtmf button,
:root[data-skin="atlas"] .ui-btn:not(.app-gesture) { min-height: var(--target-min, 44px); }
:root[data-skin="atlas"] .shell-bell,
:root[data-skin="atlas"] .ui-icon-btn { min-width: var(--target-min, 44px); }
:root[data-skin="atlas"] .ui-icon-btn { display: inline-flex; align-items: center; justify-content: center; }
:root[data-skin="atlas"] a.ui-btn { display: inline-flex; align-items: center; justify-content: center; }
:root[data-skin="atlas"] .callbar-dtmf { grid-template-columns: repeat(6, minmax(var(--target-min, 44px), 1fr)); }

/* ---------- L'écran principal, dans la feuille de la scène : l'état, ce qui s'ouvre d'ici ---------- */
.app-home-panel { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.app-home-panel:empty { display: none; }
.app-gesture { align-self: stretch; justify-content: center; min-height: 48px; font-size: var(--font-4); text-align: center; }
.app-home-link { display: inline-flex; align-items: center; min-height: var(--target-min, 44px); color: var(--text); font-weight: 700; }
.app-home-link + .app-home-link { margin-left: var(--space-4); }
/* Le donneur d'ordre sans rien à vérifier : une ligne d'état calme, sans bouton ; Suivre liste ses campagnes sous la bande. */
.app-home-calm { margin: 0; color: var(--muted); font-size: var(--font-3); line-height: 1.5; }
/* Le témoin du direct : un voyant et ses mots, jamais la couleur seule. */
.app-live { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--font-1); }
.app-live::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text); box-sizing: border-box; }
.app-live[data-live="live"]::before { background: var(--live, var(--brand-solid)); border: 0; }

/* ---------- Conclure : Aujourd'hui, l'Agenda (jour, semaine), les agendas reliés, la fiche d'un RDV ---------- */
.app-conclure { display: flex; flex-direction: column; gap: var(--space-4); max-width: 960px; }
.app-conclure-panel { max-width: 420px; }
.app-conclure-h2 { margin: 0; font-size: var(--font-4); }
.app-conclure-h3 { margin: 0 0 var(--space-2); font-size: var(--font-3); }
.app-conclure-h2::first-letter, .app-conclure-h3::first-letter { text-transform: uppercase; }
.app-conclure-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.app-conclure-bar .app-conclure-h2 { flex: 1 1 100%; }
.app-conclure-views, .app-conclure-nav { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.app-conclure-views button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.app-conclure-dayblock { padding-top: var(--space-3); border-top: var(--line, 1.5px) solid var(--rule, var(--border)); }
.app-conclure-items, .app-conclure-calendars, .app-conclure-said { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.app-conclure-said li::before { content: '— '; color: var(--muted); }
.app-conclure-item {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1) var(--space-3);
  background: var(--panel); border: var(--line, 1.5px) solid var(--rule, var(--border)); border-radius: var(--radius-sm);
}
.app-conclure-item-body {
  flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  min-height: var(--target-min, 44px); color: var(--text); text-decoration: none;
}
.app-conclure-item-body[href]:hover .app-conclure-item-text, .app-conclure-item-body[href]:focus-visible .app-conclure-item-text { text-decoration: underline; }
.app-conclure-item-body[href]:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.app-conclure-item-time { font-variant-numeric: tabular-nums; font-weight: 700; }
/* Une occupation se lit en tirets, une occupation d'un agenda relié en pointillés : jamais la couleur seule. */
.app-conclure-item-busy { border-style: dashed; }
.app-conclure-item-external { border-style: dotted; }
.app-conclure-calendar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.app-conclure-calendar-name { font-weight: 700; overflow-wrap: anywhere; }
.app-conclure-calendar-hint { flex: 1 1 100%; color: var(--muted); font-size: var(--font-2); }
.app-conclure-calendar-actions { display: inline-flex; gap: var(--space-2); margin-left: auto; }
.app-conclure-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-3); }
.app-conclure-facts dt { color: var(--muted); }
.app-conclure-facts dd { margin: 0; overflow-wrap: anywhere; }
.app-conclure-fiche .ui-tampon { margin-bottom: var(--space-3); }

/* ---------- O-11 : la fiche campagne en étapes (un itinéraire de quatre arrêts, une étape à l'écran) ---------- */
/* Partir (O-10) : le bandeau d'un espace résilié, en tête de chaque écran ; et la carte « Partir » de Mon compte. */
:root[data-skin="atlas"] .shell-terminated-banner { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--warn); border-left-width: 4px; border-radius: var(--radius); background: var(--panel-2); color: var(--text); font-weight: 600; }
:root[data-skin="atlas"] .departure-gesture { display: grid; gap: var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
:root[data-skin="atlas"] .departure-gesture:first-of-type { border-top: 0; padding-top: 0; }
:root[data-skin="atlas"] .departure-gesture h3 { margin: 0; font-size: var(--font-4); }
:root[data-skin="atlas"] .departure-gesture dl { margin: 0; display: grid; gap: var(--space-1); }
:root[data-skin="atlas"] .departure-gesture dt { font-weight: 700; }
:root[data-skin="atlas"] .departure-gesture dd { margin: 0 0 var(--space-2); color: var(--muted); }
:root[data-skin="atlas"] .departure-gesture .ui-form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
/* Les actions en masse (Ruben, 28/10) : la barre de la sélection des prospects, au-dessus de la liste. */
:root[data-skin="atlas"] .leads-bulk { display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
:root[data-skin="atlas"] .leads-bulk[hidden] { display: none; }
:root[data-skin="atlas"] .leads-bulk-count { margin: 0; font-weight: 700; }
:root[data-skin="atlas"] .leads-bulk .ui-form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
:root[data-skin="atlas"] .leads-bulk p.sub { margin: 0; }
:root[data-skin="atlas"] .campaign-steps { margin: var(--space-3) 0 var(--space-4); }
:root[data-skin="atlas"] .campaign-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--space-2); }
:root[data-skin="atlas"] .campaign-steps button {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--target-min, 44px);
  padding: var(--space-2) var(--space-3); margin: 0; border: var(--line, 1.5px) solid var(--rule, var(--border));
  border-radius: var(--radius-sm); background: var(--panel); color: var(--text); font: inherit; font-weight: 700;
  text-align: left; cursor: pointer;
}
:root[data-skin="atlas"] .campaign-steps button[aria-current="step"] { background: var(--text); color: var(--bg); }
:root[data-skin="atlas"] .campaign-steps button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
:root[data-skin="atlas"] .campaign-step-mark {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border: 1.5px solid currentColor; border-radius: 50%; font-variant-numeric: tabular-nums; font-size: var(--font-2);
}
:root[data-skin="atlas"] .campaign-steps button[data-done="true"]:not([aria-current="step"]) .campaign-step-mark { background: var(--text); color: var(--bg); border-color: var(--text); }
:root[data-skin="atlas"] .campaign-step-panel:focus { outline: none; }
:root[data-skin="atlas"] .campaign-step-panel > * + * { margin-top: var(--space-4); }
:root[data-skin="atlas"] .campaign-step-next { margin-top: var(--space-4); }
@media (max-width: 720px) {
  /* Quatre arrêts tiennent sur un téléphone : le numéro et le mot, sur deux lignes au besoin. */
  :root[data-skin="atlas"] .campaign-steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- O-11 : Réglages regroupés (un onglet empile ses sections, un sommaire mène à chacune) ---------- */
:root[data-skin="atlas"] .settings-summary { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); }
:root[data-skin="atlas"] .settings-section + .settings-section { margin-top: var(--space-6); padding-top: var(--space-5); border-top: var(--line, 1.5px) solid var(--border); }
:root[data-skin="atlas"] .settings-section:focus { outline: none; }

/* ---------- Téléphone ---------- */
@media (max-width: 720px) {
  /* Conclure sur téléphone : la fiche en une colonne, les gestes de l'agenda pleine largeur. */
  .app-conclure-facts { grid-template-columns: minmax(0, 1fr); }
  .app-conclure-facts dd { margin-bottom: var(--space-2); }
  .app-conclure-panel { max-width: none; }
  .app-conclure-bar > .ui-btn-primary { flex: 1 1 100%; }
  .app-conclure-calendar-actions { margin-left: 0; }
}

/* Mon niveau (spec Atlas § 6.3, § 6.4) : les tampons en rangée ; la célébration, un bandeau bref à l'ocre de l'argent. */
.app-stamps { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-2) 0; }
.app-celebration { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); margin-bottom: var(--space-3); border: 2px solid var(--money); color: var(--money); animation: app-celebration-in .4s ease-out; }
.app-celebration button { min-height: var(--target-min, 44px); }
@keyframes app-celebration-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- « À traiter » et les missions de Piloter : les listes de la feuille du Marché (Ruben, 08/11) ---------- */
.app-todo { display: flex; flex-direction: column; gap: var(--space-2); }
.app-todo-title { margin: 0; font-size: var(--font-1); font-weight: 700; color: var(--muted); }
.app-todo-list, .app-home-campaigns .ui-lignes-list { background: var(--panel-2, var(--bg)); border-radius: var(--radius, 14px); }
.app-todo-line + .app-todo-line { border-top: 1px solid var(--border); }
.app-todo-go { display: flex; align-items: center; min-height: var(--target-min, 44px); padding: 8px 14px; color: var(--text); font-size: var(--font-2); font-weight: 700; text-decoration: none; }
.app-todo-go::after { content: '›'; margin-left: auto; padding-left: var(--space-3); color: var(--muted); }
.app-todo-none { margin: 0; color: var(--muted); }
.app-home-campaigns .ui-lignes-list { padding: 0 14px; }
.app-home-campaigns .ui-ligne-body { grid-template-columns: 10px minmax(0, 1fr) auto; }
.app-home-campaigns .ui-ligne-code:empty { display: none; }
.app-home-campaigns .ui-ligne-title { font-size: var(--font-2); }
.app-home-campaigns .ui-ligne-meta { grid-column: 2; }

.app-board, .app-verify-part {
  display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3);
  background: var(--panel); border: var(--line, 1.5px) solid var(--rule, var(--border)); border-radius: var(--radius-sm);
}
.app-board { margin-bottom: var(--space-4); }
.app-board h2 { margin: 0; font-size: var(--font-4); }
.app-todo-list { list-style: none; margin: 0; padding: 0; }

/* ---------- La vérification un par un et la commande (spec Atlas § 4) ---------- */
.app-verify, .app-order { display: flex; flex-direction: column; gap: var(--space-3); max-width: 60rem; }
.app-verify-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.app-verify-head h2 { margin: 0; flex: 1 1 auto; }
.app-verify-head p { flex-basis: 100%; margin: 0; }
.app-verify-part h3 { margin: 0; font-size: var(--font-3, 1rem); }
.app-verify-facts, .app-verify-points, .app-verify-calls, .app-verify-turns { margin: 0; padding-left: var(--space-4); }
.app-verify-turns { max-height: 24rem; overflow-y: auto; }
.app-verify-transcript summary { min-height: var(--target-min, 44px); display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.app-verify-gestures { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.app-verify-count, .app-order-live { margin: 0; color: var(--muted); }
.app-order-figure { margin: 0; font-weight: 700; }

/* « Réduire les animations » (spec § 5) : sous la peau, rien ne bouge. */
@media (prefers-reduced-motion: reduce) {
  :root[data-skin="atlas"] *, :root[data-skin="atlas"] *::before, :root[data-skin="atlas"] *::after { animation: none !important; transition: none !important; }
}

/* ---------- C5 : le cadre de travail dans l'onglet `marche` (shell/workFrame.js) ---------- */
/* La mission d'un propriétaire couvre l'onglet ; la barre d'appel de `marche` ne reparaît au-dessus que pour
   « Décrocher » : pendant l'appel, ses gestes sont ceux du cadre (le pont). */
:root[data-skin="atlas"] .work-frame {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg);
}
:root[data-skin="atlas"] .work-frame-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-4); background: var(--panel);
  border-bottom: var(--line, 1.5px) solid var(--rule, var(--border));
}
:root[data-skin="atlas"] .work-frame-bar h2 { margin: 0; font-size: var(--font-3, 1rem); }
:root[data-skin="atlas"] .work-frame iframe { flex: 1; width: 100%; border: 0; }
:root[data-skin="atlas"] body:has(.work-frame) #shell-callbar:has(#callbar-answer) { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; }

/* ---------- A3 : l'appel et l'après-appel en plein écran (components/callBar.js, `data-full`) ---------- */
/* Rien ne bouge pendant l'appel, sauf le minuteur ; le guide en tête, les gestes en bas. */
:root[data-skin="atlas"] #shell-callbar:has(#callbar[data-full="true"]) {
  position: fixed; inset: 0; z-index: 65; overflow: auto; background: var(--bg);
}
:root[data-skin="atlas"] #callbar[data-full="true"] { max-width: 48rem; margin: 0 auto; padding: var(--space-5) var(--space-4); display: grid; gap: var(--space-4); }
:root[data-skin="atlas"] #callbar[data-full="true"] .callbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
:root[data-skin="atlas"] #callbar[data-full="true"] #callbar-hangup { min-height: 56px; flex: 1 1 100%; }
:root[data-skin="atlas"] .callbar-guide-box { border: var(--line, 1.5px) solid var(--rule, var(--border)); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
:root[data-skin="atlas"] .callbar-guide-box h3 { margin: 0 0 var(--space-2); }
:root[data-skin="atlas"] .callbar-guide-notice { margin: 0 0 var(--space-3); color: var(--muted); }
:root[data-skin="atlas"] .callbar-guide { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); font-size: var(--font-3, 1.05rem); }
:root[data-skin="atlas"] .callbar-guide-box details { margin-top: var(--space-3); }
:root[data-skin="atlas"] .callbar-guide-box summary { min-height: var(--target-min, 44px); display: flex; align-items: center; cursor: pointer; font-weight: 700; }

/* La carte d'Appeler (spec 2026-11-05 § 4.1) : la carte du Marché au-dessus de ses plaques. */
.app-zones-map { display: grid; gap: var(--space-2); }
.app-zones-map-canvas { height: min(56vh, 520px); border-radius: var(--radius-sm); overflow: hidden; }
.app-zones-map-list { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }

/* Les trois chiffres de Piloter (spec 2026-11-05 § 4.2). */
.app-top-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; }
.app-top-stat { display: grid; gap: var(--space-1); min-width: 0; }
.app-top-stat-label { font-size: var(--font-1); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-top-stat-value { margin: 0; font-size: var(--font-5, var(--font-6)); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }

/* La carte en direct de Piloter (spec 2026-11-05 § 4.2) : la même mise en page que la carte d'Appeler. */
.app-live-map { display: grid; gap: var(--space-2); }
.app-live-map-canvas { height: min(56vh, 520px); border-radius: var(--radius-sm); overflow: hidden; }
.app-live-map-list { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
.app-live-map-queue { margin: 0; font-weight: 700; }

/* « Qui appelle », dans la fiche d'une mission (spec 2026-11-05 § 4.2). */
.app-who-calls { display: grid; gap: var(--space-2); justify-items: start; margin-bottom: var(--space-4); }
.app-who-calls-list { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }

/* Les commerciaux en tournée, sur la carte en direct de Piloter (spec 2026-11-05 § 5.1). Ma tournée et la cagnotte : game.css. */
.app-live-map-tour { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
/* Le bouton plein, lien ou bouton, ne se souligne jamais (Ruben, 08/11). */
.app-gesture { text-decoration: none; }
/* La fiche de publication numérote ses étapes dans le texte : la liste ne double pas (T21). */
:root[data-skin="atlas"] .shell-publication-steps { list-style: none; padding-left: 0; }
