:root {
  --void: #090a08;
  --deep: #151610;
  --panel: rgba(21, 22, 16, 0.9);
  --panel-solid: #151610;
  --cyan: #5cb8b2;
  --cyan-dim: #2f6e6a;
  --violet: #8668c9;
  --magenta: #7f4c31;
  --rust: #7f4c31;
  --amber: #d0a653;
  --green-sys: #8ebf8a;
  --blue: #6a8f96;
  --text: #e5dfcf;
  --muted: #918a79;
  --error: #d86352;
  --glow-cyan: 0 0 8px rgba(92, 184, 178, 0.28);
  --glow-violet: 0 0 8px rgba(208, 166, 83, 0.3);
  --border: rgba(208, 166, 83, 0.28);
  --border-soft: rgba(127, 76, 49, 0.35);
  --font-ui: "Orbitron", sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --taskbar-h: 48px;
  --term-h: min(34vh, 320px);
  --z-window: 10;
  --z-term: 80;
  --z-taskbar: 100;
  --z-menu: 110;
  --z-notify: 120;
  --z-boot: 200;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  background: var(--void);
  user-select: none;
}

/* —— Atmosphere (panneau administratif industriel) —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(208, 166, 83, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 20%, rgba(127, 76, 49, 0.22), transparent 50%),
    radial-gradient(ellipse 45% 30% at 50% 90%, rgba(92, 184, 178, 0.08), transparent 55%),
    linear-gradient(180deg, #12140f 0%, #090a08 50%, #070806 100%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(208, 166, 83, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 76, 49, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.7;
}

.metal-plates {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 78px,
      rgba(229, 223, 207, 0.04) 79px,
      transparent 80px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 110px,
      rgba(127, 76, 49, 0.08) 111px,
      transparent 112px
    );
}

.rail-schematic {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background:
    repeating-linear-gradient(
      102deg,
      transparent 0,
      transparent 48px,
      rgba(208, 166, 83, 0.35) 49px,
      rgba(208, 166, 83, 0.35) 50px,
      transparent 51px,
      transparent 96px
    );
  mask-image: linear-gradient(180deg, transparent 8%, #000 35%, #000 78%, transparent 100%);
}

.cable-traces {
  position: absolute;
  inset: 8% 5% 20% 5%;
  opacity: 0.12;
  background:
    radial-gradient(circle at 20% 30%, transparent 0 40%, rgba(92, 184, 178, 0.4) 41%, transparent 42%),
    radial-gradient(circle at 70% 60%, transparent 0 35%, rgba(127, 76, 49, 0.5) 36%, transparent 37%);
}

.sector-marks {
  position: absolute;
  inset: 12% 8% 28% 8%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18%;
  font-family: var(--font-ui);
  font-size: clamp(0.9rem, 2.2vw, 1.4rem);
  letter-spacing: 0.28em;
  color: rgba(145, 138, 121, 0.22);
  align-items: center;
  justify-items: center;
}

.grid-floor {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -10%;
  height: 45%;
  background:
    linear-gradient(90deg, transparent 0%, rgba(208, 166, 83, 0.1) 50%, transparent 100%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 39px,
      rgba(92, 184, 178, 0.08) 40px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 39px,
      rgba(127, 76, 49, 0.1) 40px
    );
  transform: perspective(420px) rotateX(62deg);
  transform-origin: center top;
  animation: grid-pulse 8s ease-in-out infinite;
}

@keyframes grid-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.55;
  }
}

.neon-haze {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 38%, rgba(208, 166, 83, 0.08), transparent 40%),
    radial-gradient(circle at 78% 58%, rgba(127, 76, 49, 0.1), transparent 35%);
  animation: haze-drift 14s ease-in-out infinite alternate;
}

@keyframes haze-drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-2%, 1.5%);
  }
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.4;
}

/* —— Desktop —— */
.desktop {
  position: relative;
  z-index: 1;
  height: calc(100dvh - var(--term-h) - var(--taskbar-h));
  padding: 1rem 1rem 0.5rem;
  overflow: hidden;
}

.site-banner {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  text-align: right;
  pointer-events: none;
  max-width: min(460px, 58vw);
  z-index: 2;
}

.site-name {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(0.68rem, 1.8vw, 0.92rem);
  letter-spacing: 0.12em;
  color: var(--amber);
  text-shadow: 0 0 10px rgba(208, 166, 83, 0.35);
}

