:root {
  --void: #080b14;
  --deep: #0c1220;
  --panel: rgba(17, 24, 39, 0.82);
  --panel-solid: #111827;
  --cyan: #72b7d2;
  --cyan-dim: #3d6a7f;
  --soft-cyan: #68d5d0;
  --violet: #a99be8;
  --magenta: #a99be8;
  --rust: #6b7280;
  --amber: #d1ad68;
  --green-sys: #83c6a3;
  --blue: #72b7d2;
  --text: #edf3f7;
  --muted: #a7b2bd;
  --error: #d97578;
  --glow-cyan: 0 0 14px rgba(114, 183, 210, 0.12);
  --glow-violet: 0 0 14px rgba(169, 155, 232, 0.1);
  --border: rgba(114, 183, 210, 0.22);
  --border-soft: rgba(167, 178, 189, 0.16);
  --font-ui: "Syne", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains 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;
  --z-lock: 220;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*,
*::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 (chambre Solution Neuf — lumière basse) —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 82% 18%, rgba(114, 183, 210, 0.14), transparent 58%),
    radial-gradient(ellipse 40% 35% at 12% 72%, rgba(131, 198, 163, 0.06), transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(169, 155, 232, 0.04), transparent 65%),
    linear-gradient(180deg, #0a0f1a 0%, var(--void) 42%, #060912 100%);
}

/* Fine medical panel grid */
.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(114, 183, 210, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 178, 189, 0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, #000 20%, transparent 85%);
}

/* Translucent curtain / room divider suggestion */
.atmosphere::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 38%;
  width: 22%;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(237, 243, 247, 0.025) 18%,
      rgba(104, 213, 208, 0.04) 50%,
      rgba(237, 243, 247, 0.02) 82%,
      transparent 100%
    );
  filter: blur(1px);
  opacity: 0.7;
  animation: curtain-breathe 12s ease-in-out infinite;
}

@keyframes curtain-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(0);
  }
  50% {
    opacity: 0.75;
    transform: translateX(0.4%);
  }
}

/* Integrated wall panel — rounded inset sections */
.metal-plates {
  position: absolute;
  inset: 4% 6% 18% 6%;
  opacity: 0.22;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(237, 243, 247, 0.03) 0%, transparent 40%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.5), rgba(8, 11, 20, 0.2));
  box-shadow:
    inset 0 0 0 1px rgba(114, 183, 210, 0.08),
    inset 0 1px 0 rgba(237, 243, 247, 0.04);
}

.metal-plates::before {
  content: "";
  position: absolute;
  inset: 12% 8%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(167, 178, 189, 0.06);
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 47px,
    rgba(114, 183, 210, 0.03) 48px,
    transparent 49px
  );
}

/* Soft floor reflection — lots of empty space */
.grid-floor {
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: -8%;
  height: 38%;
  background:
    linear-gradient(90deg, transparent 0%, rgba(114, 183, 210, 0.04) 50%, transparent 100%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 59px,
      rgba(104, 213, 208, 0.035) 60px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 59px,
      rgba(167, 178, 189, 0.03) 60px
    );
  transform: perspective(520px) rotateX(68deg);
  transform-origin: center top;
  opacity: 0.28;
  animation: grid-pulse 14s ease-in-out infinite;
}

@keyframes grid-pulse {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 0.34;
  }
}

/* Abstract medical data / waveform lines */
.rail-schematic {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 78px,
      rgba(131, 198, 163, 0.18) 79px,
      rgba(131, 198, 163, 0.18) 80px,
      transparent 81px,
      transparent 156px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 120px,
      rgba(114, 183, 210, 0.08) 121px,
      transparent 122px
    );
  mask-image: linear-gradient(180deg, transparent 5%, #000 30%, #000 75%, transparent 95%);
}

.rail-schematic::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 42%;
  height: 2px;
  border-radius: 2px;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(131, 198, 163, 0.15) 5%,
      rgba(131, 198, 163, 0.35) 12%,
      transparent 14%,
      rgba(104, 213, 208, 0.25) 22%,
      transparent 24%,
      rgba(131, 198, 163, 0.2) 31%,
      transparent 33%,
      rgba(114, 183, 210, 0.2) 48%,
      transparent 52%,
      rgba(131, 198, 163, 0.3) 68%,
      transparent 72%,
      rgba(104, 213, 208, 0.15) 88%,
      transparent 100%
    );
  animation: ecg-drift 18s ease-in-out infinite alternate;
}

