/* ============================================================
   Chretieno-OS — Design System v5 « COSMOS »
   Charte : space/cosmique · bleu #2366FF + cyan #00F0FF +
   violet #BB5CF6 + rose #FF2055 · Orbitron · glassmorphism.
   ============================================================ */

:root {
  /* Fonds spatiaux */
  --bg:        #0B0F17;
  --bg-2:      #0d1220;
  --surface:   #121826;
  --surface-2: #1A2233;
  --surface-3: #223256;
  --elevated:  #161f31;

  /* Bordures & texte (teinte froide) */
  --line:        rgba(130,175,255,.09);
  --line-strong: rgba(130,190,255,.20);
  --text:        #EAF2FF;
  --text-2:      #9fb2ce;
  --text-dim:    #61738f;

  /* Palette signature */
  --accent:      #2366FF;   /* bleu principal */
  --accent-2:    #00F0FF;   /* cyan (glow / dégradés) */
  --accent-soft: rgba(35,102,255,.18);
  --cyan:        #00F0FF;
  --violet:      #BB5CF6;
  --pink:        #FF2055;

  /* Statuts */
  --ok:          #2fe6c0;
  --warn:        #f5b544;
  --crit:        #FF2055;
  --info:        #2366FF;

  /* Rayons */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 26px;

  /* Ombres + halos cosmiques */
  --sh-1: 0 1px 2px rgba(0,0,0,.35);
  --sh-2: 0 8px 24px rgba(0,0,0,.4);
  --sh-3: 0 22px 60px rgba(0,0,0,.55);
  --sh-win: 0 28px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(35,102,255,.12);
  --glow-accent: 0 0 22px rgba(35,102,255,.55);
  --glow-cyan:   0 0 24px rgba(0,240,255,.5);

  /* Layout */
  --topbar-h:  38px;
  --taskbar-h: 60px;

  /* Fonts */
  --f-base:    'Inter', system-ui, -apple-system, sans-serif;
  --f-display: 'Orbitron', 'Space Grotesk', 'Inter', sans-serif;
  --f-mono:    'JetBrains Mono', 'Consolas', monospace;
  --f-ui:      var(--f-base);

  --persona: var(--accent);

  /* ---- Compat : alias pour l'ancien CSS ---- */
  --bg-0: var(--bg);
  --bg-1: var(--bg-2);
  --c-violet: var(--violet);
  --c-cyan:   var(--cyan);
  --c-pink:   var(--pink);
  --c-phosphor: var(--ok);
  --c-neon:   var(--warn);
  --c-red:    var(--crit);
  --c-amber:  var(--warn);
  --c-blue:   var(--info);
  --clip-panel: none; --clip-window: none; --clip-chip: none; --clip-tile: none;
  --glow-p: 0 0 0 0 transparent; --glow-v: 0 0 0 0 transparent; --glow-c: 0 0 0 0 transparent; --glow-n: 0 0 0 0 transparent;
  --bevel: 0px; --bevel-sm: 0px; --bevel-xs: 0px;
}

/* personas → couleurs de la charte */
body[data-persona="visitor"]   { --persona: var(--accent); }
body[data-persona="developer"] { --persona: var(--cyan); }
body[data-persona="player"]    { --persona: var(--ok); }
body[data-persona="admin"]     { --persona: var(--violet); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-base);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }

#wallpaperCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* ============================================================
   COCKPIT
   ============================================================ */
.cockpit {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--taskbar-h);
  grid-template-columns: minmax(0, 1fr);   /* empêche la grille de s'élargir au contenu (barre) → fenêtres = largeur écran */
  z-index: 1;
}