.site-sub {
  margin: 0.2rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.site-badges {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
}

.site-badges li {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--text);
  border: 1px solid var(--border-soft);
  background: rgba(9, 10, 8, 0.55);
  padding: 0.18rem 0.45rem;
}

.site-badges li span {
  color: var(--muted);
  margin-right: 0.45rem;
}

.desk-icon {
  width: 108px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.5rem 0.4rem 0.45rem;
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(229, 223, 207, 0.04), transparent 40%),
    rgba(21, 22, 16, 0.72);
  color: var(--text);
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.desk-icon:hover {
  border-color: var(--amber);
  box-shadow: 0 0 12px rgba(208, 166, 83, 0.15);
}

.desk-icon.accent {
  border-color: rgba(208, 166, 83, 0.45);
}

.desk-icon.warn {
  border-color: rgba(216, 99, 82, 0.45);
}

.desk-icon .glyph {
  width: 100%;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(127, 76, 49, 0.45);
  color: var(--amber);
  font-size: 0.95rem;
  background: rgba(9, 10, 8, 0.45);
}

.desk-icon.accent .glyph {
  color: var(--amber);
  border-color: rgba(208, 166, 83, 0.55);
  box-shadow: none;
  text-shadow: none;
}

.desk-icon.warn .glyph {
  color: var(--error);
}

.desk-icon .label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
  line-height: 1.15;
}

.desk-icon .label .cmd {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--text);
}

.desk-icon .label .code {
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.icon-rail {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.35rem 0.5rem;
  max-height: calc(100% - 0.5rem);
  width: max-content;
  max-width: 100%;
  position: relative;
  z-index: 3;
}

.windows-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.windows-layer > * {
  pointer-events: auto;
}

/* —— Window chrome —— */
.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(181, 107, 255, 0.15),
    0 18px 50px rgba(0, 0, 0, 0.55),
    var(--glow-violet);
  overflow: hidden;
  animation: win-in 0.28s ease-out;
}

.win-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 5;
  background:
    linear-gradient(
      135deg,
      transparent 50%,
      rgba(77, 232, 255, 0.35) 50%,
      rgba(77, 232, 255, 0.35) 60%,
      transparent 60%,
      transparent 70%,
      rgba(181, 107, 255, 0.55) 70%,
      rgba(181, 107, 255, 0.55) 80%,
      transparent 80%
    );
}

.win-resize:hover {
  background:
    linear-gradient(
      135deg,
      transparent 45%,
      rgba(77, 232, 255, 0.7) 45%,
      rgba(77, 232, 255, 0.7) 55%,
      transparent 55%,
      transparent 65%,
      rgba(255, 79, 216, 0.75) 65%,
      rgba(255, 79, 216, 0.75) 78%,
      transparent 78%
    );
}

@keyframes win-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.window.focused {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(77, 232, 255, 0.25),
    0 22px 55px rgba(0, 0, 0, 0.6),
    var(--glow-cyan);
}

.window.minimized {
  display: none;
}

.win-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  background: linear-gradient(90deg, rgba(91, 124, 255, 0.35), rgba(181, 107, 255, 0.25));
  border-bottom: 1px solid var(--border-soft);
  cursor: grab;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.win-titlebar:active {
  cursor: grabbing;
}

.win-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.win-title .cmd-tag {
  color: var(--cyan);
  margin-right: 0.35rem;
}

.win-controls {
  display: flex;
  gap: 0.25rem;
}

.win-controls button {
  width: 28px;
  height: 22px;
  border: 1px solid rgba(77, 232, 255, 0.25);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.win-controls button:hover {
  background: rgba(77, 232, 255, 0.2);
  box-shadow: var(--glow-cyan);
}

.win-controls .close:hover {
  background: rgba(255, 79, 216, 0.35);
  border-color: var(--magenta);
}

.win-body {
  flex: 1;
  overflow: auto;
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  user-select: text;
  min-height: 0;
}

.win-body:has(.cam-layout),
.win-body:has(.capture-viewer),
.win-body:has(.transcript-dialog) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.win-body > .cam-layout,
.win-body > .capture-viewer,
.win-body > .transcript-dialog {
  flex: 1;
  min-height: 0;
}

.win-body::-webkit-scrollbar {
  width: 8px;
}
.win-body::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--cyan-dim));
  border-radius: 4px;
}

.doc h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(77, 232, 255, 0.5);
}

.doc p {
  margin: 0 0 0.45rem;
  color: var(--text);
}