@keyframes ecg-drift {
  from {
    transform: translateX(-0.5%);
    opacity: 0.6;
  }
  to {
    transform: translateX(0.5%);
    opacity: 0.9;
  }
}

.cable-traces {
  position: absolute;
  inset: 10% 8% 24% 8%;
  opacity: 0.08;
  background:
    radial-gradient(ellipse 30% 20% at 22% 35%, rgba(104, 213, 208, 0.35), transparent 70%),
    radial-gradient(ellipse 25% 18% at 74% 58%, rgba(169, 155, 232, 0.25), transparent 70%);
}

.sector-marks {
  position: absolute;
  inset: 14% 10% 32% 10%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20%;
  font-family: var(--font-ui);
  font-size: clamp(0.75rem, 1.8vw, 1.1rem);
  letter-spacing: 0.22em;
  color: rgba(167, 178, 189, 0.14);
  align-items: center;
  justify-items: center;
}

/* Blurred luminous window — diffuse exterior light */
.neon-haze {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 55% at 88% 22%, rgba(114, 183, 210, 0.16), transparent 62%),
    radial-gradient(ellipse 35% 40% at 90% 30%, rgba(237, 243, 247, 0.06), transparent 55%),
    radial-gradient(ellipse 30% 25% at 15% 80%, rgba(131, 198, 163, 0.05), transparent 50%);
  filter: blur(28px);
  animation: haze-drift 20s ease-in-out infinite alternate;
}

@keyframes haze-drift {
  from {
    transform: translate(0, 0);
    opacity: 0.85;
  }
  to {
    transform: translate(-1%, 0.8%);
    opacity: 1;
  }
}

/* Idle monitor — very faint horizontal lines */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 4px,
    rgba(0, 0, 0, 0.06) 4px,
    rgba(0, 0, 0, 0.06) 5px
  );
  opacity: 0.25;
}

/* —— 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.14em;
  font-weight: 500;
  color: var(--soft-cyan);
  text-shadow: none;
}

.site-sub {
  margin: 0.2rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.site-badges {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.32rem;
}

.site-badges li {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 20, 0.62);
  padding: 0.22rem 0.55rem;
  backdrop-filter: blur(8px);
  animation: none;
}

.site-badges li span {
  color: var(--muted);
  margin-right: 0.45rem;
}

/* Palliative / care badges — sober, never blinking */
.site-badges li.palliatif,
.site-badges li.critical,
.site-badges li.alert {
  border-color: rgba(217, 117, 120, 0.28);
  color: var(--text);
  background: rgba(17, 24, 39, 0.72);
  animation: none;
}

.site-badges li.palliatif span {
  color: var(--muted);
}

.desk-icon {
  width: 108px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.5rem 0.45rem 0.48rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(237, 243, 247, 0.04), transparent 45%),
    rgba(17, 24, 39, 0.68);
  color: var(--text);
  cursor: pointer;
  clip-path: none;
  backdrop-filter: blur(10px);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.desk-icon:hover {
  border-color: rgba(114, 183, 210, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), var(--glow-cyan);
}

.desk-icon.accent {
  border-color: rgba(104, 213, 208, 0.35);
}

.desk-icon.warn {
  border-color: rgba(217, 117, 120, 0.32);
}

.desk-icon .glyph {
  width: 100%;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(114, 183, 210, 0.2);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-size: 0.95rem;
  background: rgba(8, 11, 20, 0.45);
}

.desk-icon.accent .glyph {
  color: var(--soft-cyan);
  border-color: rgba(104, 213, 208, 0.35);
  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(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow:
    0 0 0 1px rgba(237, 243, 247, 0.04),
    0 16px 48px rgba(0, 0, 0, 0.42),
    var(--glow-violet);
  overflow: hidden;
  animation: win-in 0.45s ease-out;
}

.win-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 5;
  border-radius: 0 0 var(--radius-md) 0;
  background:
    linear-gradient(
      135deg,
      transparent 50%,
      rgba(114, 183, 210, 0.25) 50%,
      rgba(114, 183, 210, 0.25) 58%,
      transparent 58%,
      transparent 68%,
      rgba(169, 155, 232, 0.3) 68%,
      rgba(169, 155, 232, 0.3) 76%,
      transparent 76%
    );
}