/* ============================================================
   TOPBAR — fine barre supérieure discrète
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: rgba(14,18,25,.55);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  font-size: 12.5px;
  color: var(--text-2);
}
.topbar-center { display: none; }
.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-logo { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.topbar-brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2px;
  color: var(--text);
}
.topbar-ver { color: var(--text-dim); font-size: 11px; font-family: var(--f-mono); }
.topbar-sep { color: var(--text-dim); opacity: .35; }
.topbar-ctx { color: var(--text-2); font-weight: 500; }
.topbar-pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok);
}
.topbar-persona {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
}
/* Puce compte + menu déroulant */
.acc-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 8px 3px 4px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text); cursor: pointer; transition: background .15s, border-color .15s;
}
.acc-chip:hover, .acc-chip.open { background: var(--surface); border-color: color-mix(in srgb, var(--cyan) 30%, var(--line-strong)); }
.acc-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--f-display); font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(160deg, var(--accent), var(--accent-2)); }
.acc-name { font-size: 12px; font-weight: 600; }
.acc-chev { color: var(--text-dim); transition: transform .15s; }
.acc-chip.open .acc-chev { transform: rotate(180deg); }
.acc-menu {
  position: fixed; top: 52px; right: 14px; z-index: 9400; width: 246px; padding: 8px;
  background: linear-gradient(180deg, rgba(26,34,51,.95), rgba(14,19,30,.97));
  border: 1px solid var(--line-strong); border-radius: 14px;
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--sh-3); animation: ccIn .16s cubic-bezier(.2,.8,.2,1);
}
.acc-menu hr { border: none; height: 1px; background: var(--line); margin: 7px 4px; }
.acc-menu-head { display: flex; align-items: center; gap: 11px; padding: 8px 8px 4px; }
.acc-av.lg { width: 38px; height: 38px; font-size: 15px; }
.acc-menu-head b { display: block; font-size: 13.5px; color: var(--text); }
.acc-menu-head small { font-size: 11.5px; color: var(--text-dim); }
.acc-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border: none; border-radius: 9px; background: transparent; color: var(--text-2);
  font-size: 13px; cursor: pointer; transition: background .12s, color .12s; }
.acc-item svg { width: 16px; height: 16px; flex: none; }
.acc-item:hover { background: var(--accent-soft); color: var(--text); }
.acc-item--danger:hover { background: color-mix(in srgb, var(--crit) 18%, transparent); color: #fff; }
.topbar-icon { position: relative; width: 30px; height: 30px; display: grid; place-items: center; background: transparent; border: none; color: var(--text-2); cursor: pointer; border-radius: var(--r-xs); transition: .15s; }
.topbar-icon:hover { color: var(--text); background: rgba(255,255,255,.06); }
.notif-dot { position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 6px var(--pink); border: 1.5px solid var(--bg); }

.notif-panel {
  position: fixed; top: calc(var(--topbar-h) + 8px); right: 12px;
  width: 340px; max-width: calc(100vw - 24px);
  background: rgba(18,24,38,.92); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  z-index: 9000; box-shadow: var(--sh-3), 0 0 40px rgba(35,102,255,.1);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  overflow: hidden; animation: notifOpen .18s cubic-bezier(.2,.8,.2,1);
}
.notif-panel[hidden] { display: none; }
@keyframes notifOpen { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.notif-head b { font-family: var(--f-display); font-size: 14px; }
.notif-head button { background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; }
.notif-head button:hover { color: var(--cyan); }
.notif-list { max-height: 60vh; overflow: auto; padding: 6px; }
.notif-item { display: flex; gap: 12px; padding: 11px 12px; border-radius: var(--r); transition: background .15s; }
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-ic { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--nc); background: color-mix(in srgb, var(--nc) 16%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--nc) 25%, transparent); }
.notif-body { min-width: 0; }
.notif-body b { display: block; font-size: 13px; color: var(--text); }
.notif-body span { display: block; font-size: 12px; color: var(--text-2); line-height: 1.4; margin: 2px 0; }
.notif-body small { font-size: 10.5px; color: var(--text-dim); font-family: var(--f-mono); }
.notif-empty { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ============================================================
   WORKSPACE — bureau
   ============================================================ */
.workspace { position: relative; overflow: hidden; z-index: 1; }

.desktop-grid {
  position: absolute;
  top: 24px; left: 24px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 98px);
  grid-auto-columns: 92px;
  gap: 6px 6px;
  max-height: calc(100% - 48px);
}
.dicon {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  width: 92px; padding: 10px 4px 8px;
  border-radius: var(--r); cursor: pointer; user-select: none; text-align: center;
  border: 1px solid transparent;
  transition: background .15s, transform .12s, border-color .15s;
}
.dicon:hover { background: rgba(255,255,255,.05); border-color: var(--line); }
.dicon.selected { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dicon-icon {
  width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px;
  background: linear-gradient(160deg, var(--ic, var(--accent)), color-mix(in srgb, var(--ic, var(--accent)) 30%, #0a0e18));
  border: 1px solid color-mix(in srgb, var(--ic, var(--accent)) 55%, transparent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ic, var(--accent)) 32%, transparent), inset 0 1.5px 0 rgba(255,255,255,.28), inset 0 -7px 14px rgba(0,0,0,.22);
  transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .16s;
}
.dicon:hover .dicon-icon { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 28px color-mix(in srgb, var(--ic, var(--accent)) 48%, transparent), inset 0 1.5px 0 rgba(255,255,255,.32); }
.dicon-icon svg { width: 42px; height: 42px; filter: drop-shadow(0 1.5px 3px rgba(0,0,0,.5)); }
.dicon-label { font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.2; text-shadow: 0 1px 4px rgba(0,0,0,.75); }

/* ============================================================
   TASKBAR — dock flottant cosmos (Démarrer · dock · centre de contrôle)
   ============================================================ */
.taskbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 10px;
  padding: 7px 9px;
  min-height: 58px;
  width: max-content;
  max-width: calc(100% - 24px);
  background: linear-gradient(180deg, rgba(26,34,51,.80), rgba(14,19,30,.86));
  border: 1px solid color-mix(in srgb, var(--cyan) 12%, var(--line-strong));
  border-radius: 19px;
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow: 0 14px 44px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.07),
              0 -22px 46px -24px color-mix(in srgb, var(--accent) 65%, transparent);
  position: relative;
  align-self: center;
}
/* fine ligne lumineuse cyan sur le dessus */
.taskbar::before {
  content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cyan) 55%, transparent), transparent);
}