.doc .muted {
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  background: rgba(77, 232, 255, 0.05);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.file-list button:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.file-list .cmd {
  color: var(--violet);
}

/* —— Camera logs —— */
.cam-layout {
  display: grid;
  gap: 0.85rem;
}

.cam-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cam-toolbar button {
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  background: rgba(77, 232, 255, 0.06);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.cam-toolbar button.active,
.cam-toolbar button:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.cam-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}

.cam-list-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(77, 232, 255, 0.4);
}

.cam-list-head .muted {
  margin: 0;
  font-size: 0.78rem;
}

.cam-hint {
  margin: 0;
  font-size: 0.75rem;
}

.cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 0.65rem;
  flex: 1;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
  padding: 0.15rem;
}

.cam-grid-responsive {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
}

.cam-grid-empty {
  grid-column: 1 / -1;
  margin: 0.5rem 0;
}

.cam-tile {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(77, 232, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
  background-color: #0a0520;
  background-size: cover;
  background-position: center;
  background:
    linear-gradient(145deg, rgba(20, 10, 50, 0.9), rgba(5, 2, 20, 0.95)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(77, 232, 255, 0.04) 3px,
      rgba(77, 232, 255, 0.04) 4px
    );
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  width: 100%;
}

.cam-tile.has-shot {
  background-color: #05010f;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cam-tile:hover {
  border-color: var(--magenta);
  box-shadow: var(--glow-violet);
}

.cam-tile .noise {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: radial-gradient(circle, rgba(77, 232, 255, 0.35) 0.5px, transparent 0.6px);
  background-size: 4px 4px;
  animation: noise-shift 2.4s steps(4) infinite;
  pointer-events: none;
}

.cam-tile .badge {
  position: absolute;
  z-index: 2;
  top: 0.35rem;
  left: 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--magenta);
  text-shadow: 0 0 8px rgba(255, 79, 216, 0.6);
  font-family: var(--font-ui);
}

.cam-tile .cam-meta {
  position: absolute;
  z-index: 2;
  left: 0.4rem;
  right: 0.4rem;
  bottom: 1.35rem;
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text);
}

.cam-tile .cam-dur {
  color: var(--cyan);
}

.cam-tile .cam-id {
  position: absolute;
  z-index: 2;
  left: 0.4rem;
  right: 0.4rem;
  bottom: 0.3rem;
  font-size: 0.62rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cam-tile .cam-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes noise-shift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1px, 1px);
  }
  50% {
    transform: translate(1px, -1px);
  }
  75% {
    transform: translate(-1px, -1px);
  }
  100% {
    transform: translate(0, 0);
  }
}

.cam-tile.live .badge {
  color: #ff4d6d;
  animation: blink 1.2s step-end infinite;
}

.cam-log-list {
  display: grid;
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
}

.cam-log-item {
  display: grid;
  grid-template-columns: 72px 70px 1fr;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(181, 107, 255, 0.2);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-mono);
  text-align: left;
  align-items: center;
}

.cam-log-item.has-thumb {
  grid-template-columns: 56px 56px 72px 1fr;
}

.cam-log-item .thumb {
  width: 56px;
  height: 36px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(77, 232, 255, 0.35);
  box-shadow: 0 0 8px rgba(181, 107, 255, 0.25);
}

.cam-log-item:hover {
  border-color: var(--cyan);
}

.cam-log-item .time {
  color: var(--cyan);
}

.cam-log-item .cam {
  color: var(--violet);
}

.cam-log-item .evt {
  color: var(--muted);
}

/* —— Capture viewer —— */
.capture-viewer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  min-height: 0;
}

.capture-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.meta-line {
  margin: 0 0 0.2rem;
  color: var(--text);
}

.meta-line span {
  display: inline-block;
  min-width: 5.5rem;
  color: var(--cyan);
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.capture-evt {
  margin: 0;
  color: var(--magenta);
  font-size: 0.85rem;
  text-shadow: 0 0 10px rgba(255, 79, 216, 0.35);
  flex-shrink: 0;
}

.capture-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 140px;
  border: 1px solid rgba(77, 232, 255, 0.4);
  border-radius: 4px;
  overflow: hidden;
  background: #05010f;
  box-shadow:
    inset 0 0 30px rgba(181, 107, 255, 0.15),
    0 0 20px rgba(77, 232, 255, 0.12);
}