.win-resize:hover {
  background:
    linear-gradient(
      135deg,
      transparent 45%,
      rgba(104, 213, 208, 0.45) 45%,
      rgba(104, 213, 208, 0.45) 55%,
      transparent 55%,
      transparent 65%,
      rgba(169, 155, 232, 0.5) 65%,
      rgba(169, 155, 232, 0.5) 76%,
      transparent 76%
    );
}

@keyframes win-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.window.focused {
  border-color: rgba(104, 213, 208, 0.45);
  box-shadow:
    0 0 0 1px rgba(104, 213, 208, 0.12),
    0 20px 52px rgba(0, 0, 0, 0.48),
    var(--glow-cyan);
}

.window.minimized {
  display: none;
}

.win-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.6rem 0.48rem 0.8rem;
  background: linear-gradient(
    90deg,
    rgba(114, 183, 210, 0.14),
    rgba(169, 155, 232, 0.1)
  );
  border-bottom: 1px solid var(--border-soft);
  cursor: grab;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  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(--soft-cyan);
  margin-right: 0.35rem;
}

.win-controls {
  display: flex;
  gap: 0.25rem;
}

.win-controls button {
  width: 28px;
  height: 22px;
  border: 1px solid rgba(114, 183, 210, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 20, 0.35);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.win-controls button:hover {
  background: rgba(114, 183, 210, 0.14);
  border-color: rgba(114, 183, 210, 0.35);
}

.win-controls .close:hover {
  background: rgba(217, 117, 120, 0.2);
  border-color: rgba(217, 117, 120, 0.4);
}

.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;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-shadow: none;
}

.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: var(--radius-sm);
  background: rgba(114, 183, 210, 0.04);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.file-list button:hover {
  border-color: rgba(114, 183, 210, 0.4);
  background: rgba(114, 183, 210, 0.08);
  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: var(--radius-sm);
  background: rgba(114, 183, 210, 0.05);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.cam-toolbar button.active,
.cam-toolbar button:hover {
  color: var(--cyan);
  border-color: rgba(114, 183, 210, 0.4);
  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: none;
}

.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(114, 183, 210, 0.22);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #0a0e18;
  background-size: cover;
  background-position: center;
  background:
    linear-gradient(145deg, rgba(12, 18, 32, 0.92), rgba(8, 11, 20, 0.96)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 4px,
      rgba(114, 183, 210, 0.025) 4px,
      rgba(114, 183, 210, 0.025) 5px
    );
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  width: 100%;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.cam-tile.has-shot {
  background-color: #080b14;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cam-tile:hover {
  border-color: rgba(169, 155, 232, 0.4);
  box-shadow: var(--glow-violet);
}

.cam-tile .noise {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(circle, rgba(114, 183, 210, 0.2) 0.5px, transparent 0.6px);
  background-size: 5px 5px;
  animation: noise-shift 6s steps(3) 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(--violet);
  text-shadow: none;
  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);
  }
  33% {
    transform: translate(-0.5px, 0.5px);
  }
  66% {
    transform: translate(0.5px, -0.5px);
  }
  100% {
    transform: translate(0, 0);
  }
}

.cam-tile.live .badge {
  color: var(--error);
  animation: soft-pulse 3s ease-in-out infinite;
}

@keyframes soft-pulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

.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(169, 155, 232, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 20, 0.35);
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-mono);
  text-align: left;
  align-items: center;
  transition: border-color 0.3s ease;
}

.cam-log-item.has-thumb {
  grid-template-columns: 56px 56px 72px 1fr;
}

.cam-log-item .thumb {
  width: 56px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(114, 183, 210, 0.25);
  box-shadow: none;
}

.cam-log-item:hover {
  border-color: rgba(114, 183, 210, 0.35);
}

.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(--violet);
  font-size: 0.85rem;
  text-shadow: none;
  flex-shrink: 0;
}