.task-start {
  display: flex; align-items: center; gap: 9px;
  padding: 0 16px; height: 42px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: var(--f-display);
  font-weight: 600; font-size: 13px; letter-spacing: .3px;
  cursor: pointer;
  transition: filter .15s, transform .1s, box-shadow .2s;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 50%, transparent), inset 0 1px 0 rgba(255,255,255,.32);
}
.task-start .ts-logo { display: grid; place-items: center; }
.task-start svg { width: 19px; height: 19px; filter: drop-shadow(0 0 6px rgba(255,255,255,.55)); }
.task-start:hover { filter: brightness(1.1); box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 62%, transparent), inset 0 1px 0 rgba(255,255,255,.38); }
.task-start:active { transform: scale(.97); }
.task-start.active { filter: brightness(1.14); }

/* Dock (apps épinglées + ouvertes) — directement dans la barre, sans cadre */
.task-dock {
  display: flex; align-items: center; gap: 3px;
  padding: 0 2px;
}
.task-pinned, .task-running { display: flex; align-items: center; gap: 3px; }
.task-running { overflow-x: auto; scrollbar-width: none; }
.task-running::-webkit-scrollbar { display: none; }
.task-running:not(:empty) { margin-left: 3px; padding-left: 6px; border-left: 1px solid var(--line); }

.task-app {
  position: relative;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.task-app svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.task-app:hover { background: color-mix(in srgb, var(--ic, var(--accent)) 16%, rgba(255,255,255,.04)); border-color: color-mix(in srgb, var(--ic, var(--accent)) 34%, transparent); transform: translateY(-3px); }
.task-app.running::after {
  content: ''; position: absolute; bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-dim); transition: all .2s;
}
.task-app.focused { background: color-mix(in srgb, var(--ic, var(--accent)) 18%, transparent); border-color: color-mix(in srgb, var(--ic, var(--accent)) 42%, transparent); }
.task-app.focused::after { width: 18px; height: 3px; border-radius: 3px; background: var(--ic, var(--accent)); box-shadow: 0 0 8px var(--ic, var(--accent)); }
.task-tooltip {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%);
  background: var(--elevated); color: var(--text);
  padding: 5px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  font-size: 11.5px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s;
  box-shadow: var(--sh-2);
}
.task-app:hover .task-tooltip { opacity: 1; }

