/* ============================================================
   RÉSIDUS DE L’ANCIEN SHELL (design E), encore utilisés par des écrans pas encore refaits :
   verre .lg, en-tête de page, outils, écran de connexion, listes déroulantes (glass-select).
   Chaque bloc disparaît avec la phase qui refait son écran (voir design-f-atelier/AVANCEMENT.md).
   Le shell lui-même est dans f.css.
   ============================================================ */
:root {
  --shell-sidebar-w: 240px;
  --shell-sidebar-collapsed-w: 56px;
  --shell-topbar-h: 56px;
  --shell-current-w: var(--shell-sidebar-w);
}
/* ---------- squelette ---------- */
#appMain:focus { outline: none; }
#appMain h1[tabindex="-1"]:focus { outline: none; }
/* Le contenu n'apparaît qu'une fois l'écran choisi par le routeur. */
body:not(.shell-ready) #appMain .pages { display: none; }
/* ---------- verre (DESIGN.md §2) : navigation et commandes uniquement ---------- */
/* Liquid glass ultra transparent : un seul réglage pour tout le site (barres, menus, palette,
   inspecteur, listes déroulantes). --glass-tint = le fond (0% transparent, 100% fond plein),
   --glass-blur = l'effet (flou de ce qui passe derrière, 0px = aucun). */
:root {
  --glass-tint: 2%;
  --glass-sheen: .03;
  --glass-blur: 6px;
  --glass-bg:
    linear-gradient(160deg, rgba(255,255,255,calc(var(--glass-sheen) * 2)) 0%, rgba(255,255,255,0) 45%, rgba(255,255,255,var(--glass-sheen)) 100%),
    color-mix(in srgb, var(--color-bg) var(--glass-tint), transparent);
  --glass-filter: blur(var(--glass-blur)) saturate(170%);
  --glass-edge: rgba(255,255,255,.28);
  --glass-shadow: inset 0 1px 1px rgba(255,255,255,.55), inset 0 -1px 1px rgba(255,255,255,.12), 0 16px 40px -24px rgba(0,0,0,.45);
  --glass-text-shadow: 0 1px 3px color-mix(in srgb, var(--color-bg) 85%, transparent);
  --glass-hover: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.lg {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow);
  text-shadow: var(--glass-text-shadow);
}
/* bordure dégradée de 1 px (masque content-box xor) */
.lg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.6) 0%, rgba(255,255,255,.12) 26%, rgba(255,255,255,.03) 55%, rgba(255,255,255,.14) 82%, rgba(255,255,255,.4) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.lg > * { position: relative; z-index: 1; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lg { background: rgba(30,31,36,.97); }
}
/* Thème clair (à venir) : pas de verre blanc sur blanc, une surface pleine. */
[data-theme="light"] .lg { background: var(--color-surface); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: none; }
[data-theme="light"] .lg::before { display: none; }
/* ---------- barre latérale ---------- */
.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: 1.4px solid var(--color-text);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
/* Repliée : les libellés sont masqués à l'écran mais restent le nom accessible des
   liens et du sélecteur de projet (pas de visibility: hidden). */