.capture-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 140px;
  border: 1px solid rgba(114, 183, 210, 0.28);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #080b14;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.35),
    0 0 16px rgba(114, 183, 210, 0.06);
}

.capture-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #060912;
}

.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: var(--error);
  text-shadow: none;
  animation: soft-pulse 3.5s ease-in-out infinite;
}

.hud-id {
  color: var(--cyan);
  text-shadow: none;
}

.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: var(--radius-sm);
  background: rgba(114, 183, 210, 0.06);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.capture-nav button:hover:not(:disabled) {
  border-color: rgba(114, 183, 210, 0.4);
  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(114, 183, 210, 0.14);
}

.transcript-file {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow: none;
}

.transcript-status {
  margin: 0;
  font-size: 0.75rem;
  color: var(--violet);
  animation: status-pulse 2.8s ease-in-out infinite;
}

.transcript-status.done {
  color: var(--green-sys);
  animation: none;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.95;
  }
}

.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(8, 11, 20, 0.35),
    rgba(12, 18, 32, 0.25)
  );
  border: 1px solid rgba(169, 155, 232, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.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.4s ease-out;
}

.transcript-line.instant {
  animation: none;
}

.transcript-line.ok {
  color: var(--green-sys);
}
.transcript-line.muted {
  color: var(--muted);
  font-style: italic;
}
.transcript-line.warn {
  color: var(--amber);
  text-shadow: none;
}
.transcript-line.out {
  color: var(--text);
}
.transcript-line.stance {
  color: #b9c8d4;
  font-size: 0.9rem;
  line-height: 1.65;
}
.transcript-line.canyn {
  color: #d4b98a;
  font-size: 0.9rem;
  line-height: 1.55;
}
.transcript-line.systeme {
  color: #7a8794;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  font-style: normal;
}

.transcript-actions button.is-active {
  border-color: rgba(104, 213, 208, 0.45);
  color: var(--soft-cyan);
  box-shadow: var(--glow-cyan);
}

.transcript-cursor {
  display: inline;
  margin-left: 1px;
  color: var(--soft-cyan);
  animation: cursor-breathe 1.8s ease-in-out infinite;
}

@keyframes cursor-breathe {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes line-fade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

.transcript-actions {
  display: flex;
  gap: 0.45rem;
}

.transcript-actions button {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(114, 183, 210, 0.06);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.transcript-actions button:hover:not(:disabled) {
  border-color: rgba(114, 183, 210, 0.4);
  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(114, 183, 210, 0.1);
  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(--green-sys);
}

.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(169, 155, 232, 0.1);
}

.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(--green-sys);
  text-shadow: none;
}
.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(--violet);
  flex-shrink: 0;
  text-shadow: none;
}

.prompt .cwd {
  color: var(--soft-cyan);
}

#cmd {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--soft-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(12, 18, 32, 0.94), rgba(8, 11, 20, 0.97));
  border-top: 1px solid rgba(114, 183, 210, 0.22);
  box-shadow:
    0 -10px 36px rgba(0, 0, 0, 0.38),
    0 -1px 0 rgba(237, 243, 247, 0.03);
  backdrop-filter: blur(18px);
}

.term-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.85rem;
  border-bottom: 1px solid rgba(169, 155, 232, 0.12);
  background: linear-gradient(
    90deg,
    rgba(114, 183, 210, 0.1),
    rgba(169, 155, 232, 0.06)
  );
  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(17, 24, 39, 0.92), rgba(8, 11, 20, 0.96));
  border-top: 1px solid rgba(114, 183, 210, 0.2);
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 0.85rem;
  border: 1px solid rgba(169, 155, 232, 0.28);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    135deg,
    rgba(114, 183, 210, 0.18),
    rgba(169, 155, 232, 0.12)
  );
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.start-btn:hover {
  border-color: rgba(104, 213, 208, 0.4);
  box-shadow: var(--glow-cyan);
}