/* Centre de contrôle (réseau · jauges · horloge) */
.task-ctrl {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 13px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  border: 1px solid var(--line);
}
.ctrl-btn {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: none; border-radius: 10px; background: transparent;
  color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.ctrl-btn:hover { background: rgba(255,255,255,.08); color: var(--cyan); }
.ctrl-btn:active { transform: scale(.92); }

.ctrl-net { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--text-2); }
.ctrl-net .net-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: netPulse 2.4s ease-in-out infinite; }
@keyframes netPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }

.ctrl-div { width: 1px; height: 26px; background: var(--line); }

.ctrl-stat { display: inline-flex; align-items: center; gap: 6px; }
.ctrl-tag { font-family: var(--f-display); font-style: normal; font-size: 9px; font-weight: 600; letter-spacing: .6px; color: var(--text-dim); }
.ctrl-ring { position: relative; width: 32px; height: 32px; display: grid; place-items: center; }
.ctrl-ring svg { width: 32px; height: 32px; transform: rotate(-90deg); }
.ctrl-ring .g-bg { fill: none; stroke: rgba(255,255,255,.10); stroke-width: 3.4; }
.ctrl-ring .g-fg { fill: none; stroke: var(--gc, var(--cyan)); stroke-width: 3.4; stroke-linecap: round;
  stroke-dasharray: 94.25; stroke-dashoffset: 66; transition: stroke-dashoffset .6s ease;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--gc, var(--cyan)) 75%, transparent)); }
.ctrl-ring em { position: absolute; font-family: var(--f-display); font-style: normal; font-weight: 600; font-size: 10px; color: var(--text); }

.ctrl-clock {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.05; padding-left: 2px; text-align: right;
}
.ctrl-clock b { color: var(--text); font-size: 14px; font-weight: 600; font-family: var(--f-display); font-feature-settings: 'tnum'; }
.ctrl-clock small { color: var(--text-dim); font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase; margin-top: 1px; }
.task-ctrl { cursor: pointer; }

/* ============================================================
   CENTRE DE CONTRÔLE (panneau widgets — jauges + actions)
   ============================================================ */