.capture-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.capture-hud {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  top: 0.5rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.hud-rec {
  color: #ff4d6d;
  text-shadow: 0 0 8px rgba(255, 77, 109, 0.7);
  animation: blink 1.2s step-end infinite;
}

.hud-id {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(77, 232, 255, 0.5);
}

.capture-nav {
  display: flex;
  gap: 0.45rem;
  justify-content: stretch;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.capture-nav button {
  flex: 1;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  background: rgba(77, 232, 255, 0.08);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.capture-nav button:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.capture-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* —— Fenetre transcription animee —— */
.transcript-dialog {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  min-height: 0;
}

.transcript-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(77, 232, 255, 0.2);
}

.transcript-file {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(77, 232, 255, 0.4);
}

.transcript-status {
  margin: 0;
  font-size: 0.75rem;
  color: var(--magenta);
  animation: status-pulse 1.4s ease-in-out infinite;
}

.transcript-status.done {
  color: var(--cyan);
  animation: none;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.transcript-stream {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  padding: 0.35rem 0.15rem 0.75rem;
  font-size: 0.86rem;
  line-height: 1.55;
  user-select: text;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2),
    rgba(12, 6, 40, 0.35)
  );
  border: 1px solid rgba(181, 107, 255, 0.18);
  border-radius: 3px;
  box-shadow: inset 0 0 24px rgba(77, 232, 255, 0.05);
}

.transcript-stream::-webkit-scrollbar {
  width: 8px;
}
.transcript-stream::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--cyan-dim));
  border-radius: 4px;
}

.transcript-line {
  margin: 0 0 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
  animation: line-fade 0.25s ease-out;
}

.transcript-line.instant {
  animation: none;
}

.transcript-line.ok {
  color: var(--cyan);
}
.transcript-line.muted {
  color: var(--muted);
  font-style: italic;
}
.transcript-line.warn {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.25);
}
.transcript-line.out {
  color: var(--text);
}

.transcript-cursor {
  display: inline;
  margin-left: 1px;
  color: var(--cyan);
  animation: blink 0.7s step-end infinite;
}

@keyframes line-fade {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

.transcript-actions {
  display: flex;
  gap: 0.45rem;
}

.transcript-actions button {
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  background: rgba(77, 232, 255, 0.08);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.transcript-actions button:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.transcript-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}

.capture-frame.alone {
  min-height: 240px;
}

.capture-evt.muted-note {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
}

/* —— Stocks / logs tables —— */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th,
.data-table td {
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid rgba(77, 232, 255, 0.12);
  text-align: left;
}

.data-table th {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--violet);
  text-transform: uppercase;
}

.data-table .low {
  color: var(--error);
}

.data-table .ok {
  color: var(--cyan);
}

.log-feed {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.log-row {
  display: grid;
  grid-template-columns: 78px 64px 1fr;
  gap: 0.45rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(181, 107, 255, 0.12);
}

.log-row .lvl-info {
  color: var(--cyan);
}
.log-row .lvl-warn {
  color: var(--amber);
}
.log-row .lvl-alert {
  color: var(--error);
}

/* —— Terminal window body —— */
.term-screen {
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  cursor: text;
}

.term-output {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.term-output .line {
  margin: 0 0 0.1rem;
}

.line.cmd {
  color: var(--muted);
}
.line.out {
  color: var(--text);
}
.line.ok {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(77, 232, 255, 0.35);
}
.line.warn {
  color: var(--amber);
}
.line.err {
  color: var(--error);
}
.line.muted {
  color: var(--muted);
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.prompt {
  color: var(--magenta);
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(255, 79, 216, 0.45);
}

.prompt .cwd {
  color: var(--cyan);
}

#cmd {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--cyan);
}

/* —— Terminal dock (toujours en bas) —— */
.term-dock {
  position: fixed;
  z-index: var(--z-term);
  left: 0;
  right: 0;
  bottom: var(--taskbar-h);
  height: var(--term-h);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(14, 8, 40, 0.96), rgba(6, 2, 18, 0.98));
  border-top: 1px solid rgba(77, 232, 255, 0.4);
  box-shadow:
    0 -12px 40px rgba(0, 0, 0, 0.45),
    0 -2px 24px rgba(181, 107, 255, 0.12);
  backdrop-filter: blur(14px);
}

.term-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.85rem;
  border-bottom: 1px solid rgba(181, 107, 255, 0.22);
  background: linear-gradient(90deg, rgba(91, 124, 255, 0.22), rgba(181, 107, 255, 0.12));
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
  flex-shrink: 0;
}