.start-glyph {
  color: var(--soft-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(114, 183, 210, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(114, 183, 210, 0.05);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.task-pill.active {
  color: var(--soft-cyan);
  border-color: rgba(104, 213, 208, 0.38);
  box-shadow: inset 0 -2px 0 var(--violet);
}

.tray {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(114, 183, 210, 0.14);
  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: none;
}

/* —— 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(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.38),
    var(--glow-violet);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: win-in 0.35s 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: var(--radius-sm);
  background: transparent;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-align: left;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.start-menu button:hover {
  background: rgba(114, 183, 210, 0.08);
  border-color: rgba(114, 183, 210, 0.22);
}

.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: var(--font-ui);
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  letter-spacing: 0.08em;
  color: var(--soft-cyan);
  text-shadow: none;
  margin: 0 0 0.85rem;
}

.hub-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(237, 243, 247, 0.88);
  margin: 0 0 0.4rem;
}

.hub-lead {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--muted);
  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(114, 183, 210, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    rgba(17, 24, 39, 0.82),
    rgba(12, 18, 32, 0.55)
  );
  backdrop-filter: blur(10px);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.hub-node:hover,
.hub-node:focus-visible {
  border-color: rgba(104, 213, 208, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), var(--glow-cyan);
  transform: translateY(-1px);
  outline: none;
}

.hub-node-code {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--violet);
  text-shadow: none;
}

.hub-node-name {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text);
}

.hub-node-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.hub-foot {
  margin: 1.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(167, 178, 189, 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: #0a0e18 !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: #080b14;
}
.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(8, 11, 20, 0.94));
  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(--green-sys);
  box-shadow: 0 0 10px rgba(131, 198, 163, 0.45);
  animation: diode-pulse 4s ease-in-out infinite;
}
.term-link-warn {
  margin-left: auto;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0.75;
  animation: none;
}
.term-vents {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 8px,
    rgba(167, 178, 189, 0.18) 9px,
    transparent 10px
  );
  opacity: 0.4;
}
@keyframes diode-pulse {
  0%,
  100% {
    opacity: 0.45;
    box-shadow: 0 0 6px rgba(131, 198, 163, 0.25);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 12px rgba(131, 198, 163, 0.5);
  }
}

/* —— Boot —— */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-boot);
  display: grid;
  place-items: center;
  background: rgba(8, 11, 20, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}
.boot-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.boot-overlay.hide {
  opacity: 0;
}
.boot-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-solid);
  padding: 1.25rem 1.5rem;
  min-width: min(320px, 80vw);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    var(--glow-cyan);
  backdrop-filter: blur(12px);
}
.boot-code {
  margin: 0 0 0.75rem;
  font-family: var(--font-ui);
  letter-spacing: 0.14em;
  color: var(--soft-cyan);
}
.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);
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.9);
  padding: 0.55rem 1.6rem 0.55rem 0.7rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  animation: notify-in 0.5s ease;
}
.notify.clickable {
  cursor: pointer;
}
.notify.leaving {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.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;
  transition: color 0.3s ease;
}
.notify-close:hover {
  color: var(--text);
}
.notify-text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.45;
}
@keyframes notify-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Session lock (protocole RM-9) —— */
body.session-locked #desktop,
body.session-locked #term-dock,
body.session-locked .taskbar,
body.session-locked #start-menu {
  visibility: hidden;
  pointer-events: none;
}

body.session-unlocked #desktop,
body.session-unlocked #term-dock,
body.session-unlocked .taskbar {
  visibility: visible;
  pointer-events: auto;
}

.medical-lock {
  position: fixed;
  inset: 0;
  z-index: var(--z-lock);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(114, 183, 210, 0.12), transparent 55%),
    rgba(8, 11, 20, 0.94);
  backdrop-filter: blur(10px);
  overflow: auto;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.medical-lock[hidden],
.medical-lock.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.medical-lock-panel {
  width: min(560px, 100%);
  max-height: min(92dvh, 900px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(17, 24, 39, 0.88);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    var(--glow-cyan);
  padding: 1.35rem 1.4rem 1.5rem;
  backdrop-filter: blur(16px);
}

.medical-lock-header {
  margin-bottom: 1.1rem;
}

.medical-lock-code {
  margin: 0 0 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--violet);
  text-transform: uppercase;
}

.medical-lock-header h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-ui);
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--soft-cyan);
}

.medical-lock-status {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
  letter-spacing: 0.04em;
}

.medical-lock-lead {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}