.cc-panel {
  position: fixed; right: 14px; bottom: 80px; z-index: 9400;
  width: 320px; padding: 16px;
  background: linear-gradient(180deg, rgba(26,34,51,.94), rgba(14,19,30,.96));
  border: 1px solid color-mix(in srgb, var(--cyan) 12%, var(--line-strong));
  border-radius: 18px;
  backdrop-filter: blur(26px) saturate(180%); -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow: var(--sh-3), inset 0 1px 0 rgba(255,255,255,.06);
  animation: ccIn .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes ccIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.cc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.cc-head b { font-family: var(--f-display); font-size: 14px; color: var(--text); }
.cc-head span { font-size: 11px; color: var(--text-dim); font-family: var(--f-mono); }
.cc-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.cc-gauge { position: relative; display: grid; place-items: center; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.cc-gauge svg { width: 100%; max-width: 116px; transform: rotate(-90deg); }
.cc-g-bg { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 7; }
.cc-g-fg { fill: none; stroke: var(--gc, var(--cyan)); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 213.63; stroke-dashoffset: 150; transition: stroke-dashoffset .6s ease;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gc, var(--cyan)) 70%, transparent)); }
.cc-gauge-c { position: absolute; text-align: center; }
.cc-gauge-c em { display: block; font-family: var(--f-display); font-style: normal; font-size: 23px; font-weight: 700; color: var(--text); line-height: 1; }
.cc-gauge-c em::after { content: '%'; font-size: 12px; opacity: .55; margin-left: 1px; }
.cc-gauge-c small { font-size: 10px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; }
.cc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cc-stat { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 11px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.cc-stat-k { font-size: 11.5px; color: var(--text-2); }
.cc-stat b { font-family: var(--f-display); font-size: 13px; color: var(--text); }
.cc-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-tg { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: background .13s, color .13s, border-color .13s; }
.cc-tg span { display: grid; place-items: center; width: 18px; height: 18px; flex: none; }
.cc-tg svg { width: 16px; height: 16px; }
.cc-tg:hover { background: var(--accent-soft); color: var(--text); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.cc-tg--danger:hover { background: color-mix(in srgb, var(--crit) 18%, transparent); border-color: color-mix(in srgb, var(--crit) 40%, transparent); color: #fff; }

/* ============================================================
   MOBILE (≤ 768px) — vue « téléphone » : springboard + plein écran
   ============================================================ */
@media (max-width: 768px) {
  :root { --topbar-h: 50px; --taskbar-h: 64px; }

  /* Topbar compacte */
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar-ver, .topbar-sep, .topbar-ctx { display: none; }
  .topbar-right { gap: 8px; }
  .acc-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Bureau = grille plein écran (springboard) */
  .workspace { overflow-y: auto; overflow-x: hidden; }
  .desktop-grid {
    position: static; top: auto; left: auto;
    display: grid; grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; grid-template-rows: none;
    gap: 20px 4px; max-height: none;
    padding: 20px 12px calc(var(--taskbar-h) + 20px);
    width: 100%; box-sizing: border-box;
  }
  .dicon { width: auto; padding: 6px 2px; }
  .dicon-icon { width: 56px; height: 56px; }
  .dicon-icon svg { width: 38px; height: 38px; }
  .dicon-label { font-size: 11px; }

  /* Fenêtres : plein écran (déjà maximisées via JS) — pas de min/max ni resize
     (préfixe body.is-mobile pour battre window.css chargé après) */
  body.is-mobile .win .win-resize { display: none; }
  body.is-mobile .win-btn--min, body.is-mobile .win-btn--max { display: none; }
  body.is-mobile .win-titlebar { height: 48px; }
  body.is-mobile .win-btn--close { width: 42px; height: 42px; }
  body.is-mobile .win-titlebar-title { font-size: 14px; }

  /* Taskbar pleine largeur, ancrée en bas */
  .taskbar {
    width: 100%; max-width: none; margin: 0; border-radius: 0;
    height: var(--taskbar-h); padding: 8px 12px; gap: 10px;
    border-left: none; border-right: none; border-bottom: none;
    justify-content: space-between; align-self: stretch;
  }
  .taskbar::before { display: none; }
  /* dock = sélecteur d'apps OUVERTES (pinned masquées, on lance via Démarrer) */
  body.is-mobile .task-pinned { display: none; }
  body.is-mobile .task-running { overflow-x: auto; max-width: 46vw; }
  .task-start .ts-label { display: none; }     /* juste le logo C */
  .task-start { padding: 0 16px; height: 46px; }
  .task-ctrl { gap: 8px; padding: 0 10px; height: 46px; }
  .ctrl-net, .ctrl-tag, .ctrl-btn { display: none; }  /* on garde jauges + horloge */

  /* Menu Démarrer = feuille plein écran (préfixe pour battre .start-menu défini plus bas) */
  body.is-mobile .start-menu {
    left: 0; right: 0; transform: none;
    top: var(--topbar-h); bottom: var(--taskbar-h);
    width: 100%; max-width: none; max-height: none;
    border-radius: 0; border-left: none; border-right: none;
    animation: none;
  }
  body.is-mobile .start-grid { grid-template-columns: repeat(3, 1fr); }

  /* Panneaux flottants = quasi pleine largeur en bas */
  .cc-panel { left: 8px !important; right: 8px; width: auto; max-width: none; bottom: calc(var(--taskbar-h) + 8px); }
  .acc-menu { left: 8px !important; right: 8px; width: auto; max-width: none; top: calc(var(--topbar-h) + 4px); }
  .notif-panel { left: 8px !important; right: 8px; width: auto; max-width: none; }

  /* Menus contextuels plus larges au doigt (préfixe pour battre .ctx-menu défini plus bas) */
  body.is-mobile .ctx-menu { min-width: 240px; }
  body.is-mobile .ctx-menu button { padding: 12px 14px; }
}

/* ============================================================
   START MENU
   ============================================================ */
.start-menu {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--taskbar-h) + 6px);
  width: 560px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--taskbar-h) - 24px);
  background: rgba(22,29,43,.92);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  z-index: 9000;
  display: flex; flex-direction: column;
  box-shadow: var(--sh-3);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  animation: startOpen .2s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.start-menu[hidden] { display: none; }
@keyframes startOpen {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateX(-50%); }
}
.start-head { padding: 16px 16px 10px; }
.start-head input {
  width: 100%; padding: 11px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text); font-size: 13.5px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.start-head input::placeholder { color: var(--text-dim); }