.term-dock-title {
  color: var(--text);
}

.term-dock-hint {
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

.term-dock-hint em {
  color: var(--cyan);
  font-style: normal;
}

.term-dock .term-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.85rem 0.65rem;
  cursor: text;
}

.term-dock .term-output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 0.35rem;
  user-select: text;
}

.term-dock .term-output::-webkit-scrollbar {
  width: 8px;
}
.term-dock .term-output::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--cyan-dim));
  border-radius: 4px;
}

/* —— Taskbar —— */
.taskbar {
  position: fixed;
  z-index: var(--z-taskbar);
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.65rem;
  background: linear-gradient(180deg, rgba(18, 10, 48, 0.95), rgba(6, 2, 20, 0.98));
  border-top: 1px solid rgba(77, 232, 255, 0.35);
  box-shadow: 0 -8px 40px rgba(181, 107, 255, 0.15);
  backdrop-filter: blur(12px);
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 0.85rem;
  border: 1px solid rgba(181, 107, 255, 0.5);
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(91, 124, 255, 0.45), rgba(181, 107, 255, 0.35));
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: var(--glow-violet);
}

.start-btn:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.start-glyph {
  color: var(--cyan);
}

.task-pills {
  flex: 1;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  min-width: 0;
}

.task-pill {
  height: 34px;
  padding: 0 0.75rem;
  border: 1px solid rgba(77, 232, 255, 0.2);
  border-radius: 3px;
  background: rgba(77, 232, 255, 0.06);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
}

.task-pill.active {
  color: var(--cyan);
  border-color: rgba(77, 232, 255, 0.55);
  box-shadow: inset 0 -2px 0 var(--magenta);
}

.tray {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(77, 232, 255, 0.2);
  font-size: 0.78rem;
  color: var(--muted);
}

.tray-hint {
  display: none;
}

@media (min-width: 720px) {
  .tray-hint {
    display: inline;
    opacity: 0.7;
  }
}

#clock {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(77, 232, 255, 0.4);
}

/* —— Start menu —— */
.start-menu {
  position: fixed;
  z-index: var(--z-menu);
  left: 0.65rem;
  bottom: calc(var(--taskbar-h) + 0.5rem);
  width: min(220px, calc(100vw - 1.3rem));
  padding: 0.65rem;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--glow-violet);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: win-in 0.2s ease-out;
}

.start-menu[hidden] {
  display: none;
}

.start-title {
  margin: 0 0 0.35rem;
  padding: 0 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--violet);
  text-transform: uppercase;
}

.start-menu button {
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-align: left;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}