.medical-lock-live {
  min-height: 1.2rem;
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.medical-lock-live.is-error {
  color: var(--error);
}

.medical-lock-live.is-ok {
  color: var(--green-sys);
}

.medical-recovery-form {
  display: grid;
  gap: 0.85rem;
}

.medical-field {
  display: grid;
  gap: 0.3rem;
}

.medical-field label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.medical-field input,
.medical-public-search input {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 20, 0.65);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 0.55rem 0.7rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.medical-field input:focus,
.medical-public-search input:focus {
  border-color: rgba(104, 213, 208, 0.45);
  box-shadow: var(--glow-cyan);
}

.medical-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.medical-primary,
.medical-secondary,
.medical-assist-btn {
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.medical-primary {
  border: 1px solid rgba(104, 213, 208, 0.4);
  background: rgba(104, 213, 208, 0.12);
  color: var(--soft-cyan);
}

.medical-primary:hover:not(:disabled) {
  border-color: rgba(104, 213, 208, 0.6);
  box-shadow: var(--glow-cyan);
}

.medical-secondary {
  border: 1px solid var(--border-soft);
  background: rgba(114, 183, 210, 0.05);
  color: var(--cyan);
}

.medical-secondary:hover:not(:disabled) {
  border-color: rgba(114, 183, 210, 0.4);
}

.medical-primary:disabled,
.medical-secondary:disabled {
  opacity: 0.45;
  cursor: default;
}

.medical-validation {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 20, 0.55);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.medical-validation.is-error {
  border-color: rgba(217, 117, 120, 0.35);
  color: var(--error);
}

.medical-validation.is-ok {
  border-color: rgba(131, 198, 163, 0.35);
  color: var(--green-sys);
}

.medical-assistance {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.medical-assist-btn {
  border: 1px solid rgba(169, 155, 232, 0.3);
  background: rgba(169, 155, 232, 0.08);
  color: var(--violet);
}

.medical-assist-emergency {
  border-color: rgba(209, 173, 104, 0.4);
  background: rgba(209, 173, 104, 0.1);
  color: var(--amber);
}

.medical-unlock-progress {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(131, 198, 163, 0.28);
  border-radius: var(--radius-md);
  background: rgba(8, 11, 20, 0.55);
}

.medical-progress-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--green-sys);
}

.medical-unlock-progress p {
  margin: 0.2rem 0;
  font-size: 0.82rem;
  color: var(--text);
}

.medical-unlock-progress span {
  display: inline-block;
  min-width: 5.5rem;
  color: var(--muted);
  margin-right: 0.45rem;
}

.medical-public-access {
  display: grid;
  gap: 0.85rem;
}

.medical-public-head {
  display: grid;
  gap: 0.35rem;
}

.medical-public-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--soft-cyan);
}

.medical-public-session {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.medical-public-search {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
}

.medical-result-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: min(42vh, 320px);
  overflow: auto;
}

.medical-result-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(114, 183, 210, 0.04);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.medical-result-btn:hover,
.medical-result-btn:focus-visible {
  border-color: rgba(114, 183, 210, 0.4);
  background: rgba(114, 183, 210, 0.08);
  outline: none;
}

.medical-result-title {
  letter-spacing: 0.03em;
}

.medical-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.5rem 0.2rem;
}

.medical-document-viewer {
  display: grid;
  gap: 0.65rem;
}

.medical-document-viewer h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.medical-document-viewer .doc {
  max-height: min(48vh, 360px);
  overflow: auto;
  padding: 0.35rem 0.15rem;
  user-select: text;
}

@media (max-width: 560px) {
  .medical-public-search {
    grid-template-columns: 1fr;
  }

  .medical-lock-panel {
    padding: 1.1rem 1rem 1.25rem;
  }
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .boot-overlay {
    transition: opacity 0.2s ease !important;
  }

  .medical-lock {
    transition: opacity 0.2s ease !important;
  }

  .notify.leaving {
    transition: opacity 0.2s ease !important;
  }

  .term-diode,
  .grid-floor,
  .neon-haze,
  .atmosphere::after,
  .rail-schematic::after,
  .cam-tile .noise,
  .cam-tile.live .badge,
  .hud-rec,
  .transcript-cursor,
  .transcript-status,
  .window,
  .start-menu,
  .notify {
    animation: none !important;
  }
}