.start-head input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.start-body { flex: 1; overflow-y: auto; padding: 6px 16px 16px; }
.start-body::-webkit-scrollbar { width: 8px; }
.start-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.start-section + .start-section { margin-top: 18px; }
.start-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-dim); margin-bottom: 10px; font-weight: 600;
}
.start-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.start-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 10px;
  border: 1px solid transparent; border-radius: var(--r);
  background: transparent; cursor: pointer; color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
}
.start-tile svg { width: 30px; height: 30px; }
.start-tile:hover { background: rgba(255,255,255,.06); border-color: var(--line); transform: translateY(-1px); }
.start-tile span { font-size: 11.5px; text-align: center; line-height: 1.2; }

.start-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--line);
  background: rgba(0,0,0,.15);
}
.start-user { display: flex; align-items: center; gap: 10px; }
.start-user-avatar {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: #fff;
}
.start-user-avatar svg { width: 22px; height: 22px; }
.start-user-meta b { font-size: 13px; display: block; color: var(--text); }
.start-user-meta small { color: var(--text-dim); font-size: 11px; }
.start-actions { display: flex; gap: 6px; }
.start-act {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); color: var(--text-2); cursor: pointer;
  transition: .15s;
}
.start-act svg { width: 18px; height: 18px; }
.start-act:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.start-act--danger:hover { color: var(--crit); border-color: var(--crit); background: color-mix(in srgb, var(--crit) 14%, transparent); }

/* ============================================================
   CONTEXT MENU
   ============================================================ */