/* sélecteur de projet */
.shell-project-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-text-inverse);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.shell-project-icon.is-empty { background: var(--color-surface-active); color: var(--color-text-secondary); }
/* entrées */
/* Une seule pastille qui glisse d'une entrée à l'autre (§7.2). */
/* favoris : liste courte, défile seule si l'espace manque (le pied reste visible) */
/* pied de barre : toujours visible, jamais coupé */
/* ---------- barre du haut ---------- */
/* pastille Unity (§4.4) */
.unity-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-disabled);
  flex-shrink: 0;
}
@keyframes shell-unity-pulse {
  from { transform: scale(1); opacity: .6; }
  to { transform: scale(2.8); opacity: 0; }
}
/* indicateur d'exécutions (§4.5) */
@keyframes shell-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
/* avatar */
/* ---------- menus et panneaux ---------- */
@keyframes shell-pop-in {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
/* ---------- fenêtres (nouveau projet, déplacer) ---------- */
@keyframes shell-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shell-dialog-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
.shell-field-label { font-size: 12px; font-weight: 500; }
.shell-choice-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.shell-choice { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.shell-choice:hover { background: var(--color-hover); }
.shell-choice input:disabled + span { color: var(--color-text-muted); }
/* ---------- toasts ---------- */
@keyframes shell-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Le badge de connexion ne recouvre pas la barre latérale. */
body .connection-status { left: calc(var(--shell-current-w) + 40px); }
/* ---------- pages : hiérarchie commune (§8, NAV-07) ---------- */
#appMain .page-head { padding: 32px 0 24px; }
#appMain .page-head h1 { font-size: 28px; line-height: 1.2; }
#appMain .page-head p { max-width: 60ch; font-size: 14px; color: var(--color-text-secondary); }
#appMain .page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#appMain .page-head-action .btn { display: inline-flex; align-items: center; gap: 6px; }
#appMain .page-head-action .material-symbols-outlined { --icon-size: var(--icon-sm); }
@keyframes shell-project-fade { from { opacity: 0; } to { opacity: 1; } }
/* Outils : ce dont chaque outil a besoin (§5.7) */
#appMain .tool-bottom { justify-content: flex-start; gap: 6px; flex-wrap: wrap; }
.tool-need {
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.tool-need-unity { border-color: var(--color-border-strong); color: var(--color-text); }
.wfe-card-action-icon { --icon-size: var(--icon-sm); }
[data-requires-unity][aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
/* ---------- tailles d'écran (§4.1) ---------- */
@media (max-width: 767px) {
  /* Texte masqué à l'écran mais gardé comme nom accessible du bouton. */
  body .connection-status { left: 16px; }
  /* Workflows : les dossiers passent au-dessus de la liste. */
  #appMain .a8-workflows-layout { flex-direction: column; gap: 12px; }
  #appMain .a8-sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--color-border); }
  #appMain .a8-main { min-width: 0; }
  #appMain .search-field { min-width: 0; }
}
/* Tablette : la barre latérale prend 240 px ; les boutons de la barre du haut passent en
   icônes (texte gardé comme nom accessible) pour tenir sans défilement horizontal. */
/* ---------- listes déroulantes en verre (js/glass-select.js) ---------- */
.gs-native {
  position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important;
  opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%) !important; overflow: hidden !important;
}
.gs-trigger.gs-trigger {
  display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; text-align: left; cursor: pointer;
  background-image: none; appearance: none; -webkit-appearance: none;
}
.gs-trigger[hidden] { display: none !important; }
.gs-trigger:disabled { cursor: not-allowed; }
.gs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-trigger.gs-empty .gs-label { color: var(--color-text-muted); }
.gs-chevron { flex: none; --icon-size: var(--icon-sm); color: var(--color-text-muted); transition: transform var(--motion-fast) var(--ease-standard); }
.gs-trigger[aria-expanded="true"] .gs-chevron { transform: rotate(180deg); }
.as-select .gs-chevron { display: none; }
.gs-menu.lg {
  position: fixed; z-index: 100020; box-sizing: border-box; max-width: calc(100vw - 16px); overflow-y: auto; padding: 6px;
  border: 1px solid var(--glass-edge); border-radius: 14px; color: var(--color-text);
  font: 400 14.5px var(--font-ui); letter-spacing: -.01em; transform-origin: top center; scrollbar-width: thin;
  animation: gs-menu-in var(--motion-fast) var(--ease-enter);
}
.gs-menu.lg::before { display: none; }
.gs-menu.gs-up { transform-origin: bottom center; }
@keyframes gs-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
html:not([data-motion="full"]) .gs-menu.lg { animation: none; }
.gs-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; letter-spacing: inherit;
  text-align: left; cursor: pointer;
}
.gs-item:hover:not(:disabled), .gs-item:focus-visible { background: var(--glass-hover); outline: none; }
.gs-item:disabled { color: var(--color-text-muted); cursor: not-allowed; }
.gs-item.gs-nested { padding-left: 18px; }
.gs-item-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-check { flex: none; --icon-size: var(--icon-sm); visibility: hidden; }
.gs-item[aria-selected="true"] .gs-check { visibility: visible; }
.gs-item[aria-selected="true"] .gs-item-text { font-weight: 600; }
.gs-group { padding: 10px 10px 4px; font: 600 11.5px var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.gs-empty-note { padding: 12px 10px; font-size: 13.5px; color: var(--color-text-secondary); }
.wfe-inspector-field .gs-trigger {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-control);
  background-color: var(--solid-2); color: var(--t1); font: inherit; font-size: 14.5px;
}
.as-select .gs-trigger { width: auto; height: auto; padding: 0 2px; border: 0; background: transparent; color: var(--t1, var(--color-text)); font: inherit; font-size: 14.5px; }
.a8-folder-select.gs-trigger { width: 100%; }