.start-menu button:hover {
  background: rgba(77, 232, 255, 0.1);
  border-color: rgba(77, 232, 255, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 640px) {
  .desktop {
    padding: 0.5rem;
  }

  .site-banner {
    top: 0.5rem;
    right: 0.5rem;
  }

  .desk-icon {
    width: 78px;
  }

  .window {
    max-width: calc(100vw - 1rem);
    max-height: calc(100dvh - var(--taskbar-h) - 12rem);
  }

  .tray-hint {
    display: none;
  }

  .cam-log-item,
  .cam-log-item.has-thumb {
    grid-template-columns: 56px 1fr;
    gap: 0.25rem 0.5rem;
  }

  .cam-log-item.has-thumb .thumb {
    grid-row: span 2;
  }

  .cam-log-item .time,
  .cam-log-item .cam,
  .cam-log-item .evt {
    grid-column: 2;
  }

  .capture-meta {
    grid-template-columns: 1fr;
  }

  .log-row {
    grid-template-columns: 64px 1fr;
  }

  .log-row span:nth-child(2) {
    grid-column: 2;
  }

  .log-row span:nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* —— Hub racine —— */
.hub-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.hub {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
}

.hub-header {
  margin-bottom: 1.75rem;
}

.hub-brand {
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  letter-spacing: 0.08em;
  color: var(--neon, #6ef3ff);
  text-shadow: 0 0 18px rgba(110, 243, 255, 0.45);
  margin: 0 0 0.85rem;
}

.hub-title {
  font-family: "Share Tech Mono", monospace;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(230, 245, 255, 0.85);
  margin: 0 0 0.4rem;
}

.hub-lead {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.92rem;
  color: rgba(180, 200, 220, 0.75);
  margin: 0;
}

.hub-nodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hub-node {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: 0.15rem;
  align-items: baseline;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(110, 243, 255, 0.28);
  background: linear-gradient(135deg, rgba(12, 8, 28, 0.85), rgba(20, 12, 40, 0.55));
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hub-node:hover,
.hub-node:focus-visible {
  border-color: rgba(110, 243, 255, 0.75);
  box-shadow: 0 0 24px rgba(110, 243, 255, 0.18);
  transform: translateY(-2px);
  outline: none;
}

.hub-node-code {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: Orbitron, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: #ff4fd8;
  text-shadow: 0 0 10px rgba(255, 79, 216, 0.4);
}

.hub-node-name {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.05rem;
  color: #e8f7ff;
}

.hub-node-meta {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  color: rgba(160, 185, 210, 0.7);
}

.hub-foot {
  margin: 1.5rem 0 0;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(140, 160, 180, 0.55);
}

/* —— Documents structurés —— */
.doc-gap { margin: 0.15rem 0; line-height: 0.6; }
.doc-sub {
  margin: 0.55rem 0 0.2rem;
  color: var(--amber);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.doc-li {
  margin: 0.12rem 0;
  padding-left: 0.15rem;
  color: var(--text);
}
.doc-kv {
  margin: 0.15rem 0;
  display: grid;
  grid-template-columns: minmax(5rem, 38%) 1fr;
  gap: 0.35rem;
}
.doc-k { color: var(--muted); }
.doc-v { color: var(--text); }
.doc-note {
  margin: 0.2rem 0;
  color: var(--green-sys);
  font-size: 0.92em;
}
.doc-log {
  margin: 0.08rem 0;
  font-size: 0.88em;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: pre-wrap;
}

/* —— Cam tiles (contain) —— */
.cam-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background-color: #0a0b08 !important;
  background-image: none !important;
  min-height: 180px;
  padding: 0;
  overflow: hidden;
}
.cam-tile .cam-shot {
  flex: 1;
  min-height: 110px;
  display: grid;
  place-items: center;
  background: #050605;
}
.cam-tile .cam-shot img {
  max-width: 100%;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.cam-tile .cam-shot-empty {
  color: var(--muted);
  font-size: 0.85rem;
}
.cam-tile .badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
}
.cam-tile .cam-foot {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.5rem 0.55rem;
  background: linear-gradient(180deg, transparent, rgba(9, 10, 8, 0.95));
  text-align: left;
}
.cam-tile .cam-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  font-size: 0.68rem;
  color: var(--muted);
}
.cam-tile .cam-id {
  position: static;
  font-size: 0.65rem;
  color: var(--muted);
}

/* —— Terminal public —— */
.term-dock-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.term-diode {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(208, 166, 83, 0.8);
  animation: diode-pulse 2.4s ease-in-out infinite;
}
.term-link-warn {
  margin-left: auto;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--error);
  opacity: 0.85;
}
.term-vents {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 6px,
    rgba(145, 138, 121, 0.25) 7px,
    transparent 8px
  );
  opacity: 0.5;
}
@keyframes diode-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* —— Boot —— */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-boot);
  display: grid;
  place-items: center;
  background: rgba(9, 10, 8, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.boot-overlay.show { opacity: 1; }
.boot-overlay.hide { opacity: 0; }
.boot-panel {
  border: 1px solid var(--border);
  background: var(--panel-solid);
  padding: 1.25rem 1.5rem;
  min-width: min(320px, 80vw);
  box-shadow: 0 0 24px rgba(127, 76, 49, 0.2);
}
.boot-code {
  margin: 0 0 0.75rem;
  font-family: var(--font-ui);
  letter-spacing: 0.14em;
  color: var(--amber);
}
.boot-line {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* —— Notifications —— */
.notify-stack {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  z-index: var(--z-notify);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: min(280px, 70vw);
  pointer-events: none;
}
.notify {
  pointer-events: auto;
  position: relative;
  border: 1px solid var(--border-soft);
  background: rgba(21, 22, 16, 0.94);
  padding: 0.55rem 1.6rem 0.55rem 0.7rem;
  animation: notify-in 0.25s ease;
}
.notify.clickable { cursor: pointer; }
.notify.leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
}
.notify-close {
  position: absolute;
  top: 0.2rem;
  right: 0.3rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.notify-text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text);
}
@keyframes notify-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-overlay,
  .notify,
  .term-diode,
  .grid-floor,
  .neon-haze {
    animation: none !important;
    transition: none !important;
  }
}