.ctx-menu {
  position: fixed; z-index: 9500;
  background: rgba(26,33,48,.96);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 6px; min-width: 220px;
  font-size: 13px;
  box-shadow: var(--sh-3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.ctx-menu button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text);
  padding: 9px 12px; cursor: pointer; border-radius: var(--r-sm);
  transition: background .12s;
}
.ctx-menu button:hover { background: var(--accent-soft); }
.ctx-menu hr { border: none; height: 1px; background: var(--line); margin: 5px 8px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-stack {
  position: fixed; bottom: calc(var(--taskbar-h) + 14px); right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9700; max-width: 340px;
}
.toast {
  background: rgba(26,33,48,.96);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  padding: 12px 15px; border-radius: var(--r);
  display: flex; flex-direction: column; gap: 3px;
  animation: toastIn .25s ease;
  box-shadow: var(--sh-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
@keyframes toastIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast b { color: var(--text); font-size: 13px; font-weight: 600; }
.toast span { color: var(--text-2); font-size: 12.5px; }

/* ============================================================
   SNAP PREVIEW
   ============================================================ */
.snap-preview {
  position: fixed;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  border-radius: var(--r-lg);
  z-index: 8000; pointer-events: none;
  transition: .12s ease;
}

/* ============================================================
   BOOT — écran de démarrage (cosmos)
   ============================================================ */
@keyframes brandSpin { to { transform: rotate(360deg); } }
.brand-spin { animation: brandSpin 16s linear infinite; }

.boot {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  background: radial-gradient(120% 90% at 50% 40%, rgba(11,15,23,.25), rgba(6,9,15,.82));
  backdrop-filter: blur(2px);
  transition: opacity .6s ease;
}
.boot.hidden { opacity: 0; pointer-events: none; }
.boot-logo svg { display: block; filter: drop-shadow(0 0 20px rgba(0,240,255,.45)); }
.boot-word { font-family: var(--f-display); font-size: 30px; font-weight: 800; letter-spacing: 7px; color: #fff; text-shadow: 0 0 24px rgba(0,240,255,.25); margin-top: 6px; }
.boot-word span { color: var(--cyan); }
.boot-sub { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 3px; color: var(--text-2); }
.boot-progress { width: 300px; max-width: 70vw; height: 4px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.boot-progress i { display: block; width: 0; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--cyan)); box-shadow: 0 0 12px var(--cyan); transition: width .25s ease; }
.boot-pct { font-family: var(--f-display); font-size: 13px; font-weight: 600; letter-spacing: 2px; color: var(--cyan); }
.boot-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 8px; font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim); }
.boot-steps .bs { display: inline-flex; align-items: center; gap: 7px; transition: color .3s; }
.boot-steps .bs i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-strong); transition: .3s; }
.boot-steps .bs.done { color: var(--text-2); }
.boot-steps .bs.done i { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* ============================================================
   LOCK / LOGIN — écran de connexion (cosmos, mono-utilisateur)
   ============================================================ */
.lock {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 34px 28px;
  background: radial-gradient(130% 100% at 50% 22%, rgba(11,15,23,0), rgba(6,9,15,.45));
  opacity: 0; transition: opacity .5s ease;
}
.lock.show { opacity: 1; }
.lock-err { color: var(--crit); font-size: 12px; margin-top: 9px; min-height: 15px; }
@keyframes lockShake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.lock-card.shake { animation: lockShake .4s; }
.lock-card {
  position: relative; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 40px 46px 34px;
  background: rgba(18,24,38,.5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--sh-3), 0 0 60px rgba(35,102,255,.12), inset 0 0 0 1px rgba(0,240,255,.05);
}
.lock-logo svg { display: block; filter: drop-shadow(0 0 16px rgba(0,240,255,.45)); margin-bottom: 8px; }
.lock-welcome { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 5px; font-size: 11px; color: var(--cyan); }
.lock-user {
  font-family: var(--f-display); font-weight: 800; font-size: 42px; letter-spacing: 5px;
  margin: 2px 0 20px;
  background: linear-gradient(120deg, #fff, var(--cyan) 55%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lock-form { display: flex; gap: 8px; width: min(320px, 78vw); }
.lock-form input {
  flex: 1; background: rgba(11,15,23,.7); border: 1px solid var(--line-strong);
  border-radius: var(--r); color: var(--text); padding: 12px 16px; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.lock-form input::placeholder { color: var(--text-dim); }
.lock-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--glow-accent); }
.lock-go {
  width: 46px; border: none; border-radius: var(--r);
  background: linear-gradient(160deg, var(--accent), var(--cyan)); color: #001018;
  font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: var(--glow-accent);
  transition: filter .15s, transform .1s;
}
.lock-go:hover { filter: brightness(1.1); }
.lock-go:active { transform: scale(.96); }
.lock-role { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 2.5px; color: var(--text-dim); margin: -16px 0 20px; }
.lock-formarea { width: min(320px, 78vw); }
.lock-enter {
  width: 100%; padding: 13px; border: none; border-radius: var(--r);
  background: linear-gradient(160deg, var(--accent), var(--cyan)); color: #001018;
  font-family: var(--f-base); font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: var(--glow-accent); transition: filter .15s, transform .1s;
}
.lock-enter:hover { filter: brightness(1.08); } .lock-enter:active { transform: scale(.98); }
.lock-last { margin-top: 16px; font-size: 11px; color: var(--text-dim); font-family: var(--f-mono); }

/* switcher de comptes */
.lock-switch { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.lock-acc { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; background: none; border: none; opacity: .55; transition: opacity .15s, transform .12s; }
.lock-acc:hover { opacity: 1; transform: translateY(-2px); }
.lock-acc.active { opacity: 1; }
.lock-acc .av {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(160deg, var(--ac), color-mix(in srgb, var(--ac) 40%, #0a0e18));
  border: 2px solid transparent; transition: .15s;
}
.lock-acc.active .av { border-color: var(--ac); box-shadow: 0 0 18px color-mix(in srgb, var(--ac) 55%, transparent); }
.lock-acc span { font-size: 11px; color: var(--text-2); }

.lock-foot {
  position: fixed; bottom: 18px; left: 18px; right: 18px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--text-dim);
}
.lock-status { display: inline-flex; align-items: center; gap: 8px; }
.lock-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.lock-actions { display: flex; gap: 8px; }
.lock-actions button {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: rgba(18,24,38,.5); border: 1px solid var(--line-strong);
  color: var(--text-2); border-radius: 50%; cursor: pointer; font-size: 15px; transition: .15s;
}
.lock-actions button:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 560px) { .lock-user { font-size: 32px; } .lock-card { padding: 32px 26px; } }

/* Boutons génériques réutilisables (nouveau style) */
.btn {
  padding: 9px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--accent);
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: filter .15s, background .15s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--text-2); border-color: var(--line-strong); }
.btn--ghost:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); filter: none; }
.btn--danger { background: transparent; color: var(--crit); border-color: color-mix(in srgb, var(--crit) 55%, transparent); }
.btn--danger:hover { background: var(--crit); color: #fff; }
.btn--xs { padding: 5px 10px; font-size: 11.5px; }

/* ============================================================
   RECHERCHE UNIVERSELLE (Spotlight — Ctrl+K)
   ============================================================ */
.spot { position: fixed; inset: 0; z-index: 9800; display: none; padding-top: 12vh; justify-content: center; align-items: flex-start; background: rgba(6,9,15,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.spot.show { display: flex; }
.spot-box { width: min(620px, 92vw); background: linear-gradient(180deg, rgba(26,34,51,.97), rgba(14,19,30,.98)); border: 1px solid color-mix(in srgb, var(--cyan) 16%, var(--line-strong)); border-radius: 16px; box-shadow: var(--sh-3), 0 0 60px rgba(35,102,255,.18); overflow: hidden; animation: ccIn .16s cubic-bezier(.2,.8,.2,1); }
.spot-inrow { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.spot-search { color: var(--cyan); display: grid; place-items: center; }
.spot-inrow input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 16px; font-family: var(--f-base); }
.spot-inrow input::placeholder { color: var(--text-dim); }
.spot-inrow kbd { font-family: var(--f-mono); font-size: 10px; color: var(--text-dim); border: 1px solid var(--line-strong); border-radius: 5px; padding: 2px 6px; }
.spot-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.spot-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text); cursor: pointer; transition: background .1s, border-color .1s; }
.spot-item.sel, .spot-item:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.spot-ic { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(160deg, var(--c, var(--accent)), color-mix(in srgb, var(--c, var(--accent)) 32%, #0a0e18)); }
.spot-ic svg { width: 18px; height: 18px; }
.spot-l { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.spot-l b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-l small { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-t { font-family: var(--f-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; flex: none; }
.spot-empty { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ============================================================
   MOBILE — layouts internes des apps (sidebar → barre horizontale)
   (body.is-mobile pour battre apps2/apps3.css chargés après os.css)
   ============================================================ */
body.is-mobile .projects2,
body.is-mobile .settings2,
body.is-mobile .admin2 { display: flex; flex-direction: column; }

body.is-mobile .pj2-side,
body.is-mobile .set2-side,
body.is-mobile .adm2-side {
  width: 100% !important; flex: none;
  flex-direction: row; flex-wrap: nowrap; align-items: center;
  overflow-x: auto; overflow-y: hidden;
  border-right: none; border-bottom: 1px solid var(--line);
  gap: 6px; padding: 9px 12px; scrollbar-width: none;
}
body.is-mobile .pj2-side::-webkit-scrollbar,
body.is-mobile .set2-side::-webkit-scrollbar,
body.is-mobile .adm2-side::-webkit-scrollbar { display: none; }
body.is-mobile .pj2-side-h,
body.is-mobile .pj2-side hr { display: none; }
body.is-mobile .pj2-cat,
body.is-mobile .set2-side button,
body.is-mobile .adm2-tab { flex: none; width: auto; white-space: nowrap; }
body.is-mobile .adm2-side .brand,
body.is-mobile .adm2-side .adm2-foot { flex: none; white-space: nowrap; }

body.is-mobile .pj2-main,
body.is-mobile .set2-main,
body.is-mobile .adm2-main { flex: 1 1 auto; min-height: 0; min-width: 0; overflow-y: auto; }
body.is-mobile .pj-grid { grid-template-columns: 1fr; padding: 14px; }

/* À propos : héro empilé + stats sur 2 colonnes */
body.is-mobile .pf-hero { flex-direction: column; text-align: center; align-items: center; gap: 14px; }
body.is-mobile .pf-stats { grid-template-columns: 1fr 1fr; }
body.is-mobile .pf-featured { grid-template-columns: 1fr; }
body.is-mobile .pf-links { justify-content: center; }

/* Diagramme infra : nœuds plus étroits pour tenir sur petit écran */
body.is-mobile .nd-node { min-width: 0; width: 100%; max-width: 320px; }
body.is-mobile .nd-hw { min-width: 140px; }

/* Monitoring : KPIs et graphes empilés */
body.is-mobile .mon-kpis { grid-template-columns: 1fr 1fr; }
body.is-mobile .mon-charts { grid-template-columns: 1fr; }
